Search...
APIJSLog inGet started
Airwallex logo
Home
Platform APIs
Connected Accounts
Accounts
Payments
Transactional FX
Payouts
Issuing
Back to home
OverviewHow Airwallex Issuing worksSupported regions and currenciesSupported card programs
Use Cases
Transactions
Transaction LifecycleRetrieve card transactionsHandle transaction disputes
Simulate transactions on issued cards
Transaction failure reasonsHandle OvercapturesProvide Fraud Feedback
Troubleshooting

Simulate transactions on issued cards

You can conduct end-to-end testing of your issuing integration by simulating card transactions on your Airwallex issued cards in the demo environment. The endpoints simulate the production behaviour of our payment networks.

Key simulation scenarios include:

  • Authorization transaction including incremental auth, failed auth
  • Capture transaction on an existing authorization including partial captures
  • Authorization and capture in a single transaction
  • Refunds and reversals

You can retrieve the simulated transactions via Get transactions for a single card API, Get single transaction API, and Get list of financial transactions API.

As a platform account, you can call the simulation APIs on behalf of a connected account using the x-on-behalf-of header.

Prerequisites

Simulate an authorization

An authorization request reserves funds on the available balance. You can simulate an authorization transaction to be approved or failed. The transaction object in the response is the same as Get single transaction API.

Successful authorization

To create a successful authorization transaction, call Create a transaction for the provided card API by providing the following request parameters:

  • card_id or card_number: If both are provided, then card_number takes precedence.
    • card_id is the unique identifier of an Airwallex issued card. You can get the card_id from Get all cards API. If your account does not own the card then the transaction will fail.
    • card_number is a 16-digit card number, which you can retrieve from the web app or from Get sensitive card details API. If your account does not own the card then the transaction will fail.
  • transaction_amount: Transaction amount to be authorized, maximum amount is $9,999.99.
  • transaction_currency: Currency code, only including USD, AUD, GBP, EUR, CAD, JPY, HKD, CNY, SGD, NZD, and CHF.
  • merchant_category_code: A 4-digit Visa MCC .
  • auth_code: A 6-digit authorization code for transaction testing. If not provided, it is auto-generated.
  • merchant_info: Description of merchant with an exact string length of 43 characters. If not provided, defaults to ‘CARD_TX_GENERATOR TEST’.

Make sure the authorization request is compliant with the authorization controls set on your account.

Shell

Failed authorization

In addition to the request fields for a successful authorization, set transaction_failure_reason to one of the failure reasons to simulate a failed authorization. Possible failure reasons include: PIN_INVALID, CVV_INVALID, PIN_RETRIES_EXCEEDED, CARDHOLDER_VERIFICATION_FAILED, INVALID_EXPIRY_DATE, TRANSACTION_BLOCKED.

You can also fail an authorization based on authorization controls on the card. For example, if you set a spending limit of $100 on your account and you attempt to authorize $110, then this payment will fail.

Shell

Incremental authorization

In addition to the request fields for a successful authorization, provide transaction_id, which is used to associate the given authorization request with a previous authorization. This creates an incremental authorization linked to the previous transaction.

Shell

Single transaction with auth and capture

In addition to the request fields for a successful authorization, specify single_phase as true to combine authorization and capture into a single transaction request.

Shell

Simulate a capture

A capture transaction deducts funds specified in the request from your account balance in your multi-currency Wallet.

Successful capture

If the authorization has been approved (transaction status: PENDING), use Capture the transaction with the provided id API with the authorization transaction_id from Step 2, to capture the full authorized funds. The captured amount will be deducted from your account balance in your multi-currency Wallet.

Partial capture

To capture only a partial amount of the authorized funds, specify an amount smaller than the full authorization amount in the transaction_amount field.

Shell

Simulate refunds and reversals

Simulate refunds on previously approved captured transactions and reversals on pending authorizations.

Refund a transaction

You can simulate refunds on an approved capture transaction (status:APPROVED), either fully captured or partially captured.

Call Refund a transaction for the provided card API by providing the following fields:

  • card_id or card_number: If both are provided, card_number takes precedence.
  • transaction_amount: The amount to refund.
  • transaction_currency: Currency of the refund transaction. Can only be one of USD, AUD, GBP, EUR, CAD, JPY, HKD, CNY, SGD, NZD, CHF
  • transaction_id: Optional. Identifies the transaction linked with the refund request to which refund must be issued. If not provided, an unlinked refund will be created.

The transaction object in the response is the same as Get single transaction API for the REFUND type.

Shell

Reverse a transaction

You can simulate reversals on an approved authorization (status:PENDING). Call Reverse a transaction with the provided id API by providing the following fields:

  • transaction_id: Provide identifier of the authorization transaction to reverse as the request parameter.
  • transaction_amount: Optional. The amount to reverse for partial reversals. If not provided, the full amount will be reversed.
Shell
Was this page helpful?
On this page
  • Prerequisites
  • Simulate an authorization
  • Simulate a capture
  • Simulate refunds and reversals
Was this page helpful?