cURL
curl -sS -X PATCH 'https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": false,
"autoCreate": false,
"active": false,
"customerPoNumber": "PO-12345"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "123e4567-e89b-12d3-a456-426614174000",
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": true,
"autoCreate": true,
"active": true,
"stockDetails": {
"newInventories": 12,
"usedInventories": 3,
"pendingInventoryOrders": 2,
"totalAvailable": 14,
"totalItemsToOrder": 6
},
"regionId": "123e4567-e89b-12d3-a456-426614174000",
"customerPoNumber": "PO-12345",
"createdInventoryOrderId": "123E4567-E89B-12D3-A456-426614174000"
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Inventory Levels
Update inventory level
Partial update for inventory level thresholds and reordering settings.
Fields accepted: minQuantity, maxQuantity, includeUsed, autoCreate, active, customerPoNumber.
skuId, warehouseId, and regionId are NOT accepted (immutable after creation) — sending
any of them returns 400 with a per-field error message. Any other field name returns
400 'Unknown field: <name>'. Sending an empty body returns 400 'At least one modifiable
field must be provided'.
Setting active=false soft-deletes the level. Reactivating via PATCH (active=true on an
inactive level) is not supported; use POST /api/inventory-levels. Sending active=true
on an already-active level is a 200 no-op (no state change, no write).
PATCH
https://apipub.firstbasehq.com
/
api
/
v1
/
inventory-levels
/
{id}
cURL
curl -sS -X PATCH 'https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": false,
"autoCreate": false,
"active": false,
"customerPoNumber": "PO-12345"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}"
payload = {}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://apipub.firstbasehq.com/api/v1/inventory-levels/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "123e4567-e89b-12d3-a456-426614174000",
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": true,
"autoCreate": true,
"active": true,
"stockDetails": {
"newInventories": 12,
"usedInventories": 3,
"pendingInventoryOrders": 2,
"totalAvailable": 14,
"totalItemsToOrder": 6
},
"regionId": "123e4567-e89b-12d3-a456-426614174000",
"customerPoNumber": "PO-12345",
"createdInventoryOrderId": "123E4567-E89B-12D3-A456-426614174000"
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Authorizations
Body
application/json
Partial update for an inventory level. Only the fields listed in this schema are accepted.
IMPORTANT: This endpoint does NOT accept skuId, warehouseId, or regionId — these are
immutable after creation. Sending any of them returns 400 with a per-field error
(Cannot change <field> after creation). Sending any other field name returns 400
with detail Unknown field: <name>. Sending an empty body returns 400 At least one
modifiable field must be provided. Fields skuId, warehouseId, and regionId are
not editable after the inventory level has been created.
Setting active to false soft-deletes the inventory level. Reactivating via PATCH
(active=true on an inactive level) is not supported; use POST /api/inventory-levels.
Sending active=true on an already-active level is a 200 no-op (no state change).
NOTE: Sending a wrong type for a numeric field (e.g. minQuantity: "foo") returns 400
with detail "Field \"<field>\" is missing or has an invalid value" — this is the global
deserialization error shape, not the per-field aggregated shape described above.
Response
Inventory level updated
Inventory level configuration with current stock details for a specific SKU, warehouse, and region