Skip to content

Simulate a card transaction clearing

Request

Simulates a transaction clearing request in the sandbox environment. This is done after the authorisation. The ref field can be copied from the reference object in the authorisation response.

To clear a previous authorisation, the ref details must match the previous authorisation request. The amount does not have to match the previous authorisation request, it can be more or less than the authorisation request amount.

Clearing simulation doesn't work with Mastercard.

Refund

A refund is a 2-step process: first authorise with transactionType set to REFUND, then clear using this endpoint with the same transaction type.

Security
UserToken
Path
profileIdinteger, (int64)required

The profile ID.

cardTokenstring, (uuid)required

The card token.

Headers
X-External-Correlation-Idstring, (uuid), <= 36 characters

Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. Learn more.

Example:f47ac10b-58cc-4372-a567-0e02b2c3d479
Bodyapplication/jsonrequired
amountobject
transactionTypestring

The type of the transaction. Use the same transaction type from the previous authorisation request.

refobject

The transaction reference. This can be obtained from a previous authorisation request.

curl -i -X POST \
  'https://api.wise.com/v1/simulation/spend/profiles/{profileId}/cards/{cardToken}/transactions/clearing' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479' \
  -d '{
    "amount": {
      "value": 10,
      "currency": "SGD"
    },
    "transactionType": "GOODS_AND_SERVICES",
    "ref": {
      "transaction": {
        "acquirer": {
          "institutionId": "430010",
          "name": "ACQUIRER NAME",
          "city": "CITY NAME",
          "merchantCategoryCode": 5499,
          "country": "GB",
          "acceptorTerminalId": "TERMID01",
          "acceptorIdCode": "CARD ACCEPTOR",
          "forwardingInstitutionId": "400050"
        },
        "card": {
          "token": "59123122-223d-45f9-b840-0ad4a4f80937",
          "schemeName": "VISA",
          "pan": "4242424242424242",
          "pin": "1234",
          "cvv1": "123",
          "icvv": "456",
          "cvv2": "789",
          "expiration": [
            2029,
            7
          ],
          "sequenceNumber": 1,
          "profileId": 2,
          "userId": 5,
          "cardStatus": "ACTIVE",
          "country": "SG",
          "currencies": [
            "SGD"
          ]
        },
        "pos": {
          "type": "CHIP_AND_PIN",
          "acceptsOnlinePins": true,
          "maxPinLength": 12,
          "supports3ds": false,
          "hasChip": true
        },
        "transactionStartTime": 1667541087.0476434,
        "stan": "363054",
        "schemeTransactionId": "932290252416153",
        "retrievalReferenceNum": "230805363054"
      },
      "requestMti": "0200",
      "authorizationIdResponse": "123646"
    }
  }'

Responses

Simulated transaction clearing result.

Headers
X-External-Correlation-Idstring, (uuid), <= 36 characters

Echoed back when X-External-Correlation-Id was included in the request. Learn more.

Example:"f47ac10b-58cc-4372-a567-0e02b2c3d479"
x-trace-idstring

Unique trace identifier assigned by Wise. Useful when contacting support about a specific request.

Example:"fba501b6d453b96789f52338f019341f"
Bodyapplication/json
referenceobject

The transaction reference.

errorstring or null

An error returned by the transaction, if it exists.

Response
{ "reference": { "transaction": { "acquirer": {}, "card": {}, "pos": {}, "transactionStartTime": 1667541087.0476434, "stan": "363054", "schemeTransactionId": "932290252416153", "retrievalReferenceNum": "230805363054" }, "requestMti": "0200", "authorizationIdResponse": "123646" }, "error": null }