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 Parameter | Type | Description |
---|---|---|
Event.Code | number | 1 - PAYMENT_STATUS_CHANGED |
Event.Name | string | PAYMENT_STATUS_CHANGED |
Event.CountryIsoCode | string | The country of your account with MyFatoorah. |
Event.CreationDate | datetime | The timestamp when the event was created in ISO 8601 format. |
Event.Reference | string | Unique reference ID for the webhook event. |
Data Object
Invoice Object
Input Parameter | Type | Description |
---|---|---|
Invoice.Id | string | Unique identifier for the invoice. |
Invoice.Status | string | The current status of the invoice (e.g., PAID). |
Invoice.Reference | string | A unique reference number assigned to the invoice. |
Invoice.CreationDate | datetime | The date and time when the invoice was created, formatted in ISO 8601. |
Invoice.ExpirationDate | datetime | The expiration date of the invoice, formatted in ISO 8601. |
Invoice.UserDefinedField | string | Any custom user-defined field associated with the invoice. |
Transaction Object
Input Parameter | Type | Description |
---|---|---|
Transaction.Id | string | Unique identifier for the transaction. |
Transaction.Status | string | The status of the transaction (e.g., FAILED). |
Transaction.PaymentMethod | string | The payment method used (e.g., VISA/MASTER (USD)). |
Transaction.PaymentId | string | The unique payment ID associated with the transaction. |
Transaction.ReferenceId | string | A unique identifier assigned to the transaction. |
Transaction.TrackId | string | The tracking ID for the transaction. |
Transaction.AuthorizationId | string | A unique ID associated with the authorization of the payment transaction. |
Transaction.TransactionDate | datetime | The date and time when the transaction was processed. |
Transaction.ECI | string | The Electronic Commerce Indicator (ECI) code. |
Transaction.IP.Address | string | The IP address from which the transaction was initiated. |
Transaction.IP.Country | string | The country associated with the IP address. |
Transaction.Error.Code | string | Error code returned by the payment gateway. |
Transaction.Error.Message | string | Detailed error message. |
Transaction.Card.Number | string | The masked credit/debit card number used. |
Transaction.Card.Brand | string | The brand of the payment card. |
Transaction.Card.Issuer | string | The issuing bank or financial institution of the card. |
Customer Object
Input Parameter | Type | Description |
---|---|---|
Customer.Reference | string | The CustomerIdentifier provided in the request. |
Customer.Name | string | Customer's name. |
Customer.Mobile | string | The Customer Mobile provided in the request. |
Customer.Email | string | Customer's email address (masked). |
Amount Object
Input Parameter | Type | Description |
---|---|---|
Amount.BaseCurrency | string | The base currency of the transaction. |
Amount.ValueInBaseCurrency | string | The amount in the base currency. |
Amount.ServiceCharge | string | The service charge applied in base currency. |
Amount.ServiceChargeVAT | string | The VAT applied on the service charge. |
Amount.ReceivableAmount | string | The amount the vendor receives in base currency. |
Amount.DisplayCurrency | string | The currency used for display. |
Amount.ValueInDisplayCurrency | string | The amount in display currency. |
Amount.PayCurrency | string | The currency used for payment. |
Amount.ValueInPayCurrency | string | The transaction value in payment currency. |
Suppliers Object (If applicable)
Input Parameter | Type | Description |
---|---|---|
Suppliers[ ].Code | number | Unique identifier for the supplier. |
Suppliers[ ].Name | string | The name of the supplier. |
Suppliers[ ].InvoiceShare | string | The share of the supplier in the given invoice. |
Suppliers[ ].ProposedShare | string | The ProposedShare for the supplier in the invoice. |
Suppliers[ ].DepositShare | string | The 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
Updated about 16 hours ago