Tax-exceptions

Tax exceptions

These events are emitted by the Inventory API (btrz-api-inventory) when tax exceptions are created, updated, or deleted.

Events

Action Event name Endpoint
Create a tax exception tax.exception.created POST /taxes/exceptions
Update a tax exception tax.exception.updated PUT /taxes/exceptions/{taxExceptionId}
Delete a tax exception tax.exception.deleted DELETE /taxes/exceptions/{taxExceptionId}

Payload example created / updated

For tax.exception.created and tax.exception.updated, the payload data object is the full tax exception document.

{
  "attemptId": "uuid",
  "created": 1623864385,
  "data": {
    "_id": "5f243d100617680712e78dd7",
    "accountId": "5f243d100617680712e78dd7",
    "origin": {
      "id": "5f243d100617680712e78dd7",
      "name": "Origin Station"
    },
    "destination": {
      "id": "5f243d100617680712e78dd8",
      "name": "Destination Station"
    },
    "routeId": "5f243d100617680712e78dd9",
    "tripDistance": {
      "exempt": 100,
      "taxable": 50
    },
    "createdBy": "5f243d100617680712e78dd0",
    "updatedBy": "5f243d100617680712e78dd0",
    "createdAt": { "offset": 0, "value": "2021-06-16T17:26:24.695Z" },
    "updatedAt": { "offset": 0, "value": "2021-06-16T17:26:24.695Z" }
  },
  "event": "tax.exception.created",
  "id": "uuid",
  "livemode": true
}

Field descriptions — data (tax.exception.created / tax.exception.updated)

Field Type Description
_id string Tax exception id (24 hex characters).
accountId string Account (provider) id.
origin object Origin station: id (station id), name (station name).
destination object Destination station: id (station id), name (station name).
routeId string Optional route id associated with the tax exception (24 hex).
tripDistance object Exempt and taxable distance: exempt (integer), taxable (integer).
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 deleted

For tax.exception.deleted, the payload data object contains only the deleted tax exception id.

{
  "attemptId": "uuid",
  "created": 1623864400,
  "data": {
    "taxExceptionId": "5f243d100617680712e78dd7"
  },
  "event": "tax.exception.deleted",
  "id": "uuid",
  "livemode": true
}

Field descriptions — data (tax.exception.deleted)

Field Type Description
taxExceptionId string The id of the deleted tax exception (24 hex characters).