Files
dashback/docs/api/routes/shipment.md
2026-10-20 05:33:14 +02:00

65 lines
1.7 KiB
Markdown

# `GET /shipment`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List shipments
Company-wide paginated list of shipment manifests (`manifest` rows with `type = 'shipment'`)
with delivery state, entityId, package tracking info, and order references.
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `offset` | no | integer | Number of shipments to skip |
| `limit` | no | integer | Number of shipments to return |
| `search` | no | string | Free-text search matching shipment number, order number, external number, tracking code, or customer name |
| `state` | no | string | Optional filter by delivery state (cancelled shipments hidden by default) |
| `seekMonths` | no | integer | Negative integer for cutoff months ago (e.g. -1 for shipments older than 1 month) |
## Response `200`
Paginated shipment list
```json
{
"shipments": [
{
"id": 1,
"number": "…",
"type": "shipment",
"entityId": 1,
"externalNumber": "…",
"date": "…",
"createdAt": "…",
"orderId": 1,
"orderNumber": "…",
"customerName": "…",
"positions": 1,
"totalQuantity": 1,
"packageCount": 1,
"carrier": "…",
"trackingCode": "…",
"state": "new"
}
],
"total": 1,
"unfilteredTotal": 1,
"offset": 1,
"limit": 1
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid query parameters or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._