YQueue DocsDevelopers

Schema

Discount

Defines a discount that is applied by a merchant against an order or specific line items.

  • Catalog

Overview

object · 18 properties · 18 required

Properties

uuid

string Required

The discount's unique identifier.

Format uuid
Read only Yes

model_type

enum Required
Read only Yes

Allowed values

discount

name

string Required

The discount's display name.

Example Buy 1, Get 1 Free
Min length 1
Max length 255

tags

array Required

The discount's tags.

Unique items Yes
Array items

Items

string
Format uuid

calculation

allOf Required

The discount's calculation. Discounts may use `fixed`, `percentage`, or `price_override` calculations.

All of

All of 1

reference

References Calculation.

All of 2

object

product_group

string | null Required

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.

Format uuid
Nullable Yes

availability

reference Required

References Availability.

promo_code

string | null Required

The promo code associated with the discount. This can only be set when creating the discount, and cannot be changed.

Example B1G1F
Min length 1
Max length 255
Nullable Yes

description

string | null Required

A user-friendly description of the discount.

Example Buy anything and get another anything free!
Min length 1
Max length 255
Nullable Yes

total_redemption_limit

integer | null Required

The total number of redemptions permitted.

Minimum 1
Nullable Yes

daily_redemption_limit

integer | null Required

The total number of redemptions permitted per calendar day.

Minimum 1
Nullable Yes

total_user_redemption_limit

integer | null Required

The total number of redemptions permitted per user.

Minimum 1
Nullable Yes

daily_user_redemption_limit

integer | null Required

The total number of redemptions permitted per user, per calendar day.

Minimum 1
Nullable Yes

allow_redemption_alongside_others

boolean Required

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

boolean Required

Indicates if this discount will automatically apply, assuming all other conditions are met.

minimum_sub_total_spend

oneOf Required
Nullable Yes
One of

One of 1

null

One of 2

reference

References Money.

qty_allocation_mechanics

object | null Required

The mechanics that control the behaviour of a quantity-based discount.

Nullable Yes
Nested properties

trigger_product_group

string Required

The uuid of the product group that should trigger the discount.

Format uuid

trigger_qty

integer Required

The required qty of items from the `trigger_product_group` that must be present to trigger the discount.

Minimum 1

discount_qty

integer Required

The qty of items from the `product_group` that should be discounted when the trigger is activated.

Minimum 1

allocation_limit

integer | null Required

The maximum number of times the discount should be applied in a single cart.

Minimum 1
Nullable Yes

created_at

string Required

The date-time that the discount was created.

Format date-time
Read only Yes

Used by

Raw YAML
Download source
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

Search documentation

Search across this documentation site.