Set customer role discounts for categories, products, variations or the whole shop. These endpoints only write: the API can't read or delete discounts.
Set category discounts
Sets the discount percentage that customers in the given roles get on the products of a category. Send an array; each element creates or updates one discount per role in role_ids. Fields you omit keep their stored values (a new discount has no dates); an explicit null removes a date or sets the percentage to 0. If several elements set the same category and role, the last one wins. An unknown or deleted category_id returns 400 and saves nothing. The API can't read or delete discounts; to end one, set ends.
Set category discounts › Request Body
category_idThe ID of an existing, not deleted category.
role_idsThe IDs of the customer roles the discount is for. Each ID must exist, otherwise the request returns 400. The element sets one discount per role.
discount_percentThe discount percentage. Must be at least 0 and below 100 after rounding to two decimals, otherwise 400. null means 0.
startsWhen the discount starts, as an ISO 8601 date or date-time, read as the shop's local time (an offset is ignored). null removes the start date.
endsWhen the discount ends, in the same format as starts. null removes the end date.
Set category discounts › Responses
The discounts as stored.
hrefThe URL of the request.
One item per category and role, sorted by category ID and role ID, highest first.
Set role discounts
Sets the shop-wide discount percentage of the given customer roles. Send an array; each element updates every role in role_ids. starts and ends limit when the discount applies; they keep their stored values if you omit them, and an explicit null removes a date. If several elements set the same role, the last one wins. An unknown role ID returns 400 and saves nothing.
Set role discounts › Request Body
role_idsThe IDs of the customer roles the discount is for. Each ID must exist, otherwise the request returns 400. The element sets one discount per role.
discount_percentThe discount percentage. Must be at least 0 and below 100 after rounding to two decimals, otherwise 400. null means 0.
startsWhen the discount starts, as an ISO 8601 date or date-time, read as the shop's local time (an offset is ignored). null removes the start date.
endsWhen the discount ends, in the same format as starts. null removes the end date.
Set role discounts › Responses
The discounts as stored.
hrefThe URL of the request.
One item per role, sorted by role ID, highest first.
Set product discounts
Sets the fixed price or discount percentage, or both, that customers in the given roles get on a product. Send an array; each element creates or updates one discount per role in role_ids. Fields you omit keep their stored values (a new discount has 0 prices and no dates); an explicit null removes a date or sets a price field to 0. If several elements set the same product and role, the last one wins. An unknown or deleted product_id returns 400 and saves nothing. The API can't read or delete discounts; to end one, set ends.
Set product discounts › Request Body
product_idThe ID of an existing, not deleted product.
role_idsThe IDs of the customer roles the discount is for. Each ID must exist, otherwise the request returns 400. The element sets one discount per role.
fixed_priceA fixed price for the role, entered like the shop's product prices (with or without VAT, depending on the shop's settings). 0 or null means no fixed price. A negative value returns 400.
discount_percentThe discount percentage. Must be at least 0 and below 100 after rounding to two decimals, otherwise 400. null means 0.
startsWhen the discount starts, as an ISO 8601 date or date-time, read as the shop's local time (an offset is ignored). null removes the start date.
endsWhen the discount ends, in the same format as starts. null removes the end date.
Set product discounts › Responses
The discounts as stored.
hrefThe URL of the request.
One item per product and role, sorted by product ID and role ID, highest first.
Set variation discounts
Sets the fixed price or discount percentage, or both, that customers in the given roles get on a variation. Send an array; each element creates or updates one discount per role in role_ids. Fields you omit keep their stored values (a new discount has 0 prices and no dates); an explicit null removes a date or sets a price field to 0. If several elements set the same variation and role, the last one wins. An unknown or deleted variation_id returns 400 and saves nothing. The API can't read or delete discounts; to end one, set ends.
Set variation discounts › Request Body
variation_idThe ID of an existing, not deleted variation.
role_idsThe IDs of the customer roles the discount is for. Each ID must exist, otherwise the request returns 400. The element sets one discount per role.
fixed_priceA fixed price for the role, entered like the shop's product prices (with or without VAT, depending on the shop's settings). 0 or null means no fixed price. A negative value returns 400.
discount_percentThe discount percentage. Must be at least 0 and below 100 after rounding to two decimals, otherwise 400. null means 0.
startsWhen the discount starts, as an ISO 8601 date or date-time, read as the shop's local time (an offset is ignored). null removes the start date.
endsWhen the discount ends, in the same format as starts. null removes the end date.
Set variation discounts › Responses
The discounts as stored.
hrefThe URL of the request.
One item per variation and role, sorted by variation ID and role ID, highest first.