Operation-reasons

Operation reasons webhooks

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


Inventory API – operation-reasons resource

Emitted when an operation reason is created (POST /operation-reasons), updated (PUT /operation-reasons/:id), or deleted (DELETE /operation-reasons/:id).

Events (Inventory API)

Action Event name Endpoint
Create an operation reason operationReasons.created POST /operation-reasons
Update an operation reason operationReasons.updated PUT /operation-reasons/:id
Delete an operation reason operationReasons.deleted DELETE /operation-reasons/:id

Payload example – created (Inventory API)

The data object for operationReasons.created is the full created operation reason (same shape as the API response operationReason).

{
  "attemptId": "d42c1225-9917-410c-950e-0383162d416b",
  "created": 1771027702,
  "data": {
    "_id": "698fbca4ee66f906c52a9451",
    "accountId": "6601f1d64f95b505b8eb42e2",
    "createdAt": {
      "offset": 0,
      "value": "2026-02-14T00:07:00.667Z"
    },
    "createdBy": "68e3c6d55a958106e34b4f37",
    "enabled": false,
    "lexiconKeys": {
      "name": "6601f1d64f95b505b8eb42e2-undefined-name-6601f1d64f95b505b8eb42e2-ffaecb8e-fd98-4a88-8b68-f9ef65c0dfcd-ed4bde34-f171-49b8-a132-858fc36b3fff"
    },
    "name": "Test",
    "ord": 0,
    "type": "cut",
    "updatedAt": {
      "offset": 0,
      "value": "2026-02-14T00:07:00.667Z"
    },
    "updatedBy": "68e3c6d55a958106e34b4f37"
  },
  "event": "operationReasons.created",
  "id": "7ec09d11-974e-4828-8373-c09fc9f9e738",
  "livemode": false
}

Payload example – updated (Inventory API)

The data object for operationReasons.updated is the full updated operation reason (same shape as the API response operationReason).

{
  "attemptId": "ca8dfe73-029c-4c74-b43c-2706aae4d92a",
  "created": 1771028039,
  "data": {
    "_id": "698fbca4ee66f906c52a9451",
    "accountId": "6601f1d64f95b505b8eb42e2",
    "createdAt": {
      "offset": 0,
      "value": "2026-02-14T00:07:00.667Z"
    },
    "createdBy": "68e3c6d55a958106e34b4f37",
    "enabled": true,
    "lexiconKeys": {
      "name": "6601f1d64f95b505b8eb42e2-undefined-name-6601f1d64f95b505b8eb42e2-ffaecb8e-fd98-4a88-8b68-f9ef65c0dfcd-ed4bde34-f171-49b8-a132-858fc36b3fff"
    },
    "name": "Test (updated)",
    "ord": 1,
    "type": "cut",
    "updatedAt": {
      "offset": 0,
      "value": "2026-02-14T00:13:06.830Z"
    },
    "updatedBy": "68e3c6d55a958106e34b4f37"
  },
  "event": "operationReasons.updated",
  "id": "c1945aa8-2982-4974-9494-9f37db44244e",
  "livemode": false
}

Payload example – deleted (Inventory API)

The data object for operationReasons.deleted contains only the id of the deleted operation reason.

{
  "attemptId": "928a9c14-b24b-423e-8cd0-64e4b21033d0",
  "created": 1771028122,
  "data": {
    "_id": "698fbca4ee66f906c52a9451"
  },
  "event": "operationReasons.deleted",
  "id": "ec5d930b-6b5d-40d1-b8bf-3dcbf5f71ec2",
  "livemode": false
}

Field descriptions – data (created / updated)

data matches the Inventory API OperationReason schema. Main fields:

Field Type Description
_id string The operation reason id (24 hex characters).
accountId string The account id of this resource.
name string Default name of the operation reason.
ord number Display order. Default 0.
type string Operation type for this reason (e.g. cut).
enabled boolean Whether this reason is enabled. Default false.
lexiconKeys object Lexicon keys (e.g. name key for translations).
createdBy string The user that created this resource.
updatedBy string The last user that updated this resource.
createdAt object The date the object was created (BzDate: offset, value).
updatedAt object The date the object was last updated (BzDate: offset, value).

Field descriptions – data (deleted)

Field Type Description
_id string Id of the deleted operation reason (24 hex characters).