Skip to main content
WEBHOOK

Authorizations

Authorization
string
header
required

Authorization: Bearer <key>. Sandbox keys start with mgw_test_ and live keys start with mgw_live_. Each key works only in its own environment, and a live key works only from the IP addresses or ranges registered for it.

Headers

webhook-id
string
required

The event's id. It's the same on every attempt, so use it to drop repeats.

Pattern: ^msg_[0-9a-f]{24}$
webhook-timestamp
string
required

When we sent this attempt, in seconds since 1970-01-01 UTC. Refuse one too far from your own clock: see Webhooks.

Pattern: ^[0-9]+$
webhook-signature
string
required

v1, and the base64 HMAC-SHA256 of webhook-id, webhook-timestamp and the body, joined by full stops, keyed with your signing secret. More than one, separated by spaces, while a secret is being rotated.

Body

application/json
object
string
required
Allowed value: "event"
id
string
required

Unique identifier for the event. Starts with msg_. Matches the webhook-id header the event was sent with.

Pattern: ^msg_[0-9a-f]{24}$
type
enum<string>
required

What changed, followed by the state the change moved it to. New types can appear: ignore any you don't handle.

Available options:
allocation.booked,
allocation.refused,
allocation.rejected,
allocation.uncertain,
application.opened,
application.refused,
application.rejected,
application.submitted,
application.uncertain,
application.unplaced,
order.cancelled,
order.expired,
order.filled,
order.partially_filled,
order.pending,
order.refused,
order.rejected,
order.uncertain
timestamp
string<date-time>
required

The updated_at of the order, application or allocation.

version
integer<int64>
required

Increases with each of your events and is never reused. Other partners' events never move it. Compare it per object: ignore an event whose version is lower than the last you applied to that object.

data
object
required

The order, application or allocation as the change left it, exactly as its GET returned it then. Its object field says which.

Response

200

Any 2xx tells us you have the event. Anything else, or no answer in time, and we send it again later.