Skip to content

Webhook integration

Your webhook endpoint should accept HTTPS POST requests with a JSON body and return a success status as soon as the payload has been durably accepted.

Receiving requests

Recommended practices include:

  • expose the webhook endpoint over HTTPS
  • parse the request body as JSON
  • treat id as the idempotency key for the delivery
  • store the raw payload before performing expensive downstream processing
  • return a response promptly and process side effects asynchronously

HMAC authentication is always enabled. Every delivery includes the X-Ingrid-Timestamp and X-Ingrid-Signature headers; verify them as described in Verifying Requests.

OAuth 2.0 Client Credentials authentication is optional. When configured, Ingrid uses the provided client credentials to obtain an access token from your authorization server, then includes it in the webhook request as Authorization: Bearer <token>. For protocol details, see RFC 6749 (The OAuth 2.0 Authorization Framework).

Routing payloads

Use the top-level type field to route the payload family:

  • ECOM_ORDER for order payloads
  • PARCEL for parcel payloads

Then use the two trigger fields for different purposes:

  • triggeringEvent is the canonical business event from Ingrid's public event catalog, for example order.confirmed.v1, parcel.on_route.v1, or parcel.out_for_delivery.v1
  • triggerName is the configured scenario name that matched and caused this delivery to be sent to your endpoint

Receiver logic should generally branch primarily on triggeringEvent. Use triggerName as contextual metadata for routing, debugging, analytics, or to distinguish multiple subscriptions built on the same business event.

Example:

  • triggeringEvent: order.confirmed.v1
  • triggerName: high-value-orders-us

This indicates that the business event was order.confirmed.v1, and that the delivery originated from the configured scenario for high-value US orders.

Acknowledgment semantics

Treat the webhook as successfully received only after you have:

  1. parsed the request
  2. validated that the payload is structurally acceptable
  3. stored it or handed it off to a durable internal queue

If your endpoint cannot safely accept the event, return an appropriate non-2xx response and allow the sender to retry according to the delivery policy.

Idempotency

Webhook consumers should expect duplicate delivery attempts and design handlers to be idempotent.

Use id to:

  • reject duplicates that were already processed
  • correlate retries of the same delivery
  • trace a delivery across logs, queues, and downstream jobs