Skip to main content

Create Sales Order Financial Line

POST 

/api/sales-orders/:salesOrder/financial-lines

Adds a financial line (shipping, handling, fee, or other non-product revenue/cost line) to a sales order.

Required scope: orders:write

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

Authentication: Requires Bearer token.

Request body fields:

  • financial_line_type_id (integer, required): Existing financial line type.
  • amount (number, required, min 0): Unit amount in the order currency.
  • description (string, optional): Display description. Defaults to the line type's name when omitted.
  • quantity (integer, optional, min 1): Quantity.
  • discount_rate (number, optional, 0-1): Fractional discount applied to the extended amount.
  • tax_allocation (number, optional, min 0): Tax amount for the line. When omitted and a tax_rate is set, it is computed automatically from the extended amount (and backed out of the amount on tax-inclusive orders).
  • tax_rate_id (integer, optional): Existing tax rate.
  • tax_rate (number, optional, min 0): Tax percentage used for the automatic tax_allocation computation.
  • allocate_to_products (boolean, optional): Whether the line's value is prorated across the order's product lines. Defaults from the line type.
  • proration_strategy (string, optional): One of revenue_based, cost_based, weight_based, volume_based, quantity_based, specific_line, manual. Defaults from the line type.
  • allocate_to_id (integer, optional), allocate_to_type (string, optional): The specific line to allocate to when proration_strategy is specific_line.
  • nominal_code_id (integer, optional): Existing accounting nominal code. Defaults from the line type.

The response is the created financial line as a bare JSON object (no envelope), returned with status 201. Computed columns such as extended_amount appear when the line is next read via the list endpoint.

Path parameters:

  • salesOrder (required): Sales order ID.

Requires permission: sales_orders.update

Request

Responses

Created

Response Headers
    Content-Type