Simulate payment disputes
You can conduct unit and end-to-end testing of your payments disputes integration by simulating dispute creation, resolution and escalation in the sandbox environment. Airwallex acts as the dispute management entity of the payment processor in these scenarios to produce the simulated result.
Key simulation scenarios include:
- Create, resolve, and escalate payment disputes
Create a payment dispute
Call Create a PaymentDispute API to simulate a payment dispute that requires a response from the merchant.
Provide the following fields in the request body:
payment_intent_id
: Get a PaymentIntent ID from Get list of PaymentIntents API.stage
: The dispute stage. Possible values:RFI
,PRE_CHARGEBACK
,CHARGEBACK
, orPRE_ARBITRATION
.reason_code
: A valid reason code for the given processor. See test reason codes.due_at
: Provide a due date for the dispute.amount
: The dispute amount in the original currency.comment
: Description of why the dispute has been raised.documents
: A list of file IDs providing the supporting evidence for the dispute.
The response object will be the same as Retrieve a PaymentDispute API.
Resolve a payment dispute
Resolving the dispute transitions the dispute to the final status. Call Resolve a PaymentDispute API with the following fields:
in_favor_of
: If specified asMERCHANT
, the dispute status transitions toWON
orREVERSED
. If specified asCUSTOMER
, the dispute status transitions toLOST
.amount
: The resolved amount. Defaults to the full disputed amount.comment
: Description of why the dispute was resolved.
The response object will be the same as Retrieve a PaymentDispute API.
Escalate a payment dispute
Call Escalate a PaymentDispute API with the Payment Dispute ID to decline the evidence provided by the merchant and escalate the dispute to the next stage if needed.
Specify the new due date of the dispute in the due_date
field.
Troubleshooting
You might encounter the following errors when simulating payment APIs.
Error scenario | Error code | Error response | Recommended actions |
---|---|---|---|
Create a payment dispute | |||
Invalid or missing reason_code or stage or payment_intent_id or due_at |
validation_error | {
|
Check input and pass valid values for the field. |
Payment not found | not_found | {
|
Check input and provide a valid Payment Intent ID. |
Resolve/Escalate a payment dispute | |||
Invalid value in in_favor_of |
validation_error | {
|
Check input and provide either MERCHANT or CUSTOMER as value. |
Payment Dispute not found | not_found | {
|
Check input and provide a valid Payment Dispute ID. |