Skip to main content

Allocate Cost Entry by Proration

POST 

/api/cost-entries/:costEntry/allocate/proration

Allocates a cost entry across a custom list of products, splitting the amount by the chosen proration strategy.

Required scope: purchase-orders:write

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

Required fields: strategy (straight_line, front_loaded, back_loaded, revenue_based, cost_based, weight_based, volume_based, quantity_based, specific_line, manual) and items (array of {product_id, quantity, revenue, cost, weight, volume} - the strategy determines which measure drives each product's share).

Optional: amount (defaults to the entry's unallocated amount), allocation_date (defaults to today), period_start, period_end.

Authentication: Requires Bearer token.

Returns 422 when the chosen strategy has nothing to divide by — no item has the measure it uses (for example every product is weightless under weight_based). The message names the missing measure; nothing is allocated. Add the missing values to the products, or choose another strategy. A strategy that can't divide automatically (specific_line, manual) is refused the same way.

Request​

Responses​

OK

Response Headers
    Content-Type