Guides

Recurring Data Model

Data Model

Overview

The "Recurring Updates" webhook is triggered whenever there is an update to a recurring payment. This webhook ensures that your system is notified of recurring payment status changes, allowing for real-time updates and appropriate actions.

Your webhook endpoint will receive a POST request containing an event with a Code of 5 and Name of RECURRING_UPDATES. This event is particularly useful for tracking active, canceled, or updated recurring payments and their associated transactions.


Request Model

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

Event Object

Input ParameterTypeDescription
Event.Codenumber5 - RECURRING_UPDATES
Event.NamestringRECURRING_UPDATES
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

The Data Object contains multiple nested objects as below.

Recurring Object

Input ParameterTypeDescription
Recurring.IdstringUnique identifier for the recurring payment.
Recurring.NextPayDatedatetimeThe scheduled date and time for the next recurring payment, formatted in ISO 8601 and always in UTC.
Recurring.StatusstringACTIVE - The recurring payment is being processed normally, but its iterations have not been completed yet.
UNCOMPLETED - MyFatoorah attempted to withdraw the recurring value, but the payment failed, and all retry attempts were unsuccessful.
COMPLETED - The recurring payment has been executed successfully with all iterations completed; it will not be executed again.
Recurring.InitialInvoiceIdstringThe invoice ID associated with the creation of the recurring payment.

Payment Object

The Payment Object contains details about the latest processed recurring payment.

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., SUCCESS).
Transaction.PaymentMethodstringThe payment method used (e.g., VISA/MASTER).
Transaction.PaymentIdstringThe unique payment ID associated with the transaction.
Transaction.ReferenceIdstringA unique identifier assigned to the transaction for tracking purposes.
Transaction.TrackIdstringThe tracking ID for the payment transaction.
Transaction.AuthorizationIdstringA unique ID associated with the authorization of the payment.
Transaction.TransactionDatedatetimeThe date and time when the transaction was processed.
Transaction.ECIstringThe Electronic Commerce Indicator (ECI) code, representing security level.
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, if applicable.
Transaction.Error.MessagestringDetailed error message, if applicable.
Transaction.Card.NumberstringThe masked credit/debit card number used for the transaction.
Transaction.Card.BrandstringThe brand of the payment card, such as Visa or MasterCard.
Transaction.Card.IssuerstringThe issuing bank or financial institution of the card, if available.

Amount Object

Input ParameterTypeDescription
Amount.BaseCurrencystringThe base currency of your MyFatoorah account (e.g., KWD).
Amount.ValueInBaseCurrencystringThe amount in the base currency.
Amount.ServiceChargestringThe service charge applied in base currency.
Amount.ServiceChargeVATstringThe VAT applied to 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 (e.g., USD).
Amount.ValueInPayCurrencystringThe transaction value in payment currency.

Sample Event

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

{
  "Event": {
    "Code": 5,
    "Name": "RECURRING_UPDATES",
    "CountryIsoCode": "KWT",
    "CreationDate": "2025-02-09T01:16:11.9770000",
    "Reference": "WH-19916"
  },
  "Data": {
    "Recurring": {
      "Id": "RECUR1218312623",
      "NextPayDate": "2025-02-09T21:00:00Z",
      "Status": "ACTIVE",
      "InitialInvoiceId": "5047674"
    },
    "Payment": {
      "Invoice": {
        "Id": "5105602",
        "Status": "PAID",
        "Reference": "2025015455",
        "CreationDate": "2025-02-09T01:16:10.6259466Z",
        "ExpirationDate": "2025-02-10T01:16:10.6259466Z",
        "UserDefinedField": ""
      },
      "Transaction": {
        "Id": "121797",
        "Status": "SUCCESS",
        "PaymentMethod": "VISA/MASTER",
        "PaymentId": "07075105602247796773",
        "ReferenceId": "504001121797",
        "TrackId": "09-02-2025_2477967",
        "AuthorizationId": "262890",
        "TransactionDate": "2025-02-09T01:16:11.8837517Z"
      }
    }
  }
}

Webhook Signature

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

Recurring.Id=RECUR1037225,Recurring.Status=UNCOMPLETED,Recurring.InitialInvoiceId=322242

This webhook allows real-time tracking of recurring payments, ensuring accurate financial management and automated processing in your system.