Authorize a sale transaction

Before you start a sale transaction in mobile app using the transaction API endpoint, make sure you have the following:

API key issued by Xplor Pay.

Mobile JSON Web Token (mobilejwt) returned by the successfulTransactionToken method using the JavaScript SDK integration.

To create a multi-use or durable token (id) when authorizing a sale transaction:

  1. Add the create-token field with a value of true to the request body when calling the transactions API endpoint to authorize a sale transaction.

{
    "type": "sale",
    "card": "4111111111111111",
    "exp-date": "1227",
    "amount": "1.00",
    "create-token": "true"
}
  1. Use the POST method to call the rest/v2/transactions/auth endpoint.

The API returns the following response:

{
    "code": "200",
    "status": "success",
    "exchange-id": "ID-clearent-cgw-1-1747434482642-0-19185009",
    "links": [
        {
            "rel": "transaction",
            "href": "/rest/v2/transactions?id=118883986",
            "id": "118883986"
        },
        {
            "rel": "token",
            "href": "/rest/v2/tokens/1100001516808661111",
            "id": "1100001516808661111"
        }
    ],
    "payload": {
        "transaction": {
            "amount": "1.00",
            "id": "118883986",
            "created": "2025-06-03 13:53:03.177",
            "type": "SALE",
            "result": "APPROVED",
            "card": "XXXXXXXXXXXX1111",
            "authorization-code": "TAS632",
            "batch-string-id": "67",
            "display-message": "Transaction approved",
            "result-code": "000",
            "exp-date": "1227",
            "card-type": "VISA",
            "last-four": "1111",
            "merchant-id": "946074139743",
            "terminal-id": "10011111",
            "create-token": true
        },
        "payloadType": "transaction"
    }
}

The API response includes links array with the following fields:

Name
Data type
Description

rel

String

Indicates the type of resource the link refers to.

Common values are:

  • transaction

  • token

href

String (URI)

The relative URI to access the card token.

id

String

The unique multi-use or durable card token ID.

See Authorize a sale transaction endpoint response for more information.

Last updated

Was this helpful?