Skip to main content

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.

Required scope: orders:read

Grant 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 (revenue or equal_split), share.

Draft orders return an empty breakdown.

Path parameters:

  • salesOrder (required): Sales order ID.

Request​

Responses​

OK

Response Headers
    Content-Type