Retrieve an item attribute
Operation ID: getItemAttribute
Group: Inventory › Item Attributes
Open in the interactive reference
GET /inventory/item-attributes/{id}
Read-only: Reads and returns; changes nothing.
Retrieves an item attribute. The same fields come back from GET inventory/item-attributes. The item's code and the attribute's name are returned beside their identifiers, so a row can be rendered without three further calls.
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 for the item attribute to read. |
Response
200 Success
Under data (getItemAttributeOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the item attribute. Example: "9f2c1d77-5b41-4e0a-9a33-8c5d2e61b704". |
itemId |
string | yes | The identifier of the item carrying the attribute. See id on GET inventory/items/:id. Example: "5f21c8b0-9d34-4a76-8e12-04b93c7de5a8". |
itemCode |
string | no | The item's code, for example 'WIDGET-01'. Echoed so the row can be rendered without reading the item. Example: "WIDGET-01". |
attributeId |
string | yes | The identifier of the attribute definition, for example the one named 'Colour'. Example: "c7a84f92-1e63-4d55-b0a1-6f7e3b9c2d48". |
attributeName |
string | no | The attribute's name, for example 'Colour'. Example: "Colour". |
valueId |
string | no | The identifier of the chosen value. Absent when the attribute has been assigned without a value. Example: "2b6d0e14-8f77-4a91-95c3-1d4e8a7f6b03". |
value |
string | no | The chosen value's text, for example 'Red'. Absent when the attribute has been assigned without a value. Example: "Red". |
{
"data": {
"id": "9f2c1d77-5b41-4e0a-9a33-8c5d2e61b704",
"itemId": "5f21c8b0-9d34-4a76-8e12-04b93c7de5a8",
"itemCode": "WIDGET-01",
"attributeId": "c7a84f92-1e63-4d55-b0a1-6f7e3b9c2d48",
"attributeName": "Colour",
"valueId": "2b6d0e14-8f77-4a91-95c3-1d4e8a7f6b03",
"value": "Red"
},
"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