55 lines
1.4 KiB
Markdown
55 lines
1.4 KiB
Markdown
# `POST /stock/accept`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Accept delivery manifest item(s)
|
|
|
|
Books acceptance for a delivery manifest item on the ledger (warehouse_id = null).
|
|
If the connected article has stock tracking enabled, an adjustment entry is also
|
|
booked to adjust physical stock in the target warehouse.
|
|
If line amount is negative, books as a delivery return (outgoing).
|
|
|
|
|
|
## Body (JSON)
|
|
|
|
| Field | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `manifestarticleId` | no | integer | Manifest article ID of the delivery line |
|
|
| `warehouseId` | no | integer | Optional warehouse ID for inventory intake |
|
|
| `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`, `delivery` (see [`GET /events`](../events.md)).
|
|
|
|
## Response `200`
|
|
|
|
Delivery item(s) accepted successfully
|
|
|
|
## Errors
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 400 | Validation error or no company selected |
|
|
| 404 | Manifest article or warehouse not found |
|
|
| 409 | Delivery line already accepted on ledger |
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|