Create Webhook

Register a webhook endpoint to receive real-time notifications when orders are filled, deposits are received, or withdrawals complete.

POST/api/v1/webhooksRequires authentication
Store the secret immediately
The secret is only returned once, in the creation response. Store it securely - you need it to verify webhook signatures.

Request body

urlstringREQUIRED
HTTPS endpoint URL to receive webhook payloads
eventsstring[]REQUIRED
Events to subscribe to (minimum 1)One of: order.filledorder.faileddeposit.receivedwithdrawal.completed
Request examples
curl -X POST https://merx.exchange/api/v1/webhooks \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/merx",
    "events": ["order.filled", "order.failed"]
  }'

Response

201Webhook created
{
  "id": "wh_abc123",
  "user_id": "usr_xyz",
  "url": "https://example.com/webhooks/merx",
  "events": ["order.filled", "order.failed"],
  "secret": "a1b2c3d4...64_hex_chars...",
  "is_active": true,
  "created_at": "2026-03-29T12:00:00Z"
}

Response fields

idstringUnique webhook identifier
user_idstringOwner user identifier
urlstringRegistered endpoint URL
eventsstring[]Subscribed event types
secretstringHMAC signing secret (64 hex characters) - shown only once
is_activebooleanWhether the webhook is active
created_atstringISO 8601 creation timestamp