POST request with the event details each time something happens: payment created, awaiting payment, confirming, executing, completed, refunded, expired, failed, or partially paid.
Set up a webhook
Register and manage webhook endpoints in the CoinVoyage Dashboard under the Developers section.1
Navigate to Developers -> Webhooks
Open the CoinVoyage Dashboard, select Developers in the sidebar, then click Webhooks.
2
Click Add Webhook
Click the Add Webhook button to open the registration form.
3
Enter your endpoint URL
Provide the URL of your publicly accessible webhook handler.
4
Select the events to subscribe to
Choose which order lifecycle events should trigger delivery to your endpoint. Subscription event identifiers use uppercase
ORDER_* format, for example ORDER_COMPLETED.5
Save and store your Webhook Secret
Save the webhook. CoinVoyage generates a Webhook Secret. Store it securely, for example as
COIN_VOYAGE_WEBHOOK_SECRET. You need this secret to verify the signature on every incoming request.Your endpoint must be publicly accessible and respond with a
2xx status code within 30 seconds. Responses outside this window are treated as delivery failures.Delivery payload
CoinVoyage v3 delivers the same event envelope to registered webhooks and/v3/ws subscribers:
event to dispatch business logic and order.id as the CoinVoyage payment lifecycle ID. Use order.metadata to reconcile back to your internal order, invoice, account, or customer.
Verify webhook signatures
Every webhook request includes aCoinVoyage-Webhook-Signature header containing an HMAC-SHA256 signature of the raw request body, encoded in Base64. Always verify this signature before parsing or acting on the payload.
The example below shows a complete Next.js Route Handler that verifies the signature and dispatches on the event identifier:
app/api/webhook/route.ts
Read the raw request body with
req.text() before calling JSON.parse. Web Fetch API request bodies can only be read once, so read once as text, verify the signature, then parse.Security best practices
- Verify the signature before parsing or acting on the payload.
- Use a constant-time comparison such as
timingSafeEqualfor signature checks. - Use HTTPS in production.
- Store your Webhook Secret securely in a server-side secret store.
- Return a
2xxresponse quickly and move heavy work to a queue or background job. - Make event handling idempotent by
event,delivered_at, andorder.id, plus your own internal ID fromorder.metadata. - Return
200for event types you intentionally ignore so delivery does not retry forever.