Control classes

These events are emitted by the Inventory API (btrz-api-inventory) when control classes are created, updated, or deleted. The event controlclasses.authorizations.updated may be emitted by another flow (e.g. sales authorizations).

Events

Action Event name Endpoint
Create a control class controlclasses.created POST /control-classes
Update a control class controlclasses.updated PUT /control-classes/:controlClassId
Delete a control class controlclasses.deleted DELETE /control-classes/:controlClassId
Sales authorizations updated controlclasses.authorizations.updated (other flow)

Payload example created

{
  "attemptId": "03e7651b-3aa5-4d32-9601-991fec816a67",
  "created": 1628024835,
  "data": {
    "_id": "6109afcc598e472c24a437ce",
    "accountId": "52a377ec430c7d4e220001fc",
    "createdAt": {
      "offset": 0,
      "value": "2021-08-03T21:06:20.161Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "name": "R1",
    "parentId": "68d21992e029cd8755c55b51",
    "rootClassId": "68d21992e029cd8755c55b51",
    "props": {
      "productId": "68d219b0e029cd8755c55b53",
      "brandId": "68d219b0e029cd8755c55b54",
      "amenityGroupId": "68d219b0e029cd8755c55b56"
    },
    "priceModifier": {
      "type": "$",
      "value": 235000
    },
    "updatedAt": {
      "offset": 0,
      "value": "2021-08-03T21:06:20.161Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "controlclasses.created",
  "id": "24b4fd63-c0ba-4732-9aef-d379cfc81d4f",
  "livemode": true
}

Field descriptions — data (controlclasses.created / controlclasses.updated)

Field Type Description
_id string Control class id (24 hex characters).
accountId string Account (provider) id.
name string Unique name of this control class.
description string Description of this control class.
treeName string Unique name for the whole tree (root class only).
rootClassId string Root control class id if this is not a root (24 hex).
parentId string Parent control class id if not a root (24 hex).
props object Characteristics of a purchase this class applies to (productId required; may include amenityGroupId, brandId, fareId, fareClassId, seatClassId, operatingCompanyId, channel, advancePurchaseFrom, advancePurchaseTo).
priceModifier object Optional; type "%" or "$" and value.
childSelectionCriteria string Root only: "MOST_SPECIFIC" or "SALES_AUTHORIZATIONS_AVAILABILITY".
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.

Payload example updated

{
  "attemptId": "43489008-c98f-4711-beb8-362b4026f0fa",
  "created": 1628024836,
  "data": {
    "_id": "6109afcc598e472c24a437ce",
    "accountId": "52a377ec430c7d4e220001fc",
    "createdAt": {
      "offset": 0,
      "value": "2021-08-03T21:06:20.161Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "name": "R1",
    "parentId": "68d21992e029cd8755c55b51",
    "rootClassId": "68d21992e029cd8755c55b51",
    "props": {
      "productId": "68d219b0e029cd8755c55b53",
      "brandId": "68d219b0e029cd8755c55b54",
      "amenityGroupId": "68d219b0e029cd8755c55b56"
    },
    "priceModifier": {
      "type": "$",
      "value": 235000
    },    
    "updatedAt": {
      "offset": 0,
      "value": "2021-08-03T21:06:32.034Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "controlclasses.updated",
  "id": "c745cedd-d645-4649-aa2d-d85964ff85de",
  "livemode": true
}

(Field descriptions for data are the same as for controlclasses.created above.)

Payload example deleted

{
  "attemptId": "9c2abd36-aeaf-4528-ba1a-88fcd0caeabc",
  "created": 1628024835,
  "data": {
    "controlClassId": "61097f9c8eee37138528e012"
  },
  "event": "controlclasses.deleted",
  "id": "4ab81872-ee08-4457-9e73-b415aadc0be5",
  "livemode": true
}

Field descriptions — data (controlclasses.deleted)

Field Type Description
controlClassId string The deleted control class id (24 hex characters).

Payload example sales authorizations updated

{
  "attemptId": "9c2abd36-aeaf-4528-ba1a-88fcd0caeabc",
  "created": 1628024835,
  "data": {
    "providerId": "5f243d100617680712e78dd7",
    "apiKey": "5f243d100617680712e78dd7",
    "data": [
      {
        "scheduleId": "1d62a5f9-46f2-44b2-9e9c-2aa07714b10d",
        "date": "2025-12-02",
        "salesAuthorizations": [
          {
            "originStationId": "60a1b2c3d4e5f6a7b8c9d0e1",
            "destinationStationId": "60a1b2c3d4e5f6a7b8c9d0e2",
            "controlClassCode": "RBD1",
            "controlClassId": "6501a2b3c4d5e6f7a8b9c0d1",
            "authorization": 50,
            "externalTimestamp": "2025-11-30T16:45:49.178Z"
          }
        ],
        "success": true,
        "error": ""
      }
    ]
  },
  "event": "controlclasses.authorizations.updated",
  "id": "4ab81872-ee08-4457-9e73-b415aadc0be5",
  "livemode": true
}