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
Bearer authentication (token authentication) should be used for accessing the API.
Use Get Token to get an access token for client credentials. Pass the token in the request header:
where the access_token is JSON Web Tokens (JWT).
Path Parameters
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
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.
Response
Discount Updated
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