Commerce

Update a discount

Changes a percentage, fixed-amount or free-shipping discount. Buy-X-get-Y and app discounts are read-only here.

patch/v1/commerce/discounts/{discountId}

Path parameters

discountIdstring required

Platform-native id.

Request body

accountIdstring required
titlestring
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 nullable

Minimum order subtotal, a decimal in the store currency.

minimumQuantityinteger nullable
usageLimitinteger nullable

Code discounts only: total uses allowed.

oncePerCustomerboolean

Code discounts only.

startsAtstring date-time

Defaults to now.

endsAtstring date-time nullable

Response

Discount updated

Example response

{
  "discount": {
    "value": {
      "percentage": 15
    },
    "minimum": {
      "amount": {
        "amount": "19.90",
        "currency": "USD"
      }
    }
  }
}

Changes

Changed in 2 of the 60 revisions of this API.2