Refund Data Model
Data Model
Overview
The "Refund Data Model" is a Data model type used in your webhook endpoint. This model provides information about any RefundStatusChanged event.
Your webhook endpoint will receive a POST request from MyFatooah that contains an EventType parameter with a value of "2". It is used to notify your system of the refund status (refunded, canceled). Detailed functionality of how to implement your webhook endpoint is explained in the Webhook section.
Now, we are going to declare the Refund Data Model properties of your endpoint and its models along with each accepted parameter and possible value.
Request Model
Input Parameter | Type | Description |
---|---|---|
RefundId | number | |
RefundReference | string | |
CreatedDate | datetime | Format "ddMMyyyyHHmmss" |
RefundStatus | string | REFUNDED CANCELED |
Amount | string | |
Comments | string | |
InvoiceId | string | |
InvoiceRefernce | string | |
GatewayReference | GatewayReference | This parameter should not be included in the signature properties. |
GatewayReference
Input Parameter | Type | Description |
---|---|---|
PaymentId | string | |
AuthorizationId | string | |
ReferenceId | string | |
TransactionId | string | |
RefundAmount | string | |
Currency | string | |
PaymentMethod | string |
Sample Message
The below sample JSON message is sent by MyFatoorah to your endpoint.
{
"EventType":2,
"Event":"RefundStatusChanged",
"DateTime":"04032021211057",
"CountryIsoCode":"KWT",
"Data":{
"RefundId":2840,
"RefundReference":"2021000019",
"CreatedDate":"04032021210447",
"RefundStatus":"REFUNDED",
"Amount":"40",
"Comments":"Test Webhook",
"InvoiceId":"585757",
"GatewayReference":{
"AuthorizationId":"B64769",
"PaymentId":"100202109798688317",
"ReferenceId":"109710001316",
"RefundAmount":"40",
"TransactionId":"202109701626674",
"Currency":"KWD",
"PaymentMethod":"VISA/MASTER"
}
}
}
Signature
To generate the signature of this model, you should order only the below parameters alphabetic with its values then encrypt it by the secret key.
The GatewayReference parameter should not be included in the signature properties.
The following will be a sample string used in generating the signature.
Amount=40,Comments=Test Webhook,CreatedDate=04032021210447,InvoiceId=585757,RefundId=2840,RefundReference=2021000019,RefundStatus=REFUNDED
Updated 12 months ago