Product Discounts

Queries and mutations for managing Product Discounts in the platform.

Queries

Query Product Discounts

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

Get Product Discount

QUERYproductDiscount
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Product Discount

MUTATIONcreateProductDiscount
Arguments
draft​

Update Product Discount

MUTATIONupdateProductDiscount
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Product Discount

MUTATIONdeleteProductDiscount
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

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.

The maximum number of ProductDiscounts that can be active at the same time is 200.
predicate​
String​
isActive​
Boolean​
Whether the Product Discount is applied to Products matching the predicate.
isValid​
Boolean​
sortOrder​
String​

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.

key​
String​

User-defined unique identifier of the ProductDiscount.

name​
String​

Name of the ProductDiscount.

description​
String​

Description of the ProductDiscount.

referenceRefs​
Array of Reference​
nameAllLocales​
Array of LocalizedString​

Name of the ProductDiscount.

descriptionAllLocales​
Array 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.

id​
String​

Unique identifier of the ProductDiscount.

version​
Long​

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

type​
String​

Product Discount Query Result

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

Input types

ProductDiscountDraft

value​

Type of Discount and its corresponding value.

predicate​
String​

A valid ProductDiscount Predicate.

sortOrder​
String​
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.
name​

Name of the ProductDiscount.

description​

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.

isActive​
Boolean​
Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).
Default: true​
key​
String​

User-defined unique identifier for the ProductDiscount.

ProductDiscountValueInput

relative​
absolute​
external​

RelativeDiscountValueInput

permyriad​
Int​

AbsoluteDiscountValueInput

money​
Array of MoneyInput​

MoneyInput

currencyCode​
centAmount​
Long​

ExternalDiscountValueInput

dummy​
String​

ProductDiscountUpdateAction

changeIsActive​
changeName​
changePredicate​
changeSortOrder​
changeValue​
setDescription​
setKey​
setValidFrom​
setValidFromAndUntil​
setValidUntil​

Update actions

Change Is Active

isActive​
Boolean​
New value to set. If set to true, the Discount will be applied to Product Prices.

Change Name

name​

New value to set. Must not be empty.

Change Predicate

predicate​
String​
New value to set. Must be a valid ProductDiscount predicate.

Change Sort Order

sortOrder​
String​
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

permyriad​
Int​

AbsoluteDiscountValueInput

money​
Array of MoneyInput​

MoneyInput

currencyCode​
centAmount​
Long​

ExternalDiscountValueInput

dummy​
String​

Set Description

description​

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

Set Key

key​
String​

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.