Configure a webhook by defining at least one endpoint and a list of events, and you're done. When you've set up a webhook, Adfin will notify you every time an event occurs for the object.
To proceed with this guide, you must have completed your webhook signature verification Webhook Signature Verification
Set up your endpoint to receive notifications. The endpoint should be a publicly accessible URL that can receive POST requests from Adfin. The event payload is sent in the request body.
Endpoint example: https://your-platform.com/webhook-endpoint
To use our webhooks API, generate an access token using the client credentials flow. You will receive an error if using an access token generated during the authorization code flow.
Follow the instructions in this section to authorise access to your backend client. Remember that your client_secret should be kept a secret: only use it to authenticate with the Adfin platform and don’t share it outside your organisation.
Webhook subscription endpoint:
PUT /apps/{client_id}/webhooksThis endpoint allows you to subscribe your platform to specific events from Adfin (e.g., payment, dd-mandate).
curl -X PUT "https://api.staging.adfin.com/api/apps/{client_id}/webhooks" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-platform/adfin/status",
"events": ["payment", "invoice", "dd-mandate"],
"name": "webhook name",
"description": "webhook description"
}'This cURL request will register your platform to receive webhook events, which can be used to handle real-time updates from Adfin (like payments being made or mandates being signed)
If the request is successful, Adfin will respond with a confirmation that the webhook has been created.
{
"id": "29f6b7ea-94ed-4c3c-9655-b736216c798f",
"url": "https://your-platform/adfin/status",
"events": ["payment", "invoice", "dd-mandate"],
"name": "webhook name",
"description": "webhook description",
"enabled": true
}- Rotate secrets periodically: If needed, rotate the shared secret by resubscribing to the webhook.
- Rate limiting: Apply rate limits to your webhook endpoints to prevent abuse.
- Logging: Log all webhook verification failures and investigate unusual patterns of failed verification attempts.
To view the webhook payloads, please use our Webhook events page Webhook events