Webhooks Filtering
Overview
Webhook filters provide a way for publishers to receive webhook events only with a specific payload. This will allow for the subscribed endpoints to receive webhook events that you are actually interested in and filter out the events that don't match desired payload values.
Available webhook filters
Currently, the only filter that is supported is paymentMethodId
. You can find its description below.
Filter Name | Example | Description |
---|---|---|
paymentMethodId | 837465728 | By using this filter you will make sure that received webhook events will contain payment method ID you specified. Webhook events with other payment method ID won't be delivered |
Subscribing to Webhook Filters
When subscribing to an endpoint to a webhook topic, you need to pass on the filters
field, which defines a list of filters that will be applied to your webhook event. The documentation for relevant endpoints used for subscribing to webhook can be found here.
Below you can find an example request body for filters list and the description of their parameters:
[
{
"name": "paymentMethodId",
"options": {
"value": 320113641
}
}
]
Parameter | Description |
---|---|
name | Name of the webhook filter. Currently only one available is paymentMethodId |
value | Value of paymentMethodId field you want to receive in webhook events. Webhook events with different paymentMethodId values will be discarded. |
Example request bodies
Example webhook subscription request,
[
{
"url": "https://example-endpoint-with-filters.com",
"filters": [
{
"name": "paymentMethodId",
"options": {
"value": 320113641
}
}
]
}
]
Example webhook subscription request with two URLs,
[
{
"url": "https://endpoint-receiving-only-320113641.com",
"filters": [
{
"name": "paymentMethodId",
"options": {
"value": 320113641
}
}
]
},
{
"url": "https://endpoint-receiving-only-112323789.com",
"filters": [
{
"name": "paymentMethodId",
"options": {
"value": 112323789
}
}
]
}
]
Updated almost 4 years ago