Using Webhooks

Overview

Webhooks let your application receive real-time updates from Due. You register a public HTTPS URL; when a subscribed event occurs, we send an HTTP POST with a JSON payload to that URL.

Think of webhooks as a call to action — when something happens in Due, your system is immediately notified.

How it works

  1. You create an endpoint on your server that listens for POST requests.
  2. You register that endpoint in the Due Dashboard (or via API).
  3. Whenever an event occurs, Due sends a JSON payload to your endpoint.
  4. Your server processes the event

Setup

Step 1 — Discover available events

Check which events your account can subscribe to:

curl -X GET "https://api.due.network/v1/webhook_endpoints/events" \
  -H 'Authorization: Bearer <token>' \
  -H 'Due-Account-Id: <account_id>'

Step 2 — Register a webhook endpoint

Create a webhook endpoint and tell Due which events to send there:

curl -X POST "https://api.due.network/v1/webhook_endpoints" \
  -H "Authorization: Bearer <token>" \
  -H 'Due-Account-Id: <account_id>' \
  -d '{
    "url": "https://example.com/webhooks/due",
    "events": ["<event_type_from_step_1>"],
    "description": "Production webhook"
  }'

Step 3 — Verify your endpoint

List your endpoints and confirm your new one is active:

curl -X GET "https://api.due.network/v1/webhook_endpoints" \
  -H "Authorization: Bearer <token>" \
  -H 'Due-Account-Id: <account_id>'

Step 4 — Receive your first event

Trigger an action in Due that emits one of the subscribed events. Due will POST the event payload directly to your webhook URL. In the sandbox environment, you can simulate pay-ins to see webhooks about transfers.

Manage endpoints (optional)

Update an endpoint

curl -X POST "https://api.due.network/v1/webhook_endpoints/<endpoint_id>" \
  -H "Authorization: Bearer <token>" \
  -H 'Due-Account-Id: <account_id>' \ 
  -d '{
    "events": ["<updated_event_type>"],
    "description": "Updated endpoint"
  }'

Delete an endpoint

curl -X DELETE "https://api.due.network/v1/webhook_endpoints/<endpoint_id>" \
  -H "Authorization: Bearer <token>" \
  -H 'Due-Account-Id: <account_id>'

To see the full list of webhook endpoint methods, please refer to the API reference