Subscribe to webhook events
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Create a webhook subscription to receive real-time notifications when events occur in your Lirium account.
Request
POST /webhooks/subscriptions
Request Body
Send one entry per event you want to receive. Each entry pairs an action with the URL that action is delivered to, so different events can go to different endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
subscriptions | array | Yes | Subscriptions to create. |
subscriptions[].action | string | Yes | Event to subscribe to. See Supported Event Types. |
subscriptions[].url | string | Yes | URL the event is delivered to. See URL Requirements. |
Subscribing an action that is already subscribed replaces its URL.
Supported Event Types
order-closed- Order has been completed or cancelledorder-updated- Order status has changedpartner-order-created- Partner order has been createdpartner-order-closed- Partner order has been completed or cancelledpartner-order-updated- Partner order status has changedcustomer-product-changed- The state of one of a customer's products has changedcustomer-requirement-rejected- Customer KYC requirement was rejectedincoming-funds- Funds have been received at a receiving address
URL Requirements
The URL is validated when the subscription is created, and again before each delivery. It must:
- Use
https. - Have a host that resolves to a public address. Hosts resolving to private, loopback, link-local, reserved, multicast or unspecified addresses are rejected.
- Be resolvable at the time you subscribe.
Local Endpoints Are Not Reachable
https://localhostand private-network hosts are rejected. To receive events on a local machine, expose it through a public tunnel and subscribe the tunnel'shttpsURL.
Example Request
{
"subscriptions": [
{
"action": "order-closed",
"url": "https://your-server.com/webhooks/orders"
},
{
"action": "customer-product-changed",
"url": "https://your-server.com/webhooks/customers"
}
]
}Example Response
{
"subscriptions": [
{
"action": "order-closed",
"url": "https://your-server.com/webhooks/orders"
},
{
"action": "customer-product-changed",
"url": "https://your-server.com/webhooks/customers"
}
]
}Errors
| Status | error_code | Cause |
|---|---|---|
| 400 | invalid_parameters | Unknown action, or a url that is not https or has no host. |
| 400 | invalid_webhook_url | The url host resolves to a disallowed address, or could not be resolved. |
{
"error_code": "invalid_webhook_url",
"error_msg": "Webhook url resolves to a disallowed address"
}Security
All webhook calls include a JWT signature in the X-JWT-SIGNATURE header. See Webhooks Signature for verification details, and the Webhook Signature Verification recipe for a ready-to-use helper.
Your endpoint must:
- Use HTTPS
- Respond with a 2xx status code within 30 seconds
- Be idempotent (handle duplicate deliveries gracefully)
Deliveries do not follow redirects — subscribe the final URL rather than one that redirects to it.
