webhookWebhooks

ZayPay can notify your app in real time when an order status changes.

This is useful for dApps like wallets or launchpads to:

  • Update user balances immediately

  • Trigger notifications (e.g. when a swap completes or fails)

  • Start follow-up workflows

Setup

πŸ‘‰ To enable webhooks, contact your Zay Pay account manager and provide them with the HTTPS URL of your webhook endpoint.

Requirements:

  • The URL must be HTTPS (in production)

  • Must accept POST requests

  • Must return a 2xx response on success

Webhook Body Format

Each webhook request is sent as a JSON object in the request body.

Field
Type
Description

event_type

string

Type of the event. Possible values: order_status_changed.

subject_type

string

Type of the object that triggered the event. Possible values: Order.

subject_id

string

Unique identifier (UUID) of the object that triggered the event.

payload

object

The object data. For orders, this is a full Order object. See the API referencearrow-up-right for full schema.

Events

order_status_changed

Sent whenever an order’s status changes.

Order Status Values

The payload.order.status field can take the following values:

  • creating – Order is being created

  • transfer_pending – Waiting for deposit

  • deposit_received – Deposit confirmed

  • completed – Order completed successfully

  • cancelled – Order was cancelled or expired

  • kyc_required – KYC verification needed

  • refund_initiated – Refund process started

  • refund_completed – Refund completed

  • refund_failed – Refund failed

  • creation_blocked – Order creation blocked

  • creation_rate_limited – Too many requests, creation rate limited

  • deposit_only – Deposit-only mode (e.g. SOL to SOL)

Payload Example

Last updated