Rivier/ Reference/ shop

Add a discount

post/shop/discounts

Add a discount: a code or automatic, percent, fixed or free shipping, with limits.

Before you call

Credential
Authorization: Bearer $KEY
Scope
shop:admin
Sdk
shop.discount.create
Cli
shop discount create

Request bodyapplication/json, required

  • codestring or null
  • namestringrequired
    At most 120 characters.
  • kindstringrequired
    One of: percent, fixed, free_shipping.
  • percentBpinteger or null
  • amountMinorinteger or null
  • currencystring or null
  • scopeobject
    Default: {"all":true}.
    • allboolean
    • productIdslist of string (uuid)
    • collectionIdslist of string (uuid)
  • minSubtotalMinorinteger
    Default: 0. At least 0. At most 9007199254740991.
  • limitTotalinteger or null
  • limitPerContactinteger or null
  • stackableboolean
    Default: false.
  • automaticboolean
    Default: false.
  • validFromstring (date-time) or null
  • validTostring (date-time) or null

Responses

  • 201application/json
    Success
    • 400application/json
      The request was malformed
      • errorstringrequired
      • messagestring
    • 401application/json
      No valid credential
      • errorstringrequired
      • messagestring
    • 403application/json
      The credential lacks the scope, origin or address
      • errorstringrequired
      • messagestring
    • 429application/json
      Over the key's rate limit; see Retry-After
      • errorstringrequired
      • messagestring

    This page as Markdown