Skip to main content

Update Sales Order Discount

PUT 

/api/sales-orders/:salesOrder/discounts/:discount

Updates an existing discount on a sales order and recalculates the order's discount totals.

Required scope: orders:write

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

Authentication: Requires Bearer token.

Request body fields (all optional — omitted fields keep their current values):

  • scope (string): line or order.
  • type (string): percentage or fixed_amount.
  • rate (number): Percentage rate, 0-100.
  • amount (number): Discount amount in the order currency, minimum 0.
  • name (string, max 255): Display label.
  • sales_order_line_id (integer): Existing product line the discount applies to.
  • financial_line_id (integer): Existing charge line the discount applies to.
  • source_type (string, max 50): Origin of the discount.
  • source_reference (string, max 255): External reference such as a coupon code.
  • apply_before_tax (boolean): Whether the discount applies before tax is calculated.
  • sequence (integer, min 0): Application order.

Behavior:

  • The update triggers the same full discount recalculation as creating a discount — line totals, order-level allocation across lines, and the order's discount totals are refreshed.
  • For percentage discounts the effective amount is recomputed and returned in the response.

The response is the updated discount object (no envelope).

Path parameters:

  • salesOrder (required): Sales order ID.
  • discount (required): Discount ID.

Requires permission: sales_orders.update

Request

Responses

OK

Response Headers
    Content-Type