Event types
Payload
data.intent. Failure events also include
data.reason; refund and reversal events include data.refund or
data.reversal. Local amounts are int64 strings. Store webhook_event_id
as the deduplication key and data.intent.id as the payment identifier.
Verify the request
Webhook requests include these headers:- Select the outbound webhook secret for the key ID and environment. This is separate from your API signing secret.
- Read the exact raw request body bytes. Check the timestamp against your allowed clock window and validate the nonce and signature formats.
- Build the HMAC canonical string with
POST, your endpoint’s pathname including its query string, timestamp, nonce, and SHA-256 body hash. Include the trailing newline. - Compare the received and computed signatures in constant time. Reject malformed signatures, including a different decoded length.
- Check and record the nonce atomically to reject request replays. Verify the signature before storing the event or changing payment state.
Acknowledge and reconcile
- Return
2xxafter durably storing the verified event. An already-stored event may be acknowledged again without repeating its accounting effects. - Deduplicate by
webhook_event_id. Delivery is at least once, and ordering is not guaranteed. - Network and
5xxfailures are retried with backoff up to the configured attempt limit. Exhausted deliveries are retained for operator replay. - A
4xxresponse is treated as a permanent failure and is not automatically retried. Return5xxwhen a temporary storage failure prevents acceptance. - Retrieve
GET /v1/payment_intents/{id}when events arrive out of order or local state is uncertain. See Reconciliation.