u
This commit is contained in:
45
docs/api/routes/warehouse/create.md
Normal file
45
docs/api/routes/warehouse/create.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# `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)
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "…",
|
||||
"sort": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created warehouse
|
||||
|
||||
```json
|
||||
{
|
||||
"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`._
|
||||
Reference in New Issue
Block a user