u
This commit is contained in:
54
docs/api/routes/stock/accept.md
Normal file
54
docs/api/routes/stock/accept.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# `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`._
|
||||
Reference in New Issue
Block a user