Skip to main content
New to the sandbox environment? Read Sandbox vs Production to understand more about sandbox environment.

Card Transaction Simulator

The Card Transaction Simulator allows you to test full card transaction lifecycles in the sandbox environment, without sending transactions to the live card network. It can also start an asynchronous in-app 3DS challenge before an authorization. For a normal transaction request, the simulator:
  1. The simulator authenticates the request
  2. It checks available balance
  3. It applies lifecycle logic:
    • Authorization creates a hold
    • Reversal releases a hold
    • Replacement adjusts an existing hold
    • Clearing confirms/settles a transaction
    • Clearing Cancellation cancels via clearing
  4. It returns an approval or denial response with production-like fields

How to Simulate a Card Transaction

1

Authenticate with the Simulator API

Use HTTP Basic Auth:
  • Username: simulator
  • Password: Provided during onboarding
All simulator endpoints require authentication.
2

Choose the Card Identifier

You can simulate transactions using:
  • card_id → POST /transactions/simulate
  • pan → POST /transactions/simulate-by-pan
Both endpoints behave identically.
3

Understand Request Fields

All simulation requests use these fields:

Transaction Types

The simulator supports five transaction types that form a complete lifecycle: authorization, reversal, replacement, clearing, and clearing cancellation.

Simulate an Authorization

Authorization creates an initial hold on the card balance.
1

Send Authorization Request

Required: transaction_type, amount, currency, and card_id or pan.
2

Simulator Validation

The simulator will:
  • Confirm the card exists
  • Verify the card is active
  • Check sufficient available balance
  • Place a hold for the requested amount
3

Store Authorization Code

If approved, the response includes authorization_code and authorization_id.
Save the authorization_code as it’s required for reversals, replacements, and clearing operations.

Test in-app 3DS

Set the optional 3ds field to true to test the same integration your app uses for a real in-app 3DS challenge. The simulator creates a synthetic Apata challenge internally; it does not make a request to Apata. Partner webhook delivery, user API polling, EIP-712 wallet signing, and decision submission all use the normal integration path.
3ds: true is supported only for transaction_type: "authorization" through POST /transactions/simulate with a card_id. It is not supported for reversals, replacements, clearing, clearing cancellation, by-PAN simulations, or named scenarios.
Before testing, the card must be active and Gnosis Pay must have enabled in-app 3DS and an active partner webhook for your sandbox tenant.
1

Start the simulation

Authenticate with the Simulator API and send:
The simulator request amount is expressed in major units and must be greater than zero. The generated 3DS challenge exposes the equivalent minor-unit integer string and its decimal exponent; for example, "1.00" USD becomes amount: "100" and decimals: 2.
2

Save the asynchronous simulation ID

The simulator returns 202 Accepted instead of the normal synchronous transaction response:
The synthetic challenge expires five minutes after the simulation starts.
3

Handle the challenge through your integration

Your partner webhook receives card.3ds.challenge.created. Your app can also discover the challenge through GET /user-api/3ds/challenges.Follow the normal flow in In-App 3DS Push Provisioning: show the challenge, request the decision-bound EIP-712 data, have the cardholder sign it, and submit the signed approval or decline. The simulator does not provide a shortcut around wallet proof.
4

Poll the simulation

Use Simulator API Basic Auth to request:
Continue until the simulation reaches a terminal state.

3DS simulation statuses

After approval, a completed response includes the normal Pismo result under transaction:
Funds are not required to test challenge delivery, polling, signing, decline, or timeout. Sufficient available balance is required only for the Pismo authorization after an approval. Without it, the simulation still reaches completed, but transaction.status is denied, usually with denial code 810 (Insufficient balance). You can fund the account before deciding through POST /ledger/top-up; use the accountId from the challenge and the account’s supported currency.

Simulate a Reversal

Reversal cancels a previous authorization entirely and releases the held amount.
1

Provide Authorization Code

You must use the authorization_code returned from the original authorization.
2

Send Reversal Request

3

Simulator Behavior

The simulator will:
  • Validate the original authorization exists
  • Confirm the amount matches
  • Release the full held balance

Simulate a Replacement

Replacement adjusts a previous authorization to a different amount.
1

Provide Authorization Code

Use the authorization_code from the original authorization.
2

Send Replacement Request

Required: authorization_code and replacement_amount.
3

Simulator Behavior

The simulator will:
  • Validate the original authorization
  • Reduce or increase the held amount
  • Update the balance accordingly

Simulate a Clearing

Clearing confirms a previous authorization (settlement/Base II) and finalizes the transaction.
1

Provide Authorization Code

Use the authorization_code from the original authorization.
2

Send Clearing Request

3

Simulator Behavior

The simulator will:
  • Validate the original authorization
  • Process the settlement
  • Finalize the transaction
The simulator requires a minimum 2-minute gap between clearing messages for the same authorization. Sending a second clearing before this window elapses will result in a 409 error.

Simulate a Clearing Cancellation

Clearing cancellation cancels a transaction via clearing. For partial cancellation, send an amount lower than the original authorization.
1

Provide Authorization Code

Use the authorization_code from the original authorization.
2

Send Clearing Cancellation Request

3

Simulator Behavior

The simulator will:
  • Validate the original authorization
  • Process the cancellation
  • Adjust balances accordingly
For partial cancellations, use an amount lower than the original authorization amount.

Response Handling

Approved (Authorization)

An approved authorization response includes full transaction details:

Approved (Clearing / Clearing Cancellation)

Clearing responses are sparse as most fields will be empty or zero-valued:

Denied

If denied, the response includes detailed denial information:
denial_code and denial_reason use the same codes documented in Card Decline Reasons, use the simulator to test the responses and showcase the right mapping according to the guide.

Error Handling

Validation and authentication errors return structured error objects:
Possible HTTP status codes: