Taxes
These events are emitted by the Inventory API (btrz-api-inventory) when taxes are created or updated.
Events
| Action | Event name | Endpoint |
|---|---|---|
| Create a tax | taxes.created | POST /taxes |
| Update a tax | taxes.updated | PUT /taxes/{taxId} |
Payload example created
{
"attemptId": "8616e92c-997b-4e2c-9390-b9d305e42070",
"created": 1623871550,
"data": {
"_id": "60ca5028571a9a3fa5203637",
"accountId": "52a377ec430c7d4e220001fc",
"createdAt": {
"offset": 0,
"value": "2021-06-16T19:25:28.511Z"
},
"deleted": false,
"disabled": false,
"isBorder": false,
"name": "VAT",
"province": "all",
"updatedAt": {
"offset": 0,
"value": "2021-06-16T19:25:28.515Z"
},
"value": 12000
},
"event": "taxes.created",
"id": "2cbe7a06-d376-462c-b824-02d13a1f9aac",
"livemode": true
}
Field descriptions — data (taxes.created / taxes.updated)
| Field | Type | Description |
|---|---|---|
| _id | string | Tax id (24 hex characters). |
| accountId | string | Account (provider) id. |
| name | string | Name of the tax. |
| value | number | Tax value (e.g. percentage or fixed amount). |
| isBorder | boolean | Whether the tax is a border tax. |
| country | string | Country where the tax is applied. |
| countryISOCode | string | Country ISO code where the tax is applied. |
| province | string | Province where the tax is applied (e.g. "all" for all provinces). |
| disabled | boolean | Whether the tax is disabled. |
| deleted | boolean | Whether the tax is soft-deleted. |
| validFrom | object | BzDate: date from which the tax is valid. |
| validTo | object | BzDate: date until which the tax is valid (optional). |
| createdBy | string | User id that created the resource (24 hex). |
| updatedBy | string | User id that last updated the resource (24 hex). |
| createdAt | object | BzDate: when the object was created. |
| updatedAt | object | BzDate: when the object was last updated. |
Payload example updated
{
"attemptId": "0300494a-4744-42c1-8b86-ee6792c5543f",
"created": 1623871550,
"data": {
"_id": "60ca5028571a9a3fa5203637",
"accountId": "52a377ec430c7d4e220001fc",
"createdAt": {
"offset": 0,
"value": "2021-06-16T19:25:28.511Z"
},
"deleted": false,
"disabled": false,
"isBorder": false,
"name": "VAT",
"province": "MN",
"updatedAt": {
"offset": 0,
"value": "2021-06-16T19:25:34.464Z"
},
"value": 12000
},
"event": "taxes.updated",
"id": "e9284ba6-ab75-46d4-8173-eccfeef02097",
"livemode": true
}
(Field descriptions for data are the same as for taxes.created above.)