Product Discounts

Product Discounts reduce certain Product Prices.

Product Discounts are useful for scenarios when you want to display a discounted price before adding an item to the Cart.

Product Discounts are subject to a limit in a Project.
For an introduction to Product Discounts and to understand how they work, see the Product Discounts overview.
When you create, update, or delete a Product Discount, the Prices are updated in an eventually consistent manner. Both Embedded Prices and StandalonePrices associated to a ProductVariant are updated, regardless of the Product's priceMode value.

The time to update can vary—between a fraction of a second to several hours—depending on the following factors:

  • The number of Products and their size
  • The number of Products affected by Discount predicates
  • The number of Prices to be updated
Learn more about Product Discounts in our self-paced Product Discounts module.

Get ProductDiscount

Get ProductDiscount by ID

GET
https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id}
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
id
​
String
​
id of the ProductDiscount.
Query parameters:
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Get ProductDiscount by Key

GET
https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key}
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
key
​
String
​
key of the ProductDiscount.
Query parameters:
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Query ProductDiscounts

GET
https://api.{region}.commercetools.com/{projectKey}/product-discounts
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
Query parameters:
where
​
String
​

Use to filter query responses.

For more information, see Query Predicates.
The parameter can be passed multiple times.
sort
​
String
​

Use to sort query results.

For more information, see Sorting.
The parameter can be passed multiple times.
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
limit
​
Int32
​
Default: 20​
Minimum: 0​
Maximum: 500​
offset
​
Int32
​
Number of elements skipped.
Default: 0​
Maximum: 10000​
withTotal
​
Boolean
​
Controls the calculation of the total number of query results. Set to false to improve query performance when the total is not needed.
Default: true​
var.<varName>
​
String
​
The parameter can be passed multiple times.
Response:
Request Example:cURL
curl --get https://api.{region}.commercetools.com/{projectKey}/product-discounts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 
200 Response Example: ProductDiscountPagedQueryResponsejson
{
  "limit": 20,
  "offset": 0,
  "count": 1,
  "total": 1,
  "results": [
    {
      "id": "{{product-discount-id}}",
      "version": 1,
      "key": "summer-sale",
      "name": {
        "en": "Summer Sale"
      },
      "description": {
        "en": "1€ off all products"
      },
      "value": {
        "type": "absolute",
        "money": [
          {
            "type": "centPrecision",
            "currencyCode": "EUR",
            "centAmount": 100,
            "fractionDigits": 2
          }
        ]
      },
      "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\"",
      "sortOrder": "0.9534",
      "isActive": true,
      "references": [
        {
          "typeId": "product",
          "id": "464af704-78f7-4d39-9a1c-d00a6f3234b3"
        }
      ],
      "createdAt": "2024-11-21T10:44:07.587Z",
      "lastModifiedAt": "2024-11-21T10:44:07.587Z",
      "lastModifiedBy": {
        "clientId": "{{client-id}}",
        "isPlatformClient": false
      },
      "createdBy": {
        "clientId": "{{client-id}}",
        "isPlatformClient": false
      }
    }
  ]
}

Check if ProductDiscount exists

Check if ProductDiscount exists by ID

HEAD
https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id}
Checks if a ProductDiscount exists with the provided id. Returns a 200 status if the ProductDiscount exists, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
id
​
String
​
id of the ProductDiscount.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Check if ProductDiscount exists by Key

HEAD
https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key}
Checks if a ProductDiscount exists with the provided key. Returns a 200 status if the ProductDiscount exists, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
key
​
String
​
key of the ProductDiscount.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Check if ProductDiscount exists by Query Predicate

HEAD
https://api.{region}.commercetools.com/{projectKey}/product-discounts
Checks if one or more ProductDiscounts exist for the provided query predicate. Returns a 200 status if any ProductDiscounts match the query predicate, or a 404 status otherwise.
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
Query parameters:
where
​
String
​

Use to filter query responses.

For more information, see Query Predicates.
The parameter can be passed multiple times.
Response:
200
Request Example:cURL
curl --head https://api.{region}.commercetools.com/{projectKey}/product-discounts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 

Create ProductDiscount

POST
https://api.{region}.commercetools.com/{projectKey}/product-discounts
OAuth 2.0 Scopes:
manage_product_discounts:{projectKey}manage_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
Query parameters:
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Request Body:ProductDiscountDraftasapplication/json
Response:
201

ProductDiscount

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/product-discounts -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "key" : "summer-sale",
  "name" : {
    "en" : "Summer Sale"
  },
  "description" : {
    "en" : "1€ off all products"
  },
  "value" : {
    "type" : "absolute",
    "money" : [ {
      "currencyCode" : "EUR",
      "centAmount" : 100
    } ]
  },
  "predicate" : "(product.id = "{{product-id}}" and variant.id = 1) or variant.key = "{{product-variant-key}}" or attributes.label = "{{product-attribute-label}}"",
  "sortOrder" : "0.9534",
  "isActive" : true
}
DATA
201 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Update ProductDiscount

Update ProductDiscount by ID

POST
https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id}
OAuth 2.0 Scopes:
manage_product_discounts:{projectKey}manage_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
id
​
String
​
id of the ProductDiscount.
Query parameters:
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Request Body:
application/json
version​
Int64​
Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.
actions​

Update actions to be performed on the ProductDiscount.

Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "version" : 1,
  "actions" : [ {
    "action" : "changeValue",
    "value" : {
      "type" : "absolute",
      "money" : [ {
        "currencyCode" : "EUR",
        "centAmount" : 200
      } ]
    }
  } ]
}
DATA
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 2,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 200,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "464af704-78f7-4d39-9a1c-d00a6f3234b3"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-12-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Update ProductDiscount by Key

POST
https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key}
OAuth 2.0 Scopes:
manage_product_discounts:{projectKey}manage_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
key
​
String
​
key of the ProductDiscount.
Query parameters:
expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Request Body:
application/json
version​
Int64​
Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.
actions​

Update actions to be performed on the ProductDiscount.

Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "version" : 1,
  "actions" : [ {
    "action" : "changeValue",
    "value" : {
      "type" : "absolute",
      "money" : [ {
        "currencyCode" : "EUR",
        "centAmount" : 200
      } ]
    }
  } ]
}
DATA
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 2,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 200,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "464af704-78f7-4d39-9a1c-d00a6f3234b3"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-12-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Update actions

Set Key

action​
String​
"setKey"
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.
MinLength: 2​MaxLength: 256​Pattern: ^[A-Za-z0-9_-]+$​
Example: json
{
  "action": "setKey",
  "key": "new-key"
}

Change Value

action​
String​
"changeValue"
value​

New value to set. Must not be empty.

Example: json
{
  "action": "changeValue",
  "value": {
    "type": "relative",
    "permyriad": 2000
  }
}

Change Predicate

action​
String​
"changePredicate"
predicate​
String​
New value to set. Must be a valid ProductDiscount predicate.
Example: json
{
  "action": "changePredicate",
  "predicate": "product.id = \"{{product-id}}\""
}

Change Is Active

action​
String​
"changeIsActive"
isActive​
Boolean​
New value to set. If set to true, the Discount will be applied to Product Prices.
Example: json
{
  "action": "changeIsActive",
  "isActive": false
}

Set Valid From

action​
String​
"setValidFrom"
validFrom​
Value to set. If omitted, any existing value is removed. Take Eventual Consistency into account for calculated discount values.
Example: json
{
  "action": "setValidFrom",
  "validFrom": "2025-10-12T14:05:00.000Z"
}

Set Valid Until

action​
String​
"setValidUntil"
validUntil​
Value to set. If omitted, any existing value is removed. Take Eventual Consistency into account for calculated undiscounted values.
Example: json
{
  "action": "setValidUntil",
  "validUntil": "2025-11-12T14:05:00.000Z"
}

Set Valid From and Until

action​
String​
"setValidFromAndUntil"
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.
Example: json
{
  "action": "setValidFromAndUntil",
  "validFrom": "2025-10-12T14:00:00.000Z",
  "validUntil": "2025-11-12T14:05:00.000Z"
}

Change Name

action​
String​
"changeName"
name​

New value to set. Must not be empty.

Example: json
{
  "action": "changeName",
  "name": {
    "de": "Neuer Rabatt",
    "en": "New discount"
  }
}

Set Description

action​
String​
"setDescription"
description​

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

Example: json
{
  "action": "setDescription",
  "description": {
    "de": "Neue Beschreibung",
    "en": "New description"
  }
}

Change Sort Order

action​
String​
"changeSortOrder"
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.
Example: json
{
  "action": "changeSortOrder",
  "sortOrder": "0.3"
}

Delete ProductDiscount

Delete ProductDiscount by ID

DELETE
https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id}
OAuth 2.0 Scopes:
manage_product_discounts:{projectKey}manage_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
id
​
String
​
id of the ProductDiscount.
Query parameters:
version
​
Int64
​

Last seen version of the resource.

expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/product-discounts/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Delete ProductDiscount by Key

DELETE
https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key}
OAuth 2.0 Scopes:
manage_product_discounts:{projectKey}manage_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
key
​
String
​
key of the ProductDiscount.
Query parameters:
version
​
Int64
​

Last seen version of the resource.

expand
​
String
​

Use to expand resources in a single request.

For more information, see Reference Expansion.
The parameter can be passed multiple times.
Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/product-discounts/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Get Matching ProductDiscount

POST
https://api.{region}.commercetools.com/{projectKey}/product-discounts/matching
This endpoint can be used to simulate which Product Discounts would be applied if a specified Product Variant had a specified Price. Given Product and Product Variant IDs and a Price, this endpoint will return the ProductDiscount that would have been applied to that Price.
If a Product Discount could not be found that could be applied to the Price of a Product Variant, a NoMatchingProductDiscountFound error is returned.
OAuth 2.0 Scopes:
view_product_discounts:{projectKey}view_products:{projectKey}
Path parameters:
region
​
String
​
Region in which the Project is hosted.
projectKey
​
String
​
key of the Project.
Request Body:ProductDiscountMatchQueryasapplication/json
Response:
200

ProductDiscount

as
application/json
Request Example:cURL
curl https://api.{region}.commercetools.com/{projectKey}/product-discounts/matching -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "productId" : "{{product-id}}",
  "variantId" : 1,
  "staged" : false,
  "price" : {
    "id" : "{{price-id}}",
    "value" : {
      "currencyCode" : "EUR",
      "centAmount" : 10000
    },
    "country" : "DE",
    "customerGroup" : {
      "typeId" : "customer-group",
      "id" : "{{customer-group-id}}"
    },
    "tiers" : [ {
      "minimumQuantity" : 10,
      "value" : {
        "currencyCode" : "EUR",
        "centAmount" : 9000
      }
    } ]
  }
}
DATA
200 Response Example: ProductDiscountjson
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

Representations

ProductDiscount

id​
String​

Unique identifier of the ProductDiscount.

version​
Int64​

Current version of the ProductDiscount.

key​
String​

User-defined unique identifier of the ProductDiscount.

MinLength: 2​MaxLength: 256​Pattern: ^[A-Za-z0-9_-]+$​
name​

Name of the ProductDiscount.

description​

Description of the ProductDiscount.

value​

Type of Discount and its corresponding value.

predicate​
String​
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.

isActive​
Boolean​
Whether the Product Discount is applied to Products matching the predicate.
references​
Array of Reference​
References to all resources addressed in the predicate by their IDs. This value is generated by the platform.
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.
createdAt​

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

createdBy​BETA

IDs and references that created the ProductDiscount.

lastModifiedAt​

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

lastModifiedBy​BETA

IDs and references that last modified the ProductDiscount.

Example: json
{
  "id": "{{product-discount-id}}",
  "version": 1,
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 100,
        "fractionDigits": 2
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true,
  "references": [
    {
      "typeId": "product",
      "id": "{{product-id}}"
    }
  ],
  "createdAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedAt": "2024-11-21T10:44:07.587Z",
  "lastModifiedBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  },
  "createdBy": {
    "clientId": "{{client-id}}",
    "isPlatformClient": false
  }
}

ProductDiscountDraft

key​
String​

User-defined unique identifier for the ProductDiscount.

If the value is used by another Product Discount, a DuplicateField error is returned.
MinLength: 2​MaxLength: 256​Pattern: ^[A-Za-z0-9_-]+$​
name​

Name of the ProductDiscount.

description​

Description of the ProductDiscount.

value​

Type of Discount and its corresponding value.

predicate​
String​
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.
If the value is used by another Product Discount, a DuplicateField error is returned.
isActive​
Boolean​
Whether to activate the ProductDiscount. To deactivate it even though the predicate matches, set to false.
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.
Example: json
{
  "key": "summer-sale",
  "name": {
    "en": "Summer Sale"
  },
  "description": {
    "en": "1€ off all products"
  },
  "value": {
    "type": "absolute",
    "money": [
      {
        "currencyCode": "EUR",
        "centAmount": 100
      }
    ]
  },
  "predicate": "(product.id = \"{{product-id}}\" and variant.id = 1) or variant.key = \"{{product-variant-key}}\" or attributes.label = \"{{product-attribute-label}}\"",
  "sortOrder": "0.9534",
  "isActive": true
}

ProductDiscountPagedQueryResponse

PagedQueryResult with results containing an array of ProductDiscount.
limit​
Int64​
Default: 20​Minimum: 0​Maximum: 500​
offset​
Int64​
Number of elements skipped.
Default: 0​Maximum: 10000​
count​
Int64​

Actual number of results returned.

total​
Int64​
Total number of results matching the query. This number is an estimation that is not strongly consistent. This field is returned by default. For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. When the results are filtered with a Query Predicate, total is subject to a limit.
results​
Array of ProductDiscount​
ProductDiscounts matching the query.

ProductDiscountReference

id​
String​
Unique identifier of the referenced ProductDiscount.
typeId​
product-discount
Contains the representation of the expanded ProductDiscount. Only present in responses to requests with Reference Expansion for ProductDiscounts.

ProductDiscountKeyReference

Used by the Import API to identify a ProductDiscount.
key​
String​

User-defined unique identifier of the referenced ProductDiscount.

typeId​
product-discount

ProductDiscountResourceIdentifier

ResourceIdentifier to a ProductDiscount. Either id or key is required. If both are set, an InvalidJsonInput error is returned.
id​
String​
Unique identifier of the referenced ProductDiscount. Required if key is absent.
key​
String​
User-defined unique identifier of the referenced ProductDiscount. Required if id is absent.
typeId​
product-discount

ProductDiscountValue

Abstract parent type for the specific values, distinguished by the type field - relative, absolute, or external.

ProductDiscountValueRelative

Discounts the product price by a percentage, defined by the permyriad field.
type​
String​
"relative"
permyriad​
Int64​
Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.
Example: json
{
  "type": "relative",
  "permyriad": 1000
}

ProductDiscountValueAbsolute

Discounts the Product's Price by a fixed amount, defined by the money field.
type​
String​
"absolute"
money​
Array of CentPrecisionMoney​
Money values in different currencies. An absolute ProductDiscount will only match a price if this array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.
Example: json
{
  "type": "absolute",
  "money": [
    {
      "type": "centPrecision",
      "currencyCode": "EUR",
      "centAmount": 100,
      "fractionDigits": 2
    }
  ]
}

ProductDiscountValueExternal

Discounts the Product Price by allowing the client to explicitly set a discounted value. Used when setting discounts using an external service.
type​
String​
"external"
Example: json
{
  "type": "external"
}

ProductDiscountValueDraft

Abstract parent draft type for the specific value drafts, distinguished by the type field - relative, absolute, or external.

ProductDiscountValueRelativeDraft

Discounts the Product Price by a percentage, defined by the permyriad field.
type​
String​
"relative"
permyriad​
Int64​
Fraction (per ten thousand) the price is reduced by. For example, 1000 will result in a 10% price reduction.
Example: json
{
  "type": "relative",
  "permyriad": 1000
}

ProductDiscountValueAbsoluteDraft

Discounts the Product Price by a fixed amount, defined by the money field.
type​
String​
"absolute"
money​
Array of Money​

Money values in different currencies. An absolute Product Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be decreased by 10€ and the matching $ price will be decreased by 15$.

If the value exceeds the price of a Product Variant, the resulting discounted price is set to 0.
If the array is empty or has multiple values of the same currency, the API returns an InvalidOperation error.
Example: json
{
  "type": "absolute",
  "money": [
    {
      "currencyCode": "EUR",
      "centAmount": 100
    }
  ]
}

ProductDiscountValueExternalDraft

Discounts the Product Price by allowing the client to explicitly set a discounted value. Use this when setting discounts using an external service.
type​
String​
"external"
Example: json
{
  "type": "external"
}

ProductDiscountMatchQuery

productId​
String​

ID of the specified Product.

variantId​
Int32​

ID of the specified Product Variant.

staged​
Boolean​
Controls which projected representation is applied for the query. Set to true for the staged Product Projection of the specified Product Variant, set to false for the current one.
price​

Specified Price of the specified Product Variant.

Example: json
{
  "productId": "{{product-id}}",
  "variantId": 1,
  "staged": false,
  "price": {
    "id": "{{price-id}}",
    "value": {
      "currencyCode": "EUR",
      "centAmount": 10000
    },
    "country": "DE",
    "customerGroup": {
      "typeId": "customer-group",
      "id": "{{customer-group-id}}"
    },
    "tiers": [
      {
        "minimumQuantity": 10,
        "value": {
          "currencyCode": "EUR",
          "centAmount": 9000
        }
      }
    ]
  }
}

QueryPrice

id​
String​

Unique identifier of the given Price.

value​

Money value of the given Price.

country​

Country for which the given Price is valid.

Pattern: ^[A-Z]{2}$​
customerGroup​
CustomerGroup for which the given Price is valid.
channel​
ProductDistribution Channel for which the given Price is valid.
validFrom​

Date from which the given Price is valid.

validUntil​

Date until which the given Price is valid.

discounted​
DiscountedPrice you specify for the given Price.
tiers​
Array of PriceTierDraft​
Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.
If discounted is specified, the tiered Price is ignored for a Product Variant.
custom​

Custom Fields of the Price.

Example: json
{
  "id": "{{price-id}}",
  "value": {
    "currencyCode": "EUR",
    "centAmount": 10000
  },
  "country": "DE",
  "customerGroup": {
    "typeId": "customer-group",
    "id": "{{customer-group-id}}"
  },
  "tiers": [
    {
      "minimumQuantity": 10,
      "value": {
        "currencyCode": "EUR",
        "centAmount": 9000
      }
    }
  ]
}