Use Cases
- Order Fulfillment: Trigger downstream processes when a checkout intent completes.
- Error Handling: React immediately when an offer retrieval or order placement fails.
- Customer Notifications: Send real-time updates to buyers about their order status.
Setting Up Webhooks
Navigate to Account Settings
Go to the Rye Console and find the Webhooks section on the accounts tab.
Set Up an Endpoint
Enter your publicly accessible endpoint URL. It must be reachable over the internet and capable of handling HTTP POST requests.
URL Verification Handshake
After saving your endpoint, Rye sends a verification challenge. Your endpoint must respond with the ID of the webhook endpoint, found under Expected Response:
source.id:Verification Request:Implement Signature Verification
Each webhook includes a cryptographic signature to verify its authenticity. See the verification section below.
Payload Format
Most webhook payloads are thin events — they contain the resource ID and the event type, not the full resource. To get the complete state, call the API after receiving the event. Example Payload:Thin events keep webhook payloads small and stable. The API always returns the most current state of the resource, so fetching after notification ensures you have the latest data.
product.updated) also include a data field carrying a snapshot of the resource at the time the event was emitted. This is a convenience for consumers that don’t need strict consistency, but it does not replace fetching. The snapshot can be stale if events are delivered out of order or the underlying resource changes between emission and delivery. For authoritative state, still call the corresponding lookup endpoint using source.id — the same pattern as with thin events.
Webhook Headers
Every webhook request includes the following headers:| Header | Description |
|---|---|
x-rye-signature | HMAC-SHA256 signature for verifying authenticity. |
x-rye-event-id | Unique event ID. |
x-rye-timestamp | Unix timestamp (seconds) of the event delivery. |
x-rye-topic | The event topic (e.g., checkout_intent.completed). |
Verifying Webhook Signatures
Each webhook is signed using HMAC-SHA256 with your HMAC secret key, available in the Rye Console under the Webhooks section.Signature Format
Thex-rye-signature header contains a hex-encoded HMAC-SHA256 signature of the raw request body:
Verification Steps
SDKs contain anevent.unwrap(...) helper function which can be used to verify a signature and parse a webhook payload. If you are using a language we do not have an SDK for, you can manually verify webhook signatures by following the instructions below:
- Extract the signature value from the
x-rye-signatureheader (strip thev0=prefix). - Compute HMAC-SHA256 of the raw request body using your secret key.
- Hex-encode the result and compare with the extracted signature using a constant-time comparison.
- Reject the request if they do not match.
Code Examples
Best Practices
Process Webhooks Asynchronously
Webhook requests must respond within 5 seconds. Verify the signature, acknowledge receipt, and process the event in the background.Handle Out-of-Order Delivery
Webhooks may arrive out of order. Use thecreatedAt field to determine event ordering, or simply fetch the latest state from the API — since events are thin notifications, the API always returns the most current data.
Deduplicate Events
Each event has a deterministicid (e.g., evt_ci_abc123def456_completed). Store processed event IDs to skip duplicates:
- Extract the event
idfrom the payload. - Check if you’ve already processed this
id. - If yes, return
200without reprocessing. - If no, process the event and store the
id.

