- Description: Proceed a sale payment with the token
- Path:
/tokenization/sale
- Method:
POST
- Request Header:
Content-Type: application/json
Request Parameters
Parameter | Type | Required/optional | Default | Description |
---|
merchantId | string | Required | | Merchant identifier |
userId | string | Required | | Merchant's user identifier, value is case insensitive |
tokenId | number | Required | | User's token identifier |
merchantReference | string | Required | | An unique reference to identify this order |
currency | string | Optional | HKD | 3-Letters ISO currency code, supports HKD , USD |
amount | number | Required | | Sale amount |
email | string | Optional | | Email to receive receipt |
callbackUrl | object | Optional | | |
callbackUrl.notify | string | Optional | | An API URL in merchant's backend to receive notification |
isRecurring | boolean | Optional | false | Enable/disable recurring payment |
lineItems | array | Required | | |
lineItems[index].quantity | number | Required | | Number of items, must be an integer |
lineItems[index].priceData | string | Required | | Price data object with details |
lineItems[index].unitAmount | number | Required | | Unit amount of the item |
lineItems[index].name | string | Required | | Name of the item |
Example:
{
"request": "{\"currency\":\"USD\",\"amount\":50,\"lineItems\":[{\"priceData\":{\"name\":\"Book\",\"unitAmount\":50},\"quantity\":1}],\"merchantId\":3,\"userId\":\"user1\",\"tokenId\":\"436\",\"isRecurring\":true,\"merchantReference\":\"merRef1656991200725\"}",
"signature": "H72q6TZBuo/U0LGNiFm0ZRnKNqOyeBqlqBL38l3gHFYjs5GXdq8pkb/4gUAAZlp30C87CoUvgoJq0FrCGv4nxEnfuYRj+0UZh1wgLATLJv+dse9GS26yFQfdzkPglaStEDlrenxR54Z+H5FszBm+YCFoUWE3J3p+5lD8QkcIGUsJJerrz1NQ1sUFZn1J+SEKM8gFwqwB7tcP8cl77h6SpskfroZ9OA8YeudNdZGoaG+H4ntlcafVPoemcCqxgm6jyqFW5FML+uhOdfrD7wIWshRjfjajGJ4rVsVhnf6XqQC/ELP7MeyESmC8aY7EsMUxZjU6UckY/8oXDRba2vO9dQ=="
}
Response Parameters
Parameter | Type | Required/optional | Description |
---|
responseCode | string | Required | Payment Gateway response code |
message | string | Required | Payment Gateway response message |
order | object | Required | |
order.id | number | Required | Order identifier. If it is recurring payment, save this value as next recurring payment's parentOrderId |
order.merchantId | number | Required | Merchant identifier which own this order |
order.merchantReference | string | Required | Your reference for the order |
order.currency | string | Required | 3-Letters ISO currency code of the order |
order.amount | number | Required | Order amount |
order.netAmount | number | Required | Net amount of the order |
order.cardType | string | Required | Card type of the order |
order.createTime | datetime | Required | Timestamp when the order is created. Maintained by the Payment Gateway |
order.updateTime | datetime | Required | Timestamp when the order is last updated. Maintained by the Payment Gateway |
order.status | string | Required | Status of the order. Maintained by the Payment Gateway |
order.recurring | boolean | Required | Flags the order is a recurring order or not |
transaction | object | Required | |
transaction.id | number | Required | Transaction identifier for the refund transaction |
transaction.merchantId | number | Required | Merchant identifier which own this transaction |
transaction.type | string | Required | Transaction type |
transaction.amount | string | Required | Transaction amount |
transaction.status | string | Required | Status of the transaction. Maintained by the Payment Gateway |
transaction.maskedPan | string | Required | Masked card number of the original sale transaction if supported by the payment method |
transaction.stan | string | Required | System trace audit number for the transaction |
Example:
{
"responseCode": "0000",
"message": "Success",
"order": {
"id": 5798,
"merchantId": 3,
"merchantReference": "merRef1656991200725",
"currency": "USD",
"amount": 50,
"netAmount": 50,
"cardType": "VISA",
"createTime": "2022-07-05T03:20:01.307+00:00",
"updateTime": "2022-07-05T03:20:01.307+00:00",
"status": "SUCCESS",
"issuerCountryCode": "HK",
"recurring": true
},
"transaction": {
"id": 3970,
"merchantId": 3,
"type": "SALE",
"amount": 50,
"currency": "USD",
"status": "SUCCESS",
"maskedPan": "470534XXXXXX8101",
"stan": "3970"
}
}