NAV Navbar
Logo

FORT Tokenization Service

The Token service allows the Merchant to store the Customer’s credit card details in a safe and secure environment substituting the Customer’s sensitive card details with a non-sensitive equivalent referred to as a Token. The Token can be used to process transactions without the use of the card details.

Create Token in Transaction Flow

To create a new Token, include the following parameter in the Authorization/ Purchase Request parameters you will send to PayFort; the same parameter will hold the Token name in PayFort’s Response:

ATTRIBUTES Description
token_name
Alphanumeric
Optional
max: 100
Holds the name of the Token to update the Token or rename it.
Example: OpVmp
Special characters: . @ - _

Create New Token Service

This service allows Merchants to verify and tokenize their Customer’s credit cards without charging their Customers.

FORT Tokenization Service URLs

Test Environment URL:

https://sbcheckout.PayFort.com/FortAPI/paymentPage

Production Environment URL:

https://checkout.PayFort.com/FortAPI/paymentPage

Parameters Submission Type

HTTPs Form Post Request.

Create New Token Service - Request

Include the following parameters in the Request you will send to PayFort:

ATTRIBUTES Description
service_command
Alpha
Mandatory
Max: 20
Command.
Possible/ expected values: CREATE_TOKEN
access_code
Alphanumeric
Mandatory
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Mandatory
Max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
Mandatory
Max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
Special characters: - _ .
language
Alpha
Mandatory
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
card_number
Numeric
Mandatory
Max: 16
The clear card data collect on the Merchant page form, developed by the Merchant.
Example: 400555******0001
expiry_date
Numeric
Mandatory
Max: 4
The card’s expiry date.
Example: 2105
return_url
Alphanumeric
Mandatory
Max: 400
The URL of the Merchant’s page that will be displayed to the customer when the order is processed.
Example: http://www.merchant.com
Special characters: $ ! = ? # & - _ / : .
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
currency
Alpha
Optional
Max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
token_name
Alphanumeric
Optional
Max: 100
The Token received from the Tokenization process.
Example: Op9Vmp
Special characters: . @ - _
card_holder_name
Alpha
Optional
Max: 50
The card holder name.
Example: John Smith
Special characters: ' - .

Create New Token Service - Response

The following parameters will be returned in PayFort’s Response:

ATTRIBUTES Description
service_command
Alpha
Max: 20
Command.
Possible/ expected values: CREATE_TOKEN
access_code
Alphanumeric
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
Max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
language
Alpha
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
card_number
Numeric
Max: 16
The clear credit card’s number.
Example: 400555******0001
expiry_date
Numeric
Max: 4
The card’s expiry date.
Example: 2105
return_url
Alphanumeric
Max: 400
The URL of the Merchant’s page that will be displayed to the customer when the order is processed.
Example: http://www.merchant.com
signature
Alphanumeric
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
currency
Alpha
Max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
token_name
Alphanumeric
Max: 100
The Token received from the Tokenization process.
Example: Op9Vmp
card_holder_name
Alpha
Max: 50
The card holder name.
Example: John Smith
response_message
Alphanumeric
Max: 150
The message description of the response code; it returns according to the request language.
Possible/ expected values: Please refer to section messages
response_code
Numeric
Max: 5
Response Code carries the value of our system’s response. *The code consists of five digits, the first 2 digits represent the response status, and the last 3 digits represent the response messages.
Example: 20064
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: Please refer to section statuses

Update Token Service

This service enables you to update your card associated with a token and the status of a token via API calls.

Update Token Service URLs

Test Environment URL:

https://sbpaymentservices.payfort.com/FortAPI/paymentApi

Production Environment URL:

https://paymentservices.payfort.com/FortAPI/paymentApi

Parameters Submission Type

REST POST request using JSON.

Update Token Service – Request

Include the following parameters in the Request you will send to PayFort:

ATTRIBUTES Description
service_command
Alpha
Mandatory
Max: 20
Command.
Possible/ expected values: UPDATE_TOKEN
Special characters: _
access_code
Alphanumeric
Mandatory
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Mandatory
Max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
Mandatory
Max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
Special characters: - _ .
language
Alpha
Mandatory
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
token_name
Alphanumeric
Mandatory
Max: 100
The token received from the Tokenization process.
Example: Op9Vmp
Special characters: . @ - _
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
expiry_date
Numeric
Optional
Max: 4
The card’s expiry date.
Example: 2105
card_holder_name
Alpha
Optional
Max: 50
The card holder name.
Example: John Smith
Special characters: ' - .
currency
Alpha
Optional
Max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
token_status
Alpha
Optional
Max: 8
Presents the token status.
Possible/ expected values:
- ACTIVE
- INACTIVE
new_token_name
Alphanumeric
Optional
Max: 100
The new name used to update the existing token.
Example: Test1
Special characters: _ - @ .

Update Token Service – Response

The following parameters will be returned in PayFort’s Response:

ATTRIBUTES Description
service_command
Alpha
Max: 20
Command.
Possible/ expected values: UPDATE_TOKEN
access_code
Alphanumeric
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Max: 20
The ID of the Merchant.
Example: CycHZxVj
merchant_reference
Alphanumeric
Max: 40
The Merchant’s unique order number.
Example: XYZ9239-yu898
language
Alpha
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
token_name
Alphanumeric
Max: 100
The Token received from the Tokenization process.
Example: Op9Vmp
signature
Alphanumeric
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
expiry_date
Numeric
Max: 4
The card’s expiry date.
Example: 2105
card_number
Numeric
Max: 16
The clear credit card’s number.
Example: 400555******0001
card_holder_name
Alpha
Max: 50
The card holder name.
Example: John Smith
currency
Alpha
Max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
response_message
Alphanumeric
Max: 150
The message description of the response code; it returns according to the request language.
Possible/ expected values: Please refer to section messages
response_code
Numeric
Max: 5
Response Code carries the value of our system’s response. *The code consists of five digits, the first 2 digits represent the response status, and the last 3 digits represent the response messages.
Example: 58000
token_status
Alpha
Max: 8
Presents the token status.
Possible/ expected values:
-ACTIVE
-INACTIVE
creation_date
Alphanumeric
Max: 30
Creation date of content in UTC format.
Example: 2017-03-13T10:09:19+02:00
card_brand
Alpha
Max: 10
Issuer account type.
Possible/ expected values:
- MASTERCARD
- VISA
- AMEX
card_bin
Numeric
Max: 6
The first 6 digits of the card number.
Example: 478773
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: Please refer to section statuses

3-D Secure Service

This service provides cardholders a decreased risk of other people being able to use their payment cards fraudulently on the Merchant’s site.

ATTRIBUTES Description
check_3ds
Alpha
Optional
max: 2
This parameter allows the Merchant to deactivate the 3-D Secure service per transaction. This parameter can be used with both Authorization and Purchase transactions.
Possible/ expected values: NO

Currency Exchange Service

This service allows the merchant to convert the transaction amount from one currency into another currency using live currency exchange rate.

Currency Exchange URLs

Test Environment URL:

https://sbpaymentservices.PayFort.com/FortAPI/paymentApi

Production Environment URL:

https://paymentservices.PayFort.com/FortAPI/paymentApi

Parameters Submission Type

REST POST request using JSON.

Currency Exchange - Request

Include the following parameters in the Request you will send to PayFort:

ATTRIBUTES Description
service_command
Alpha
Mandatory
max: 20
Command.
Possible/ expected values: CURRENCY_CONVERSION
Special characters: _
access_code
Alphanumeric
Mandatory
max: 20
Access code.
Example: zx0IPmPy5jp1vAz
merchant_identifier
Alphanumeric
Mandatory
max: 20
The ID of the Merchant.
Example: CycHZxVj
amount
Numeric
Mandatory
max: 10
The transaction’s amount. *Each currency has predefined allowed decimal points that should be taken into consideration when sending the amount.
Example: 10000
currency
Alpha
Mandatory
max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
language
Alpha
Mandatory
max: 2
The checkout page and messages language.
Possible/ expected values: en / ar
converted_currency
Alpha
Mandatory
max: 3
The ISO3 currency code of the currency you are converting the amount to.
Example: AED
signature
Alphanumeric
Mandatory
max: 200
A string hashed using the Secure Hash Algorithm. (Please refer to section Signature for more details).
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a

Currency Exchange - Response

The following parameters will be returned in PayFort’s Response:

ATTRIBUTES Description
service_command
Alpha
max: 20
Command.
Possible/ expected values: CURRENCY_CONVERSION
access_code
Alphanumeric
max: 20
Access code.
Example: zx0IPmPy5jp1vAz
merchant_identifier
Alphanumeric
max: 20
The ID of the Merchant.
Example: CycHZxVj
amount
Numeric
max: 10
The transaction’s amount.
Example: 10000
currency
Alpha
max: 3
The currency of the transaction’s amount in ISO code 3.
Example: USD
language
Alpha
max: 2
The checkout page and messages language.
Possible/ expected values: en / ar
signature
Alphanumeric
max: 200
A string hashed using the Secure Hash Algorithm. (Please refer to section Signature for more details).
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
response_message
Alphanumeric
max: 150
Message description of the response code. It returns according to the request language.
Possible/ expected values: (Please refer to section messages).
response_code
Numeric
Max: 5
Response Code carries the value of our system’s response. *The code consists of five digits, the first 2 digits represent the response status, and the last 3 digits represent the response messages.
Example: 20064
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: (Please refer to section statuses).
converted_amount
Alpha
max: 3
The amount after converting to another currency.
Example: 100 USD = 367.298 AED
converted_currency
Alpha
max: 3
The ISO3 currency code of the currency you are converting the amount to.
Example: AED
conversion_number
Alphanumeric
max: 20
A unique number generated by PayFort for every valid currency conversion request.
Example: 1443796866848