Update a discount
Changes a percentage, fixed-amount or free-shipping discount. Buy-X-get-Y and app discounts are read-only here.
Authentication
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
Path parameters
Platform-native id.
Body
application/jsonWhat every request needs
Optional parameters11 fields
Required for method code.
For type percentage, e.g. 15 for 15%.
For type fixed_amount, a decimal in the store currency.
fixed_amount only: take the amount off each item instead of once per order.
Minimum order subtotal, a decimal in the store currency.
Code discounts only: total uses allowed.
Code discounts only.
Defaults to now.
Responses
Success· the request worked
Errors· the request failed
Create a discount
Creates a code discount (buyers enter a code) or an automatic one (applied at checkout), as a percentage, a fixed amount or free shipping. It applies to every product unless productIds or collectionIds narrow it. It applies to every buyer unless customerIds limits a code discount to chosen customers, for example a goodwill code only one shopper can use.
Activate or deactivate a discount
Deactivating ends the discount now; activating starts it now.