Skip to content
logo
  • Products
    • Amwal Checkout
    • Merchant App
    • Merchant Control Panel
  • Pricing
  • Developers
  • About us
  • Contact Us
Edit Content
  • Products
    • Amwal Checkout
    • Merchant App
    • Merchant Control Panel
  • Pricing
  • Developers
  • About us
  • Contact Us
Login
Get Started
Login
Get Started
BA Booking

BA Booking

2
  • BA Booking overview
  • BA Booking Installation
amwalpay woocommerce

Woocommerce

2
  • Overview
  • Woocommerce Installation
CS-Cart

CS Cart

2
  • CS-Cart Overview
  • CS CART Installation
Shopify

Shopify

2
  • Shopify Overview
  • Shopify Installation
odoo

Odoo

2
  • Odoo Overview
  • Odoo Installation
whmcs

WHMCS

2
  • WHMCS Overview
  • WHMCS Installation
Magento

Magento

2
  • Magento 2 Overview
  • Magento Installation
Opencart

Opencart

2
  • OpenCart Overview
  • Opencart Installtion
ZenCart

ZenCart

2
  • ZenCart Overview
  • Zencart Installation
Drupal

Drupal

2
  • Drupal Overview
  • Drupal Installation
PrestaShop

PrestaShop

2
  • PrestaShop Overview
  • PrestaShop Installation
Contact Form 7

Contact Form 7

2
  • Contact Form 7 Overview
  • Contact Form 7 Installation
Joomla

Joomla

2
  • Joomla Overview
  • Joomla Installation
AMWAL INTEGRATED PAYMENT LINK

Integrated Payment Link

1
  • Implementation
Android SDk

Native Android SDK

2
  • Pre Requisites
  • Implementation
ios SDk

Native iOS SDK

3
  • Apple Pay Specific Configuration
  • Pre Requisites
  • Implementation
React SDk

React Native SDK

1
  • Implementation

Laravel Package

2
  • Installation
  • Configuration

Flutter SDK

2
  • Implementation
  • Flutter SDK Overview

SMARTBOX

5
  • Express ApplePay Implementation
  • Offsite Implementation
  • Pre Requisites
  • Implementation
  • Acquiring Session Token

Merchant Cloud Notification

1
  • Merchant Cloud Notification Integration Guide

Secure Hash Calculation

1
  • Secure Hash Calculation

Wp Travel Engine

1
  • Installation

Webhooks

8
  • Encryption and Decryption
  • Refund Payment
  • Void Payment
  • Get Transaction by ID
  • Transactions with Statistics
  • Transactions Summary
  • Delete Customer Token
  • Pay by Token
View Categories
  • Home
  • Amwal Pay Developer Portal
  • Webhooks
  • Pay by Token

Pay by Token

Overview #

The Pay by Token API allows merchants to execute a payment using a previously registered customer and card token. This allows a transaction to be processed without sending the customer’s card details again.

The transaction is executed using the customerId and customerTokenId returned by the Execute API when tokenization is enabled.

Environment #

EnvironmentBase URL
UAThttps://test.amwalpg.com:14443/
Productionhttps://webhook.amwalpg.com/

Endpoint #

POST

Execute/PayByToken

Content Type #

application/json


Request #

Request Headers #

HeaderRequiredValue
Content-TypeYesapplication/json

Request Method #

POST

Sample Request #

{
    "amount": 1,
    "terminalId": 380024,
    "merchantId": 74417,
    "customerId": "fe60f286-b67e-47b2-81db-168d27f97288",
    "customerTokenId": "73b76aca-3876-4db9-859c-f56872c779c2",
    "requestDateTime": "2023-07-24T15:48:26.101Z",
    "clientMail": "client-email@test.com",
    "currencyCode": "512",
    "transactionId": "fa4d322e-55f6-41db-8b9b-7acf8fcc1390",
    "secureHashValue": "84EB3BF8F62EF25717D1E9E13C3CFB719A890980BBF2631AFD8965182ADE1754"
}

Token Information #

The customerId and customerTokenId are obtained from the Execute API response when IsTokenized is true.

These values can subsequently be used to execute a payment without requiring the customer to provide their full card details again.


Request Parameters #

FieldRequiredTypeConstraintsDescriptionExample
customerIdYesGUIDMaximum 32 charactersCustomer ID associated with a registered payment token.5ee9205ab53d45638b07f90507c2866d
customerTokenIdYesGUIDMaximum 32 charactersCustomer token ID that identifies the saved card token used for the payment.ea0a60d2e9be4c35b15a2a7f031a821f
amountYesNumericLength: 1–9Purchase transaction amount.1
terminalIdYesNumericMaximum 30 charactersTerminal ID initiating the transaction.140052
merchantIdYesNumericMaximum 30 charactersMerchant ID initiating the transaction.1345
merchantReferenceNoStringLength: 4Merchant reference code.1234
requestDateTimeYesStringValid UTC date/timeDate and time when the transaction request was created.2023-03-08T20:51:38.401Z
clientMailNoStringMaximum 256 charactersCustomer email address.demoemail@mail.com
currencyCodeYesNumericLength: 2–4Currency code used for the transaction.512
transactionIdYesStringMaximum 256 charactersUnique identifier used to identify the transaction.5ee9205ab53d45638b07f90507c2866d
secureHashValueYesStringMaximum 256 charactersSecure hash value used to validate the integrity and authenticity of the request.3DB2F9CB975DADB533A2068F5C2911F9CCFF8AA0DFF3F92

Response #

Successful Response #

A successful transaction returns success: true and a response code of 00.

Sample Success Response #

{
    "success": true,
    "responseCode": "00",
    "message": "Success",
    "data": {
        "systemTraceNr": null,
        "message": "CAPTURED - ",
        "transactionId": "b81e7509-6ca0-4ab2-89c1-f373bbd4d91b",
        "isOtpRequired": false,
        "hostResponseData": {
            "TransactionId": "202431897300287",
            "Rrn": "431880000100",
            "TrackId": "b81e75096ca04ab289c1f373bbd4d91b",
            "PaymentId": null,
            "Auth": "490908"
        },
        "terminalId": 221143,
        "transactionTypeId": 2,
        "transactionTypeDisplayName": "Purchase",
        "customerId": null,
        "merchantId": 7921,
        "currency": null,
        "amount": 1,
        "currencyId": 512
    },
    "errorList": []
}

Success Response Parameters #

FieldTypeDescriptionExample
successBooleanIndicates whether the transaction was successful.true
responseCodeStringResponse code returned by the API.00
messageStringGeneral response message.Success
dataObjectContains the transaction details.Object
data.systemTraceNrStringSystem trace number associated with the transaction.null
data.messageStringMessage describing the transaction result.CAPTURED
data.transactionIdStringTransaction identifier returned by the API.b81e7509-6ca0-4ab2-89c1-f373bbd4d91b
data.isOtpRequiredBooleanIndicates whether OTP verification is required.false
data.hostResponseDataObjectContains transaction information returned by the payment host.Object
data.hostResponseData.TransactionIdStringTransaction identifier provided by the payment host.202431897300287
data.hostResponseData.RrnStringRetrieval Reference Number associated with the transaction.431880000100
data.hostResponseData.TrackIdStringTrack identifier associated with the transaction.b81e75096ca04ab289c1f373bbd4d91b
data.hostResponseData.PaymentIdStringPayment identifier provided by the payment host.null
data.hostResponseData.AuthStringAuthorization code returned by the payment host.490908
data.terminalIdNumericUnique identifier of the terminal used for the transaction.380024
data.transactionTypeIdNumericTransaction type identifier.2
data.transactionTypeDisplayNameStringDisplay name of the transaction type based on the Accept-Language header.Purchase
data.merchantIdNumericMerchant identifier associated with the transaction.7921
data.currencyStringCurrency name used for the transaction.OMR
data.amountNumericAmount processed for the transaction.1
data.currencyIdNumericCurrency identifier used for the transaction.512
data.customerIdGUIDCustomer ID returned when tokenization is enabled and recurring payments are supported.89217ad0-872d-45c3-a6b3-6cba7967d836
data.customerTokenIdGUIDCustomer token ID associated with the saved card token.89217ad0-872d-45c3-a6b3-6cba7967d836
errorListString ArrayList of errors. This should be empty for a successful response.[]

Tokenized Payment Details #

When the Execute API returns IsTokenized as true, the response can contain:

  • customerId
  • customerTokenId

These identifiers can be securely stored by the merchant and used for subsequent Pay by Token transactions.

The merchant can execute a subsequent transaction by providing:

customerId
customerTokenId

This eliminates the need to send the customer’s full card information for subsequent tokenized payments.

Important: Token identifiers should be treated as sensitive payment-related data and must be stored and transmitted securely.


Failure Response #

If the transaction cannot be processed, the API returns success: false along with a response code and an errorList describing the failure.

Sample Failure Response #

{
    "success": false,
    "responseCode": "61",
    "message": "APGEX: 62cfc42bff3b",
    "data": null,
    "errorList": [
        "Token Not Found"
    ]
}

Failure Response Parameters #

FieldTypeDescriptionExample
successBooleanIndicates whether the transaction was successful.false
responseCodeStringResponse code returned by the API.61
messageStringGeneral response or error message.APGEX: 62cfc42bff3b
dataObjectTransaction data. This may be null when the transaction fails.null
errorListString ArrayList containing one or more errors explaining the failure.["Token Not Found"]

Common Failure Example #

Token Not Found #

{
    "success": false,
    "responseCode": "61",
    "message": "APGEX: 62cfc42bff3b",
    "data": null,
    "errorList": [
        "Token Not Found"
    ]
}

This response indicates that the supplied customerId and/or customerTokenId could not be found or could not be used to process the transaction.


Transaction Flow #

The Pay by Token process follows these general steps:

  1. The customer completes an initial payment transaction.
  2. If tokenization is enabled, the Execute API returns customerId and customerTokenId.
  3. The merchant securely stores the token identifiers.
  4. For a subsequent payment, the merchant sends the customerId and customerTokenId to the Execute/PayByToken endpoint.
  5. The payment is processed without sending the customer’s full card details.
  6. The API returns the transaction result and payment host information.

Note: Ensure that the correct merchant credentials, terminal ID, and environment-specific configuration are used when switching between UAT and Production.

Updated on August 10, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Delete Customer Token
Table of Contents
  • Overview
    • Environment
    • Endpoint
    • Content Type
  • Request
    • Request Headers
    • Request Method
    • Sample Request
      • Token Information
  • Request Parameters
  • Response
    • Successful Response
      • Sample Success Response
    • Success Response Parameters
  • Tokenized Payment Details
  • Failure Response
    • Sample Failure Response
    • Failure Response Parameters
  • Common Failure Example
    • Token Not Found
  • Transaction Flow

Secure. Seamless – Powering Payments for Every Business.

Sign Up
Support

4th Floor, Majan Tower Building
North Al Ghubrah, P.O. Box 233, P.C 118
Muscat, Sultanate of Oman

: support@amwal-pay.com

📞 : +96824121845

Resources
  • Developers
  • Careers
Company
  • About us
  • Contact Us
  • Contact Sales
  • Partners

2026 © AmwalPay. All Rights Reserved.

  • Terms & Conditions
  • Privacy Policy