Create a webhook subscription
const url = 'https://api-omni.linra.net/api/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com","eventTypes":["order.completed"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-omni.linra.net/api/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "eventTypes": [ "order.completed" ] }'The response’s secret is shown EXACTLY ONCE — store it immediately. Up to 5 active
subscriptions per partner (BUSINESS_WEBHOOK_SUBSCRIPTION_LIMIT above that). See the
Webhooks guide for the full HMAC verification walkthrough.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Must be a public HTTPS URL — private/loopback/link-local addresses are rejected (SSRF guard), re-checked on every delivery attempt.
Responses
Section titled “Responses”The subscription, plus its one-time secret.
object
object
object
object
Shown exactly once — store it now. Used as the HMAC signing key.
Example
{ "state": "SUCCESS"}Request validation failed.
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Active-subscription cap exceeded.
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Examples
{ "state": "BUSINESS_WEBHOOK_SUBSCRIPTION_LIMIT", "payload": null, "details": { "limit": 5 }}Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Headers
Section titled “Headers”Seconds to wait before retrying.