Commerce
Create a discount
POSThttps:/ / zernio.com/ api/ v1/ commerce/ discounts
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, and to every buyer.
PlatformsShopify
Authentication
AuthorizationBearer tokenRequired
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
Body
application/jsonWhat every request needs
accountIdstringRequired
titlestringRequired
methodstringRequiredOne of
code | automatictypestringRequiredOne of
percentage | fixed_amount | free_shippingOptional parameters12 fields
codestring
Required for method code.
percentagenumber
For type percentage, e.g. 15 for 15%.
amountstring
For type fixed_amount, a decimal in the store currency.
appliesOnEachItemboolean
fixed_amount only: take the amount off each item instead of once per order.
minimumSubtotalstring or null
Minimum order subtotal, a decimal in the store currency.
minimumQuantityinteger or null
usageLimitinteger or null
Code discounts only: total uses allowed.
oncePerCustomerboolean
Code discounts only.
startsAtstring (date-time)
Defaults to now.
endsAtstring or null (date-time)
productIdsarray of strings
collectionIdsarray of strings