Subscribe
Creates a new webhook subscription. After creation the API sends a verification POST to
your url containing a X-Hook-Ping header. Your endpoint must respond with a matching
X-Hook-Pong header to activate the subscription.
Subscription states
| Status | Description |
|---|---|
pending |
Created, awaiting verification |
active |
Verified and receiving events |
failed_activation |
Verification was rejected |
failed |
Disabled after 3 consecutive delivery failures |
disabled |
Manually disabled or target returned 410 |
Available event topics
Orders: orders, orders.created, orders.created.checkout, orders.updated,
orders.updated.placed, orders.updated.closed, orders.updated.shipped,
orders.updated.cancelled, orders.deleted
Products: products, products.created, products.updated, products.deleted,
products.updated.variants.created, products.updated.variants.updated,
products.updated.variants.deleted, products.updated.assets.created,
products.updated.assets.deleted
POST
/hub/{shop_id}/subscriptionsAuthorization
AuthorizationBearer token (JWT) · headerrequiredOAuth 2.0 Bearer token. Obtain via `POST https://auth.onbolder.com/oauth/token`.
Path parameters
shop_idintegerrequiredRequest body
requiredapplication/jsontopicstringrequiredEvent topic to subscribe to, e.g. `orders.updated.placed`
urlstringrequiredURL to POST event notifications to
notify_originbooleanWhether to notify the originating app
default: true
authSubscriptionAuthShow propertiesHide properties
typestringAllowed:
nonebasicusernamestringpasswordstringResponses
201Subscription created (pending verification)
idintegerstatusstringAllowed:
pendingactivefailed_activationfaileddisabledtopicstringurlstringnotify_originbooleanauthSubscriptionAuthShow propertiesHide properties
typestringAllowed:
nonebasicusernamestringpasswordstringerror_countintegerlast_errorstring | nullcreated_onstring<date-time>updated_onstring<date-time>_linksobject422Validation errors
_classstring[]_embeddedobjectShow propertiesHide properties
errorsobject[]Show propertiesHide properties
Array of
object_classstring[]fieldstringmessagesstring[]Request
curl -X POST "https://api.onbolder.com/v1/hub/0/subscriptions" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"topic": "string",
"url": "string",
"notify_origin": true,
"auth": {
"type": "none",
"username": "string",
"password": "string"
}
}'const response = await fetch("https://api.onbolder.com/v1/hub/0/subscriptions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"topic": "string",
"url": "string",
"notify_origin": true,
"auth": {
"type": "none",
"username": "string",
"password": "string"
}
})
});import requests
response = requests.post(
"https://api.onbolder.com/v1/hub/0/subscriptions",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"topic": "string",
"url": "string",
"notify_origin": True,
"auth": {
"type": "none",
"username": "string",
"password": "string"
}
},
)Response
{
"id": 0,
"status": "pending",
"topic": "string",
"url": "string",
"notify_origin": true,
"auth": {
"type": "none",
"username": "string",
"password": "string"
},
"error_count": 0,
"last_error": "string",
"created_on": "2019-08-24T14:15:22Z",
"updated_on": "2019-08-24T14:15:22Z",
"_links": {}
}{
"_class": [
"string"
],
"_embedded": {
"errors": [
{
"_class": [
"string"
],
"field": "string",
"messages": [
"string"
]
}
]
}
}