Items webhooks
This page documents webhook events related to items from the Inventory API (items resource).
Inventory API – items resource
Emitted when an item is created (POST /items) or updated (PUT /items/:itemId).
Events (Inventory API)
| Action | Event name | Endpoint |
|---|---|---|
| Create an item | items.created |
POST /items |
| Update an item | items.updated |
PUT /items/:itemId |
Payload example – created (Inventory API)
The data object for items.created is the full created item (same shape as the API response item).
{
"attemptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created": 1623794000,
"data": {
"_id": "60c92280d9e6c43f77b5a583",
"name": "Item name",
"type": "paid_in",
"amount": 100,
"valueType": "$",
"productId": "5f243d100617680712e78dd7",
"order": 1,
"disabled": false,
"taxable": true,
"printable": true,
"createdAt": { "offset": 0, "value": "2021-06-15T12:00:00.000Z" },
"updatedAt": { "offset": 0, "value": "2021-06-15T12:00:00.000Z" }
},
"event": "items.created",
"id": "uuid",
"livemode": true
}
Payload example – updated (Inventory API)
The data object for items.updated is the full updated item (same shape as the API response item).
{
"attemptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created": 1623794000,
"data": {
"_id": "60c92280d9e6c43f77b5a583",
"name": "Item name",
"type": "paid_in",
"amount": 100,
"valueType": "$",
"productId": "5f243d100617680712e78dd7",
"order": 1,
"disabled": false,
"taxable": true,
"printable": true,
"createdAt": { "offset": 0, "value": "2021-06-15T12:00:00.000Z" },
"updatedAt": { "offset": 0, "value": "2021-06-15T12:30:00.000Z" }
},
"event": "items.updated",
"id": "uuid",
"livemode": true
}
Field descriptions – data (created / updated)
data matches the Inventory API Item schema. Main fields:
| Field | Type | Description |
|---|---|---|
| _id | string | Item id (24 hex characters). |
| name | string | The name of the item. |
| type | string | The type of the item: paid_in or paid_out. |
| amount | number | The amount of the item. |
| valueType | string | The amount type: $ or %. |
| productId | string | The product id (24 hex characters). |
| order | number | The order of the item. |
| disabled | boolean | If the item is disabled. |
| taxable | boolean | If the item is taxable. |
| printable | boolean | If the item is printable. |
| attachToTicket | boolean | If true it needs to be associated to an associatedProductId. |
| associatedProductId | string | The associated product id (when attachToTicket is true). |
| stationProductId | string | The station product id. |
| stationId | string | The station id. |
| routeIds | array of string | The route ids. |
| channels | array of string | The channels where the item is allowed to be sold (e.g. agencyBackoffice, agencyWebsales, websales, backoffice). |
| useVariablePricingByDate | boolean | If true, the item's price is determined by pricingRules for a given date. |
| pricingRules | array | The pricing configuration for different date ranges (when useVariablePricingByDate is true). |
| createdBy | string | The user that created this resource. |
| updatedBy | string | The last user that updated this resource. |
| createdAt | object | The date the object was created (BzDate: offset, value). |
| updatedAt | object | The date the object was last updated (BzDate: offset, value). |
Other fields may be present as defined in the Inventory API Item and related schemas (e.g. fields, journeyRestrictions, shiftLocations, dynamicForm).