Webhooks
Register one URL, verify the HMAC signature, and handle the seven event types.
Webhooks tell your platform what happened after an API call returns: a payment settled, an ACH debit was returned, a batch funded, an applicant submitted. dhango sends every event to a single HTTPS URL on your platform account. There is no per-event subscription, so your handler reads Type and branches on it.
Register the URL
In the dashboard, open Accounts, your platform account, API Credentials, then Webhook Integration. Set the URL and generate the HMAC key on that panel. dhango creates the key, so store it with your other secrets. Users with the API Credentials permission can view it again later.
The Webhooks page in the dashboard lists every delivery, filterable by status (all, successful, or failed), event type, and account. Retry resends a payload to your registered URL. Forward sends it to any other URL, including localhost, which is handy for debugging.
Verify the signature
Verify every delivery before you trust it. Each POST carries three headers: AccountKey, Timestamp (Unix seconds), and HMACSignature (a base64 HMAC-SHA256).
- Build the string
Timestamp+.+ the raw request body. - Compute its HMAC-SHA256 with your HMAC key.
- Compare your result with the decoded
HMACSignaturebytes, using a constant-time comparison. - Reject the request if the timestamp is too old. The embed walkthrough uses a five-minute window.
Use the raw body exactly as received. If you parse and re-serialize the JSON first, the signature will not match. The timestamp check limits replays, but a captured request still verifies until its timestamp goes stale, so make your handler idempotent too.
The body is an object with Type and Data, and the AccountKey header is the account the event is about. For ApplicationSubmitted, that is your platform account, because the merchant account does not exist yet.
Return a 2xx response to acknowledge a delivery. Anything else is retried. Unless a custom schedule is configured, dhango waits 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours, 12 hours, and 24 hours between attempts. If every attempt fails, dhango emails the platform users who have the API Credentials permission.
Event types
| Type | When it is sent | Data |
|---|---|---|
BatchAdd | A batch is created | The batch, in the same shape as the batches API |
BatchUpdate | A batch changes | The batch |
TokenUpdate | A saved payment method changes, including an automatic card update or a notification of change applied to a payer token | The token |
TransactionEvent | A payment is created, updated, voided, refunded, or returned, or a payout succeeds | The transaction, in the same shape as GET /v1/transactions/{id}. A parent with splits includes those splits, and a split leg does not include the other merchants. A successful payout uses transaction event type Payout. Later payout events use Batch, Process, and Return. |
AccountProcessorCredentialUpdate | A processor credential is activated, deactivated, or updated | The processor credential status for the account |
ApplicationSubmitted | The applicant agrees to terms | ApplicationId, PlatformIdentifier, OrganizationName, DoingBusinessAs, ContactEmailAddress, SubmitDate |
TokenImported | One row of a token import finishes, success or failure | OriginalTokenId, TokenId (null on failure), Success, ErrorCode, ErrorMessage, FileName, RowNumber |
TokenImported never includes account numbers, routing numbers, card numbers, or the account holder name. On failure, ErrorCode is InvalidRow or TokenizationFailed. On success, fetch the masked token with TokenId.
TransactionEvent covers many different actions. To tell them apart, read the transaction event type in the payload, and see Transaction lifecycles for what each one means.
Retries and dashboard replays send the same event more than once, so handle every delivery idempotently.