Card testing

Simulate authorization

Simulate an authorization request with a card you issued previously.

Body·
required
application/json
  • card
    Type: object ·

    The card to simulate an authorization with.

  • transaction
    Type: object ·

    The transaction to simulate with the specified card. For example, a purchase.

    • type
      Discriminator
      Type: string
      required

      The transaction type.

    • amount
      Type: integer
      min:  
      0

      The payment amount, in minor currency units.

      To perform a card verification, set amount to 0, or omit the field entirely.

    • currency
      Type: string
      min length:  
      3
      max length:  
      3

      The currency to use for the transaction, as a three-letter ISO currency code. If this currency differs from the cardholder's billing currency, the billing amount will be adjusted according to the applicable conversion rate. If no currency is provided, the transaction will default to the cardholder's billing currency.

    • merchant
      Type: object ·

      The merchant related data to use for the transaction.

    • authorization_type
      Type: string · enum

      Use authorization for a known final amount or pre_authorization for an estimated amount.

      values
      • authorization
      • pre_authorization
Responses
  • application/json
  • 401

    Unauthorized

  • application/json
  • 500

    Internal Server Error

Request Example for post/issuing/simulate/authorizations
curl 'https://{prefix}.api.sandbox.checkout.com/issuing/simulate/authorizations' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "card": {
    "id": "crd_fa6psq242dcd6fdn5gifcq1491",
    "expiry_month": 5,
    "expiry_year": 2025
  },
  "transaction": {
    "type": "purchase",
    "amount": 2500,
    "currency": "GBP",
    "merchant": {
      "category_code": "7399"
    }
  }
}'
{
  "id": "trx_aaqc4uaaybigcaaqc4uaayfiga",
  "status": "Authorized"
}

Simulate incrementing an authorization

Simulate an incremental authorization request for an existing approved transaction.

Incremental authorizations increase the total authorized amount of the transaction. For example, adding a restaurant bill to an existing hotel booking.

Path Parameters
  • id
    Type: string ·
    min length:  
    30
    max length:  
    30
    Pattern: ^trx_[a-z0-9]{26}$
    required

    The transaction's unique identifier.

Body·
required
application/json
  • amount
    Type: integer
    min:  
    0

    You must provide the amount in the transaction currency's minor currency units.

Responses
  • application/json
  • 401

    Unauthorized

  • 404

    Authorization not found

  • application/json
  • 500

    Internal Server Error

Request Example for post/issuing/simulate/authorizations/{id}/authorizations
curl 'https://{prefix}.api.sandbox.checkout.com/issuing/simulate/authorizations/trx_aayhhfwbdyxwcaeyhhfwbd4xga/authorizations' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "amount": 3500
}'
{
  "status": "Authorized"
}

Simulate clearing

Simulate the clearing of an existing approved authorization.

Path Parameters
  • id
    Type: string ·
    min length:  
    30
    max length:  
    30
    Pattern: ^trx_[a-z0-9]{26}$
    required

    The transaction's unique identifier.

Body·
required
application/json
  • amount
    Type: integer
    min:  
    0

    The amount to clear. If not specified, the full authorized amount will be cleared.

    You must provide the amount in the transaction currency's minor currency units.

Responses
  • 202

    Presentment accepted

  • 401

    Unauthorized

  • 404

    Authorization not found

  • application/json
  • 500

    Internal Server Error

Request Example for post/issuing/simulate/authorizations/{id}/presentments
curl 'https://{prefix}.api.sandbox.checkout.com/issuing/simulate/authorizations/trx_aayhhfwbdyxwcaeyhhfwbd4xga/presentments' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "amount": 2500
}'
No Body

Simulate refund

Simulate the refund of an existing approved authorization, after it has been cleared.

Path Parameters
  • id
    Type: string ·
    min length:  
    30
    max length:  
    30
    Pattern: ^trx_[a-z0-9]{26}$
    required

    The transaction's unique identifier.

Body·
required
application/json
  • amount
    Type: integer
    min:  
    0

    The amount to refund. If not specified, the full cleared amount will be refunded.

    You must provide the amount in the transaction currency's minor currency units .

Responses
  • 202

    Refund accepted

  • 401

    Unauthorized

  • 404

    Presentment not found

  • application/json
  • 500

    Internal Server Error

Request Example for post/issuing/simulate/authorizations/{id}/refunds
curl 'https://{prefix}.api.sandbox.checkout.com/issuing/simulate/authorizations/trx_aayhhfwbdyxwcaeyhhfwbd4xga/refunds' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "amount": 2500
}'
No Body

Simulate reversal

Simulate the reversal of an existing approved authorization.

Path Parameters
  • id
    Type: string ·
    min length:  
    30
    max length:  
    30
    Pattern: ^trx_[a-z0-9]{26}$
    required

    The transaction's unique identifier.

Body·
required
application/json
  • amount
    Type: integer
    min:  
    0

    The amount to reverse. If unspecified, the full transaction amount will be reversed.

    You must provide the amount in the transaction currency's minor currency units.

Responses
  • application/json
  • 401

    Unauthorized

  • 404

    Authorization not found

  • application/json
  • 500

    Internal Server Error

Request Example for post/issuing/simulate/authorizations/{id}/reversals
curl 'https://{prefix}.api.sandbox.checkout.com/issuing/simulate/authorizations/trx_aayhhfwbdyxwcaeyhhfwbd4xga/reversals' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "amount": 2500
}'
{
  "status": "Reversed"
}