Document Line Service

Back

Overview

Document lines represent individual items within a document (sales order, credit note, quote, etc.). Each line captures product, quantity, pricing, and fulfillment details.

All document line operations are tenant-aware and scoped to the current tenant.


Endpoints

Back to Sales

GET

/api/v1/DocumentLines/document/{documentId}

Returns all lines for a specific document.

Route parameters:

Behavior:

Response:

Authorization:


GET

/api/v1/DocumentLines/{id}

Returns a single document line by its numeric identifier.

Route parameters:

Behavior:

Response:

Authorization:


POST

/api/v1/DocumentLines

Creates a new document line.

Request body (DocumentLineModel):

Behavior:

Response:

Authorization:


POST

/api/v1/DocumentLines/{id}/pick?warehouseId=123

Picks a Sales Order document line from the given warehouse and marks it picked. Gated by the PICK_LINE document action (DocumentActionEngine) — allowed only while the parent Sales Order is AWAITING_PICK. The caller must say which warehouse the pick is coming from — this is not inferred from the line (its own WarehouseId is only a price-time estimate, not a reliable source of truth).

Once every (non-deleted) line on the parent document is picked, the document auto-advances via the system-triggered MARK_PICKED action — the same action-resolution pipeline as every other document action — to AWAITING_CUSTOMISATION/AWAITING_MANPACKING/AWAITING_DISPATCH depending on tenant feature flags. There is no user-invokable document-level "mark picked" action.

Route parameters:

Query parameters:

Behavior:

Response:

Authorization:


POST

/api/v1/DocumentLines/{id}/receive?warehouseId=123

Receives a Purchase Order document line into the given warehouse and marks it received (reuses the same IsPicked field — there is no separate "received" state). Gated by the RECEIVE_LINE document action — allowed only while the parent Purchase Order is AWAITING_STOCK.

Once every line on the Purchase Order is received, it auto-advances via the system-triggered MARK_RECEIVED action to RECEIVED — after that, RECEIVE_LINE is no longer allowed, so a line can't be received twice. Stock-required lines record a positive stock transaction (reason Receive) — the opposite of picking. After adding stock, any Sales Order sitting in AWAITING_STOCK with a line for the same product variant is automatically rechecked (via its STOCK_RECEIVED action) and advanced to AWAITING_PICK if it now has enough stock.

Route parameters:

Query parameters:

Behavior:

Response:

Authorization:


POST

/api/v1/DocumentLines/pick/bulk

Bulk variant of pick — picks several Sales Order lines (optionally spanning multiple documents) into a single warehouse in one request. Best-effort: one bad line ID doesn't block the rest — each requested line gets its own success/failure result.

Request body (BulkDocumentLineActionRequest):

Behavior: identical per-line rules as the single pick endpoint, applied to each line.

Response:

Authorization:


POST

/api/v1/DocumentLines/receive/bulk

Bulk variant of receive — same shape and behavior as pick/bulk, for Purchase Order lines.

Request body (BulkDocumentLineActionRequest):

Response:

Authorization:


PUT

/api/v1/DocumentLines/{id}

Updates an existing document line.

Route parameters:

Request body (DocumentUpdate):

Behavior:

Response:

Authorization:


DELETE

/api/v1/DocumentLines/{id}

Deletes a document line by its identifier.

Route parameters:

Behavior:

Response:

Authorization:


DocumentLineModel Fields

Returned by GET and POST endpoints:


Notes