Guides

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:

ParameterTypeOptional?Description
StartstringYesStart date for filtering webhook events (format: ISO 8601) in UTC Time zone
EndstringYesEnd date for filtering webhook events (format: ISO 8601) in UTC Time zone
PageintegerYesPage number for pagination (1-based). The number of events in a single page is 500 events.
EventTypestringYesWebhook V1:
TransactionsStatusChanged, RefundStatusChanged, RecurringStatusChanged, BalanceTransferred, SupplierStatusChanged
Webhook V2:
PAYMENT_STATUS_CHANGED, REFUND_STATUS_CHANGED, RECURRING_UPDATES, BALANCE_TRANSFERED, SUPLIER_STATUS_CHANGED
StatusstringYesStatus 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.
KeyarrayYesArray of Keys based on the KeyType
KeyTypestringYesInvoiceId: 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

ParameterTypeDescription
IsSuccessBooleanIndicates if the request was successful
MessageStringStatus or result message
ValidationErrorsArrayList of validation errors returned from the request - Always null in successful responses
DataObjectContains the response details

Data Object

ParameterTypeDescription
ItemsArrayList of Webhook Event Log item objects
PaginationObjectPagination information

Items Array

ParameterTypeDescription
EndPointstringThe URL where the webhook notification was sent
SignaturestringSignature for verifying the webhook payload
EventCodeintegerNumeric code for the event type
EventNamestringName 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
EventEntityIdstringIdentifier for the entity associated with the event
WebhookReferencestringUnique reference for the webhook event
DataobjectThe Webhook Data Content
StatusstringStatus 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.
AttemptsarrayList of delivery attempt objects

Attempts Array

ParameterTypeDescription
DatestringDatetime of the attempt (format: ISO 8601) in UTC Time zone
StatusintegerThe status code we received from your server for the attempt
Response MessagestringThe message corresponding to the status code we received.
DurationstringThe number of seconds it took for your server to respond to the attempt.

Pagination Object

ParameterTypeDescripton
PageSizeintegerThe size of the page (Fixed: 500)
PageNumberintegerThe page you are currently on.
PagesCountintegerThe number of pages with webhook events matching the filters.
ItemsCountintegerThe 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
        }
    }
}