---
title: "Update discount"
method: PUT
path: "/v1/commerce/discounts/{discountId}"
tags: ["Discounts"]
---

# Update discount

`PUT /v1/commerce/discounts/{discountId}`

## Request

- Base URL: `https://api.squarespace.com`
- URL: `https://api.squarespace.com/v1/commerce/discounts/{discountId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/squarespace/apis/commerce-api/docs/v1/commerce/discounts/:discountId/put.ts> (a function with typed inputs; its response is checked against the schema)

Replaces the discount for the given discount ID. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS.

## Path parameters

- `discountId` string, required

## Headers

- `Authorization` string, required
- `User-Agent` string, required

## Request body

- Discount: Discount configured for a Commerce store.
  - `criteria` union, required
    - AnyOrderCriteria: Discount applies to any order. No additional conditions.
      - `type` string, required
    - BuyXGetYCriteria: Discount applies when the cart contains a required quantity of qualifying items (buy side), granting a discount on a quantity of eligible items (reward side).
      - `type` string, required
      - `criteriaAppliesTo` 'PRODUCT': Specifies the possible targets for a BuyXGetYCriteria buy-side.
      - `criteriaProductIds` string[]: Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT.
      - `eligibleForDiscountQuantity` integer, required: Quantity of eligible items the discount applies to.
      - `requiredFullPriceQuantity` integer, required: Quantity of qualifying items required at full price.
      - `rewardAppliesTo` 'PRODUCT': Specifies the possible targets for a BuyXGetYCriteria reward-side.
      - `rewardProductIds` string[]: Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT.
    - CartTotalCriteria: Discount applies when the cart total meets or exceeds a minimum.
      - `type` string, required
      - `minimumCartTotal` MonetaryAmount, required: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.
    - ProductCriteria: Discount applies when the cart contains a specific product.
      - `type` string, required
      - `productId` string: Identifier of the product the discount targets.
      - `productName` string: Display-time snapshot of the product name at the time the discount was created.
  - `id` string: Discount id.
  - `isLimitedUses` boolean: If true, the discount can only be used `maxUsesAllowed` times site-wide.
  - `isOncePerCustomer` boolean: If true, a given customer can only use this discount once.
  - `lastRedeemedAt` string, date-time: Timestamp of the most recent redemption. Null if never redeemed.
  - `maxUsesAllowed` integer: Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.
  - `name` string, required: Display name for the discount.
  - `numberOfUses` integer: Number of times this discount has been redeemed.
  - `paymentPlanOptions` PaymentPlanOptions: Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE.
    - `type` 'NONE' | 'ALL_PAYMENTS', required: Defines how the discount applies to payment-plan payments.
  - `status` 'ACTIVE' | 'SCHEDULED' | 'EXPIRED': Defines the lifecycle status of a discount.
  - `subscriptionOptions` SubscriptionOptions: Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED.
    - `type` 'EXCLUDED' | 'ALL_PAYMENTS' | 'LIMITED_PAYMENTS', required: Defines how the discount applies to subscription payments.
  - `template` union, required
    - BuyXGetYFixedAmountTemplate: Apply a fixed monetary amount off each reward item in a BUY_X_GET_Y discount.
      - `type` string, required
      - `discountAmount` MonetaryAmount, required: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.
      - `maxApplicationsPerCart` integer: Caps how many times the discount can be applied per cart. 0 means unlimited.
    - BuyXGetYPercentageTemplate: Apply a percentage discount off each reward item in a BUY_X_GET_Y discount.
      - `type` string, required
      - `discountPercentage` number, required: Percentage to subtract from each reward item. Range (0, 100].
      - `maxApplicationsPerCart` integer: Caps how many times the discount can be applied per cart. 0 means unlimited.
    - FixedAmountTemplate: Apply a fixed monetary amount off the cart total.
      - `type` string, required
      - `discountAmount` MonetaryAmount, required: A monetary amount with currency code and decimal value.
        - `currency` object: ISO 4217 currency code.
          - `currencyCode` string
          - `defaultFractionDigits` integer
          - `displayName` string
          - `numericCode` integer
          - `numericCodeAsString` string
          - `symbol` string
        - `value` number: Decimal monetary value.
    - FreeShippingTemplate: Waive shipping cost for eligible carts.
      - `type` string, required
      - `appliesToFulfillmentOptionType` 'SHIPPING' | 'PICKUP' | 'LOCAL_DELIVERY': Fulfillment channel a free-shipping discount applies to.
      - `selectedShippingOption` SelectedShippingOption: A shipping option targeted by a free-shipping discount.
        - `isAllServicesSelected` boolean: If true, all services within the shipping option are eligible.
        - `selectedService` 'FEDEX_GROUND' | 'FEDEX_GROUND_HOME_DELIVERY' | 'FEDEX_PRIORITY_OVERNIGHT' | 'FEDEX_STANDARD_OVERNIGHT' | 'FEDEX_2_DAY' | 'FEDEX_2_DAY_AM' | 'FEDEX_EXPRESS_SAVER' | 'FEDEX_FIRST_OVERNIGHT' | 'FEDEX_SAME_DAY' | 'FEDEX_SAME_DAY_CITY' | 'UPS_GROUND' | 'UPS_NEXT_DAY_AIR' | 'UPS_NEXT_DAY_AIR_SAVER' | 'UPS_NEXT_DAY_AIR_EARLY_AM' | 'UPS_TWO_DAY_AIR' | 'UPS_TWO_DAY_AIR_AM' | 'UPS_THREE_DAY_SELECT' | 'USPS_PRIORITY' | 'USPS_EXPRESS' | 'USPS_STANDARD': Carrier service eligible for a free-shipping discount.
        - `shippingOptionId` string, required: Identifier of the shipping option.
        - `shippingOptionName` string, required: Display-time snapshot of the shipping option name.
    - PercentageTemplate: Apply a percentage discount off the cart total.
      - `type` string, required
      - `percentage` number, required: Percentage to subtract from the cart total. Range (0, 100].
  - `trigger` union, required
    - AutoTrigger: Trigger for a discount that is automatically applied; no promo code required.
      - `type` string, required
    - PromoCodeTrigger: Trigger for a discount that is unlocked by a shopper-entered promo code.
      - `type` string, required
      - `promoCode` string, required: Shopper-entered promo code. Required, non-empty, 1–50 characters; allowed characters: letters, digits, underscore, hyphen.
  - `validFrom` string, date-time, required: When the discount becomes active.
  - `validTo` string, date-time: When the discount expires. Null = no expiry.
  - `websiteId` string: 24-char website id.

## Response `200`

The updated discount.

- DiscountResponse: Envelope for a single discount response.
  - `discount` Discount, required: Discount configured for a Commerce store.
    - `criteria` union, required
      - AnyOrderCriteria: Discount applies to any order. No additional conditions.
        - `type` string, required
      - BuyXGetYCriteria: Discount applies when the cart contains a required quantity of qualifying items (buy side), granting a discount on a quantity of eligible items (reward side).
        - `type` string, required
        - `criteriaAppliesTo` 'PRODUCT': Specifies the possible targets for a BuyXGetYCriteria buy-side.
        - `criteriaProductIds` string[]: Product ids the cart must contain. Required if criteriaAppliesTo=PRODUCT.
        - `eligibleForDiscountQuantity` integer, required: Quantity of eligible items the discount applies to.
        - `requiredFullPriceQuantity` integer, required: Quantity of qualifying items required at full price.
        - `rewardAppliesTo` 'PRODUCT': Specifies the possible targets for a BuyXGetYCriteria reward-side.
        - `rewardProductIds` string[]: Product ids eligible for the reward. Required if rewardAppliesTo=PRODUCT.
      - CartTotalCriteria: Discount applies when the cart total meets or exceeds a minimum.
        - `type` string, required
        - `minimumCartTotal` MonetaryAmount, required: A monetary amount with currency code and decimal value.
          - `currency` object: ISO 4217 currency code.
            - `currencyCode` string
            - `defaultFractionDigits` integer
            - `displayName` string
            - `numericCode` integer
            - `numericCodeAsString` string
            - `symbol` string
          - `value` number: Decimal monetary value.
      - ProductCriteria: Discount applies when the cart contains a specific product.
        - `type` string, required
        - `productId` string: Identifier of the product the discount targets.
        - `productName` string: Display-time snapshot of the product name at the time the discount was created.
    - `id` string: Discount id.
    - `isLimitedUses` boolean: If true, the discount can only be used `maxUsesAllowed` times site-wide.
    - `isOncePerCustomer` boolean: If true, a given customer can only use this discount once.
    - `lastRedeemedAt` string, date-time: Timestamp of the most recent redemption. Null if never redeemed.
    - `maxUsesAllowed` integer: Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.
    - `name` string, required: Display name for the discount.
    - `numberOfUses` integer: Number of times this discount has been redeemed.
    - `paymentPlanOptions` PaymentPlanOptions: Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE.
      - `type` 'NONE' | 'ALL_PAYMENTS', required: Defines how the discount applies to payment-plan payments.
    - `status` 'ACTIVE' | 'SCHEDULED' | 'EXPIRED': Defines the lifecycle status of a discount.
    - `subscriptionOptions` SubscriptionOptions: Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED.
      - `type` 'EXCLUDED' | 'ALL_PAYMENTS' | 'LIMITED_PAYMENTS', required: Defines how the discount applies to subscription payments.
    - `template` union, required
      - BuyXGetYFixedAmountTemplate: Apply a fixed monetary amount off each reward item in a BUY_X_GET_Y discount.
        - `type` string, required
        - `discountAmount` MonetaryAmount, required: A monetary amount with currency code and decimal value.
          - `currency` object: ISO 4217 currency code.
            - `currencyCode` string
            - `defaultFractionDigits` integer
            - `displayName` string
            - `numericCode` integer
            - `numericCodeAsString` string
            - `symbol` string
          - `value` number: Decimal monetary value.
        - `maxApplicationsPerCart` integer: Caps how many times the discount can be applied per cart. 0 means unlimited.
      - BuyXGetYPercentageTemplate: Apply a percentage discount off each reward item in a BUY_X_GET_Y discount.
        - `type` string, required
        - `discountPercentage` number, required: Percentage to subtract from each reward item. Range (0, 100].
        - `maxApplicationsPerCart` integer: Caps how many times the discount can be applied per cart. 0 means unlimited.
      - FixedAmountTemplate: Apply a fixed monetary amount off the cart total.
        - `type` string, required
        - `discountAmount` MonetaryAmount, required: A monetary amount with currency code and decimal value.
          - `currency` object: ISO 4217 currency code.
            - `currencyCode` string
            - `defaultFractionDigits` integer
            - `displayName` string
            - `numericCode` integer
            - `numericCodeAsString` string
            - `symbol` string
          - `value` number: Decimal monetary value.
      - FreeShippingTemplate: Waive shipping cost for eligible carts.
        - `type` string, required
        - `appliesToFulfillmentOptionType` 'SHIPPING' | 'PICKUP' | 'LOCAL_DELIVERY': Fulfillment channel a free-shipping discount applies to.
        - `selectedShippingOption` SelectedShippingOption: A shipping option targeted by a free-shipping discount.
          - `isAllServicesSelected` boolean: If true, all services within the shipping option are eligible.
          - `selectedService` 'FEDEX_GROUND' | 'FEDEX_GROUND_HOME_DELIVERY' | 'FEDEX_PRIORITY_OVERNIGHT' | 'FEDEX_STANDARD_OVERNIGHT' | 'FEDEX_2_DAY' | 'FEDEX_2_DAY_AM' | 'FEDEX_EXPRESS_SAVER' | 'FEDEX_FIRST_OVERNIGHT' | 'FEDEX_SAME_DAY' | 'FEDEX_SAME_DAY_CITY' | 'UPS_GROUND' | 'UPS_NEXT_DAY_AIR' | 'UPS_NEXT_DAY_AIR_SAVER' | 'UPS_NEXT_DAY_AIR_EARLY_AM' | 'UPS_TWO_DAY_AIR' | 'UPS_TWO_DAY_AIR_AM' | 'UPS_THREE_DAY_SELECT' | 'USPS_PRIORITY' | 'USPS_EXPRESS' | 'USPS_STANDARD': Carrier service eligible for a free-shipping discount.
          - `shippingOptionId` string, required: Identifier of the shipping option.
          - `shippingOptionName` string, required: Display-time snapshot of the shipping option name.
      - PercentageTemplate: Apply a percentage discount off the cart total.
        - `type` string, required
        - `percentage` number, required: Percentage to subtract from the cart total. Range (0, 100].
    - `trigger` union, required
      - AutoTrigger: Trigger for a discount that is automatically applied; no promo code required.
        - `type` string, required
      - PromoCodeTrigger: Trigger for a discount that is unlocked by a shopper-entered promo code.
        - `type` string, required
        - `promoCode` string, required: Shopper-entered promo code. Required, non-empty, 1–50 characters; allowed characters: letters, digits, underscore, hyphen.
    - `validFrom` string, date-time, required: When the discount becomes active.
    - `validTo` string, date-time: When the discount expires. Null = no expiry.
    - `websiteId` string: 24-char website id.

## Other responses

- `400`: Bad request. Missing or invalid fields, invalid criteria/template pairing, or promo code reserved for gift cards.
- `403`: Forbidden. Insufficient scope (OAuth or API key), or the requested resource is not accessible for the authenticated website.
- `404`: Discount not found for this website.
- `409`: Conflict. The promo code is already in use by another discount, the maximum number of auto-trigger discounts has been reached, or a provided currency does not match the store's configured currency.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/squarespace/apis/commerce-api.md) - [All operations](https://skmtc.dev/squarespace/apis/commerce-api/llms.txt) - [OpenAPI document](https://skmtc.dev/squarespace/apis/commerce-api/revisions/5dd4b1b7cd38?raw)
