Discount Groups

Queries and mutations for managing Discount Groups in the platform.

Queries

Query Discount Groups

QUERYdiscountGroups
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​

Get Discount Group

QUERYdiscountGroup
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Discount Group

MUTATIONcreateDiscountGroup
Arguments
draft​

Update Discount Group

MUTATIONupdateDiscountGroup
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Discount Group

MUTATIONdeleteDiscountGroup
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

DiscountGroup

Allowing to group discounts.

id​
String​

Unique identifier of the DiscountGroup.

version​
Long​

Current version of the DiscountGroup.

key​
String​

User-defined unique identifier of the DiscountGroup.

sortOrder​
String​
Value between 0 and 1 that determines the order in which the CartDiscount from the DiscountGroup is applied; a CartDiscount with a higher value is prioritized.

The sort order is unique among all DiscountGroups and CartDiscounts.

isActive​
Boolean​

A DiscountGroup must be active for its CartDiscounts to be considered during discount application.

name​
String​

Name of the DiscountGroup.

nameAllLocales​
Array of LocalizedString​

Name of the DiscountGroup.

description​
String​

Description of the DiscountGroup.

descriptionAllLocales​
Array of LocalizedString​

Description of the DiscountGroup.

createdAt​

Date and time (UTC) the DiscountGroup was initially created.

lastModifiedAt​

Date and time (UTC) the DiscountGroup was last updated.

createdBy​

IDs and references that created the DiscountGroup.

lastModifiedBy​

IDs and references that last modified the DiscountGroup.

Discount Group Query Result

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of DiscountGroup​

Input types

DiscountGroupDraft

key​
String​

User-defined unique identifier for the DiscountGroup.

If the value is used by another Discount Group, a DuplicateField error is returned.
sortOrder​
String​
Value between 0 and 1 that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.
If the value is used by another Cart Discount or Discount Group, a DuplicateField error is returned.
name​

Name of the DiscountGroup.

isActive​
Boolean​

A DiscountGroup must be active for its CartDiscounts to be considered during discount application.

Default: true​
description​

Description for the DiscountGroup.

DiscountGroupUpdateAction

setKey​
setSortOrder​
setName​
setIsActive​
setDescription​

Update actions

Set Key

Setting a key generates the DiscountGroupKeySet Message.
key​
String​

New value to set.

If the value is used by another Discount Group, a DuplicateField error is returned.

Set Sort Order

Setting the sort order generates the DiscountGroupSortOrderSet Message.
sortOrder​
String​
New value to set (between 0 and 1). A CartDiscount with a higher value will be prioritized.
If the value is used by another Cart Discount or Discount Group, a DuplicateField error is returned.

Set Name

name​

New value to set. If omitted, any existing value is removed.

Set Is Active

This action generates the DiscountGroupIsActiveSet Message.
If the limit for active Discount Groups has been reached, a MaxDiscountGroupsReached error is returned.
isActive​
Boolean​

New value to set.

A DiscountGroup must be active for its CartDiscounts to be considered during discount application.

Set Description

description​

Value to set. If omitted, any existing value is removed.