1.6 KiB
1.6 KiB
PATCH /shipping/{id}
Protected. Requires a valid session cookie (credentials: 'include').
Update shipping
Updates a shipping record. If transitioned to shipped, stock is adjusted
via ledger and article history is written. Once shipped, it cannot be undone.
Path parameters
| Param | Required | Type | Description |
|---|---|---|---|
id |
yes | integer | Shipping ID |
Body (JSON)
| Field | Required | Type | Description |
|---|---|---|---|
type |
no | string | |
state |
no | string | |
trackingCode |
no | string | Carrier parcel tracking code |
carrier |
no | string | Carrier name (e.g. DHL, UPS, DPD) |
warehouseId |
no | integer | Warehouse ID for stock deduction when transitioning to shipped |
{
"type": "…",
"state": "…",
"trackingCode": "…",
"carrier": "…",
"warehouseId": 1
}
Response 200
Updated shipping
{
"shipping": {
"id": 1,
"manifestId": 1,
"number": "…",
"trackingCode": "…",
"carrier": "…",
"type": "…",
"state": "…"
}
}
Errors
| Status | Description |
|---|---|
| 400 | Validation error or no company selected — {"error":"…"} |
| 401 | Unauthorized — {"error":"…"} |
| 403 | Not authorized — {"error":"…"} |
| 404 | Shipping or warehouse not found — {"error":"…"} |
| 409 | Shipped shipping cannot be undone, or order already shipped — {"error":"…"} |
Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.