Skip to main content

Map Cost Entry Source Line to Product

PATCH 

/api/cost-entries/:costEntry/source-lines/:sourceLine

Points a source line (typically an unknown SKU) at a product and makes it a product charge. With allocate (default true) its unallocated amount is allocated to that product, linked to the line.

Required scope: purchase-orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body: product_id (required, existing product), allocate (optional boolean).

404 when the line belongs to another cost entry; 422 when the allocation would exceed what the entry has left.

Authentication: Requires Bearer token (scope purchase-orders:write).

Request​

Responses​

OK

Response Headers
    Content-Type