Delivery API: use externalNumber for user reference
Delivery create now accepts externalNumber (user-supplied reference) instead
of number; the manifest number is auto-allocated server-side via
nextNumber('delivery'). Update patches externalNumber (clearable) rather than
number. DeliverySummary schema documents externalNumber and notes number is
auto-generated. Regenerate API docs.
This commit is contained in:
@@ -5,15 +5,18 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
Create delivery
|
||||
|
||||
Creates a goods receipt with header and lines in one transaction.
|
||||
Each line requires `sku`, `amount`, `net`, and `tax` (rate).
|
||||
`rebate` defaults to `0`; `transactedAmount` defaults to `amount`.
|
||||
The manifest `number` is allocated automatically via
|
||||
`nextNumber('delivery')`; the user-supplied reference is stored as
|
||||
`externalNumber`. Each line requires `sku`, `amount`, `net`, and
|
||||
`tax` (rate). `rebate` defaults to `0`; `transactedAmount` defaults
|
||||
to `amount`.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"number": "DHL-123",
|
||||
"externalNumber": "DHL-123",
|
||||
"date": "2026-08-10",
|
||||
"supplierId": 1,
|
||||
"lines": [
|
||||
@@ -38,6 +41,7 @@ Created delivery
|
||||
"number": "…",
|
||||
"type": "delivery",
|
||||
"supplierId": 1,
|
||||
"externalNumber": "…",
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"lines": [
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@ Delivery
|
||||
"number": "…",
|
||||
"type": "delivery",
|
||||
"supplierId": 1,
|
||||
"externalNumber": "…",
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"lines": [
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ Delivery list
|
||||
"number": "…",
|
||||
"type": "delivery",
|
||||
"supplierId": 1,
|
||||
"externalNumber": "…",
|
||||
"date": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,8 +4,10 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Update delivery
|
||||
|
||||
Patches header fields that are present. If `lines` is present, replaces
|
||||
all lines; if omitted, leaves lines unchanged. Returns the full delivery.
|
||||
Patches header fields that are present. The manifest `number` is
|
||||
auto-allocated and cannot be patched; only the user-supplied
|
||||
`externalNumber` reference is editable. If `lines` is present,
|
||||
replaces all lines; if omitted, leaves lines unchanged.
|
||||
|
||||
|
||||
## Path parameters
|
||||
@@ -18,7 +20,7 @@ all lines; if omitted, leaves lines unchanged. Returns the full delivery.
|
||||
|
||||
```json
|
||||
{
|
||||
"number": "DHL-124",
|
||||
"externalNumber": "DHL-124",
|
||||
"lines": []
|
||||
}
|
||||
```
|
||||
@@ -34,6 +36,7 @@ Updated delivery
|
||||
"number": "…",
|
||||
"type": "delivery",
|
||||
"supplierId": 1,
|
||||
"externalNumber": "…",
|
||||
"date": "2026-08-10T00:00:00.000Z",
|
||||
"lines": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user