Skip to content

Create a webhook subscription

POST
/api/v1/webhooks
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.

Media typeapplication/json
object
url
required

Must be a public HTTPS URL — private/loopback/link-local addresses are rejected (SSRF guard), re-checked on every delivery attempt.

string format: uri
eventTypes
required
Array<string>
>= 1 items
Allowed values: order.completed order.failed order.cancelled order.returned order.fulfilment-updated variant.back-in-stock order.return-request.updated

The subscription, plus its one-time secret.

Media typeapplication/json
object
state
required
string
payload
required
details
object
payload
required
object
subscription
object
id
string format: uuid
partnerId
string format: uuid
url
string format: uri
eventTypes
Array<string>
isActive
boolean
lastDeliveryAt
string format: date-time
nullable
lastDeliveryStatus
string
nullable
createdAt
string format: date-time
nullable
secret

Shown exactly once — store it now. Used as the HMAC signing key.

string
Example
{
"state": "SUCCESS"
}

Request validation failed.

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}

Active-subscription cap exceeded.

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Examples
Examplelimit
{
"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).

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}
Retry-After
integer

Seconds to wait before retrying.