Guides

Refund Data Model

Data Model

Overview

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

Your webhook endpoint will receive a POST request containing an event with a Code of 2 and Name of REFUND_STATUS_CHANGED. This event is particularly useful for keeping track of refunded transactions, ensuring that your system updates the refund status accurately.


Request Model

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

Event Object

Input ParameterTypeDescription
Event.Codenumber2 - REFUND_STATUS_CHANGED
Event.NamestringREFUND_STATUS_CHANGED
Event.CountryIsoCodestringThe country of your account with MyFatoorah.
Event.CreationDatedatetimeThe timestamp when the event was created in ISO 8601 format. Time zone is in UTC.
Event.ReferencestringUnique reference ID for the webhook event.

Data Object

The Data Object contains several nested objects inside of it as below.

Refund Object

Input ParameterTypeDescription
Refund.IdnumberUnique identifier for the refund transaction.
Refund.ReferencestringA unique reference number assigned to the refund transaction.
Refund.StatusstringThe current status of the refund (e.g., REFUNDED/CANCELED).
Refund.InvoiceIdstringThe invoice ID associated with the refund.
Refund.CreationDatedatetimeThe date and time when the refund request was created, formatted in ISO 8601.
Refund.RefundDatedatetimeThe date and time when the refund was processed, formatted in ISO 8601.
Refund.RRNstringRetrieval Reference Number (RRN) for tracking the refund transaction.
Refund.CommentstringOptional comments provided by MyFatoorah during the refund process
Refund.VendorCommentstringOptional comment sent by the vendor to issue the refund.

Amount Object

Input ParameterTypeDescription
Amount.BaseCurrencystringThe base currency of your account with MyFatoorah
Amount.ValueInBaseCurrencystringThe refunded amount in the base currency.

Amount Distribution

Input ParameterTypeDescription
Amount.Distribution.VendorstringThe portion of the refund amount allocated to the vendor.
Amount.Distribution.SuppliersarrayThe portion of the refund amount allocated to suppliers. (if any).

Suppliers Array

Input ParameterTypeDescription
Amount.Distribution.Suppliers[].CodenumberUnique identifier for the supplier.
Amount.Distribution.Suppliers[].NamestringThe name of the supplier.
Amount.Distribution.Suppliers[].AmountstringThe amount deducted from the supplier.

Referenced Invoice Object

Input ParameterTypeDescription
ReferencedInvoice.IdstringThe InvoiceId of the original invoice associated with the refund.
ReferencedInvoice.ReferencestringThe reference number of the original invoice.
ReferencedInvoice.PaymentMethodstringThe payment method used for the original transaction (e.g., VISA/MASTER).
ReferencedInvoice.BaseCurrencystringThe base currency of your account (e.g., KWD).
ReferencedInvoice.ValueInBaseCurrencystringThe total value of the original invoice in base currency.
ReferencedInvoice.RemainingValueInBaseCurrencystringThe remaining amount in base currency after the refund.

Sample Event

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

{
  "Event": {
    "Code": 2,
    "Name": "REFUND_STATUS_CHANGED",
    "CountryIsoCode": "KWT",
    "CreationDate": "2025-05-13T06:06:20.4000000Z",
    "Reference": "WH-128044"
  },
  "Data": {
    "Refund": {
      "Id": "111147",
      "Reference": "2025000058",
      "Status": "REFUNDED",
      "InvoiceId": "5620292",
      "CreationDate": "2025-05-13T06:06:19.247Z",
      "RefundDate": "2025-05-13T06:06:20.2019805Z",
      "RRN": "513306098825",
      "Comment": "",
      "VendorComment": "Supplier Refund"
    },
    "Amount": {
      "BaseCurrency": "KWD",
      "ValueInBaseCurrency": "30",
      "Distribution": {
        "Vendor": "10",
        "Suppliers": [
          {
            "Code": 1,
            "Name": "Hinds Hall",
            "Amount": "20"
          }
        ]
      }
    },
    "ReferencedInvoice": {
      "Id": "5620277",
      "Reference": "2025042457",
      "ExternalIdentifier": "1Q3bpLfxwqnTd3NtP3LELbCNi5oi4fZBU",
      "PaymentMethod": "VISA/MASTER",
      "BaseCurrency": "KWD",
      "ValueInBaseCurrency": "64.32",
      "RemainingValueInBaseCurrency": "34.32"
    }
  }
}

Webhook Signature

You will use the parameters mentioned below to generate the webhook signature for the REFUND_STATUS_CHANGED event.

Refund.Id=111147,Refund.Status=REFUNDED,Amount.ValueInBaseCurrency=30,ReferencedInvoice.Id=5620277

This webhook allows real-time tracking of refund transactions, ensuring accurate reconciliation and financial updates in your system.