u
This commit is contained in:
49
docs/api/routes/ledger.md
Normal file
49
docs/api/routes/ledger.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# `GET /ledger`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Query ledger by manifest article ID or SKU
|
||||
|
||||
Alternative query endpoint supporting `?manifestarticle_id=...` or `?sku=...`,
|
||||
with optional `?transaction_type=...`.
|
||||
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `manifestarticle_id` | no | integer | Query entries for this manifest article line ID |
|
||||
| `sku` | no | string | Query entries for this article SKU |
|
||||
| `transaction_type` | no | string | Optional transaction type filter |
|
||||
|
||||
## Response `200`
|
||||
|
||||
List of ledger entries
|
||||
|
||||
```json
|
||||
{
|
||||
"ledger": [
|
||||
{
|
||||
"id": 1,
|
||||
"manifestarticle_id": 1,
|
||||
"transaction_type": "…",
|
||||
"amount": 1,
|
||||
"transaction_text": "…",
|
||||
"hash_version": 1,
|
||||
"prev_hash": "…",
|
||||
"sku": "…",
|
||||
"created_at": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Missing required query parameter or no company selected — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user