Skip to content

Webhooks

A webhook is a callback which enables our API to notify your system of new events concerning your transactions. Whenever objects in the Glo Currency API change state, we can optionally send the object details to a pre-registered webhook address. Webhooks can be created using the Glo Currency API.

Whenever possible we prefer using webhooks to listen on events (for example when a transaction has been paid out) instead of polling the status, and we expect implementations fully utilising webhooks.

Webhooks will always generate a POST request to the specified endpoint, and will also include Authorization-Nonce and Authorization-Signature authentication headers, so their validity can be verified on the receiver end.

You’ll need to reply to the endpoint call with a successful status code (e.g. 200), otherwise we’ll assume that the webhook was not delivered.

We sending request to specified endpoint only once, to ensure you receive events in the correct order.

The structure of the body we send will follow the following template:

{
    "webhook_id": // the ID of the webhook
    "event_type": // the specific event
        // that was triggered
    "data": {
        // details of
        // the object on which
        // the event happened
    }
}

Creating webhooks

To register the webhook you should send us event_type and uri:

You can have one registered webhook for each event_type.

POST /webhooks

{
    "event_type": "sender.approved",
    "uri": "https://example.com"
}

event_type is a combination of object type and state.

For transaction events please use transaction.[TRANSACTION_STATE], for sender events you should use sender.[SENDER_STATE].

Obtaining webhooks

To get the full list of webhooks registered for you should send the following request:

GET /webhooks

Deleting webhooks

To remove the webhook you should send DELETE request with the WEBHOOK_ID from the previous step.

DELETE /webhooks/[WEBHOOK_ID]