Configure an endpoint
- Open the Partner Dashboard.
- Select the organization and app.
- Open Webhooks, add the endpoint URL, and create the webhook.
- Copy the webhook secret and store it in your server’s secret manager.
Verify every request
Layerswap uses Svix for webhook delivery. Verify the raw request body and Svix signature headers with the app’s webhook secret before parsing or acting on the payload. Follow the Svix payload verification guide for your server framework. Reject invalid signatures and keep verification ahead of any balance credit, order fulfillment, or database state transition.Payload shape
Webhook data describes the swap at the status available when the event is sent. Expect swap identifiers and lifecycle fields to be central, with quote and transaction data becoming available as processing progresses. A representative shape is:GET /swaps/{id} before executing irreversible business logic.
Receiver checklist
- Read the raw body before JSON middleware changes it.
- Verify the Svix signature and reject stale or invalid requests according to the verification library.
- Deduplicate side effects by swap ID and resulting status or transaction hash.
- Return a success response only after the event is durably accepted.
- Process asynchronously when downstream work can exceed the request timeout.
- Reconcile periodically with Track swaps.