Search...
APIJSLog inGet started in sandbox
Airwallex logo
Home
Platform APIs
Connected Accounts
Accounts
Payments
Transactional FX
Payouts
Issuing
Back to home
OverviewAPI
SDKs
Sandbox environment
Sandbox environment overviewConnected accounts
Deposits
Linked Accounts
Payments
Simulate shopper actionSimulate payment disputes
Payouts
Issuing
Risk

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, or PRE_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.
Shell

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 as MERCHANT, the dispute status transitions to WON or REVERSED. If specified as CUSTOMER, the dispute status transitions to LOST.
  • amount: The resolved amount. Defaults to the full disputed amount.
  • comment: Description of why the dispute was resolved.
Shell

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.

Shell

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 {
"code": "validation_error",
"message": "Invalid {field}."
}
Check input and pass valid values for the field.
Payment not found not_found {
"code": "not_found",
"message": "Payment with ${payment_intent_id} not found"
}
Check input and provide a valid Payment Intent ID.
Resolve/Escalate a payment dispute
Invalid value in in_favor_of validation_error {
"code": "validation_error",
"message": "Invalid value in in_favor_of."
}
Check input and provide either MERCHANT or CUSTOMER as value.
Payment Dispute not found not_found {
"code": "not_found",
"message": "Payment dispute with ${payment_dispute_id} not found."
}
Check input and provide a valid Payment Dispute ID.
Was this page helpful?
On this page
  • Create a payment dispute
  • Resolve a payment dispute
  • Escalate a payment dispute
  • Troubleshooting
Was this page helpful?