GetWebhooks
Overview
The GetWebhooks
endpoint is a POST request. It is used to get all the webhook events that MyFatoorah has triggered to your endpoint based on the configuration of the webhook in your account and some details regarding their status.
This endpoint can be very powerful to help you get the webhook events that you haven't received if your server was down or slow, leading to you not getting the webhook event.
The endpoint on Webhook_GetWebhooks.
Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.
Request Header
Add "Authorization": "Bearer {Token}" to the request header. The token of the demo configuration can be found here.
Request Model
The request is a POST request with the following parameters:
Parameter | Type | Optional? | Description |
---|---|---|---|
Start | string | Yes | Start date for filtering webhook events (format: ISO 8601) in UTC Time zone |
End | string | Yes | End date for filtering webhook events (format: ISO 8601) in UTC Time zone |
Page | integer | Yes | Page number for pagination (1-based). The number of events in a single page is 500 events. |
EventType | string | Yes | Webhook V1: TransactionsStatusChanged, RefundStatusChanged, RecurringStatusChanged, BalanceTransferred, SupplierStatusChanged Webhook V2: PAYMENT_STATUS_CHANGED, REFUND_STATUS_CHANGED, RECURRING_UPDATES, BALANCE_TRANSFERED, SUPLIER_STATUS_CHANGED |
Status | string | Yes | Status of webhook attempts to filter: Waiting: Webhook isn't yet triggered from MyFatoorah Running: The webhook is triggered from MyFatoorah but we are still attempting to reach your endpoint till we get success status code or all the retries are consumed. Succeeded: Webhook is successfully received on your end. Failed: Your server failed to receive the webhook and all the retries are consumed. |
Key | array | Yes | Array of Keys based on the KeyType |
KeyType | string | Yes | InvoiceId: This filters for the Payment Webhook with this InvoiceId CustomerReference: This filters for the Payment Webhook with this CustomerReference. WebhookReference: This filters for the webhook events that have this Webhook Reference |
Response Model
Parameter | Type | Description |
---|---|---|
IsSuccess | Boolean | Indicates if the request was successful |
Message | String | Status or result message |
ValidationErrors | Array | List of validation errors returned from the request - Always null in successful responses |
Data | Object | Contains the response details |
Data Object
Parameter | Type | Description |
---|---|---|
Items | Array | List of Webhook Event Log item objects |
Pagination | Object | Pagination information |
Items Array
Parameter | Type | Description |
---|---|---|
EndPoint | string | The URL where the webhook notification was sent |
Signature | string | Signature for verifying the webhook payload |
EventCode | integer | Numeric code for the event type |
EventName | string | Name of the event. The name of the event is affected by the version of the webhook you are using. Webhook V1: TransactionsStatusChanged, RefundStatusChanged, RecurringStatusChanged, BalanceTransferred, SupplierStatusChanged Webhook V2: PAYMENT_STATUS_CHANGED, REFUND_STATUS_CHANGED, RECURRING_UPDATES, BALANCE_TRANSFERED, SUPLIER_STATUS_CHANGED |
EventEntityId | string | Identifier for the entity associated with the event |
WebhookReference | string | Unique reference for the webhook event |
Data | object | The Webhook Data Content |
Status | string | Status of the webhook event delivery. Waiting: Webhook isn't yet triggered from MyFatoorah Running: The webhook is triggered from MyFatoorah but we are still attempting to reach your endpoint till we get success status code or all the retries are consumed. Succeeded: Webhook is successfully received on your end. Failed: Your server failed to receive the webhook and all the retries are consumed. |
Attempts | array | List of delivery attempt objects |
Attempts Array
Parameter | Type | Description |
---|---|---|
Date | string | Datetime of the attempt (format: ISO 8601) in UTC Time zone |
Status | integer | The status code we received from your server for the attempt |
Response Message | string | The message corresponding to the status code we received. |
Duration | string | The number of seconds it took for your server to respond to the attempt. |
Pagination Object
Parameter | Type | Descripton |
---|---|---|
PageSize | integer | The size of the page (Fixed: 500) |
PageNumber | integer | The page you are currently on. |
PagesCount | integer | The number of pages with webhook events matching the filters. |
ItemsCount | integer | The number of webhook events matching the filters. |
Sample Request & Response
{
"Start": "2024-02-12T00:16:29.650Z",
"End": "2025-02-12T20:43:43.848Z",
"Status": "Failed",
}
{
"IsSuccess": true,
"Message": "",
"ValidationErrors": null,
"Data": {
"Items": [
{
"EndPoint": "https://webhook.site/2a9d88c8-1329-4ad4-a163-57cac6986547",
"Signature": "N+TPuke9hEn963L1zQbXF3zSR2zx7O/RgM4eCavfP8A=",
"EventCode": 1,
"EventName": "TransactionsStatusChanged",
"EventEntityId": "5131277",
"WebhookReference": "WH-24349",
"Data": {
"InvoiceId": 5131277,
"InvoiceReference": "2025000148",
"CreatedDate": "12022025154151",
"CustomerReference": "rLVgyA7C6v19bHwpXEIDrA5wW",
"CustomerName": "sdadsaas sad Ggaga",
"CustomerMobile": "+966",
"CustomerEmail": "[email protected]",
"TransactionStatus": "SUCCESS",
"PaymentMethod": "VISA/MASTER",
"UserDefinedField": "rLVgyA7C6v19bHwpXEIDrA5wW",
"ReferenceId": "504312229134",
"TrackId": "12-02-2025_2485915",
"PaymentId": "07075131277248591573",
"AuthorizationId": "229134",
"InvoiceValueInBaseCurrency": "112.185",
"BaseCurrency": "KWD",
"InvoiceValueInDisplayCurreny": "30.29",
"DisplayCurrency": "USD",
"InvoiceValueInPayCurrency": "112.19",
"PayCurrency": "SAR"
},
"Status": "Failed",
"Attempts": [
{
"Date": "2025-02-12T12:42:16.1218556Z",
"Status": 404,
"ResponseMessage": "Not Found",
"Duration": "0.056"
},
{
"Date": "2025-02-12T12:42:51.2235299Z",
"Status": 404,
"ResponseMessage": "Not Found",
"Duration": "0.052"
},
{
"Date": "2025-02-12T12:43:21.2716528Z",
"Status": 404,
"ResponseMessage": "Not Found",
"Duration": "0.073"
},
{
"Date": "2025-02-12T12:43:51.2951604Z",
"Status": 404,
"ResponseMessage": "Not Found",
"Duration": "0.048"
}
]
},
{
"EndPoint": "https://webhook.site/2a9d88c8-1329-4ad4-a163-57cac6986547",
"Signature": "QcNL1eSkVJuXqsC5zF7bCzKfn0c+DuFWP/LFQlRkrjQ=",
"EventCode": 1,
"EventName": "TransactionsStatusChanged",
"EventEntityId": "5131253",
"WebhookReference": "WH-24344",
"Data": {
"InvoiceId": 5131253,
"InvoiceReference": "2025000147",
"CreatedDate": "12022025153902",
"CustomerReference": "rt3V3n4nBpSdkF5HQLsRs52NV",
"CustomerName": "sdadsaas sad Ggaga",
"CustomerMobile": "+966",
"CustomerEmail": "[email protected]",
"TransactionStatus": "SUCCESS",
"PaymentMethod": "VISA/MASTER",
"UserDefinedField": "rt3V3n4nBpSdkF5HQLsRs52NV",
"ReferenceId": "504312227034",
"TrackId": "12-02-2025_2485907",
"PaymentId": "07075131253248590772",
"AuthorizationId": "227034",
"InvoiceValueInBaseCurrency": "260.444",
"BaseCurrency": "KWD",
"InvoiceValueInDisplayCurreny": "70.32",
"DisplayCurrency": "USD",
"InvoiceValueInPayCurrency": "260.45",
"PayCurrency": "SAR"
},
"Status": "Failed",
"Attempts": [
{
"Date": "2025-02-12T12:39:16.9598573Z",
"Status": 400,
"ResponseMessage": "Bad Request",
"Duration": "0.066"
},
{
"Date": "2025-02-12T12:39:51.0342446Z",
"Status": 400,
"ResponseMessage": "Bad Request",
"Duration": "0.048"
},
{
"Date": "2025-02-12T12:40:36.0741091Z",
"Status": 400,
"ResponseMessage": "Bad Request",
"Duration": "0.073"
},
{
"Date": "2025-02-12T12:41:06.1305213Z",
"Status": 400,
"ResponseMessage": "Bad Request",
"Duration": "0.048"
}
]
}
],
"Pagination": {
"PageSize": 500,
"PageNumber": 1,
"PagesCount": 1,
"ItemsCount": 2
}
}
}
Updated about 15 hours ago