Items
Upsert an item
PUT
/
item
/
{id}
Upsert an item
curl --request PUT \
--url https://{instance}/api/v2/item/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"sku": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": true,
"identifier": "<string>",
"description": "<string>",
"category": "<string>",
"isConsumable": true,
"shipLoose": true,
"trackedOnly": true,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {}
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sku: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
isArchived: true,
identifier: '<string>',
description: '<string>',
category: '<string>',
isConsumable: true,
shipLoose: true,
trackedOnly: true,
baseUnitMeasureId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
purchaseUnitMeasureId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
unitsPerPurchase: 123,
stockLength: 123,
defaultLocationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parentItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
minQuantity: 123,
maxQuantity: 123,
unitCost: 123,
metadata: {}
})
};
fetch('https://{instance}/api/v2/item/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/item/{id}"
payload = {
"name": "<string>",
"sku": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": True,
"identifier": "<string>",
"description": "<string>",
"category": "<string>",
"isConsumable": True,
"shipLoose": True,
"trackedOnly": True,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"sku": "<string>",
"description": "<string>",
"category": "<string>",
"type": "raw_material",
"status": "design",
"isConsumable": true,
"shipLoose": true,
"trackedOnly": true,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trackingMode": "aggregate",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {},
"onHand": 123,
"allocated": 123,
"available": 123,
"onOrder": 123,
"isShort": true,
"belowMin": true,
"vendorSkus": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}Authorizations
Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.
Path Parameters
Record id.
Query Parameters
Columns to overwrite when the row already exists. Repeat the parameter for each column: a single comma-separated value is read as one column name and fails at the database. Without the parameter the request is rejected with 400.
Body
application/json
Optional client-supplied ID.
Available options:
raw_material, purchased, manufactured Available options:
design, active, obsolete Available options:
aggregate, piece, lot Response
Successful response.
Show child attributes
Show child attributes
⌘I
Upsert an item
curl --request PUT \
--url https://{instance}/api/v2/item/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"sku": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": true,
"identifier": "<string>",
"description": "<string>",
"category": "<string>",
"isConsumable": true,
"shipLoose": true,
"trackedOnly": true,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {}
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sku: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
isArchived: true,
identifier: '<string>',
description: '<string>',
category: '<string>',
isConsumable: true,
shipLoose: true,
trackedOnly: true,
baseUnitMeasureId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
purchaseUnitMeasureId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
unitsPerPurchase: 123,
stockLength: 123,
defaultLocationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parentItemId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
minQuantity: 123,
maxQuantity: 123,
unitCost: 123,
metadata: {}
})
};
fetch('https://{instance}/api/v2/item/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/item/{id}"
payload = {
"name": "<string>",
"sku": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isArchived": True,
"identifier": "<string>",
"description": "<string>",
"category": "<string>",
"isConsumable": True,
"shipLoose": True,
"trackedOnly": True,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"value": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"archivedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"identifier": "<string>",
"sku": "<string>",
"description": "<string>",
"category": "<string>",
"type": "raw_material",
"status": "design",
"isConsumable": true,
"shipLoose": true,
"trackedOnly": true,
"baseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchaseUnitMeasureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unitsPerPurchase": 123,
"stockLength": 123,
"defaultLocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trackingMode": "aggregate",
"minQuantity": 123,
"maxQuantity": 123,
"unitCost": 123,
"metadata": {},
"onHand": 123,
"allocated": 123,
"available": 123,
"onOrder": 123,
"isShort": true,
"belowMin": true,
"vendorSkus": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}{
"error": {
"message": "<string>",
"code": "BAD_REQUEST",
"requestId": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"missingPermissions": [
"<string>"
]
},
"context": {}
}