Returns the reason code with the given identifier.
GET /inventory/reason-codes/{id}
Group: Inventory › Reason Codes · Operation ID: getReasonCode
The response has the same fields as POST inventory/reason-codes/search. The collection GET inventory/reason-codes returns the same fields except documentTypes, which it cannot express. To look a reason code up by its code instead of its id, filter the collection GET inventory/reason-codes on code.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "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 for the reason code to return. |
Response
200 Success
Under data (getReasonCodeOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the reason code. |
code |
string | yes | The business code of the reason code, for example 'DAMAGE'. It is unique within the tenant. |
description |
string | no | A free-form description of what the reason code means. Absent when none was given. |
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. |
requiresApproval |
boolean | no | Whether documents using this reason code require approval before they take effect. |
documentTypes |
array of string, one of "InventoryIncrease", "InventoryDecrease", "SalesReturn", "PurchaseReturn", "Disposal" |
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. |
lastModifiedDate |
string (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. |
Errors
| Code | Status |
|---|---|
NOT_FOUND |
400 |
Statuses
400— Invalid request or business failure. Codes: NOT_FOUND401— Missing or invalid access token403— Not authorized404— Not found429— Too many requests500— Internal server error