Items
Query items
POST
/
item
/
query
Query items
curl --request POST \
--url https://{instance}/api/v2/item/query \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"filter": "<string>",
"search": "<string>",
"page": 1,
"pageSize": 100,
"orderBy": "<string>",
"select": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
search: '<string>',
page: 1,
pageSize: 100,
orderBy: '<string>',
select: ['<string>']
})
};
fetch('https://{instance}/api/v2/item/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/item/query"
payload = {
"filter": "<string>",
"search": "<string>",
"page": 1,
"pageSize": 100,
"orderBy": "<string>",
"select": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"values": [
{
"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>"
}
],
"hasMore": true
}{
"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.
Body
application/json
The same options the list endpoint takes in the query string. Any additional key is read as a field filter.
AND/OR filter expression.
Full-text search term.
Page to return, starting at 1.
Records per page. Defaults to 100 when omitted.
Sort as field:asc or field:desc.
Return only these fields.
Field name.
⌘I
Query items
curl --request POST \
--url https://{instance}/api/v2/item/query \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"filter": "<string>",
"search": "<string>",
"page": 1,
"pageSize": 100,
"orderBy": "<string>",
"select": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: '<string>',
search: '<string>',
page: 1,
pageSize: 100,
orderBy: '<string>',
select: ['<string>']
})
};
fetch('https://{instance}/api/v2/item/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{instance}/api/v2/item/query"
payload = {
"filter": "<string>",
"search": "<string>",
"page": 1,
"pageSize": 100,
"orderBy": "<string>",
"select": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"values": [
{
"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>"
}
],
"hasMore": true
}{
"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": {}
}