Skip to main content

Item Type Management API

Version 1.7 — April 2025

Authentication: All requests require an IdToken from the Login API. See Authentication to obtain one and Errors for authorization errors.

Create Item Types API​

Create Inventory Parts API allows to create multiple inventory parts at the same time.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
idStringThe unique id associated with the part. Usually referred as item number/SKU number of the product. If the part number is not unique, the id is usually a combination of multiple properties joined with - to make the id unique.Yes
numberStringPart numberNo
nameStringOptional property to describe the name of the item/SKU if there is oneNo
descriptionStringPart descriptionNo
quantityIntegerThe expected quantity of the partNo
unitStringUnit of measure of the partNo
imagePathStringImage URL of the part that can be used to display on the UINo
customPropertiesAWS/JSONAdditional properties that a customer may want to specify for the itemNo

Headers –
Authorization – $idToken

Request Body​

Here is an example for payload for creating 3 inventory parts with customProperties:

mutation {
createInventoryParts(
input: {
inputList: [
{
id: "STTC-125-PK-1"
number: "STTC-125"
unit: "PC"
quantity: 1
customProperties: "{\"color_ts\":\"Red\"}"
}
{
id: "STTC-126-PK-1"
number: "STTC-126"
unit: "BX"
quantity: 1
customProperties: "{\"color_ts\":\"Blue\"}"
}
{
id: "STTC-127-PK-1"
number: "STTC-127"
unit: "PC"
quantity: 6
customProperties: "{\"color_ts\":\"Yellow\"}"
}
]
}
) {
partIds
}
}

Status Code - 200

Response Body​

{
"data": {
"createInventoryParts": {
"partIds": ["STTC-125-PK-1", "STTC-126-PK-1", "STTC-127-PK-1"]
}
}
}

Errors​

See authorization errors.

Additional Errors​

ErrorError code
Duplicate part ids in payload400
Inventory Part ids already exists409

Duplicate part ids in payload​

{
"data": {
"createInventoryParts": null
},
"errors": [
{
"path": ["createInventoryParts"],
"data": null,
"errorType": "PayloadValidationError",
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 5,
"sourceName": null
}
],
"message": "Duplicates in id values: [STTC-125-PK-1]. The values must be unique."
}
]
}

Inventory Part ids already exist​

{
"data": {
"createInventoryParts": {
"partIds": []
}
},
"errors": [
{
"path": ["createInventoryParts"],
"data": null,
"errorType": "Error",
"errorInfo": {
"ids": ["STTC-125-PK-1", "STTC-126-PK-1", "STTC-127-PK-1"]
},
"locations": [
{
"line": 2,
"column": 5,
"sourceName": null
}
],
"message": "[BadRequest] Node creation for ItemType violates uniqueness constraint for fields: identifier, class. Status: 409"
}
]
}

Update Item Types API​

Update Inventory Parts API allows to create update inventory parts at the same time.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
idStringThe unique id associated with the part. Usually referred as item number/SKU number of the product. If the part number is not unique, the id is usually a combination of multiple properties joined with "-" to make the id unique.Yes
numberStringPart numberNo
nameStringOptional property to describe the name of the item/SKU if there is oneNo
descriptionStringPart descriptionNo
quantityIntegerThe expected quantity of the partNo
unitStringUnit of measure of the partNo
imagePathStringImage URL of the part that can be used to display on the UINo
customPropertiesAWS/JSONAdditional properties that a customer may want to specify for the itemNo

Headers –
Authorization – $idToken

Request Body​

Here is an example for payload for updating 2 inventory parts:

mutation {
updateInventoryParts(
input: {
inputList: [
{ id: "STTC-125-PK-1", number: "STTC-125-X" }
{ id: "STTC-126-PK-1", number: "STTC-126-X" }
]
}
) {
partIds
}
}

Status Code - 200

Response Body​

{
"data": {
"updateInventoryParts": {
"partIds": ["STTC-125-PK-1", "STTC-126-PK-1"]
}
}
}

Response consists of a list of all part ids that were updated.

Errors​

See authorization errors.

Additional Errors​

ErrorError code
Partial Update409

Partial Update (STTC-126-PK-1 is updated) but STTC-125-PK-2 is not found in the DB (therefore not updated)​

{
"data": {
"updateInventoryParts": {
"partIds": ["STTC-126-PK-1"]
}
},
"errors": [
{
"path": ["updateInventoryParts"],
"data": null,
"errorType": null,
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 5,
"sourceName": null
}
],
"message": "partId: STTC-125-PK-2 not found in DB"
}
]
}

List Item Types API​

List Item Types API allows to retrieve all the item types and view their details.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
inventoryPartsObjectList of item types (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

inventoryParts​

PropertyTypeDescriptionRequired
idStringItem Type identifierYes
nameStringItem Type NameNo
numberStringItem Type numberNo
descriptionStringItem Type descriptionNo
quantityIntegerItem Type quantityNo
unitStringUnit of measureNo
imagePathStringImage URL of the item typeNo
customPropertiesAWSJSONOther properties for Item typesNo

Headers –
Authorization – $idToken

Request Body​

query inventoryParts($filter: String, $nextToken: String) {
inventoryParts(input: { filter: $filter, nextToken: $nextToken }) {
nextToken
inventoryParts {
id
name
number
unit
description
quantity
imagePath
customProperties
}
}
}

Status Code - 200

Errors​

See authorization errors.


List Item Types at Locations API​

List Item Types at Location API allows to retrieve all the item types at the locations and view their statuses. List can be retrieved for any or all locations.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
inventoryPartsObjectList of item types by location (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

inventoryParts​

PropertyTypeDescriptionRequired
typeObjectItem Type details (view table below)Yes
missingCountNumberCount of missing items of that item type at the locationNo
dueSoonCountNumberCount of items of that item type that are due for maintenance soonNo
overdueCountNumberCount of items of that item type that are overdue for maintenanceNo
onhandCountNumberOn hand count of items of that item type at the locationNo
totalCountNumberTotal number of items of that item type at the locationNo
locationObjectLocation details (view table below)No

type​

PropertyTypeDescriptionRequired
idStringItem Type identifierYes
nameStringItem Type NameNo
descriptionStringItem Type descriptionNo
customPropertiesAWSJSONOther properties for Item typesNo

location​

PropertyTypeDescriptionRequired
idStringLocation identifierYes
nameStringLocation NameNo

Headers –
Authorization – $idToken

Request Body​

query inventoryPartMetrics($filter: String, $nextToken: String) {
inventoryPartMetrics(input: { filter: $filter, nextToken: $nextToken }) {
nextToken
inventoryParts {
id
name
missingCount
dueSoonCount
overdueCount
onHandCount
totalCount
location {
id
name
}
type {
id
name
description
customProperties
}
}
}
}
----------------------------------------------------------------------
Filter input
{
"filter": "location.name == \"Location A\""
}

Status Code - 200

Errors​

See authorization errors.


List Item Types Counts API​

List Inventory Parts Count at Location API allows to retrieve all the counts of inventory parts at the locations. List can be retrieved for any or all locations.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
inventoryPartsObjectList of inventoryParts count by location (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

inventoryParts​

PropertyTypeDescriptionRequired
locationObjectLocation details (view table below)No
totalCountNumberTotal number of items of that inventory part at the locationNo
customerOnHandCountNumberTotal on-hand number of items of that inventory part at the locationNo

location​

PropertyTypeDescriptionRequired
idStringLocation identifierYes
nameStringLocation nameNo

Headers –
Authorization – $idToken

Request Body​

query inventoryPartLocationMetrics($filter: String, $nextToken: String) {
inventoryPartLocationMetrics(
input: { filter: $filter, nextToken: $nextToken }
) {
nextToken
inventoryParts {
totalCount
customerOnHandCount
location {
id
name
}
}
}
}

Status Code - 200

Errors​

See authorization errors.