Transaction Data Model

Data Model

Overview

The "Transaction Data Model" is a Data model type used in your webhook endpoint. This model provides information about any TransactionsStatusChanged event.

Your webhook endpoint will receive a POST request from MyFatooah that contains an EventType parameter with a value of "1". It is used to notify your system of the transaction status (success, failed). Detailed functionality of how to implement your webhook endpoint is explained in the Webhook section.

Now, we are going to declare the Transaction Data Model properties of your endpoint and its models along with each accepted parameter and possible value.


Request Model

Input ParameterTypeDescription
InvoiceIdnumber
InvoiceReferencestring
CreatedDatedatetimeFormat "ddMMyyyyHHmmss"
CustomerReferencestring
CustomerNamestring
CustomerMobilestring
CustomerEmailstring
TransactionStatusstringSUCCESS
FAILED
CANCELED
AUTHORIZE
PaymentMethodstring
UserDefinedFieldstring
ReferenceId string
TrackIdstring
PaymentIdstring
AuthorizationIdstring
InvoiceValueInBaseCurrency string
BaseCurrency string
InvoiceValueInDisplayCurreny string
DisplayCurrency string
InvoiceValueInPayCurrency string
PayCurrency string

Sample Message

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

{
   "EventType":1,
   "Event":"TransactionsStatusChanged",
   "DateTime":"04032021211615",
   "CountryIsoCode":"KWT",
   "Data":{
      "InvoiceId":586170,
      "InvoiceReference":"2021000184",
      "CreatedDate":"04032021211555",
      "CustomerReference":"12223444",
      "CustomerName":"Test Webhook",
      "CustomerMobile":"96512345678",
      "CustomerEmail":"[email protected]",
      "TransactionStatus":"SUCCESS",
      "PaymentMethod":"KNET",
      "UserDefinedField":null,
      "ReferenceId":"106310001097",
      "TrackId":"04-03-2021_477336",
      "PaymentId":"100202106359084366",
      "AuthorizationId":"B68413",
      "InvoiceValueInBaseCurrency":"456.75",
      "BaseCurrency":"KWD",
      "InvoiceValueInDisplayCurreny":"456.75",
      "DisplayCurrency":"KWD",
      "InvoiceValueInPayCurrency":"456.75",
      "PayCurrency":"KWD"
   }
}

👍

Signature

To generate the signature of this model, you should order only the above parameters alphabetic with its values then encrypt it by the secret key.

The following will be a sample string used in generating the signature.

AuthorizationId=B68413,BaseCurrency=KWD,CreatedDate=04032021211555,[email protected],CustomerMobile=96512345678,CustomerName=Test Webhook,CustomerReference=12223444,DisplayCurrency=KWD,InvoiceId=586170,InvoiceReference=2021000184,InvoiceValueInBaseCurrency=456.75,InvoiceValueInDisplayCurreny=456.75,InvoiceValueInPayCurrency=456.75,PayCurrency=KWD,PaymentId=100202106359084366,PaymentMethod=KNET,ReferenceId=106310001097,TrackId=04-03-2021_477336,TransactionStatus=SUCCESS,UserDefinedField=