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.

  1. ›
  2. ›
  3. ›
  4. ›
  5. ›

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.

FieldWhat it holds
merchant_idYour Orchestration merchant ID.
event_idThe ID of this event.
event_typeWhat happened, for example payment_succeeded.
content.typeThe kind of object in content.object.
content.objectThe object that changed.
timestampWhen the event was created, in UTC.
processor_merchant_idThe merchant account whose processing credentials were used. Usually the same as merchant_id.
content.typecontent.object has the same fields as
payment_detailsGET /payments/{payment_id}
refund_detailsGET /refunds/{refund_id}
dispute_detailsGET /disputes/{dispute_id}
mandate_detailsGET /mandates/{mandate_id}
payout_detailsGET /payouts/{payout_id}
subscription_detailsPOST /subscriptions/{subscription_id}/confirm
A payment_succeeded delivery

content.object is cut down to its main fields here. A real delivery has every field of the payment.

Loading...

Headers

HeaderWhat it holds
Content-Typeapplication/json
X-Webhook-Signature-512The signature of the body, described below.
Your custom headersWhatever 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.

  1. Read the raw request body before you parse it. Parsing and re-serialising the JSON can change the bytes, and the signature stops matching.
  2. Compute an HMAC-SHA512 of the raw body, keyed with the hash key, as lowercase hex.
  3. Compare it with the X-Webhook-Signature-512 header using a constant-time comparison.
  4. 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.

Node.js example (Express)
Loading...

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.6
99.80.139.75
Live
34.249.246.114

What you can subscribe to

  • payment_created_enabledA payment intent was created
  • payment_succeeded_enabledMoney captured
  • payment_failed_enabledDeclined or abandoned
  • payment_statuses_enabledAn explicit list of statuses, for finer control than the three booleans
  • refund_statuses_enabledRefunds reaching success or failure
  • payout_statuses_enabledPayout state changes

outgoing_webhook_custom_http_headers adds headers to every delivery, for example a value your endpoint checks alongside the signature.