REST Resource: projects.locations.brands.stores.discounts

Resource: Discount

A discount that can be applied to orders at a store. Next ID: 16

JSON representation
{
  "name": string,
  "displayName": string,
  "type": enum (DiscountType),
  "scope": enum (Scope),
  "schedule": {
    object (Schedule)
  },
  "fixedAmount": {
    object (Money)
  },
  "percent": number,
  "maxDiscountValue": {
    object (Money)
  },
  "appliedItems": {
    object (ItemGroup)
  },
  "requiredItems": {
    object (ItemGroup)
  },
  "autoApply": boolean,
  "promoCode": string,
  "additionalConstraint": {
    object (Constraint)
  },
  "integrationAttributes": {
    object (DiscountIntegrationAttributes)
  },
  "image": {
    object (Image)
  }
}
Fields
name

string

Identifier. The discount name. Format: projects/{project}/locations/{location}/brands/{brand}/stores/{store}/discounts/{discount}

displayName

string

Required. The user-facing name of the discount (e.g., "20% Off Your Order").

type

enum (DiscountType)

Required. The type of discount being applied.

scope

enum (Scope)

Required. The scope at which the discount is applied.

schedule

object (Schedule)

Optional. The schedule when the discount is active.

fixedAmount

object (Money)

Optional. The fixed monetary value of the discount or the fixed total price, depending on the 'type'.

percent

number

Optional. The percentage value of the discount (0.0 to 100.0). Set when 'type' is PERCENT_OFF.

maxDiscountValue

object (Money)

Optional. If the discount type is PERCENT_OFF, we can set a max discount value user can get.

appliedItems

object (ItemGroup)

Optional. The group of items the discount is applied to. Required if 'scope' is ITEM. E.g. Bundles, mix-and-match, and the GET part of BOGO are defined here.

requiredItems

object (ItemGroup)

Optional. The group of items that must be present in the cart to activate the discount only need to be set when discount type is BOGO. E.g. The BUY part of BOGO discount is defined here.

autoApply

boolean

Optional. If true, the discount is automatically applied when the criteria are met.

promoCode

string

Optional. The code required to apply the discount.

additionalConstraint

object (Constraint)

Optional. Additional constraint to apply this discount.

integrationAttributes

object (DiscountIntegrationAttributes)

Optional. Metadata associated with this entity used for downstream integrations.

image

object (Image)

Optional. Image to display for this discount in the UI.

DiscountType

The type of a discount.

Enums
DISCOUNT_TYPE_UNSPECIFIED Unspecified discount type.
BOGO Buy X, Get Y Free/Z Percent Off/For Z amount.
FIXED_OFF A fixed monetary amount discount (e.g., $5.00 off an item or order).
PERCENT_OFF A percentage discount (e.g., 20% off an item or order).
FIXED_TOTAL Sets the final price of the discounted items to a fixed total (e.g., 2 items for $10.00).
FREE_DELIVERY Waives the delivery fee for the order.

Scope

Defines the level at which the discount is applied.

Enums
SCOPE_UNSPECIFIED Unspecified scope.
ORDER Applied to the entire order.
ITEM Applied to specific items.

ItemGroup

A collection of items from the menu, defined by selection criteria, used to specify required or applied items for a discount. Next ID: 6

JSON representation
{
  "name": string,

  // Union field type can be only one of the following:
  "selectItems": {
    object (SelectItems)
  },
  "allOf": {
    object (AllOf)
  },
  "anyOf": {
    object (AnyOf)
  }
  // End of list of possible types for union field type.
}
Fields
name

string

Optional. Name of the item group.

Union field type. The type of item group. type can be only one of the following:
selectItems

object (SelectItems)

A list of matchers. An item is considered a match if it satisfies ANY of these ItemMatcher criteria (OR logic).

allOf

object (AllOf)

Represents a logical AND of sub-groups.

anyOf

object (AnyOf)

Represents a logical OR of sub-groups.

SelectItems

Defines a requirement to select a specific quantity of items where each item matches ANY of the provided ItemCriteria.

JSON representation
{
  "matches": [
    {
      object (ItemMatcher)
    }
  ],
  "minQuantity": integer,
  "maxQuantity": integer
}
Fields
matches[]

object (ItemMatcher)

Required. Matchers for the items.

minQuantity

integer

Optional. Minimum quantity required for a match.

maxQuantity

integer

Optional. Maximum quantity allowed for a match.

ItemMatcher

Defines the criteria for matching a single item. All specified fields are combined using AND. Next ID: 5

JSON representation
{
  "itemId": string,
  "modifierId": string,
  "categoryId": string,
  "modifierMatcher": {
    object (ModifierMatcher)
  }
}
Fields
itemId

string

Optional. Item ID to match.

modifierId

string

Optional. Modifier ID to match.

categoryId

string

Optional. Category ID to match.

modifierMatcher

object (ModifierMatcher)

Optional. Defines the criteria for modifiers in order to match the Item.

ModifierMatcher

Defines the criteria for matching modifiers.

JSON representation
{
  "allowedModifierIds": [
    string
  ],
  "minModifiers": integer,
  "maxModifiers": integer
}
Fields
allowedModifierIds[]

string

Optional. Modifier id that are required in order to apply the discount.

minModifiers

integer

Optional. The minimum number of modifiers required for a match. If required_modifier_ids is set, will only count modifiers in the list.

maxModifiers

integer

Optional. The maximum number of modifiers allowed for a match. If required_modifier_ids is set, will only count modifiers in the list.

AllOf

Represents a logical AND of sub-groups.

JSON representation
{
  "groups": [
    {
      object (ItemGroup)
    }
  ]
}
Fields
groups[]

object (ItemGroup)

Required. Sub-groups components.

AnyOf

Represents a logical OR of sub-groups.

JSON representation
{
  "groups": [
    {
      object (ItemGroup)
    }
  ]
}
Fields
groups[]

object (ItemGroup)

Required. Sub-groups components.

Constraint

Additional constraint to apply this discount.

JSON representation
{
  "minSpend": {
    object (Money)
  },
  "maxUsesPerOrder": integer,
  "allowedChannels": [
    enum (ChannelType)
  ],
  "requiresCustomerSignin": boolean,
  "isStackable": boolean
}
Fields
minSpend

object (Money)

Optional. Min spend in order to apply this discount.

maxUsesPerOrder

integer

Optional. How many times can this discount being used per order.

allowedChannels[]

enum (ChannelType)

Optional. Channels this discount can be applied. If not set, the discount can be applied to all channels.

requiresCustomerSignin

boolean

Optional. For mobile orders, if we need customer to signin to get this discount.

isStackable

boolean

Optional. If this discount can be used with other discount.

DiscountIntegrationAttributes

Metadata associated with a discount used for downstream integrations.

JSON representation
{
  "customIntegrationAttributes": {
    object
  }
}
Fields
customIntegrationAttributes

object (Struct format)

Optional. Arbitrary metadata to be associated with an entity, used to build downstream integrations, i.e. identifiers or schema information for constructing an order for submission to a third-party point of sale API.

Methods

create

Creates a discount.

delete

Deletes the specified discount.

get

Gets a discount.

list

Lists discounts.

patch

Updates the specified discount.