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

ParameterTypeMandatoryDefaultDescription
merchantIdStringMMerchant identifier
userIdString(64)MMerchant's user identifier, value is case insensitive
tokenIdNumberMUser's token identifier
merchantReferenceString(64)MAn unique reference to identify this order
currencyStringOHKD3-Letters ISO currency code, supports HKD, USD
amountNumber(9,2)MSale amount
emailString(255)OEmail to receive receipt
callbackUrlObjectO 
callbackUrl.notifyStringOAn API URL in merchant's backend to receive notification
isRecurringBooleanOfalseEnable/disable recurring payment
lineItemsArrayM 
lineItems[index].quantityNumber(8)MNumber of items, must be an integer
lineItems[index].priceDataStringMPrice data object with details
lineItems[index].unitAmountNumber(9,2)MUnit amount of the item
lineItems[index].nameStringMName 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

ParameterTypeMandatoryDescription
responseCodeStringMPayment Gateway response code
messageStringMPayment Gateway response message
orderObjectM 
order.idNumberMOrder identifier. If it is recurring payment, save this value as next recurring payment's parentOrderId
order.merchantIdNumberMMerchant identifier which own this order
order.merchantReferenceStringMYour reference for the order
order.currencyStringM3-Letters ISO currency code of the order
order.amountNumberMOrder amount
order.netAmountNumberMNet amount of the order
order.cardTypeStringMCard type of the order
order.createTimeDatetimeMTimestamp when the order is created. Maintained by the Payment Gateway
order.updateTimeDatetimeMTimestamp when the order is last updated. Maintained by the Payment Gateway
order.statusStringMStatus of the order. Maintained by the Payment Gateway
order.recurringBooleanMFlags the order is a recurring order or not
transactionObjectM 
transaction.idNumberMTransaction identifier for the refund transaction
transaction.merchantIdNumberMMerchant identifier which own this transaction
transaction.typeStringMTransaction type
transaction.amountStringMTransaction amount
transaction.statusStringMStatus of the transaction. Maintained by the Payment Gateway
transaction.maskedPanStringMMasked card number of the original sale transaction if supported by the payment method
transaction.stanStringMSystem 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"
}
}