Retrieve a reason code
Operation ID: getReasonCode
Group: Inventory › Reason Codes
Open in the interactive reference
GET /inventory/reason-codes/{id}
Read-only: Reads and returns; changes nothing.
Retrieves a reason code. The reason code comes back with its settings and the document types it can be selected on.
POST inventory/reason-codes/search returns the same fields. The collection GET inventory/reason-codes returns them all except documentTypes.
To find a reason code by its code instead of its id, filter the collection on code.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
id |
path | string | yes | The unique identifier of the reason code you want to retrieve. |
Response
200 Success
Under data (getReasonCodeOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the reason code. Example: "7a1c9e42-8b30-4d67-9f15-3c8e02a74b61". |
code |
string | yes | The business code of the reason code, for example 'DAMAGE'. It is unique within the tenant. Example: "DAMAGE". |
description |
string | no | A free-form description of what the reason code means. Absent when none was given. Example: "Stock damaged in the warehouse". |
isActive |
boolean | no | Whether the reason code can be selected on new documents. When false, existing documents keep it and new ones cannot select it. Example: true. |
requiresApproval |
boolean | no | Whether documents using this reason code require approval before they take effect. Example: true. |
documentTypes |
array<any> | yes | The document types this reason code may be selected on, in a stable order. An empty array when it is linked to none. It is not returned by the collection GET inventory/reason-codes. Example: ["InventoryDecrease","SalesReturn"]. |
lastModifiedDate |
date-time | no | The date and time the reason code record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. Adding or removing a document type does not change it. Example: "2026-05-12T09:30:00.000Z". |
{
"data": {
"id": "7a1c9e42-8b30-4d67-9f15-3c8e02a74b61",
"code": "DAMAGE",
"description": "Stock damaged in the warehouse",
"isActive": true,
"requiresApproval": true,
"documentTypes": [
"InventoryDecrease",
"SalesReturn"
],
"lastModifiedDate": "2026-05-12T09:30:00.000Z"
},
"diagnostics": [
{
"code": "<code>",
"message": "<message>",
"severity": "error",
"path": [
"<path>"
],
"details": "<details>"
}
]
}
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND401— The request carries no valid access token.403— Not authorized404— Not found429— Too many requests from this client address. The response has no body and noRetry-Afterheader.500— Internal server error