cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/inventory-levels' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"regionId": "123e4567-e89b-12d3-a456-426614174000",
"includeUsed": false,
"autoCreate": false,
"customerPoNumber": "PO-12345"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/inventory-levels"
payload = {
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": False,
"autoCreate": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
skuId: '123e4567-e89b-12d3-a456-426614174000',
warehouseId: '123e4567-e89b-12d3-a456-426614174000',
minQuantity: 5,
maxQuantity: 20,
includeUsed: false,
autoCreate: false
})
};
fetch('https://apipub.firstbasehq.com/api/v1/inventory-levels', 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
Create inventory level
Creates an inventory level configuration that defines the minimum and maximum stock thresholds for a specific SKU at a specific warehouse. Optionally scoped to a region. Returns 409 if a level already exists for the same SKU + warehouse + region combination.
POST
https://apipub.firstbasehq.com
/
api
/
v1
/
inventory-levels
cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/inventory-levels' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"regionId": "123e4567-e89b-12d3-a456-426614174000",
"includeUsed": false,
"autoCreate": false,
"customerPoNumber": "PO-12345"
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/inventory-levels"
payload = {
"skuId": "123e4567-e89b-12d3-a456-426614174000",
"warehouseId": "123e4567-e89b-12d3-a456-426614174000",
"minQuantity": 5,
"maxQuantity": 20,
"includeUsed": False,
"autoCreate": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
skuId: '123e4567-e89b-12d3-a456-426614174000',
warehouseId: '123e4567-e89b-12d3-a456-426614174000',
minQuantity: 5,
maxQuantity: 20,
includeUsed: false,
autoCreate: false
})
};
fetch('https://apipub.firstbasehq.com/api/v1/inventory-levels', 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
Request to create an inventory level configuration
Response
Inventory level created successfully
Inventory level configuration with current stock details for a specific SKU, warehouse, and region