Skip to main content

Sale


  • Description: Proceed a sale payment with the token
  • Path: /tokenization/sale
  • Method: POST
  • Request Header: Content-Type: application/json

Request Parameters#

ParameterTypeRequired/optionalDefaultDescription
merchantIdstringRequiredMerchant identifier
userIdstringRequiredMerchant's user identifier, value is case insensitive
tokenIdnumberRequiredUser's token identifier
merchantReferencestringRequiredAn unique reference to identify this order
currencystringOptionalHKD3-Letters ISO currency code, supports HKD, USD
amountnumberRequiredSale amount
emailstringOptionalEmail to receive receipt
callbackUrlobjectOptional 
callbackUrl.notifystringOptionalAn API URL in merchant's backend to receive notification
isRecurringbooleanOptionalfalseEnable/disable recurring payment
lineItemsarrayRequired 
lineItems[index].quantitynumberRequiredNumber of items, must be an integer
lineItems[index].priceDatastringRequiredPrice data object with details
lineItems[index].unitAmountnumberRequiredUnit amount of the item
lineItems[index].namestringRequiredName 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#

ParameterTypeRequired/optionalDescription
responseCodestringRequiredPayment Gateway response code
messagestringRequiredPayment Gateway response message
orderobjectRequired 
order.idnumberRequiredOrder identifier. If it is recurring payment, save this value as next recurring payment's parentOrderId
order.merchantIdnumberRequiredMerchant identifier which own this order
order.merchantReferencestringRequiredYour reference for the order
order.currencystringRequired3-Letters ISO currency code of the order
order.amountnumberRequiredOrder amount
order.netAmountnumberRequiredNet amount of the order
order.cardTypestringRequiredCard type of the order
order.createTimedatetimeRequiredTimestamp when the order is created. Maintained by the Payment Gateway
order.updateTimedatetimeRequiredTimestamp when the order is last updated. Maintained by the Payment Gateway
order.statusstringRequiredStatus of the order. Maintained by the Payment Gateway
order.recurringbooleanRequiredFlags the order is a recurring order or not
transactionobjectRequired 
transaction.idnumberRequiredTransaction identifier for the refund transaction
transaction.merchantIdnumberRequiredMerchant identifier which own this transaction
transaction.typestringRequiredTransaction type
transaction.amountstringRequiredTransaction amount
transaction.statusstringRequiredStatus of the transaction. Maintained by the Payment Gateway
transaction.maskedPanstringRequiredMasked card number of the original sale transaction if supported by the payment method
transaction.stanstringRequiredSystem 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"
}
}