Schema
Discount
Defines a discount that is applied by a merchant against an order or specific line items.
Overview
Properties
uuid
The discount's unique identifier.
uuid
Yes
model_type
Yes
Allowed values
discountname
The discount's display name.
Buy 1, Get 1 Free
1
255
tags
The discount's tags.
Yes
Array items
Items
uuid
calculation
The discount's calculation. Discounts may use `fixed`, `percentage`, or `price_override` calculations.
All of
All of 1
References Calculation.
All of 2
product_group
The uuid of the product group that the discount should be applied against. This field is required when `calculation.type` is `price_override` or when quantity allocation mechanics are configured.
uuid
Yes
availability
References Availability.
promo_code
The promo code associated with the discount. This can only be set when creating the discount, and cannot be changed.
B1G1F
1
255
Yes
description
A user-friendly description of the discount.
Buy anything and get another anything free!
1
255
Yes
total_redemption_limit
The total number of redemptions permitted.
1
Yes
daily_redemption_limit
The total number of redemptions permitted per calendar day.
1
Yes
total_user_redemption_limit
The total number of redemptions permitted per user.
1
Yes
daily_user_redemption_limit
The total number of redemptions permitted per user, per calendar day.
1
Yes
allow_redemption_alongside_others
Indicates if this discount can be redeemed alongside other discounts in the same cart/order. This field may only be `false` for a discount that has a non-null `promo_code`.
auto_apply
Indicates if this discount will automatically apply, assuming all other conditions are met.
minimum_sub_total_spend
Yes
One of
One of 1
One of 2
References Money.
qty_allocation_mechanics
The mechanics that control the behaviour of a quantity-based discount.
Yes
Nested properties
trigger_product_group
The uuid of the product group that should trigger the discount.
uuid
trigger_qty
The required qty of items from the `trigger_product_group` that must be present to trigger the discount.
1
discount_qty
The qty of items from the `product_group` that should be discounted when the trigger is activated.
1
allocation_limit
The maximum number of times the discount should be applied in a single cart.
1
Yes
created_at
The date-time that the discount was created.
date-time
Yes
Used by
Raw YAML
title: Discount
x-tags:
- Catalog
type: object
description: Defines a discount that is applied by a merchant against an order or specific line items.
required:
- uuid
- model_type
- name
- tags
- calculation
- product_group
- availability
- promo_code
- description
- total_redemption_limit
- daily_redemption_limit
- total_user_redemption_limit
- daily_user_redemption_limit
- allow_redemption_alongside_others
- auto_apply
- minimum_sub_total_spend
- qty_allocation_mechanics
- created_at
properties:
uuid:
type: string
format: uuid
description: The discount's unique identifier.
readOnly: true
model_type:
enum:
- discount
readOnly: true
name:
type: string
minLength: 1
maxLength: 255
description: The discount's display name.
example: 'Buy 1, Get 1 Free'
tags:
type: array
uniqueItems: true
description: The discount's tags.
items:
type: string
format: uuid
calculation:
allOf:
- $ref: ./Calculation.yaml
- type: object
required:
- type
- fixed_value
- percentage
- percentage_cap
- price_override
description: |-
The discount's calculation.
Discounts may use `fixed`, `percentage`, or `price_override` calculations.
product_group:
type:
- string
- 'null'
format: uuid
description: |-
The uuid of the product group that the discount should be applied against.
This field is required when `calculation.type` is `price_override` or when quantity allocation mechanics are configured.
availability:
$ref: ./Availability.yaml
promo_code:
type:
- string
- 'null'
minLength: 1
maxLength: 255
example: B1G1F
description: |-
The promo code associated with the discount.
This can only be set when creating the discount, and cannot be changed.
description:
type:
- string
- 'null'
minLength: 1
maxLength: 255
description: A user-friendly description of the discount.
example: Buy anything and get another anything free!
total_redemption_limit:
type:
- integer
- 'null'
minimum: 1
description: The total number of redemptions permitted.
daily_redemption_limit:
type:
- integer
- 'null'
minimum: 1
description: The total number of redemptions permitted per calendar day.
total_user_redemption_limit:
type:
- integer
- 'null'
minimum: 1
description: The total number of redemptions permitted per user.
daily_user_redemption_limit:
type:
- integer
- 'null'
minimum: 1
description: 'The total number of redemptions permitted per user, per calendar day.'
allow_redemption_alongside_others:
type: boolean
description: |-
Indicates if this discount can be redeemed alongside other discounts in the same cart/order.
This field may only be `false` for a discount that has a non-null `promo_code`.
auto_apply:
type: boolean
description: 'Indicates if this discount will automatically apply, assuming all other conditions are met.'
minimum_sub_total_spend:
oneOf:
- type: 'null'
- $ref: ./Money.yaml
qty_allocation_mechanics:
type:
- object
- 'null'
description: The mechanics that control the behaviour of a quantity-based discount.
required:
- trigger_product_group
- trigger_qty
- discount_qty
- allocation_limit
properties:
trigger_product_group:
type: string
format: uuid
description: The uuid of the product group that should trigger the discount.
trigger_qty:
type: integer
minimum: 1
description: The required qty of items from the `trigger_product_group` that must be present to trigger the discount.
discount_qty:
type: integer
minimum: 1
description: The qty of items from the `product_group` that should be discounted when the trigger is activated.
allocation_limit:
type:
- integer
- 'null'
minimum: 1
description: The maximum number of times the discount should be applied in a single cart.
created_at:
type: string
format: date-time
description: The date-time that the discount was created.
readOnly: true