Files
dashback/docs/api/routes/stock/ship.md
2026-10-23 20:31:38 +02:00

56 lines
1.5 KiB
Markdown

# `POST /stock/ship`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Ship shipment manifest item(s)
Books shipment for a shipment manifest item on the ledger (warehouse_id = null).
If the connected article has stock tracking enabled, an adjustment entry is also
booked to deduct physical stock from the target warehouse.
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `manifestarticleId` | no | integer | Manifest article ID of the shipment line |
| `warehouseId` | no | integer | Optional warehouse ID for inventory deduction |
| `items` | no | object[] | |
| `items[].manifestarticleId` | yes | integer | |
| `items[].warehouseId` | no | integer | |
```json
{
"manifestarticleId": 1,
"warehouseId": 1,
"items": [
{
"manifestarticleId": 1,
"warehouseId": 1
}
]
}
```
## Signals
On success, emits SSE signals: `stock`, `ledger`, `articles`, `shipping` (see [`GET /events`](../events.md)).
## Response `200`
Shipment item(s) shipped successfully
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Manifest article or warehouse not found — `{"error":"…"}` |
| 409 | Shipment line already shipped on ledger or stock tracking disabled — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._