These events are emitted by the Inventory API (btrz-api-inventory) when fees are created or updated.
Events
| Action | Event name | Endpoint |
|---|---|---|
| Create a fee | fee.created | POST /fees |
| Update a fee | fee.updated | PUT /fees/:feeId |
Payload example for created
{
"attemptId": "15b0691c-77f5-4b83-9d2d-ad74d9fbbf1e",
"created": 1623793727,
"data": {
"_id": "60c9200d17bda93f5c896bf3",
"accountId": "52a377ec430c7d4e220001fc",
"createdAt": {
"offset": 0,
"value": "2021-06-15T21:47:57.603Z"
},
"deleted": false,
"fareClassId": "",
"internalId": "tt",
"isRefundable": false,
"lexiconKeys": {
"name": "fees-name-52a377ec430c7d4e220001fc-18d10b0e-3749-43d6-b649-d52582bae4ab"
},
"name": "ads",
"products": {
"52a377ec430c7d4e220001fe": 1,
"reservation": 1
},
"rules": {
"no": 1
},
"taxable": false,
"updatedAt": {
"offset": 0,
"value": "2021-06-15T21:47:57.618Z"
},
"userId": "55fc2f318791db6e1a0000b6",
"value": 0,
"valueType": "$"
},
"event": "fee.created",
"id": "ed7c890d-783e-43f7-8891-f87a02101c02",
"livemode": true
}
Field descriptions — data (fee.created / fee.updated)
| Field | Type | Description |
|---|---|---|
| _id | string | Fee id (24 hex characters). |
| accountId | string | Account (provider) id. |
| internalId | string | Fee internal id. |
| name | string | Name of the fee. |
| valueType | string | Type of value: "$" or "%". |
| value | number | Fee amount value. |
| minAmount | number | Minimum value when valueType is % (optional). |
| maxAmount | number | Maximum value when valueType is % (optional). |
| rules | object | Rule flags for this fee (e.g. cancel, ticket, transaction, changePerTicket). Each key is a rule name; value 1 means the rule applies. |
| products | object | Product ids for this fee (keys are product IDs). |
| fareClassId | string | Fare class id for this fee (optional). |
| brandId | string | Brand id (optional). |
| taxable | boolean | Whether the fee is taxable. |
| isRefundable | boolean | Whether the fee is refundable. |
| applyOnZeroBalance | boolean | For transaction fees: whether to apply when balance is zero (optional). |
| chargeOnlyOnNewTransactions | boolean | For ticket change: whether the fee is applied only once (optional). |
| overrideRules | array | Time-window overrides for fee value; only for changePerTicket or cancel rules (optional). |
| lexiconKeys | object | Lexicon keys for the name. |
| deleted | boolean | Whether the fee is marked deleted. |
| createdBy | string | User id that created this resource (24 hex). |
| updatedBy | string | User id that last updated this resource (24 hex). |
| createdAt | object | BzDate: date the object was created. |
| updatedAt | object | BzDate: date the object was last updated. |
| userId | string | (If present) User id associated with the resource. |
Payload example for updated
{
"attemptId": "e01d9123-9d46-4f2f-8580-0e76698cc7c1",
"created": 1623793656,
"data": {
"_id": "602c37b2a040f6e2d36d4ea0",
"accountId": "52a377ec430c7d4e220001fc",
"createdAt": {
"offset": 0,
"value": "2021-02-16T21:22:58.565Z"
},
"deleted": false,
"fareClassId": "",
"internalId": "ha",
"isRefundable": false,
"lexiconKeys": {
"name": "fees-name-52a377ec430c7d4e220001fc-202699df-5d64-4d1c-8f31-d474fef79acd"
},
"name": "ha",
"products": {
"52a377ec430c7d4e220001fe": 1,
"reservation": 1
},
"rules": {
"transaction": 1
},
"taxable": false,
"updatedAt": {
"offset": 0,
"value": "2021-06-15T21:47:29.340Z"
},
"userId": "55fc2f318791db6e1a0000b6",
"value": 0,
"valueType": "$"
},
"event": "fee.updated",
"id": "d90260dc-947a-44ff-af5f-14e666bafd76",
"livemode": true
}
(Field descriptions for data are the same as for fee.created above.)