Sale
- Description: Proceed a sale payment with the token
- Path:
/tokenization/sale
- Method:
POST
- Request Header:
Content-Type: application/json
Request Parameters
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
merchantId | String | M | Merchant identifier | |
userId | String(64) | M | Merchant's user identifier, value is case insensitive | |
tokenId | Number | M | User's token identifier | |
merchantReference | String(64) | M | An unique reference to identify this order | |
currency | String | O | HKD | 3-Letters ISO currency code, supports HKD , USD |
amount | Number(9,2) | M | Sale amount | |
String(255) | O | Email to receive receipt | ||
callbackUrl | Object | O | ||
callbackUrl.notify | String | O | An API URL in merchant's backend to receive notification | |
isRecurring | Boolean | O | false | Enable/disable recurring payment |
lineItems | Array | M | ||
lineItems[index].quantity | Number(8) | M | Number of items, must be an integer | |
lineItems[index].priceData | String | M | Price data object with details | |
lineItems[index].unitAmount | Number(9,2) | M | Unit amount of the item | |
lineItems[index].name | String | M | 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 | Mandatory | Description |
---|---|---|---|
responseCode | String | M | Payment Gateway response code |
message | String | M | Payment Gateway response message |
order | Object | M | |
order.id | Number | M | Order identifier. If it is recurring payment, save this value as next recurring payment's parentOrderId |
order.merchantId | Number | M | Merchant identifier which own this order |
order.merchantReference | String | M | Your reference for the order |
order.currency | String | M | 3-Letters ISO currency code of the order |
order.amount | Number | M | Order amount |
order.netAmount | Number | M | Net amount of the order |
order.cardType | String | M | Card type of the order |
order.createTime | Datetime | M | Timestamp when the order is created. Maintained by the Payment Gateway |
order.updateTime | Datetime | M | Timestamp when the order is last updated. Maintained by the Payment Gateway |
order.status | String | M | Status of the order. Maintained by the Payment Gateway |
order.recurring | Boolean | M | Flags the order is a recurring order or not |
transaction | Object | M | |
transaction.id | Number | M | Transaction identifier for the refund transaction |
transaction.merchantId | Number | M | Merchant identifier which own this transaction |
transaction.type | String | M | Transaction type |
transaction.amount | String | M | Transaction amount |
transaction.status | String | M | Status of the transaction. Maintained by the Payment Gateway |
transaction.maskedPan | String | M | Masked card number of the original sale transaction if supported by the payment method |
transaction.stan | String | M | 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"
}
}