Get Sales Order Indirect Cost Breakdown
GET/api/sales-orders/:salesOrder/indirect-costs
Explains a sales order's indirect cost: every cost allocation share that makes up each line's stored indirect cost, with the inputs of the proration so the figure can be checked by hand.
orders:readGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
How a share is computed: each cost allocation is spread over every non-draft order line in its scope (the allocated product, brand, default supplier, sales channel or single order line) whose order falls in the allocation's period (period_start to period_end; an allocation with no period uses its allocation month). share = allocation_amount x line_revenue / scope_revenue. When the scope has no revenue, the amount is split equally: share = allocation_amount / scope_line_count.
Amounts are in the account's base currency.
Response fields:
- sales_order_id (integer), order_date (date|null): The order date in the account's timezone.
- stored_total (number): The order's stored indirect cost (sum of lines).
- computed_total (number): The sum of the allocation shares below.
- difference (number): stored_total - computed_total.
- is_stale (boolean): True when any line's stored figure differs from its shares by a cent or more; recompute the order to refresh it.
- lines (array): sales_order_line_id, product_id, sku, description, line_revenue, stored_amount, computed_amount, allocations.
- lines[].allocations (array, largest share first): cost_allocation_id, cost_entry_id, cost_entry_description, cost_entry_type {id, name} (null when uncategorized), allocatable_type (Product, ProductBrand, Supplier, SalesChannel or SalesOrderLine), allocatable_id, allocatable_label, period_start, period_end, allocation_amount, scope_revenue, scope_line_count, line_revenue, weighting (
revenueorequal_split), share.
Draft orders return an empty breakdown.
Path parameters:
- salesOrder (required): Sales order ID.
Request
Responses
- 200
- 401
- 403
- 404
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.