A 409 conflict error is received when there are contradicting commands that could not be sent one after the other. The full error description that you will receive is: "There was a conflict with payment resource current state".
For example, if you will use the following request flow you will receive a conflict error:
1. "Create a payment" - Successfully created.
2. "Create an authorization" - Successfully created.
3. "Create a refund" - Conflict error.
The contradicting requests are authorization and refund, a payment that is authorized can not be refunded, only captured/charged transactions can be refunded. The request that should have been sent is "Create a void".
There are a variety of scenarios that can lead to a conflict error. The questions you should ask yourself once you receive the error is: "Is the flow I am performing allowed and can it be applied?"
Here are a couple more scenarios when a 409 conflict error is returned:
- An Authorization request for an already authorized payment was sent.
- An Authorization request is sent and a previous authorization is Pending.
- A Capture request is sent for a payment of which the status is not Authorized.
- A Capture request is sent and a previous capture is Pending
Please make sure to send a payment with a valid state before sending further requests.
For more information regarding API responses, please refer to our API documentation in this link.