- Resource: Discount
- DiscountType
- Scope
- ItemGroup
- SelectItems
- ItemMatcher
- ModifierMatcher
- AllOf
- AnyOf
- Constraint
- DiscountIntegrationAttributes
- Methods
Resource: Discount
A discount that can be applied to orders at a store. Next ID: 16
| JSON representation |
|---|
{ "name": string, "displayName": string, "type": enum ( |
| Fields | |
|---|---|
name |
Identifier. The discount name. Format: projects/{project}/locations/{location}/brands/{brand}/stores/{store}/discounts/{discount} |
displayName |
Required. The user-facing name of the discount (e.g., "20% Off Your Order"). |
type |
Required. The type of discount being applied. |
scope |
Required. The scope at which the discount is applied. |
schedule |
Optional. The schedule when the discount is active. |
fixedAmount |
Optional. The fixed monetary value of the discount or the fixed total price, depending on the 'type'. |
percent |
Optional. The percentage value of the discount (0.0 to 100.0). Set when 'type' is PERCENT_OFF. |
maxDiscountValue |
Optional. If the discount type is PERCENT_OFF, we can set a max discount value user can get. |
appliedItems |
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 |
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 |
Optional. If true, the discount is automatically applied when the criteria are met. |
promoCode |
Optional. The code required to apply the discount. |
additionalConstraint |
Optional. Additional constraint to apply this discount. |
integrationAttributes |
Optional. Metadata associated with this entity used for downstream integrations. |
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 |
| Fields | |
|---|---|
name |
Optional. Name of the item group. |
Union field type. The type of item group. type can be only one of the following: |
|
selectItems |
A list of matchers. An item is considered a match if it satisfies ANY of these ItemMatcher criteria (OR logic). |
allOf |
Represents a logical AND of sub-groups. |
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 ( |
| Fields | |
|---|---|
matches[] |
Required. Matchers for the items. |
minQuantity |
Optional. Minimum quantity required for a match. |
maxQuantity |
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 ( |
| Fields | |
|---|---|
itemId |
Optional. Item ID to match. |
modifierId |
Optional. Modifier ID to match. |
categoryId |
Optional. Category ID to match. |
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[] |
Optional. Modifier id that are required in order to apply the discount. |
minModifiers |
Optional. The minimum number of modifiers required for a match. If required_modifier_ids is set, will only count modifiers in the list. |
maxModifiers |
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 ( |
| Fields | |
|---|---|
groups[] |
Required. Sub-groups components. |
AnyOf
Represents a logical OR of sub-groups.
| JSON representation |
|---|
{
"groups": [
{
object ( |
| Fields | |
|---|---|
groups[] |
Required. Sub-groups components. |
Constraint
Additional constraint to apply this discount.
| JSON representation |
|---|
{ "minSpend": { object ( |
| Fields | |
|---|---|
minSpend |
Optional. Min spend in order to apply this discount. |
maxUsesPerOrder |
Optional. How many times can this discount being used per order. |
allowedChannels[] |
Optional. Channels this discount can be applied. If not set, the discount can be applied to all channels. |
requiresCustomerSignin |
Optional. For mobile orders, if we need customer to signin to get this discount. |
isStackable |
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 |
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 |
|
|---|---|
|
Creates a discount. |
|
Deletes the specified discount. |
|
Gets a discount. |
|
Lists discounts. |
|
Updates the specified discount. |