Docs
Docs

Token Payment

The token payment functionality provides merchants and users with an additional layer of security and convenience when making recurring transactions or securely storing card information. By using this feature, merchants can simplify the payment process and enhance the user experience.

Token Generation: When a user successfully completes a transaction for the first time and selects the option to save the card, the payment gateway generates a unique token associated with the user's credit or debit card. This token replaces the sensitive card details and is used to uniquely identify the user's account in future transactions.

This endpoint receives the payment/pre-authorization transaction data and returns the result.
Method: post
URL: http://{environment-domain}/api/v1/make-token-payment
HTTP Headers: Content-Type: application/json
Add authentication headers

Example:

{
    "transactionType": "sale",
    "merchantId": "3ae25846-d5fe-40cc-a311-eb2de5174c29",
    "terminalId": "3ae25846-d5fe-40cc-a311-eb2de5174c29",
    "order": {
        "merchantOrderId": "9a6ecf36-8265-11ee-b962-0242ac120002",
        "amount": "100.00",
        "currency": "484"
    },
    "card": {
        "token": "a371f431-b300-44f8-820c-abccf6d45f98"
    },
    "installments": {
        "initialDiferement": 0,
        "numberInstallments": 0,
        "planType": "0"
    }
}

Field Description

FieldDescriptionNote
idUnique ID of the transaction assigned by the payment gateway.
merchantIdUnique identifier for the merchant on the payment gateway, assigned when the account is created.
terminalIdUnique identifier for the terminal, assigned when the account is created.
orderContains details about the purchase order.
merchantOrderIdUnique identifier for the order assigned by the merchant.
amountTotal amount of the order.
currencyCurrency code following the ISO 4217 standard.
installmentsDetails about payment in installments.Optional, if the transaction is not submitted, it will be processed without fees or deferred payments.
initialDiferementInitial deferral.
numberInstallmentsNumber of installments.
planTypeType of payment plan (“0” for regular plan).

Example of a successful response:

Http code 200

{
  "id": "5c51bebd-5b21-4ef3-b980-d41eb0b83568",
  "order": {
    "merchantOrderId": "9a6ecf36-8265-11ee-b962-0242ac120002",
    "amount": "100.00",
    "currency": "484"
  },
  "payload": {
    "paymentId": "4d0cbd45-bc39-4d17-96ef-34affa296bde",
    "responseCode": "00",
    "responseDescription": "Approved or completed successfully (if balances are available)",
    "authorizationNumber": "280188",
    "referenceNumber": "000027389440",
    "status": "Paid"
  },
  "isApproved": true,
  "isFailure": false,
  "errors": null
} 

Field Description

FieldDescription
idUnique ID of the transaction assigned by the payment gateway.
orderContains details about the purchase order.
merchantOrderIdUnique identifier for the order assigned by the merchant.
amountTotal amount of the order.
currencyCurrency code following the ISO 4217 standard.
payloadContains detailed information about the transaction.
paymentIdUnique identifier of the payment transaction.
responseCodeResponse code indicating the result of the transaction (in this case, "00" indicates approval).
responseDescriptionDescription associated with the response code.
authorizationNumberAuthorization number of the transaction.
referenceNumberReference number associated with the transaction.
statusTransaction status; in this case, "paid" indicates that the transaction was successfully completed.
isApprovedIndicates whether the transaction was approved. In this example, it is "true," meaning the transaction was approved.
isFailureIndicates whether the transaction failed. In this example, it is "false," meaning the transaction did not fail.
errorsContains details such as error number and description, if any. In this case, it is "null," meaning no errors occurred in the transaction.