Update Order Discount
Beta/v1/sales/order-discounts/{id}Idempotent with Idempotency-Key header. Learn more
Partially updates an order discount.
Only the fields you send are changed; the rest keep their current values. Changing code to one another discount already holds returns a conflict error. Edits apply to future orders only — orders that already used this discount keep the reduction they were given.
idstringOrder discount ID.
nameoptional stringDisplay name of the discount.
codeoptional stringThe code a buyer enters to apply this discount to an order.
Codes are unique within your account and are compared without regard to letter case.
percentageoptional string (decimal)The fraction of the order total to take off, as a decimal string.
This is a multiplier, not a whole percent: send 0.1 to take 10% off. Only read when discount_type is percentage.
amountoptional string (decimal)The flat amount to take off the order total, as a decimal string.
Only read when discount_type is amount.
discount_typeoptional stringenumValues:percentageamountHow the discount is calculated.
percentage: the order total is reduced by the fraction inpercentage.amount: the order total is reduced by the flat amount inamount.
Switching the type does not move the stored figure across, so send the matching percentage or amount in the same request or the discount will take nothing off.
idstringOrder discount ID.
objectstringenumValues:order_discountResource type identifier.
namestringDisplay name of the discount.
codestringThe code a buyer enters to apply this discount to an order.
Codes are unique within your account and are matched without regard to letter case.
percentagestring (decimal)The fraction of the order total taken off, as a decimal string.
This is a multiplier, not a whole percent: 0.1 takes 10% off. Only read when discount_type is percentage.
amountstring (decimal)The flat amount taken off the order total, as a decimal string.
Only read when discount_type is amount.
discount_typestringenumValues:percentageamountHow the discount is calculated.
percentage: the order total is reduced by the fraction inpercentage.amount: the order total is reduced by the flat amount inamount.
order_countintegerHow many sales orders this discount has been applied to, across all buyers.
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
Responses
Successful response for Update Order Discount