Queries and mutations for managing Product Discounts in the platform.
Queries
Query Product Discounts
| Arguments | |
|---|---|
whereString | |
sortArray of String | |
limitInt | |
offsetInt | |
Get Product Discount
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
Mutations
Create Product Discount
Update Product Discount
| Arguments | |
|---|---|
versionLong | |
actionsArray of ProductDiscountUpdateAction | |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete Product Discount
| Arguments | |
|---|---|
versionLong | |
idString | Queries with specified ID |
keyString | Queries with specified key |
Output types
ProductDiscount
A product price can be discounted in two ways:
- with a relative or an absolute product discount, which will be automatically applied to all prices in a product that match a discount predicate. A relative discount reduces the matching price by a fraction (for example 10 % off). An absolute discount reduces the matching price by a fixed amount (for example 10€ off). If more than one product discount matches a price, the discount sort order determines which one will be applied.
- with an external product discount, which can then be used to explicitly set a discounted value on a particular product price.
The discounted price is stored in the discounted field of the Product Price.
Note that when a discount is created, updated or removed it can take up to 15 minutes to update all the prices with the discounts.
predicateString | Valid ProductDiscount predicate. |
isActiveBoolean | Whether the Product Discount is applied to Products matching the predicate. |
isValidBoolean | |
sortOrderString | Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized. |
keyString | User-defined unique identifier of the ProductDiscount. |
nameString | Name of the ProductDiscount. |
descriptionString | Description of the ProductDiscount. |
referenceRefsArray of Reference | |
nameAllLocalesArray of LocalizedString | Name of the ProductDiscount. |
descriptionAllLocalesArray of LocalizedString | Description of the ProductDiscount. |
validFrom | Date and time (UTC) from which the Discount is effective.
Take Eventual Consistency into account for calculated discount values. |
validUntil | Date and time (UTC) until which the Discount is effective.
Take Eventual Consistency into account for calculated undiscounted values. |
value | Type of Discount and its corresponding value. |
idString | Unique identifier of the ProductDiscount. |
versionLong | Current version of the ProductDiscount. |
createdAt | Date and time (UTC) the ProductDiscount was initially created. |
lastModifiedAt | Date and time (UTC) the ProductDiscount was last updated. |
createdBy | IDs and references that created the ProductDiscount. |
lastModifiedBy | IDs and references that last modified the ProductDiscount. |
ProductDiscountValue
typeString |
Product Discount Query Result
offsetInt | |
countInt | |
totalLong | |
existsBoolean | |
resultsArray of ProductDiscount |
Input types
ProductDiscountDraft
value | Type of Discount and its corresponding value. |
predicateString | A valid ProductDiscount Predicate. |
sortOrderString | Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized.
The value must be unique among all ProductDiscounts in the Project. |
nameArray of LocalizedStringItemInputType | Name of the ProductDiscount. |
descriptionArray of LocalizedStringItemInputType | Description of the ProductDiscount. |
validFrom | Date and time (UTC) from which the Discount is effective. |
validUntil | Date and time (UTC) until which the Discount is effective. |
isActiveBoolean | Set to Default: true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).true |
keyString | User-defined unique identifier for the ProductDiscount. |
ProductDiscountValueInput
relative | |
absolute | |
external |
RelativeDiscountValueInput
permyriadInt |
AbsoluteDiscountValueInput
moneyArray of MoneyInput |
ExternalDiscountValueInput
dummyString |
ProductDiscountUpdateAction
changeIsActive | |
changeName | |
changePredicate | |
changeSortOrder | |
changeValue | |
setDescription | |
setKey | |
setValidFrom | |
setValidFromAndUntil | |
setValidUntil |
Update actions
Change Is Active
isActiveBoolean | New value to set.
If set to true, the Discount will be applied to Product Prices. |
Change Name
nameArray of LocalizedStringItemInputType | New value to set. Must not be empty. |
Change Predicate
predicateString | New value to set. Must be a valid ProductDiscount predicate. |
Change Sort Order
sortOrderString | New value to set.
Must not be empty.
The string value must be a number between
0 and 1.
A Discount with a higher sortOrder is prioritized.If the value is used by another Product Discount, a DuplicateField error is returned. |
Change Value
value | New value to set. Must not be empty. |
ProductDiscountValueInput
relative | |
absolute | |
external |
RelativeDiscountValueInput
permyriadInt |
AbsoluteDiscountValueInput
moneyArray of MoneyInput |
ExternalDiscountValueInput
dummyString |
Set Description
descriptionArray of LocalizedStringItemInputType | Value to set. If omitted, any existing value is removed. |
Set Key
keyString | Value to set. If omitted, any existing value is removed. If the value is used by another Product Discount, a DuplicateField error is returned. |
Set Valid From
validFrom | Value to set.
If omitted, any existing value is removed.
Take Eventual Consistency into account for calculated discount values. |
Set Valid From And Until
validFrom | Value to set.
Take Eventual Consistency into account for calculated undiscounted values. |
validUntil | Value to set.
Take Eventual Consistency into account for calculated undiscounted values. |
Set Valid Until
validUntil | Value to set.
If omitted, any existing value is removed.
Take Eventual Consistency into account for calculated undiscounted values. |