NAV Navbar
Logo

Before Starting the Integration section in the API:

Step 1: Access your test account
You have to make sure that you get access to a test account, it’s a full test environment allow you to simulate and process simulation transactions. You can contact support@payfort.com to get your test account.

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 in every section in the API documentation.

Step 3: Create the transaction request
Process a 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 each payment processed, PayFort returns the transaction’s 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 requires to test your integration before going live to verify the integration and make sure it’s implemented properly.

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. Get Batch Results:
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://sbbatch.payfort.com/integration-batch/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

Get Batch Results

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.

Get Batch Results URLs

Test Environment URL:

https://sbbatch.payfort.com/integration-batch/batchApi/

Production Environment URL:

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

Parameters Submission Type

REST POST request using JSON.

Get Batch Results - 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

Get Batch Results - 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://sbbatch.payfort.com/integration-batch/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 “Get Batch Results – Request” again to see the final status for each transaction inside the file.

Batch Invoicing

This service allows the Merchant to upload a bulk of invoices to FORT as a batch.

Before Starting

Before starting you have to know the following:
1. You’re only allowed to send PAYMENT_LINK service command in the invoice batch file.
2. You should active the Batch processing and invoicing services.
3. You can download the invoice batch file template from the Back office by clicking on the “Batch invoicing” tab that will appears only if you were active the batch and invoicing services.

How it Works – Overview

1. Upload Invoicing Batch File:
This request allows the Merchant to upload the invoice batch file to FORT system. You can download the invoice batch file template from your back office.

2. Get Invoicing Batch Results:
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. After validation the “Account Administrator” will receive an email notification with success invoices count.

3. Process Invoicing 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. After processing the “Account Administrator” will receive an email notification with success invoices count.

FORT Transaction Feedback

Overview

The FORT transaction Feedback system provides Merchants with two types of configurable notifications:
1. Direct Transaction Feedback, PayFort will send Merchants HTTPs notifications that inform Merchants of the transaction’s final status whenever a transaction is processed.
2. Notification Transaction Feedback, PayFort will send Merchants HTTPs notifications that inform Merchants of the transaction’s final status whenever a transaction status is updated.

Registering Transaction Feedback URLs

1. Log in to your back-office account.
2. Select the active channel under Integration Settings > Technical Settings.
3. Enter your Direct Transaction Feedback URL and Notification Transaction Feedback URL.
4. Click “Save Changes” button.

Transaction Feedback submission

The FORT will send Transaction Feedback data as form POST Parameters to the Merchant’s Transaction Feedback URLs.
However if you want to change the submission type to JSON or XML, you can contact us on integration@payfort.com.
This configuration can be enabled by internal PayFort team only
The specifics of the data will differ based upon the financial operation that has been processed.
Please refer to the FORT integration guide for more details.

Responding to FORT Transaction Feedback

Beyond whatever your Transaction Feedback URL does with the data received, it must also return a 2xx (like 200 , 201 , etc…) or 302 HTTP status code to tell the FORT that the notification was received. If your URL does not return 2xx or 302, the FORT will continue to retry the notification until it’s properly acknowledged.
In case the FORT does not receive 200 or 302 HTTP status code it will attempt to send the notification for 10 times with 10 seconds in between.
This configuration is editable as well, if you want to change the grace period or the time interval between the retries please contact us on integration@payfort.com.