955 B
955 B
POST /warehouse
Protected. Requires a valid session cookie (credentials: 'include').
Create warehouse
Creates a new warehouse for the selected company. Sort order will be automatically appended if omitted.
Body (JSON)
| Field | Required | Type | Description |
|---|---|---|---|
name |
yes | string | |
sort |
no | integer | Optional sort order (defaults to auto-increment) |
{
"name": "…",
"sort": 1
}
Response 201
Created warehouse
{
"warehouse": {
"id": 1,
"name": "…",
"sort": 1
}
}
Errors
| Status | Description |
|---|---|
| 400 | Invalid input or missing fields — {"error":"…"} |
| 401 | Unauthorized — {"error":"…"} |
| 403 | Not authorized — {"error":"…"} |
| 409 | Warehouse already exists — {"error":"…"} |
Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.