Using Payment Links, Payment Page, payment extensions, Payouts, POS, or the Reconciliation API? View the classic product documentation
Webhooks
How you hear about a payment you did not initiate. Configure the endpoint, watch deliveries land, and retry the ones that failed.
- ›
- ›
- ›
- ›
- ›
What a delivery contains
Every delivery is a signed JSON POST to your webhook URL. Check the signature before you act on anything in the body.
The body
Every event uses the same envelope. content.object is the object that changed, with the same fields the API returns for it.
| Field | What it holds |
|---|---|
merchant_id | Your Orchestration merchant ID. |
event_id | The ID of this event. |
event_type | What happened, for example payment_succeeded. |
content.type | The kind of object in content.object. |
content.object | The object that changed. |
timestamp | When the event was created, in UTC. |
processor_merchant_id | The merchant account whose processing credentials were used. Usually the same as merchant_id. |
| content.type | content.object has the same fields as |
|---|---|
payment_details | GET /payments/{payment_id} |
refund_details | GET /refunds/{refund_id} |
dispute_details | GET /disputes/{dispute_id} |
mandate_details | GET /mandates/{mandate_id} |
payout_details | GET /payouts/{payout_id} |
subscription_details | POST /subscriptions/{subscription_id}/confirm |
content.object is cut down to its main fields here. A real delivery has every field of the payment.
Headers
| Header | What it holds |
|---|---|
Content-Type | application/json |
X-Webhook-Signature-512 | The signature of the body, described below. |
| Your custom headers | Whatever you set in outgoing_webhook_custom_http_headers on the profile. The Peach Dashboard does not have this setting, so set it through the API. |
Deliveries also carry standard HTTP headers, such as User-Agent. Their values can change, so do not rely on them.
webhook_username and webhook_password are stored on the profile but not sent with deliveries. To authenticate deliveries, verify the signature, and add a custom header if you want a second check.
Verify the signature
Signing is always on, so there is nothing to turn on. Peach signs each delivery with the profile's payment response hash key. In the Peach Dashboard, it is the Payment response hash key under Peach Orchestration > Settings > Credentials. Each profile has its own key, so if you have more than one profile, select it under Profile ID first. It is also payment_response_hash_key in the profile you read in the next step. Keep it secret.
- Read the raw request body before you parse it. Parsing and re-serialising the JSON can change the bytes, and the signature stops matching.
- Compute an HMAC-SHA512 of the raw body, keyed with the hash key, as lowercase hex.
- Compare it with the
X-Webhook-Signature-512header using a constant-time comparison. - If they differ, reject the delivery (for example, with a 401) and do not act on it.
Deliveries carry only this SHA-512 signature. There is no SHA-256 header.
Account and profile
Reading these off your most recent payment…
Where deliveries come from
If your firewall only accepts known sources, allowlist the IPs for the environment you use.
- Sandbox
18.202.161.699.80.139.75- Live
34.249.246.114
What you can subscribe to
payment_created_enabledA payment intent was createdpayment_succeeded_enabledMoney capturedpayment_failed_enabledDeclined or abandonedpayment_statuses_enabledAn explicit list of statuses, for finer control than the three booleansrefund_statuses_enabledRefunds reaching success or failurepayout_statuses_enabledPayout state changes
outgoing_webhook_custom_http_headers adds headers to every delivery, for example a value your endpoint checks alongside the signature.