Skip to main content
Not available yet. Webhooks are implemented but switched off for every account, in both the test and the production environment: every webhook endpoint answers 404 and no events are sent. These pages describe exactly how they work, so you can build your receiver now. Your Bullionwale relationship manager will tell you when they are turned on.
A webhook is an HTTPS endpoint of yours that Bullionwale calls when something happens on your account: an order is booked, closed or rejected, or a limit order is placed, triggered or cancelled. Instead of polling GET /orders, your program is told. This page covers the webhook object and the calls that manage it; the Webhooks guide covers events, signatures and retries. Each path sits under the test base path or the production base path: Neither scope is on a key by default: ask for webhooks:read and webhooks:write when you ask for the key (see the Scope reference). Every webhook call counts against the key’s read budget (see Rate limits). A webhook belongs to one environment. One created on the test path receives only test events and is visible only on the test path. One created on the production path receives only production events (your real orders and limit orders, from every channel) and is visible only there. The id of a webhook from the other environment answers 404 webhook_not_found.

The webhook object

200 OK

Create a webhook

POST /webhooks takes:
The answer is 201 Created with the webhook and its signing secret:
201 Created
The secret is shown only in this response (and in the answer to a rotation); it is never returned again. Store it with your other credentials. It is whsec_ followed by 43 characters, and the whole string, prefix included, is the key you verify signatures with.
Each account can have at most 5 webhooks per environment, paused ones included. A sixth is refused with 409 webhook_limit_reached.

URL rules

The URL is checked when you create or change a webhook, and the address it resolves to is checked again on every delivery. It must:
  • use https;
  • carry no user name, password or #fragment;
  • resolve, and resolve only to public internet addresses: private, loopback, link-local, shared and cloud-metadata addresses are refused, as are local network names.
A URL that breaks a rule is refused with 422 invalid_webhook_url. Put any token of your own in the path or query string, not in a user name or password.

List and read

GET /webhooks returns items, every webhook of your account in the calling environment, oldest first, and total. GET /webhooks/{webhook_id} returns one.
200 OK

Change or pause a webhook

PATCH /webhooks/{webhook_id} changes url, events, description or active. Send only the fields to change; a new url is checked against the URL rules again.
200 OK
While a webhook is paused, no new events are owed to it: events that happen during the pause are not sent later. Deliveries it was already owed are held, and go out once you set active back to true.

Delete a webhook

DELETE /webhooks/{webhook_id} answers 204 No Content. The webhook is gone, and so is every delivery it was still owed.

Send a test event

POST /webhooks/{webhook_id}/test queues one webhook.test event to that webhook, signed and retried like any other delivery, whatever its events list. Use it to check your receiver end to end. A paused webhook answers 409 webhook_inactive. At most 5 test events per minute per webhook; more answer 429 rate_limited with Retry-After.
202 Accepted
event_id is the id your endpoint receives in the body, and delivery_id the X-Bullionwale-Delivery header.

Rotate the signing secret

POST /webhooks/{webhook_id}/rotate-secret replaces the signing secret at once and returns the webhook with the new secret, shown only in this response. Every delivery signed from then on, including retries of earlier events, uses the new secret; the old one stops verifying immediately, with no overlap. Switch your receiver to the new secret straight away.
The answer has the same shape as the answer to create, with a new secret and secret_last4.

Errors

The full list is in the Error reference.