Introduction
The Moyasar PG Transaction Log File (TLF) uses the standard CSV format and includes transactions from all schemes. Each row is one transaction created during the statement day.
- The first row is a header row containing the column names.
- Columns appear in the file in the order listed on this page.
- Empty values are left blank.
- Date and time values use the ISO 8601 format in UTC, for example
2024-12-07T21:15:03Z.
The file is available in three versions: 1.0, 2.0 and 3.0. Version 3.0 contains the most information and is the recommended version. The Versions column in each table shows which versions include that column.
Data Types and Lengths
The Type column in each table uses these data types:
| Type | Format |
|---|
| string | UTF-8 text |
| integer | Whole number without separators or decimal point, for example 17166 |
| decimal | Number with a decimal point, for example 123.45 |
| boolean | true or false |
| datetime | ISO 8601 in UTC, YYYY-MM-DDTHH:MM:SSZ, for example 2024-12-07T21:15:03Z |
The Length column is the length of the value in characters. A single number is a fixed length, and Up to is a maximum length. Any column can be empty when it doesn't apply to the transaction, so the minimum length of every column is 0.
The following is a description of all columns broken down into multiple segments for ease of understanding.
Basic Data
| Column | Versions | Type | Length | Description |
|---|
| id | All | string | 36 | Transaction ID within the gateway |
| order_id | All | string | 36 | Order ID within the gateway |
| type | All | string | Up to 9 | Transaction type: verify, purchase, authorize, capture, void, refund, extension, reversal |
| status | All | string | Up to 12 | Transaction status: initiated, approved, failed, timeout, system_error |
| amount | All | integer | Up to 9 | Amount in minor currency unit, for example: 1 SAR = 100 Halalah |
| terminal_id | All | string | 8 | Terminal ID |
| retrieval_reference | All | string | 12 | RRN or Retrieval Reference Number |
| response_code | All | string | Up to 3 | Gateway response code |
| stan | All | string | 6 | System Trace Audit Number |
| auth_code | All | string | 6 | Authorization Code |
| reverse_reason | All | string | Up to 15 | For reversal transactions only, possible values: request_timeout, gateway_timeout, response_error, delivery_error |
| justification | All | string | Up to 15 | For reauthorization payments only. Possible values: reauthorization, delayed_charges, resubmission, no_show |
| created_at | All | datetime | 20 | Transaction date and time |
| gateway_reference | All | string | Up to 20 | SPG's txnReference |
| auth_resp_code | All | string | Up to 3 | Issuer response code. Issuer code 85 is reported as 00 |
| receiving_institution_id | All | string | Up to 11 | Issuer Institution ID |
| forwarding_institution_id | All | string | Up to 11 | Forwarding Institution ID |
| acquiring_institution_id | All | string | Up to 11 | Acquiring Institution ID |
| primary_gateway_identifier | 3.0 | string | 4 | Always MYSR |
| secondary_gateway_identifier | 3.0 | string | 0 | Always empty |
| initiated_by | 2.0, 3.0 | string | Up to 23 | Transaction initiator: CARDHOLDER_OR_ECOMMERCE or MERCHANT |
| cof_indicator | 2.0, 3.0 | boolean | Up to 5 | Credential-on-file indicator: true or false. Empty for transactions without an agreement or justification |
| terminal_type | 3.0 | string | Up to 11 | One of: INTERNET, MAIL_ORDER, RECURRING, UNSCHEDULED or INSTALMENT |
Merchant Data
| Column | Versions | Type | Length | Description |
|---|
| merchant_id | All | string | Up to 15 | Merchant ID |
| merchant_name | All | string | Up to 35 | The order's statement descriptor if provided, otherwise the merchant name |
| merchant_arabic_name | All | string | Up to 64 | Arabic Merchant Name |
| merchant_category_code | All | string | 4 | Merchant Category Code |
| merchant_address_1 | 3.0 | string | Up to 35 | Merchant address line 1 |
| merchant_city | 2.0, 3.0 | string | Up to 20 | Merchant city name, or 001 if the merchant's city code is not a recognized Saudi city code |
| merchant_region_code | 3.0 | string | 3 | Merchant region code (3 digits), or 001 if the merchant's city code is not a recognized Saudi city code |
| merchant_zip_code | 3.0 | string | Up to 10 | Merchant ZIP code |
| merchant_country_code | 3.0 | string | 3 | Always SAU |
Sub-Merchant Data
| Column | Versions | Type | Length | Description |
|---|
| sub_merchant_id | All | string | Up to 15 | Sub-Merchant ID |
| sub_merchant_name | All | string | Up to 22 | The order's statement descriptor |
Flight Data
| Column | Versions | Type | Length | Description |
|---|
| passenger_number_record | All | string | 6 to 15 | PNR or Passenger Number Record |
Source Data
| Column | Versions | Type | Length | Description |
|---|
| source_type | All | string | Up to 11 | Source type: card, apple_pay, google_pay or samsung_pay |
| number | All | string | 8 to 19 | PAN or Primary Account Number (device PAN for wallet payments) |
| scheme | All | string | Up to 10 | Card network: mada, visa, mastercard or amex |
| first_digits | All | string | 8 | First 8 digits |
| last_digits | All | string | 4 | Last 4 digits |
| year | All | integer | 4 | Expiry year, 4 digits |
| month | All | integer | 1 to 2 | Expiry month from 1 to 12, not zero-padded |
| fingerprint | All | string | 64 | Source fingerprint |
Card Auth Data
Only present for card sources that were authenticated with 3D Secure.
| Column | Versions | Type | Length | Description |
|---|
| card_auth_value | All | string | Up to 256 | CAVV or Authentication Value |
| card_auth_status | All | string | 1 | Auth Status: Y, A, N, U, R |
| card_auth_eci | All | string | 2 | Electronic Commerce Indicator |
| card_auth_version | All | string | 5 | 2.0.0, 2.1.0, 2.2.0 or 2.3.0 |
| ds_transaction_id | All | string | 36 | Directory Server Transaction ID (UUID) |
| acs_transaction_id | All | string | 36 | Access Control Server Transaction ID (UUID) |
| tds_purchase_date | All | datetime | 20 | 3D Secure purchase date and time |
Apple Pay Data
Only present for apple_pay sources.
| Column | Versions | Type | Length | Description |
|---|
| apple_pay_cryptogram | 1.0, 2.0 | string | Up to 256 | Authentication Value |
| apple_pay_eci | 1.0, 2.0 | string | 2 | Electronic Commerce Indicator |
| apple_pay_device_identifier | 1.0, 2.0 | string | 12 | Apple Device Identifier |
Device Payment Data
Only present for apple_pay, google_pay and samsung_pay sources. Replaces the Apple Pay columns in version 3.0.
| Column | Versions | Type | Length | Description |
|---|
| device_cryptogram | 3.0 | string | Up to 256 | Authentication Value |
| device_eci | 3.0 | string | 2 | Electronic Commerce Indicator |
| device_identifier | 3.0 | string | 12 | Apple Device Identifier, for Apple Pay only |
| device_requestor_id | 3.0 | string | 11 | Token Requestor ID |
Agreement Data
Only present for orders made under an agreement.
| Column | Versions | Type | Length | Description |
|---|
| agreement_id | All | string | Up to 36 | Agreement ID |
| agreement_type | All | string | Up to 11 | One of: unscheduled, recurring, registered or installment |
| agreement_expiry | All | datetime | 20 | Expiry date of the agreement |
| agreement_max_use | All | integer | Up to 3 | Integer representing maximum use |
| agreement_current_use | 3.0 | integer | Up to 3 | Number of earlier payments made under the agreement (0 for the first payment) |
| agreement_max_variability | All | string | Up to 8 | One of: fixed or variable |
Visa Specific Data
| Column | Versions | Type | Length | Description |
|---|
| visa_merchant_identifier | All | string | 8 | Visa specific request data |
| visa_merchant_verification_value | All | string | 10 | Visa specific request data |
| visa_authorization_characteristics_indicator | All | string | 1 | Visa specific request data |
| visa_market_specific_indicator | All | string | 1 | Visa specific request data |
Mastercard Specific Data
| Column | Versions | Type | Length | Description |
|---|
| mastercard_assigned_id | All | string | 6 | Mastercard specific request data |
| mastercard_transaction_type_indicator | All | string | 3 | Mastercard specific request data |
| mastercard_promotion_code | All | string | 6 | Mastercard specific request data |
| mastercard_transaction_category_code | All | string | 1 | Mastercard specific request data |
Response Data
| Column | Versions | Type | Length | Description |
|---|
| resp_scheme_trace_id | All | string | Up to 29 | SPG's schemeTraceId |
| resp_gw_tran_id | All | string | Up to 20 | Scheme Transaction ID (SPG's gwTranId) |
| resp_merchant_advice_code | All | string | 2 | SPG's merchantAdviceCode |
| resp_cardholder_billing_amount | All | decimal | Up to 13 | SPG's cardholderBillingAmount, up to 10 digits and 2 decimal places |
| resp_cardholder_billing_currency | All | string | 3 | SPG's cardholderBillingCurrency |
| resp_cvv_result_code | All | string | 1 | SPG's cvvResultCode |
| resp_cvv_network_result_code | All | string | 1 | SPG's cvvNetworkResultCode |
| resp_avs_response_code | All | string | 1 | SPG's avsResponseCode |
| resp_avs_network_result_code | All | string | 1 | SPG's avsNetworkResultCode |
| resp_settlement_date | 3.0 | string | 19 | SPG's settlementDate, in YYYY-MM-DD HH:MM:SS format |
| resp_settlement_amount | 3.0 | decimal | Up to 13 | SPG's settlementAmount, up to 10 digits and 2 decimal places |
| resp_settlement_currency | 3.0 | string | 3 | SPG's settlementCurrency |
| resp_settlement_conversion_rate | 3.0 | string | 8 | SPG's settlementConversionRate |
| resp_settlement_conversion_date | 3.0 | string | 4 | SPG's conversionDate, in MMDD format |
Additional Response Data
Values from SPG's additionalResponseData.
| Column | Versions | Type | Length | Description |
|---|
| resp_add_cardholder_name | All | string | Up to 60 | SPG tokenization value (cardholderName) |
| resp_add_cof_token | All | string | Up to 50 | SPG tokenization value (cofToken) |
| resp_add_eci | All | string | Up to 3 | ECI returned by the issuer (eci) |
| resp_add_error_data_element | All | string | Up to 6 | errorDataElement |
| resp_add_masked_pan | All | string | 4 | SPG tokenization value (maskedPan) |
| resp_add_mastercard_pos_data | All | string | Up to 26 | Mastercard specific value (mastercardPosData) |
| resp_add_mastercard_transaction_integrity_class | All | string | 2 | Mastercard specific value (mastercardTransactionIntegrityClass) |
| resp_add_original_amounts | All | string | 24 | originalAmounts |
| resp_add_pan_expiry_date | All | string | 4 | SPG tokenization value (panExpiryDate), in MMYY format |
| resp_add_reconciliation_date | All | string | 6 | reconciliationDate, in YYMMDD format |
| resp_add_visa_account_status | All | string | 1 | Visa specific value (visaAccountStatus) |
| resp_add_visa_authorization_characteristics_indicator | All | string | 1 | Visa specific value (visaAuthorizationCharacteristicsIndicator) |
| resp_add_visa_commercial_card_type_response | All | string | 1 | Visa specific value (visaCommercialCardTypeResponse) |
| resp_add_visa_market_specific_indicator | All | string | 1 | Visa specific value (visaMarketSpecificIndicator) |
| resp_add_visa_product_id | All | string | 2 | Visa specific value (visaProductId) |
| resp_add_visa_spend_qualified_indicator | All | string | 1 | Visa specific value (visaSpendQualifiedIndicator) |
| resp_add_visa_validation_code | All | string | 4 | Visa specific value (visaValidationCode) |