Skip to main content

POST /api/v1/inventory

Create a new inventory record for tracking product stock levels.

Request Body

productId
integer
required
ID of the product to create inventory for
quantityAvailable
integer
required
Initial quantity of the product available in stock
minimumStockLevel
integer
required
Minimum stock level threshold for low stock alerts

Request

curl -X POST https://api.example.com/api/v1/inventory \
  -H "Content-Type: application/json" \
  -d '{
    "productId": 101,
    "quantityAvailable": 50,
    "minimumStockLevel": 10
  }'

Response

id
integer
Unique identifier for the newly created inventory record
productId
integer
ID of the associated product
quantityAvailable
integer
Current quantity of the product available in stock
minimumStockLevel
integer
Minimum stock level threshold for low stock alerts
lastRestockedDate
string
Timestamp of when the inventory was last restocked (ISO 8601 format)

Response Example

{
  "id": 1,
  "productId": 101,
  "quantityAvailable": 50,
  "minimumStockLevel": 10,
  "lastRestockedDate": "2026-03-03T09:15:00"
}

Status Codes

  • 201 - Inventory record created successfully

Build docs developers (and LLMs) love