Discounts

Update discount

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

put/v1/commerce/discounts/{discountId}

Request

Path parameters

discountIdstring required

The discount's unique identifier.

Headers

Authorizationstring required

API key or OAuth access token

User-Agentstring required

User Agent

Request body

idstring

Discount id.

isLimitedUsesboolean

If true, the discount can only be used maxUsesAllowed times site-wide.

isOncePerCustomerboolean

If true, a given customer can only use this discount once.

lastRedeemedAtstring date-time

Timestamp of the most recent redemption. Null if never redeemed.

maxUsesAllowedinteger

Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.

namestring required

Display name for the discount.

numberOfUsesinteger

Number of times this discount has been redeemed.

status'ACTIVE' | 'SCHEDULED' | 'EXPIRED'

Defines the lifecycle status of a discount.

validFromstring date-time required

When the discount becomes active.

validTostring date-time

When the discount expires. Null = no expiry.

websiteIdstring

24-char website id.

Example request

{
  "criteria": {
    "minimumCartTotal": {
      "value": 49.99
    }
  },
  "template": {
    "discountAmount": {
      "value": 49.99
    }
  }
}

Response

The updated discount.

Example response

{
  "discount": {
    "criteria": {
      "minimumCartTotal": {
        "value": 49.99
      }
    },
    "template": {
      "discountAmount": {
        "value": 49.99
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.