AdminPostDiscountsReq
admin/discounts.internal.AdminPostDiscountsReq
Schema
A short description of the discountfixed
for discounts that reduce the price by a fixed amount, percentage
for percentage reductions or free_shipping
The value that the discount represents. This will depend on the type of the discount.total
indicates that the discount should be applied on the cart total, and item
indicates that the discount should be applied to each discountable item in the cart."
enum: [total, item]
conditions:
type: array
description: "A set of conditions that can be used to limit when the discount can be used. Only one of products
, product_types
, product_collections
, product_tags
, and customer_groups
should be provided based on the discount condition's type."
items:
type: object
required:
- operator
properties:
operator:
type: string
description: "Operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that
discountable resources are everything but the specified resources."
enum: [in, not_in]
products:
type: array
description: list of product IDs if the condition's type is `products`.
items:
type: string
product_types:
type: array
description: list of product type IDs if the condition's type is `product_types`.
items:
type: string
product_collections:
type: array
description: list of product collection IDs if the condition's type is `product_collections`.
items:
type: string
product_tags:
type: array
description: list of product tag IDs if the condition's type is `product_tags`.
items:
type: string
customer_groups:
type: array
description: list of customer group IDs if the condition's type is `customer_groups`.
items:
type: string
is_disabled:
type: boolean
description: Whether the discount code is disabled on creation. If set to true
Learn about the metadata attribute, and how to delete and update it.
Properties
code
stringRequiredends_at
Dateis_disabled
booleanRequiredis_dynamic
booleanRequiredmetadata
Record<string, unknown>regions
string[]Requiredstarts_at
Dateusage_limit
numbervalid_duration
string