- Description: Tokenize credit card that can be used to make payment(s) without storing the card data by yourself
- Path:
/tokenization/add-token
- 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 |
reason | string | Optional | | Reason to create token |
callbackUrl | object | Required | | |
callbackUrl.success | string | Required | | An URL to redirect after successful tokenize |
callbackUrl.fail | string | Required | | An URL to redirect after failed tokenize |
callbackUrl.cancel | string | Optional | | An URL to redirect when payment is cancelled, back button will not show if value is not given |
callbackUrl.notify | string | Required | | An API URL in merchant's backend to receive notification |
lang | string | Optional | Web browser default | Default language, value can be zh-HK or en |
showLang | boolean | Optional | true | Show/hide language options |
showPoweredBy | boolean | Optional | true | Show/hide Powered by BBMSL text at the bottom |
allowedBinRanges | array | Optional | | Allow only the card matches the provided bin ranges |
allowedBinRanges[index].binStart | string | Required | | Start of bin range, e.g., 4812 ,540820 . |
allowedBinRanges[index].binEnd | string | Required | | End of bin range, must be the same length as binStart . e.g., 4814 ,540870 . |
allowedCardType | string | Optional | | Allow only the provided card type to proceed if given. Available card type: VISA , MASTER |
themeColor | string | Optional | | Order page background color |
buttonBackgroundColor | string | Optional | Background color of all buttons | |
buttonFontColor | string | Optional | Font color of all buttons | |
Example:
{
"request": "{\"merchantId\":3,\"userId\":\"abc\",\"callbackUrl\":{\"success\":\"https://www.bbmsl.com/success\",\"fail\":\"https://www.bbmsl.com/fail\",\"cancel\":\"https://www.bbmsl.com/cancel\"},\"paymentMethods\":\"CARD,APPLEPAY\"}",
"signature": "zjo6xEhFokI9LpSleJiyUukmouGQP6xQ8NLEPily36vqyQ+Zrt4/4ZmBL0sBb6KdSDHiG6VKxZXLmlJaTqoLtuC+ZS1vbrrSblcilHgCCKASMDlFG1NdF8Xt+lGuhqhvn2Det/URoslou1YmLgAfEXKWrEfScdel+ieixMiIv0K1VKwswc4lvlljCmJhgYSeiJK51djnlecMNZyTMcHwofnGV0SMuB8sGWFcAFFF6N3ZbeY3unV4NYJATrCM8OYsd2K40V4FjXR3rWsIqWr9U0u8GoQq79+dY7+Mbf84IJC0YP+KP18cz1wMz75EVpIMghChzWEa3+iwSFFtf++mOw=="
}
Response Parameters
Parameter | Type | Required/optional | Description |
---|
responseCode | string | Required | Payment Gateway response code |
message | string | Required | Payment Gateway response message |
data | string | Required | URL to hosted tokenize page |
Example:
{
"responseCode": "0000",
"message": "SUCCESS",
"data": "https://checkout.sit.bbmsl.com/token?sid=559a191620984bf5b5e9c32be0215150"
}
After getting the response data, you need to guide your user by redirecting to the URL to complete the tokenization of credit card, Apple Pay or Google Pay.