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.
orders:writeGrant 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
- 201
- 401
- 403
- 404
- 422
- 429
Created
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.
Unprocessable Entity
Response Headers
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.