Guides

Payment Status Data Model

Data Model

Overview

The "Payment Status Changed" webhook is triggered whenever there is an update to the status of a payment transaction. This webhook ensures that your system is notified of any changes in the transaction status, allowing for real-time updates and appropriate actions.

Your webhook endpoint will receive a POST request containing an event with a Code of 1 and Name of PAYMENT_STATUS_CHANGED. This event is particularly useful for keeping track of failed, authorized, released, or successful payment transactions, enabling your system to handle displaying the payment attempt result on your page and update your system with the transaction status.


Request Model

The webhook payload consists of multiple nested objects containing essential transaction details.

Event Object

Input ParameterTypeDescription
Event.Codenumber1 - PAYMENT_STATUS_CHANGED
Event.NamestringPAYMENT_STATUS_CHANGED
Event.CountryIsoCodestringThe country of your account with MyFatoorah.
Event.CreationDatedatetimeThe timestamp when the event was created in ISO 8601 format.
Event.ReferencestringUnique reference ID for the webhook event.

Data Object

Invoice Object

Input ParameterTypeDescription
Invoice.IdstringUnique identifier for the invoice.
Invoice.StatusstringThe current status of the invoice (e.g., PAID).
Invoice.ReferencestringA unique reference number assigned to the invoice.
Invoice.CreationDatedatetimeThe date and time when the invoice was created, formatted in ISO 8601.
Invoice.ExpirationDatedatetimeThe expiration date of the invoice, formatted in ISO 8601.
Invoice.UserDefinedFieldstringAny custom user-defined field associated with the invoice.

Transaction Object

Input ParameterTypeDescription
Transaction.IdstringUnique identifier for the transaction.
Transaction.StatusstringThe status of the transaction (e.g., FAILED).
Transaction.PaymentMethodstringThe payment method used (e.g., VISA/MASTER (USD)).
Transaction.PaymentIdstringThe unique payment ID associated with the transaction.
Transaction.ReferenceIdstringA unique identifier assigned to the transaction.
Transaction.TrackIdstringThe tracking ID for the transaction.
Transaction.AuthorizationIdstringA unique ID associated with the authorization of the payment transaction.
Transaction.TransactionDatedatetimeThe date and time when the transaction was processed.
Transaction.ECIstringThe Electronic Commerce Indicator (ECI) code.
Transaction.IP.AddressstringThe IP address from which the transaction was initiated.
Transaction.IP.CountrystringThe country associated with the IP address.
Transaction.Error.CodestringError code returned by the payment gateway.
Transaction.Error.MessagestringDetailed error message.
Transaction.Card.NumberstringThe masked credit/debit card number used.
Transaction.Card.BrandstringThe brand of the payment card.
Transaction.Card.IssuerstringThe issuing bank or financial institution of the card.

Customer Object

Input ParameterTypeDescription
Customer.ReferencestringThe CustomerIdentifier provided in the request.
Customer.NamestringCustomer's name.
Customer.MobilestringThe Customer Mobile provided in the request.
Customer.EmailstringCustomer's email address (masked).

Amount Object

Input ParameterTypeDescription
Amount.BaseCurrencystringThe base currency of the transaction.
Amount.ValueInBaseCurrencystringThe amount in the base currency.
Amount.ServiceChargestringThe service charge applied in base currency.
Amount.ServiceChargeVATstringThe VAT applied on the service charge.
Amount.ReceivableAmountstringThe amount the vendor receives in base currency.
Amount.DisplayCurrencystringThe currency used for display.
Amount.ValueInDisplayCurrencystringThe amount in display currency.
Amount.PayCurrencystringThe currency used for payment.
Amount.ValueInPayCurrencystringThe transaction value in payment currency.

Suppliers Object (If applicable)

Input ParameterTypeDescription
Suppliers[ ].CodenumberUnique identifier for the supplier.
Suppliers[ ].NamestringThe name of the supplier.
Suppliers[ ].InvoiceSharestringThe share of the supplier in the given invoice.
Suppliers[ ].ProposedSharestringThe ProposedShare for the supplier in the invoice.
Suppliers[ ].DepositSharestringThe amount the supplier receives from this invoice.

Sample Event

The below sample JSON message is sent by MyFatoorah to your endpoint.

{
  "Event": {
    "Code": 1,
    "Name": "PAYMENT_STATUS_CHANGED",
    "CountryIsoCode": "KWT",
    "CreationDate": "2025-05-13T06:04:10.2870000Z",
    "Reference": "WH-128040"
  },
  "Data": {
    "Invoice": {
      "Id": "5620277",
      "Status": "PAID",
      "Reference": "2025042457",
      "CreationDate": "2025-05-13T06:04:02.263Z",
      "ExpirationDate": "2025-10-10T06:04:02.263Z",
      "UserDefinedField": "",
      "ExternalIdentifier": "1Q3bpLfxwqnTd3NtP3LELbCNi5oi4fZBU"
    },
    "Transaction": {
      "Id": "96665",
      "Status": "SUCCESS",
      "PaymentMethod": "VISA/MASTER",
      "PaymentId": "07075620277263571272",
      "ReferenceId": "513306096665",
      "TrackId": "13-05-2025_2635712",
      "AuthorizationId": "861740",
      "TransactionDate": "2025-05-13T06:04:10.2254325Z",
      "ECI": "02",
      "IP": {
        "Address": "102.41.140.94",
        "Country": "Egypt"
      },
      "Error": {
        "Code": "",
        "Message": ""
      },
      "Card": {
        "Number": "545454xxxxxx5454",
        "Brand": "Master",
        "Issuer": "CENTRAL TRUST BANK, THE"
      }
    },
    "Customer": {
      "Name": "Anonymous",
      "Mobile": "+965",
      "Email": ""
    },
    "Amount": {
      "BaseCurrency": "KWD",
      "ValueInBaseCurrency": "64.32",
      "ServiceCharge": "1.255",
      "ServiceChargeVAT": "0.188",
      "ReceivableAmount": "6.288",
      "DisplayCurrency": "KWD",
      "ValueInDisplayCurrency": "64.32",
      "PayCurrency": "KWD",
      "ValueInPayCurrency": "64.32"
    },
    "Suppliers": [
      {
        "Code": 1,
        "Name": "Hinds Hall",
        "InvoiceShare": "62.877",
        "ProposedShare": "",
        "DepositShare": "56.589"
      }
    ]
  }
}

Webhook Signature

You will use the parameters mentioned below to generate the webhook signature for the PAYMENT_STATUS_CHANGED event. If a parameter has no value, set its value to an empty string.

Invoice.Id=5620277,Invoice.Status=PAID,Transaction.Status=SUCCESS,Transaction.PaymentId=07075620277263571272,Invoice.ExternalIdentifier=1Q3bpLfxwqnTd3NtP3LELbCNi5oi4fZBU