Skip to navigation

Simulate card transactions

Authorize, capture, reverse, refund and dispute on a sandbox card to test your integration end to end.

POST /simulations/cardTransactions asks the card’s issuer to run a test transaction. The issuer reports it as it reports real card activity, so your integration receives the same transactions and events it will in production. POST /simulations/disputes/{disputeId}/submit submits a dispute with the outcome the issuer is to decide.

  • Sandbox only. A production key cannot hold simulations:write, and a production request returns 403 PERMISSION_DENIED.
  • The key needs simulations:write, and transactions:read to read the results. A platform key sends Account-Holder with the account holder ID; a company key does not.
  • The card must be an issued card of the account holder.

Simulation types

typetransactionIdamountResult
AUTHORIZATIONNoneThe amount to hold.A new CARD_AUTHORIZATION transaction, PENDING. DECLINED when the issuer refuses it.
INCREMENTAL_AUTHORIZATIONA CARD_AUTHORIZATIONThe increase.The authorization’s hold grows by amount.
CAPTUREA CARD_AUTHORIZATIONThe amount to capture.The same transaction becomes CARD_SPEND, POSTED.
FORCE_CAPTURENoneThe purchase amount.A new CARD_SPEND transaction, POSTED, with no authorization before it.
REVERSALA CARD_AUTHORIZATIONThe amount to release.The hold shrinks by amount. Reversing all of it makes the transaction REVERSED.
REFUNDA CARD_SPENDThe amount to return.A new CARD_REFUND transaction. On some card programs it is not linked to the purchase through parentTransactionId.

amount.value is a positive integer in minor units, such as 2500 for $25.00. amount.currency must match the source transaction’s.

Run a purchase and a refund

1

Authorize

curl -X POST "https://$API_HOST/api/v2/simulations/cardTransactions" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID" \
-H "Idempotency-Key: 6f2b8d1e-4a7c-4e93-b0d5-2c8a1f6e9b47" \
-H "Content-Type: application/json" \
-d '{"cardId": "3f2a9c1e-7b4d-4e8a-9c2f-1d0e8b7a6c54", "type": "AUTHORIZATION", "amount": {"value": 2500, "currency": "USD"}}'
{
"id": "6b1d4f0e-2a9c-4e7b-8d3f-0c5a1e9b7d26",
"object": "cardTransactionSimulation",
"livemode": false,
"accountHolderId": "2b1f8f53-5d0e-4c0f-9a51-1d3b8c2e4f10",
"cardId": "3f2a9c1e-7b4d-4e8a-9c2f-1d0e8b7a6c54",
"type": "AUTHORIZATION",
"status": "SUBMITTED",
"createdAt": "2026-10-12T14:30:00.000Z"
}

A 200 means the issuer accepted the simulation, not that the transaction is recorded yet. The response’s id identifies the simulation request, not a transaction.

2

Find the transaction

Wait for the transaction.created event, or list the card’s authorizations:

curl "https://$API_HOST/api/v2/transactions?cardId=3f2a9c1e-7b4d-4e8a-9c2f-1d0e8b7a6c54&type=CARD_AUTHORIZATION" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID"

The authorization is PENDING with an amount of -2500. Use its id in the next step.

3

Capture

Send CAPTURE with the authorization’s id as transactionId.

curl -X POST "https://$API_HOST/api/v2/simulations/cardTransactions" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID" \
-H "Idempotency-Key: 0c4e7a2b-9d1f-4b68-a3e5-7f2d0b8c6a19" \
-H "Content-Type: application/json" \
-d '{"cardId": "3f2a9c1e-7b4d-4e8a-9c2f-1d0e8b7a6c54", "type": "CAPTURE", "transactionId": "9e4b2c7a-1f3d-4a8e-b6c0-5d2f8a1e3c94", "amount": {"value": 2500, "currency": "USD"}}'

A transaction.updated event follows when the transaction becomes CARD_SPEND and POSTED. Its transition names the change.

4

Refund

Once the transaction is CARD_SPEND, send REFUND with the same transactionId. A transaction.created event follows for the CARD_REFUND transaction.

Wait for each result before you send a follow-up that depends on it. An INCREMENTAL_AUTHORIZATION shows as a transaction.updated event once the hold has grown.

Limits

The card’s issuer decides which follow-ups it allows and how much they may move. A request it does not allow returns 422 PROVIDER_REJECTED.

  • To capture more than was authorized, simulate an INCREMENTAL_AUTHORIZATION first. Some card programs refuse a capture above the authorization.
  • A captured authorization is a purchase: refund it rather than reverse it.
  • On some card programs, an authorization that was partly reversed cannot be captured, and one that was partly captured cannot be reversed. Use a separate authorization for each path.

Simulate a decline

There is no decline override. Freeze the card with POST /cards/{cardId}/freeze, then simulate AUTHORIZATION. The issuer declines it and the transaction is DECLINED. Unfreeze the card with POST /cards/{cardId}/unfreeze when you are done.

Simulate a dispute outcome

POST /simulations/disputes/{disputeId}/submit submits a DRAFT or INFORMATION_REQUIRED dispute exactly as POST /disputes/{disputeId}/submit does, and the issuer then decides it as WON or LOST. The key needs disputes:write and simulations:write.

1

File a draft

Create the dispute on a CARD_SPEND transaction with POST /disputes, as for a real dispute.

2

Submit it with an outcome

curl -X POST "https://$API_HOST/api/v2/simulations/disputes/23456789-2345-4345-8345-234567890123/submit" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID" \
-H "Idempotency-Key: 5d8a2f1c-7e3b-4c69-a0d4-9b6e1f2c8a37" \
-H "Content-Type: application/json" \
-d '{"outcome": "WON"}'

The response is the dispute as submission leaves it, usually UNDER_REVIEW. On some card programs it is already WON or LOST.

3

Receive the decision

The decision arrives as for a real dispute: dispute.resolved, and for a win a DISPUTE_CREDIT transaction with dispute.finalCreditPosted. Read GET /disputes/{disputeId} for the dispute’s status and monetaryTransactions.

If the issuer files the dispute but refuses the outcome, the request returns 422 PROVIDER_REJECTED and the dispute stays UNDER_REVIEW.

Retries

Every simulation requires an Idempotency-Key. Retry with the same key; a replay never runs the simulation twice.

  • 502 OPERATION_OUTCOME_UNKNOWN: the issuer’s answer is not known yet. Retry later with the same key, never a new one.

No webhook is sent for the simulation itself. The transaction and dispute events are the result.

Errors

ErrorCause
400 INVALID_REQUESTThe body does not match the schema, transactionId is missing for INCREMENTAL_AUTHORIZATION, CAPTURE, REVERSAL or REFUND, or outcome is not WON or LOST.
403 PERMISSION_DENIEDThe request is in production or uses a live credential, or the key lacks simulations:write (and disputes:write for a dispute).
404 RESOURCE_NOT_FOUNDdisputeId is not a dispute of the account holder.
409 INVALID_STATEThe dispute is not DRAFT or INFORMATION_REQUIRED, another submission of it is running, or the issuer already holds a dispute for the transaction filed outside the API.
422 RELATED_RESOURCE_NOT_FOUNDcardId is not the account holder’s, or transactionId is not a transaction of this card.
422 NOT_ELIGIBLEThe card is not issued or its program cannot run simulations, the source transaction is the wrong type, the currency differs, AUTHORIZATION or FORCE_CAPTURE was sent with a transactionId, or the dispute’s submission window has closed.
422 PROVIDER_REJECTEDThe issuer refused the simulation or the dispute outcome.
502 OPERATION_OUTCOME_UNKNOWNThe outcome is not known yet. Retry with the same key.