Skip to main content

Reporting API

The Amazon Payment Services Reporting API enables merchants processing large volumes of e-commerce transactions to gain deep insights into transaction performance and behavior through comprehensive data mining capabilities. You can specify custom columns and apply filters to generate detailed reports with a query limit of 200,000 transactions per request.

The reporting process follows a two-step approach: first generate a report with your specified parameters, then download the generated report using the same merchant reference.

API Endpoints

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

Request Format

  • Method: POST
  • Content-Type: application/json
  • Submission: Server-to-server HTTPS POST

1. Generate Report

Request Parameters

Parameter
query_command   String Max: 50 Required

Query operations command for report generation.
Value: GENERATE_REPORT
Example. GENERATE_REPORT
access_code   String Max: 20 Required

Merchant access code obtained from Amazon Payment Services dashboard under Integration Settings.
Example. zx0IPmPy5jp1vAz8Kpg7
merchant_identifier   String Max: 20 Required

Unique merchant identifier assigned by Amazon Payment Services during account setup.
Example. CycHZxVj
merchant_reference   String Max: 40 Required

Unique reference for the report request. Must be unique per merchant. Alphanumeric characters, hyphens, underscores, and periods allowed.
Example. XYZ9239-yu898
from_date   String Max: 30 Required

Start date for report data filtering in ISO 8601 format with timezone.
Example. 2024-01-01T00:00:00+03:00
to_date   String Max: 30 Required

End date for report data filtering in ISO 8601 format with timezone.
Example. 2024-01-31T23:59:59+03:00
columns   Array Max: 110 Required

Array of column names to include in the generated report. See Columns Parameter section for available values.
Example. ["fort_id", "amount", "currency", "status"]
signature   String Max: 200 Required

SHA-256 hash signature for request authentication and integrity validation.
Example. 7cad05f0212ed933c9a5d5dffa31661acf2c827a
language   String Max: 2 Optional

Response language for messages and descriptions.
Values: en, ar
Example. en
response_format   String Max: 4 Optional

Response format for the API response. Default is JSON.
Values: JSON, XML
Example. JSON
filters   Array Optional

Array of filter objects to narrow down report results. Each filter contains key-value pairs for specific criteria.
Example. [{"key": "payment_option", "value": "VISA"}]

Check signature calculation section to learn how to calculate the signature.

Columns Parameter

The following table contains all the possible values you can include in your report response:

ValueDescription
fort_idThe order's unique reference returned by our system.
merchant_referenceThe Merchant's unique order number.
authorization_codeThe authorization code returned from the 3rd party responsible for processing the transaction.
customer_nameThe Customer's name.
customer_ipThe customer's IP address; where the Merchant sends as part of the authorization/purchase request.
geolocation_ipThe card for the Customer's computer.
customer_emailThe Customer's email; where the Merchant sends with the authorization/purchase request.
acquirer_nameThe name of the Acquirer.
payment_optionThe payment option use to process the authorization/purchase request.
channelThe Amazon Payment Services channel used to receive the authorization/purchase request.
transaction_dateThe date of the transaction.
card_numberThe card number used to process the transaction.
expiry_dateThe card's expiry date.
card_holder_nameThe cardholder's name.
amountThe transaction's amount.
currencyThe currency of the transaction's amount in ISO code 3.
card_binThe bank identification number (BIN); which is the initial four to eight numbers that appear on a credit card.
eciThe E-commerce indicator associated with the transactions authorization/purchase request.
operationThe operation type (authorization, purchase, void authorization, capture, and refund)
token_nameThe Token associated with the card used to process the transaction.
3ds_indicatorThis indicator will hold the value "yes" in case 3D Secure check was performed on a specific transaction. Otherwise, it will holds the value "no".
fraud_indicatorThis indicator will hold the value "yes" in case fraud check was performed on a specific transaction. Otherwise, it will holds the value "no".
installments_indicatorThis indicator will hold the value "yes" in case installments service was applied on a specific transaction. Otherwise, it will holds the value "no".
statusA two-digit numeric value that indicates the status of the transaction.
response_codeCarries the value of our system's response.
response_messageThe Message description of the response code. It returns according to the request language.
third_party_messageThe message retrieved from the third party.
third_party_codeThe code retrieved from the third party.
order_dateThe creation date of the order.
order_descriptionThe description of the order provided by the merchant.
acquirer_midThe Acquirer Merchant identifier.
acquirer_response_codeThe code the Acquirer returns.
acquirer_response_messageThe message the Acquirer returns.
processor_response_codeThe code the Processor returns.
sadad_olpSADAD Online Payment ID Alias. The value that SADAD's Customer provides to process SADAD order.
sadad_transaction_idThe identifier returned by SADAD for a specific SADAD transaction.
payment_link_idPayment link unique identifier.
Invoice_idThe identification for a specific subscription service.
digital_walletThe buyer's digital wallet.
reconciliation_referenceThe reconciliation reference number (RRN)

Filters Parameter

Include the following parameters into "filters" parameter you will send to Amazon Payment Services:

ParameterTypeMax LengthDescription
keyAlphanumeric110The name of the column you want to filter. You can choose more than one.
Values: Please refer to Key Parameter section
Special chars: # ' \ / . _ - @ : Space
valueAlphanumeric-The value of the key you want to return in your response. It depends on the key you have chosen to return.

Key Parameter

The following table contains all the possible values of the "key" parameter:

KeyDescription & Possible Values
fort_idThe order's unique reference returned by our system.
merchant_referenceThe Merchant's unique order number.
authorization_codeThe authorization code returned from the 3rd party responsible for processing the transaction.
customer_nameThe Customer's name.
customer_ipThe customer's IP address; where the Merchant sends as part of the authorization/purchase request.
geolocation_ipThe card for the Customer's computer.
customer_emailThe Customer's email; where the Merchant sends with the authorization/purchase request.
acquirer_nameThe name of the Acquirer.
payment_optionThe payment option use to process the authorization/purchase request.
Possible Values: MASTERCARD, VISA, AMEX, SADAD, NAPS, KNET, MADA, MEEZA
channelThe Amazon Payment Services channel used to receive the authorization/purchase request.
Possible Values:, Trusted, Merchant Page, Redirection, Recurring
transaction_dateThe date of the transaction.
card_numberThe card number used to process the transaction.
expiry_dateThe card's expiry date.
card_holder_nameThe cardholder's name.
amountThe transaction's amount.
currencyThe currency of the transaction's amount in ISO code 3.
card_binThe bank identification number (BIN); which is the initial four to eight numbers that appear on a credit card.
eciThe E-commerce indicator associated with the transactions authorization/purchase request.
Possible Values: ECOMMERCE, RECURRING
operationThe operation type (authorization, purchase, void authorization, capture, and refund).
token_nameThe Token associated with the card used to process the transaction.
3ds_indicatorThis indicator will hold the value "yes" in case 3D Secure check was performed on a specific transaction. Otherwise, it will holds the value "no".
Possible Values: YES, NO
fraud_indicatorThis indicator will hold the value "yes" in case fraud check was performed on a specific transaction. Otherwise, it will holds the value "no".
Possible Values: YES, NO
installments_indicatorThis indicator will hold the value "yes" in case installments service was applied on a specific transaction. Otherwise, it will holds the value "no".
Possible Values: YES, NO
statusA transaction status value that indicates the status of the transaction.
response_codeCarries the value of our system's response.
response_messageThe Message description of the response code. It returns according to the request language.
third_party_messageThe message retrieved from the third party.
third_party_codeThe code retrieved from the third party.
order_dateThe creation date of the order.
order_descriptionThe description of the order provided by the merchant.
acquirer_midThe Acquirer Merchant identifier.
acquirer_response_codeThe code the Acquirer returns.
acquirer_response_messageThe message the Acquirer returns.
processor_response_codeThe code the Processor returns.
sadad_olpSADAD Online Payment ID Alias. The value that SADAD's Customer provides to process SADAD order.
sadad_transaction_idThe identifier returned by SADAD for a specific SADAD transaction.
payment_link_idPayment link unique identifier.
Invoice_idThe identification for a specific subscription service.
digital_walletThe buyer's digital wallet.
Possible Values: MASTERPASS, VISA_CHECKOUT, APPLE_PAY
reconciliation_referenceThe reconciliation reference number (RRN)
{
"query_command": "GENERATE_REPORT",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"merchant_reference": "XYZ9239-yu898",
"from_date": "2024-01-01T00:00:00+03:00",
"to_date": "2024-01-31T23:59:59+03:00",
"columns": [
"3ds_indicator",
"acquirer_name",
"acquirer_response_code",
"amount",
"authorization_code",
"card_bin",
"currency",
"customer_ip",
"customer_name",
"fort_id",
"merchant_reference",
"operation",
"order_date",
"order_description",
"payment_option",
"response_code",
"response_message",
"status",
"transaction_date"
],
"language": "en",
"response_format": "JSON",
"signature": "7cad05f0212ed933c9a5d5dffa31661acf2c827a",
"filters": [
{
"key": "payment_option",
"value": "VISA"
}
]
}
Generate Report Sample Response
{
"query_command": "GENERATE_REPORT",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"merchant_reference": "XYZ9239-yu898",
"from_date": "2024-01-01T00:00:00+03:00",
"to_date": "2024-01-31T23:59:59+03:00",
"response_format": "JSON",
"signature": "521d32010a9988de86e16b49f6303985508d5f244784474da1184d457b53ded2",
"language": "en",
"response_message": "Success",
"response_code": "56000",
"status": "56"
}

Response Parameters

Parameter
query_command   String Max: 50

Query operations command for report generation.
Value: GENERATE_REPORT
Example. GENERATE_REPORT
access_code   String Max: 20

Merchant access code returned from the request.
Example. zx0IPmPy5jp1vAz8Kpg7
merchant_identifier   String Max: 20

Merchant identifier returned from the request.
Example. CycHZxVj
merchant_reference   String Max: 40

Unique reference for the report request returned from the request.
Example. XYZ9239-yu898
from_date   String Max: 30

Start date for report data filtering returned from the request.
Example. 2024-01-01T00:00:00+03:00
to_date   String Max: 30

End date for report data filtering returned from the request.
Example. 2024-01-31T23:59:59+03:00
signature   String Max: 200

SHA-256 hash signature for response verification and integrity validation.
Example. 521d32010a9988de86e16b49f6303985508d5f244784474da1184d457b53ded2
language   String Max: 2

Response language returned from the request.
Values: en, ar
Example. en
response_format   String Max: 4

Response format returned from the request.
Values: JSON, XML
Example. JSON
response_message   String Max: 150

Human-readable response description indicating the result of the report generation request.
Example. Success
response_code   String Max: 5

Numeric response code indicating the result of the report generation request.
Example. 56000
status   String Max: 2

Two-digit status code indicating the transaction state.
Example. 56

2. Download Report

Request Parameters

Parameter
query_command   String Max: 50 Required

Query operations command for report download.
Value: DOWNLOAD_REPORT
Example. DOWNLOAD_REPORT
access_code   String Max: 20 Required

Merchant access code obtained from Amazon Payment Services dashboard under Integration Settings.
Example. zx0IPmPy5jp1vAz8Kpg7
merchant_identifier   String Max: 20 Required

Unique merchant identifier assigned by Amazon Payment Services during account setup.
Example. CycHZxVj
merchant_reference   String Max: 40 Required

The same unique reference used in the generate report request. This links the download request to the previously generated report.
Example. XYZ9239-yu898
signature   String Max: 200 Required

SHA-256 hash signature for request authentication and integrity validation.
Example. 7cad05f0212ed933c9a5d5dffa31661acf2c827a

You must use the exact same merchant_reference that was used in the Generate Report request. Using a different reference will result in a "Report not found" error.

{
"query_command": "DOWNLOAD_REPORT",
"access_code": "zx0IPmPy5jp1vAz8Kpg7",
"merchant_identifier": "CycHZxVj",
"merchant_reference": "XYZ9239-yu898",
"signature": "7cad05f0212ed933c9a5d5dffa31661acf2c827a"
}
Download Report Sample Response
[
{
"data_count": 2
},
[
{
"order_description": "iphone",
"customer_ip": "2001:0002:6c::430",
"eci": "ECOMMERCE",
"merchant_reference": "XYZ9239-yu898",
"currency": "USD",
"geolocation_ip": "192.168.33.18",
"amount": 1000,
"payment_option": "VISA",
"fort_id": "150701416400054912",
"customer_email": "customer@amazon.com",
"customer_name": "John Smith",
"operation": "AUTHORIZATION"
},
{
"order_description": "iphone",
"customer_ip": "2001:0002:6c::430",
"eci": "ECOMMERCE",
"merchant_reference": "XYZ9239-yu898",
"currency": "USD",
"geolocation_ip": "192.168.33.18",
"amount": 1000,
"payment_option": "VISA",
"fort_id": "150701415400054909",
"customer_email": "customer@amazon.com",
"customer_name": "John Smith",
"operation": "AUTHORIZATION"
}
]
]

Response Parameters

In case the generation of the report is not complete, the merchant will receive a message indicating that the generation of the report is still in progress with the response parameters below. The Merchant can attempt to download report later.

The following parameters will be returned in Amazon Payment Services' response:

Parameter
query_command   String Max: 50

Query operations command for report download.
Value: DOWNLOAD_REPORT
Example. DOWNLOAD_REPORT
access_code   String Max: 20

Merchant access code returned from the request.
Example. zx0IPmPy5jp1vAz8Kpg7
merchant_identifier   String Max: 20

Merchant identifier returned from the request.
Example. CycHZxVj
merchant_reference   String Max: 40

The merchant's unique reference for the report request returned from the request.
Example. XYZ9239-yu898
signature   String Max: 200

SHA-256 hash signature for response verification and integrity validation.
Example. 7cad05f0212ed933c9a5d5dffa31661acf2c827a
response_message   String Max: 150

Human-readable response description indicating the result of the report download request.
Example. Success
response_code   String Max: 5

Numeric response code indicating the result of the report download request.
Example. 56000
status   String Max: 2

Two-digit status code indicating the transaction state.
Example. 56

Response Codes

For a complete list of response codes and their descriptions, please refer to our Error Codes Documentation.

If you prefer using your account dashboard, you can generate and download reports by navigating to the "Reports" section in your merchant portal. For more information, see our reports guide.

Was this page helpful?

Thanks for your feedback!