Update Discount
Update discount details.
Caution: Update of non-meta properties, properties that changes requirement or limitation can create conflict with the usage history of the discount.
Example is to change requirement.item.items, such change would mean that purchases before the change would not be correctly rewarded given the new version of the discount.
We recommend to limit the update of a discount to meta only properties if the discount has previously been used in a purchase.
Update on requirement purchase_to is only supported when
the new value that is after current value.
purchase_from can not be updated. Changing purchase_to or
limitation.dynamic_purchase_to_days also updates the customer
discounts already given, and is only supported with mode=merge.
reward can be updated. The replace rules are described in the
reward property of the request body.
requirement and limitation keys are merged with the current
values. Use mode=replace to replace the rule, for example to
remove a key.
The discount type (receipt/item) is derived from the updated
requirement.item.
The reward of a discount_debit discount can not be changed, and a
reward can not be changed to discount_debit. Only reward.base
can be updated.
Update discount.active to toggle if an discount is active
and available for purchase.
Update discount.private to toggle if an discount is included
in public discount collection if given to all customers
scopes:
- admin:discounts
- write:discounts
Authorizations
Path Parameters
An id that uniquely identifies the account.
9An UUID that uniquely identifies the discount
Query Parameters
How the request body is applied to the rule.
merge: properties in the body are updated, other properties keep their current value. Keys inrequirementandlimitationare merged with the current values.replace: the body replaces the rule.requirementandreward(withtypeandvalue) are required. Properties that are left out are removed or reset to their default, as when the rule is created,campaign_idincluded.requirement.purchase_from,requirement.purchase_toandlimitation.dynamic_purchase_to_dayscan not be changed;purchase_fromandpurchase_tocan be left out.
merge, replace Body
Discount properties to update
The campaign the rule belongs to, use null to remove
the rule from the campaign.
the discount is active and can be available for purchase
the discount is private and will not be included in public discount collection
false
Links to resources related to the discount
Discount base requirement
Reward properties to update.
When type is included the reward is replaced: type, value and
values are replaced, base and effect keep their current value
unless included. value is required when type is included.
type is required when anything other than base is included.
When only base is included, only base is updated.
With mode=replace the reward is replaced as when the rule is created.
"Gjør et Stablestol kupp!"
Additional metadata about the discount
"Spar 100,-"
Text that should be used when displaying the discount, e.g. on receipt
"Mai Salg"
Response
Discount Updated
Discount base requirement
An UUID that uniquely identifies the resource
The date-time when the resource was created
The ID of the user/client created the resource
"1c92f7e1-2897-4d46-bdcc-c127a914fb4e"
The date-time when the resource was last updated
The ID of the user/client created the resource
"1c92f7e1-2897-4d46-bdcc-c127a914fb4e"
The campaign the rule belongs to
the discount is active and can be available for purchase (if given to any or all customers)
the discount will be excluded from public discount collection (GET /discounts/public/rules).
The ID of the user/client that last updated the resource
"3d1e4824-5474-48e7-a369-4f603fa4c5b8"
The discount base type * receipt discount is given on receipt * item discount is given to items
item, receipt "Spar 100,-"
Text that should be used when displaying the discount, e.g. on receipt
"Mai Salg"
Make the discount visible to the customer from given date. Default behavior is to only return discount to the customer where the current time is between purchase_from and purchase_to
"Gjør et Stablestol kupp!"
Additional metadata about the discount
Metadata prefixed with dintero:exclude:public: will
be excluded when listing the rules from the public endpoint
and included in all other endpoints that returns discount rules
Links to resources related to the discount