Inventory Pro
Skip to main content

Contents

api

Reason Codes

Reason Codes

A reason code classifies an inventory transaction — explaining why stock was received or issued. Reason codes are created in the Desktop application; this API provides read access and the ability to discontinue them.

The Reason Code Object

{
  "typeCode": 1,
  "description": "Purchase Order Receipt",
  "active": true,
  "warehouseId": 0,
  "modified": "2025-01-10T09:00:00"
}
FieldTypeDescription
typeCodeintegerUnique numeric identifier
descriptionstringHuman-readable description
activebooleanfalse when discontinued
warehouseIdintegerWarehouse ID (0 = all warehouses)
modifieddatetimeLast modified timestamp

Note: The single reason-code response (GET /ReasonCode/{id}) includes additional fields (positive, negative, graph, pick, history, globalId, modifiedBy). The list responses (GET /ReasonCode, GET /ReasonCode/All) return the fields shown above.

Codes with type: "receive" are used on Inventory Receive operations; type: "issue" codes are used on Inventory Issue operations.


List Active Reason Codes

GET /ReasonCode

Returns active reason codes with standard pagination parameters. The typeCode value is used as the reasonCode on Inventory Receive and Inventory Issue operations.

{
  "value": [
    {
      "typeCode": 1,
      "description": "Purchase Order Receipt",
      "active": true,
      "warehouseId": 0,
      "modified": "2025-01-10T09:00:00"
    },
    {
      "typeCode": 4,
      "description": "Issued to Production",
      "active": true,
      "warehouseId": 0,
      "modified": "2025-01-10T09:00:00"
    },
    {
      "typeCode": 7,
      "description": "Inventory Adjustment In",
      "active": true,
      "warehouseId": 0,
      "modified": "2025-01-10T09:00:00"
    }
  ],
  "totalCount": 12,
  "page": 1,
  "pageSize": 25,
  "pageCount": 1,
  "hasMore": false
}

List All Reason Codes

GET /ReasonCode/All

Includes discontinued reason codes. Uses the same response shape as the active list.

{
  "value": [
    {
      "typeCode": 2,
      "description": "Legacy Receive Code",
      "active": false,
      "warehouseId": 0,
      "modified": "2024-01-10T09:00:00"
    },
    {
      "typeCode": 4,
      "description": "Issued to Production",
      "active": true,
      "warehouseId": 0,
      "modified": "2025-01-10T09:00:00"
    }
  ],
  "totalCount": 15,
  "page": 1,
  "pageSize": 25,
  "pageCount": 1,
  "hasMore": false
}

Get a Reason Code

GET /ReasonCode/{id}

Returns 404 if the reason code does not exist.

GET /ReasonCode/1
{
  "typeCode": 1,
  "description": "Purchase Order Receipt",
  "active": true,
  "positive": 1,
  "negative": 0,
  "warehouseId": 0,
  "modified": "2025-01-10T09:00:00",
  "modifiedBy": 3
}

Discontinue a Reason Code

DELETE /ReasonCode/{id}

Marks the reason code as discontinued. Existing transactions that used this code are not affected. Returns 200 with a confirmation message.

DELETE /ReasonCode/1
"Reason Code Discontinued: 1"

Permissions

ActionPermission
List / GetCategories List (SecurityID 104)
DiscontinueCreate/Modify Category (SecurityID 105)