WinShopAPI docs
ReferenceDocumentsExpedition

Delivery notes

Create a delivery note

Creates a delivery note from the header and any items in the body, and returns the stored document (201, `Location` header set). Reserves the next internal document number. Requires `Permissions.DeliveryNotes.Create`.

Search delivery notes

Returns one page of delivery notes matching the filter. Body is a `PaginationRequest` — see the *Filtering & pagination* concept in the developer docs. Sortable and limitable fields depend on the instance's data-grid view. Requires `Permissions.DeliveryNotes.View`.

Create an invoice from one or more delivery notes

Merges the delivery notes listed in `deliveryNoteIds` (at most 50) into one invoice and returns the new invoice ids — normally exactly one. Optional fields override the issue, taxable-supply and delivery dates, the payment type and the invoice numbering series; omitted ones fall back to the delivery notes' values. Cannot be undone. Requires `Permissions.Invoice.Create`. See `POST /api/documents/expedition/delivery-notes/{documentId}/invoice` for the single-note variant.

Get a delivery note

Returns one delivery note by `documentId`, with its header, items and item variants. Requires `Permissions.DeliveryNotes.View`.

Delete a delivery note

Deletes the delivery note together with its items and item variants. Cannot be undone. Call `GET {documentId}/check-delete` first to find out whether the delete is allowed. Requires `Permissions.DeliveryNotes.Delete`.

Update a delivery note

Updates the delivery note header and the items sent in the body. Pass `removeItemsNotInRequest=true` to also delete the items the body leaves out. Requires `Permissions.DeliveryNotes.Update`.

Check whether a delivery note can be deleted

Advisory pre-flight for `DELETE {documentId}`. `canBeDeleted` is false when `blockingReasons` holds `HEADER_BLOCKED` or `ITEMS_BLOCKED`. The delete re-checks inside its own transaction, so a positive answer here is an indication rather than a guarantee. Requires `Permissions.DeliveryNotes.Delete`.

Process a delivery note (deprecated)

**Deprecated.** Use `POST {documentId}/process` instead — this alias behaves identically and will be removed. Requires `Permissions.DeliveryNotes.Update`.

Create an invoice from a delivery note

Creates an invoice document covering this delivery note and returns its id (201, `Location` header pointing at the invoice detail). Requires `Permissions.Invoice.Create`.

Add items to a delivery note

Appends the items in the body to an existing delivery note and recalculates the document totals. Requires `Permissions.DeliveryNotes.Create`.

Delete delivery note items

Deletes the items listed in `itemIds` and recalculates the document totals. Call `GET {documentId}/items/check-delete` first to find out whether the delete is allowed. Requires `Permissions.DeliveryNotes.Delete`.

Check whether delivery note items can be deleted

Advisory pre-flight for `DELETE {documentId}/items`. `blockingReasons` holds `ITEMS_BLOCKED` when at least one id in `itemIds` is still referenced elsewhere. At most 1000 ids per call. Requires `Permissions.DeliveryNotes.Delete`.

Update a delivery note item

Replaces one item of the delivery note, identified by `itemId`, and recalculates the document totals. Requires `Permissions.DeliveryNotes.Update`.

Delete a delivery note item variant

Deletes one variant row (a size/colour breakdown) of an item and recalculates the document totals. Call the matching `check-delete` endpoint first to find out whether the delete is allowed. Requires `Permissions.DeliveryNotes.Delete`.

Check whether an item variant can be deleted

Advisory pre-flight for `DELETE {documentId}/items/{itemId}/variants/{variantId}`. `blockingReasons` holds `ITEM_VARIANT_BLOCKED` when the variant is still referenced elsewhere. Requires `Permissions.DeliveryNotes.Delete`.

Get the lock state of a delivery note

Returns whether the delivery note is locked against concurrent edits and, when it is, the name of the user holding the lock. Requires `Permissions.DeliveryNotes.View`.

Lock a delivery note

Locks the delivery note for the calling user so other users cannot edit or process it. Returns 400 when it is already locked. Release it with `DELETE {documentId}/lock`. Requires `Permissions.DeliveryNotes.Update`.

Unlock a delivery note

Releases the lock on the delivery note. Returns 400 when the lock belongs to another user. Requires `Permissions.DeliveryNotes.Update`.

Get a delivery note as PDF

Renders the delivery note with its configured print template and returns `application/pdf` inline. 404 when the document has no printable output. Requires `Permissions.DeliveryNotes.View`.

Process a delivery note

Posts the delivery note to stock, applying the movement of every item, and marks the document as processed. Fails when the document is already processed, or when another user holds its lock. Processing cannot be reversed through this API. Requires `Permissions.DeliveryNotes.Update`.