Skip to main content
Webhooks allow you to receive real-time HTTP notifications when events occur on your orders or returns. Instead of polling the API for updates, configure a webhook URL to receive automatic notifications.

Configuration

Configure your webhook URL in the Zinc dashboard under Settings. You can also generate a webhook secret for signature verification.

Webhook Secret

Your webhook secret is used to verify that incoming webhook requests are from Zinc. The secret format is:
Keep your webhook secret secure. If compromised, rotate it immediately in the dashboard. Rotating the secret invalidates the previous one.

Events

Order events

Return events

Return events carry an additional return_id field alongside order_id so you can route by return without parsing the data object. The status field on these events reflects the return-request status (not the order status).

Payload Structure

All webhook payloads follow this structure:

Payload Fields

Event-Specific Data

order.placed includes price components:
order.failed includes error information:
order.tracking_received includes the tracking numbers we received:
order.delivered fires when every package on the order has been delivered:
order.cancelled fires when the retailer cancels the order after placement. The order’s wallet hold is refunded at the same time:
return.created fires when a customer files a return against one of your orders. The data object echoes the return reason, free-text notes, and the line items being returned:
return.approved fires when the return is approved. Where applicable, the data object carries the merchant-issued return id and a printable label URL so you can hand them to the customer:
return.denied fires when the return is denied (e.g. outside the retailer’s return window). merchant_return_id and external_label_url are null on denied returns:
return.credited fires when the return is resolved by crediting the customer’s wallet rather than working a merchant RMA. There’s no carrier label or merchant return id in this flow:

Security

Webhook requests include headers for verification:

Verifying Signatures

To verify a webhook is from Zinc, compute the HMAC-SHA256 signature of the raw request body using your webhook secret and compare it to the X-Webhook-Signature header. Python Example:
Node.js Example:
Always verify webhook signatures before processing the payload to ensure the request originated from Zinc.

Best Practices

  1. Respond quickly - Return a 2xx status code as soon as possible. Process the webhook asynchronously if needed.
  2. Handle duplicates - Webhooks may occasionally be delivered more than once. Use the order_id to deduplicate.
  3. Verify signatures - Always validate the X-Webhook-Signature header before trusting the payload.
  4. Use HTTPS - Configure an HTTPS endpoint to ensure webhook data is encrypted in transit.
  5. Log events - Keep records of received webhooks for debugging and auditing.