These events are emitted by the Inventory API (btrz-api-inventory) when promos are created, updated, or disabled. Events are emitted from the promos data service and from handlers (e.g. delete, patch rule availability).
Events
| Action |
Event name |
Endpoint |
| Create a promo |
promo.created |
POST /promos |
| Update a promo or a promo rule |
promo.updated |
PATCH /promos/:promoId, PATCH /promo/:promoId, PUT /promos/:promoId/rules/:ruleId |
| Disable a promo |
promo.deleted |
DELETE /promos/:promoId |
Payload example
{
"id": "string",
"attemptId": "string",
"livemode": "boolean",
"created": "int",
"event": "string",
"data": {
"_id": "string",
"valueType": "string",
"value": "int",
"validPeriod": {
"to": "string",
"from": "string"
},
"userId": "string",
"updatedByUserEmail": "string",
"updatedBy": "string",
"to": "string",
"rules": [],
"qty": "int",
"productType": "string",
"name": "string",
"internalId": "string",
"from": "string",
"fare": "string",
"disabled": "boolean",
"createdByUserEmail": "string",
"createdBy": "string",
"campaign": "string",
"available": "int",
"appliesOnlyWhenLoggedIn": "boolean",
"accountId": "string",
"deleted": "boolean",
"createdAt": {
"value": "string",
"offset": "int"
},
"updatedAt": {
"value": "string",
"offset": "int"
}
}
}
| Field |
Type |
Description |
| id |
string |
Unique id of the webhook event. |
| attemptId |
string |
Id of the delivery attempt. |
| livemode |
boolean |
Whether the event is from live or test mode. |
| created |
number |
Unix timestamp when the event was created. |
| event |
string |
Event name: promo.created, promo.updated, or promo.deleted. |
| data |
object |
The promo that was created, updated, or disabled (Promo model). |
| data._id |
string |
Promo id (24 hex characters). |
| data.accountId |
string |
Account (provider) id. |
| data.internalId |
string |
Shown id of the promo (e.g. code). |
| data.name |
string |
Name of the promo. |
| data.campaign |
string |
Campaign the promo belongs to. |
| data.disabled |
boolean |
Whether the promo is disabled. |
| data.rules |
array |
Array of PromoRule. |
| data.validPeriod |
object |
Optional validity window (from, to). |
| data.autoApply |
boolean |
Whether the promo is auto-applied when adding items to a cart. |
| data.cancellable |
boolean |
Whether tickets with this promo are cancellable (unless overridden). |
| data.changeable |
boolean |
Whether tickets with this promo are changeable (unless overridden). |
| data.createdBy |
string |
User id that created the resource. |
| data.updatedBy |
string |
User id that last updated the resource. |
| data.createdAt |
object |
BzDate: when the promo was created. |
| data.updatedAt |
object |
BzDate: when the promo was last updated. |