Discounts
Manage discounts for a website.
List discounts
Returns a paginated list of discounts for the website. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS.
query Parameters
sortBySort field for the result set.
sortDirectionSort direction.
searchFree-text search across a discount's name and promo code.
statusFilter by discount lifecycle status.
criteriaFilter by one or more criteria types (comma-separated). When omitted, defaults to all allowable values.
templateFilter by one or more template types (comma-separated). When omitted, defaults to all allowable values.
triggerFilter by one or more trigger types (comma-separated): AUTO (auto-applied) or CODE (promo code). When omitted, or when all allowable values are supplied, defaults to all allowable values.
limitedUseOnlyWhen true, only discounts with limited-use semantics (per product rules) are returned.
offsetZero-based offset into the result set. Must be non-negative. Default 0.
limitPage size (1–1000; default 50).
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
List discounts › Responses
Paginated discounts for the website (empty page is a successful response).
Discounts for this page.
hasNextPageTrue when more results exist after the current window.
hasPreviousPageTrue when a page of results exists before the current window.
Create discount
Creates a discount. A successful request returns the created Discount resource. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS.
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
Create discount › Request Body
nameDisplay name for the discount.
validFromWhen the discount becomes active.
isLimitedUsesIf true, the discount can only be used maxUsesAllowed times site-wide.
isOncePerCustomerIf true, a given customer can only use this discount once.
maxUsesAllowedMaximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.
Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE.
Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED.
validToWhen the discount expires. Null = no expiry.
Create discount › Responses
The created discount.
Discount configured for a Commerce store.
Get discount
Returns the discount for the given discount ID. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS.
path Parameters
discountIdThe discount's ID
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
Get discount › Responses
Discount found.
Discount configured for a Commerce store.
Update discount
Replaces the discount for the given discount ID. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS.
path Parameters
discountIdThe discount's unique identifier.
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
Update discount › Request Body
nameDisplay name for the discount.
validFromWhen the discount becomes active.
idDiscount id.
isLimitedUsesIf true, the discount can only be used maxUsesAllowed times site-wide.
isOncePerCustomerIf true, a given customer can only use this discount once.
lastRedeemedAtTimestamp of the most recent redemption. Null if never redeemed.
maxUsesAllowedMaximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.
numberOfUsesNumber of times this discount has been redeemed.
Payment-plan applicability settings for this discount. When omitted from a create or update request, defaults to NONE.
statusDefines the lifecycle status of a discount.
Subscription applicability settings for this discount. When omitted from a create or update request, defaults to EXCLUDED.
validToWhen the discount expires. Null = no expiry.
websiteId24-char website id.
Update discount › Responses
The updated discount.
Discount configured for a Commerce store.
Delete discount
Deletes the discount for the given discount ID. Deletion is permitted for any discount owned by the website, including discounts whose criteria, template, or trigger types are not supported by this API version; no type validation is performed. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS.
path Parameters
discountIdThe discount's ID.
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
Delete discount › Responses
No content. The discount was deleted successfully.
Get fulfillment options
Returns a list of fulfillment option IDs and carrier services that can be used with discounts. Requires OAuth website scope website.discounts.read or website.discounts, or API key scope DISCOUNTS_READONLY or DISCOUNTS.
Headers
AuthorizationAPI key or OAuth access token
User-AgentUser Agent
Get fulfillment options › Responses
List of fulfillment option IDs and carrier services for the website.
Fulfillment option IDs and carrier services for this website.