Discount
A discount can be applied to a cart for promotional purposes.
Properties
code
stringRequiredA unique code for the discount - this will be used by the customer to apply the discount
created_at
DateRequiredThe date with timezone at which the resource was created.
deleted_at
null | DateRequiredThe date with timezone at which the resource was deleted.
ends_at
null | DateRequiredThe time at which the discount can no longer be used.
id
stringRequiredThe discount's ID
is_disabled
booleanRequiredWhether the Discount has been disabled. Disabled discounts cannot be applied to carts
is_dynamic
booleanRequiredA flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts
metadata
Record<string, unknown>RequiredAn optional key-value map with additional details
The details of the parent discount that this discount was created from.
parent_discount_id
stringRequiredThe Discount that the discount was created from. This will always be a dynamic discount
The details of the regions in which the Discount can be used.
The details of the discount rule that defines how the discount will be applied to a cart..
rule_id
stringRequiredThe ID of the discount rule that defines how the discount will be applied to a cart.
starts_at
DateRequiredThe time at which the discount can be used.
updated_at
DateRequiredThe date with timezone at which the resource was updated.
usage_count
numberRequiredThe number of times a discount has been used.
Default: 0
usage_limit
null | numberRequiredThe maximum number of times that a discount can be used.
valid_duration
null | stringRequiredDuration the discount runs between
Was this section helpful?