For archived content, access the previous documentation here or the previous API reference here.

Simulate a dispute (Sandbox Only)

Prev Next
Post
/v1/disputes/simulate

Create or resolve simulated disputes in the sandbox environment to test your integration. The workflow is two-phase: first create a simulated dispute using CREATE_DISPUTE or CREATE_DISPUTE_EXCEED_DEADLINE, then resolve it using DISPUTE_WON or DISPUTE_LOST.

Security
HTTP
Type basic
Body parameters
create_dispute

Create a simulated dispute

{
  "scenario": "CREATE_DISPUTE",
  "payment_id": "py-59a3cf39-2a7d-4733-a3e3-8177c78090f7",
  "amount": "100000",
  "currency": "IDR",
  "product_type": "CARDS",
  "channel_code": "CARDS"
}
create_dispute_exceed_deadline

Create a simulated dispute that will exceed deadline

{
  "scenario": "CREATE_DISPUTE_EXCEED_DEADLINE",
  "payment_id": "py-59a3cf39-2a7d-4733-a3e3-8177c78090f7",
  "amount": "100000",
  "currency": "IDR",
  "product_type": "CARDS",
  "channel_code": "CARDS",
  "deadline": "instant"
}
resolve_won

Resolve simulated dispute as WON

{
  "scenario": "DISPUTE_WON",
  "dispute_id": "mi-dspt-48e96517-9889-4e29-a93e-d1ffae1fa366"
}
resolve_lost

Resolve simulated dispute as LOST

{
  "scenario": "DISPUTE_LOST",
  "dispute_id": "mi-dspt-48e96517-9889-4e29-a93e-d1ffae1fa366"
}
OneOf
Merchant_Dispute_API_SimulateCreate
object (Merchant_Dispute_API_SimulateCreate)
scenario
string Required

CREATE_DISPUTE creates a dispute in ACTION_REQUIRED with a realistic deadline. CREATE_DISPUTE_EXCEED_DEADLINE creates a dispute that automatically expires.

Valid values[ "CREATE_DISPUTE", "CREATE_DISPUTE_EXCEED_DEADLINE" ]
ExampleCREATE_DISPUTE
payment_id
string Required

Xendit payment ID of an existing settled payment to attach the simulated dispute to.

Examplepy-59a3cf39-2a7d-4733-a3e3-8177c78090f7
amount
string Required

Dispute amount as a decimal string.

Example1000.00
currency
string Required

Currency of the simulated dispute amount, in ISO-4217 format.

ExampleIDR
product_type
string Required

Product classification for the simulated dispute (e.g., CARDS, QR).

Valid values[ "CARDS", "QR" ]
ExampleCARDS
channel_code
string Required

Specific channel for the simulated dispute. Must be consistent with product_type.

ExampleCARDS
deadline
string

Optional deadline override for the simulated dispute. Only used with CREATE_DISPUTE_EXCEED_DEADLINE scenario.

Valid values[ "instant", "1m", "2m", "3m", "5m" ]
Exampleinstant
Merchant_Dispute_API_SimulateResolve
object (Merchant_Dispute_API_SimulateResolve)
scenario
string Required

DISPUTE_WON resolves in the merchant's favor. DISPUTE_LOST resolves against the merchant.

Valid values[ "DISPUTE_WON", "DISPUTE_LOST" ]
ExampleDISPUTE_WON
dispute_id
string Required

ID of the simulated dispute to resolve.

Examplemi-dspt-48e96517-9889-4e29-a93e-d1ffae1fa366
amount
string

Optional resolved amount. Defaults to the full initial amount. Provide a lower value to simulate a partial chargeback.

Example1000.00
Responses
201

Simulation triggered successfully.

object
dispute_id
string

ID of the dispute that was created or resolved by this simulation.

Examplemi-dspt-f44d259f-fd9d-4de9-80de-1eef3f1506b7
payment_id
string | null

Payment ID the simulated dispute is attached to.

Examplepy-59a3cf39-2a7d-4733-a3e3-8177c78090f7
202

Simulation resolved successfully.

object
dispute_id
string

ID of the dispute that was created or resolved by this simulation.

Examplemi-dspt-f44d259f-fd9d-4de9-80de-1eef3f1506b7
payment_id
string | null

Payment ID the simulated dispute is attached to.

Examplepy-59a3cf39-2a7d-4733-a3e3-8177c78090f7
400

Bad request.

invalid_scenario
{
  "error_code": "INVALID_SCENARIO",
  "message": "Invalid scenario."
}
payment_not_found
{
  "error_code": "PAYMENT_NOT_FOUND",
  "message": "The specified payment was not found."
}
payment_not_settled
{
  "error_code": "PAYMENT_NOT_SETTLED",
  "message": "The specified payment is not in a settled state."
}
illegal_state
{
  "error_code": "ILLEGAL_STATE",
  "message": "Evidence must be submitted before resolving a simulated dispute."
}
invalid_request
{
  "error_code": "INVALID_REQUEST",
  "message": "Invalid deadline value. Accepted values: instant, 1m, 2m, 3m, 5m."
}
object
error_code
string
ExampleILLEGAL_STATE
message
string
ExampleThe requested action is not allowed in the current dispute state.
403

This endpoint is only available in sandbox environment.

{
  "error_code": "UNAVAILABLE_IN_LIVE_MODE",
  "message": "This endpoint is only available in test mode."
}
object
error_code
string
ExampleILLEGAL_STATE
message
string
ExampleThe requested action is not allowed in the current dispute state.
409

Conflict. A resolve scenario has already been applied.

{
  "error_code": "ILLEGAL_STATE",
  "message": "A resolve scenario has already been applied to this simulated dispute."
}
object
error_code
string
ExampleILLEGAL_STATE
message
string
ExampleThe requested action is not allowed in the current dispute state.
429

Too many requests. Maximum simulated disputes per time window exceeded.

{
  "error_code": "TOO_MANY_REQUESTS",
  "message": "Maximum of 5 simulated disputes per 24 hours exceeded."
}
object
error_code
string
ExampleILLEGAL_STATE
message
string
ExampleThe requested action is not allowed in the current dispute state.