Operation messages

Operation messages webhooks

This page documents webhook events related to operation messages from the Inventory API (operation-messages resource).


Inventory API – operation-messages resource

Emitted when an operation message is created (POST /operation-messages) or updated (PUT /operation-messages/:operationMessageId). No webhook is emitted on DELETE.

Events (Inventory API)

Action Event name Endpoint
Create an operation message operationmessage.created POST /operation-messages
Update an operation message operationmessage.updated PUT /operation-messages/:operationMessageId

Payload example – created (Inventory API)

The data object for operationmessage.created is the full created operation message (same shape as the API response).

{
  "attemptId": "84d56438-d39c-4598-bf79-1b4cdd02da24",
  "created": 1623859016,
  "data": {
    "_id": "60ca1f483d6d6319a44fff7e",
    "accountId": "52a377ec430c7d4e220001fc",
    "active": true,
    "createdAt": {
      "offset": 0,
      "value": "2021-06-16T15:56:56.071Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "displayOnTicket": true,
    "effectiveDateTimeEnd": {
      "offset": 0,
      "value": "2021-06-01T06:00:00.000Z"
    },
    "effectiveDateTimeStart": {
      "offset": 0,
      "value": "2021-06-01T05:00:00.000Z"
    },
    "lexiconKeys": {
      "message": "52a377ec430c7d4e220001fc-undefined-operationMessages-message-73abf35f-6713-440f-bc47-d30c93862a6b"
    },
    "message": "qwe",
    "name": "test 4",
    "stationId": "",
    "type": "warning",
    "updatedAt": {
      "offset": 0,
      "value": "2021-06-16T15:56:56.071Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "operationmessage.created",
  "id": "5853a8d2-b610-4e60-a95d-0e1452b199a2",
  "livemode": true
}

Payload example – updated (Inventory API)

The data object for operationmessage.updated is the full updated operation message (same shape as the API response).

{
  "attemptId": "76762b8a-4be9-4ff5-925e-3e7f667e4f9c",
  "created": 1623859005,
  "data": {
    "_id": "5c5aee2bbb6401621996eb88",
    "accountId": "52a377ec430c7d4e220001fc",
    "active": false,
    "createdAt": {
      "offset": 0,
      "value": "2019-02-06T14:24:43.044Z"
    },
    "createdBy": "54eddf07d4558abf23000004",
    "displayOnTicket": false,
    "effectiveDateTimeEnd": {
      "offset": 0,
      "value": "2019-02-07T16:10:00.000Z"
    },
    "effectiveDateTimeStart": {
      "offset": 0,
      "value": "2019-02-06T06:00:00.000Z"
    },
    "lexiconKeys": {
      "message": "operationMessages-message-52a377ec430c7d4e220001fc-7e39f2d1-cdb1-4053-a767-cb5914a86aa8"
    },
    "message": "testing",
    "name": "Test 3",
    "stationId": "52a37bf1430c7d4e22000226",
    "type": "out-of-order",
    "updatedAt": {
      "offset": 0,
      "value": "2021-06-16T15:56:26.811Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "operationmessage.updated",
  "id": "087c2421-1433-462d-b7ef-58497df48c83",
  "livemode": true
}

Field descriptions – data (created / updated)

data matches the Inventory API OperationMessage schema. Main fields:

Field Type Description
_id string The unique identifier of the operation message.
accountId string The account where this object is defined.
message string The operation message.
name string A name for the messages grid in the UI to identify the message.
effectiveDateTimeStart object/string Start of the effective period (BzDate: offset, value; or ISO 8601 datetime).
effectiveDateTimeEnd object/string End of the effective period (BzDate: offset, value; or ISO 8601 datetime).
stationId string Station id to display the message for (optional; required if type is out-of-order).
stationName string Station name to display the message for (may be present in API responses).
type string Type of the operation message: out-of-order or warning.
active boolean Status of the operation message. Default: true.
displayOnTicket boolean Option to include the message in printed tickets. Default: false.
createdBy string The unique identifier for the user who created this.
updatedBy string The unique identifier for the user that last updated this.
createdAt object/string Datetime when the operation message was created.
updatedAt object/string Datetime when the operation message was last updated.
lexiconKeys object Lexicon keys for the message (e.g. message key for translations).