Skip to main content

Request: Tokenization (tokenise)

The "tokenise" is one of the optional parameters that you can use while initiating a hosted payment page. It defines the tokenization format for securing sensitive payment information. Tokenization enhances security by replacing card details with a token.

Why You Should Use This Parameter

This parameter is required to to initiate a token that you can then use in the Token-Based Transactions



Parameter Specifications

Parametertokenise
Description
The tokenization format the generated token should follow. Hosted Payment Page APIs | Token Based Transactions.
To know more about this parameter please click here.
Data TypeSTRING
Required
Validation Rules
Pass one of the following list:
  • 2 - Hex32
  • 3 - AlphaNum20
  • 4 - Digit22
  • 5 - Digit16
  • 6 - AlphaNum32
Sample
{
"tokenise": 2,
}


Sample Request & Response Payloads

Click to view the full Request Payload!
{
"profile_id": "987###",
"tran_type": "sale",
"tran_class": "ecom",
"cart_id": "CART#1001",
"cart_currency": "SAR",
"cart_amount": 500,
"cart_description": "Description of the items/services",

"tokenise": 2
}
Click to view the full Response Payload!
{
"tran_ref": "TST22********159",
"tran_type": "Sale",
"cart_id": "CART#1001",
"cart_description": "Description of the items/services",
"cart_currency": "SAR",
"cart_amount": "500.00",
"return": "none",
"redirect_url": "https://secure.paytabs.sa/payment/page/599458B182E5B6B********************B4817FD44318539688688",
"serviceId": 2,
"profileId": 987###,
"merchantId": 1*****7,
"trace": "PMN****4.63****A8.00****C4"
}


Expected behavior

  1. You will initiate a payment request using the guide mentioned here

  2. You will use the "tokenise" parameter according to the above Specifications

  3. Then you will receive the response payload containing the "redirect_url" meaning you have initiated a correct payment request.

  4. Finally, you should redirect your customer to this URL so the payment process can be finalized.