NAV Navbar
Logo

Before Starting the Integration

These are the steps you need to know; to start building an integration with PayFort:

Step 1: Access your test account
You have to make sure that you have an access to a test account, its a full test environment allow you to simulate and process simulation transactions.

Step 2: make sure that you are using the correct integration type
Before building the integration, you need to make sure that you are selecting and using the proper parameters in the API calls as per the required integration type.

All the mandatory parameters mentioned under every section in the API document.

Step 3: Create the transaction request
Process the valid API request depends on transaction parameters included, you need to check the documentation and read every parameter possible values in order to reduce the errors in processing the transaction.

Step 4: Process the transaction response
After every payment, PayFort return the transaction response on the URL configured in your account under Technical Settings channel configuration.

You can find more details in the API documentation section Direct Transaction Feedback.

You need to validate the response parameters returned on this URL by calculating the signature for the response parameters using the SHA Response Phrase configured in your account under Security Settings.

Step 5: Test and Go Live You can use our testing cards to test your integration and simulate your test cases.

PayFort team may require to test your integration before going live to assure your application integration.

Batch Service

This service allows the Merchant to process requests to FORT in bulk as a batch.

Before Starting

Before starting you have to know the following:
1. You’re only allowed to send one of the following transactions in your batch file or a mixture of them:
    * Recurring: PURCHASE command.
    * Maintenance operations (capture, refund, and void authorization): after completing a successful Authorization or Purchase transactions through one of PayFort’s channels.
2. You should active the Batch processing service.

How it works - Overview

1. Upload Batch File:
This request allows the Merchant to upload the batch file to FORT system.

2. Validate Batch File:
This request allows the Merchants to validate the format of the file and to check that the merchant reference for each and every transaction is unique.

3. Process Batch File:
This request allows the Merchant to initiate the processing of transactions. In order to start the processing; the file should have been validated and passed the validation process.

Upload Batch file

This request allows the Merchant to upload the Batch file to the FORT system. The Merchant will specify the order of the fields in the batch file.

Upload Batch File URLs

Test Environment URL:

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

Production Environment URL:

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

Parameters Submission Type

Form Post Request.

Upload Batch File - 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: UPLOAD_BATCH_FILE
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
batch_reference
Alphanumeric
Mandatory
Max: 20
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
file
Alphanumeric
Mandatory
Max: 50
The file that contain a batch of transactions. The file should be of type CSV.
Example: test.csv
Special characters: . - ! @ # $ % ^ & ( ) _ + , Space
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a

Upload Batch File - Response

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

ATTRIBUTES Description
service_command
Alpha
Max: 20
Command.
Possible/ expected values: UPLOAD_BATCH_FILE
access_code
Alphanumeric
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Max: 20
The ID of the Merchant.
Example: CycHZxVj
batch_reference
Alphanumeric
Max: 20
The Merchant’s unique order number.
Example: XYZ9239-yu898
language
Alpha
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
batch_id
Numeric
Max: 20
The Merchant’s unique batch ID.
Example: 150754364000030895
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
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: 50000
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: Please refer to section statuses

Validate Batch file

This request allows the Merchants to validate the format of the file and to check that the merchant reference for each and every transaction is unique.

Validate Batch File URLs

Test Environment URL:

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

Production Environment URL:

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

Parameters Submission Type

REST POST request using JSON.

Validate Batch File - 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: GET_BATCH_RESULTS
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
batch_reference
Alphanumeric
Mandatory
Max: 20
The Merchant’s unique order number. *You have to use the same batch reference you used in the upload_batch_file.
Example: XYZ9239-yu898
Special characters: - _ .
language
Alpha
Mandatory
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
batch_id
Numeric
Optional
Max: 20
The Merchant’s unique batch ID returned when uploading a file successfully.
Example: 150754364000030895

Validate Batch File - Response

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

ATTRIBUTES Description
service_command
Alpha
Max: 20
Command.
Possible/ expected values: GET_BATCH_RESULTS
access_code
Alphanumeric
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Max: 20
The ID of the Merchant.
Example: CycHZxVj
batch_reference
Alphanumeric
Max: 20
The Merchant’s unique order number.
Example: XYZ9239-yu898
language
Alpha
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
batch_id
Numeric
Max: 20
The Merchant’s unique batch ID.
Example: 150754364000030895
transactions_count
Numeric
Max: 10
A parameter that counts the total number of transactions inside the file.
Example: 9
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: 70000
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: Please refer to section statuses

Process Batch file

This request allows the merchant to initiate the processing of transactions. In order to start processing; the file should have been validated and passed the validation successfully.

Process Batch File URLs

Test Environment URL:

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

Production Environment URL:

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

Parameters Submission Type

REST POST request using JSON.

Process Batch File - 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: PROCESS_BATCH
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
batch_reference
Alphanumeric
Mandatory
Max: 20
The Merchant’s unique order number. *You have to use the same batch reference you used in the upload_batch_file.
Example: XYZ9239-yu898
Special characters: - _ .
language
Alpha
Mandatory
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
batch_id
Numeric
Optional
Max: 20
The Merchant’s unique batch ID returned when uploading a file successfully.
Example: 150754364000030895

Process Batch File - Response

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

ATTRIBUTES Description
service_command
Alpha
Max: 20
Command.
Possible/ expected values: PROCESS_BATCH
access_code
Alphanumeric
Max: 20
Access code.
Example: zx0IPmPy5jp1vAz8Kpg7
merchant_identifier
Alphanumeric
Max: 20
The ID of the Merchant.
Example: CycHZxVj
batch_reference
Alphanumeric
Max: 20
The Merchant’s unique order number.
Example: XYZ9239-yu898
language
Alpha
Max: 2
The checkout page and messages language.
Possible/ expected values: en/ ar
signature
Alphanumeric
Mandatory
Max: 200
A string hashed using the Secure Hash Algorithm. Please refer to section Signature
Example: 7cad05f0212ed933c9a5d5dffa31661acf2c827a
batch_id
Numeric
Max: 20
The Merchant’s unique batch ID.
Example: 150754364000030895
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: 72147
status
Numeric
Max: 2
A two-digit numeric value that indicates the status of the transaction.
Possible/ expected values: Please refer to section statuses

After processing the batch file successfully; you can send “Validate Batch File – Request” again to see the final status for each transaction inside the file.