commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Discount Code → Query DiscountCodes

AI-generated

Summary

Query discount codes from the commercetools platform using various optional filters to control the results returned.

Inputs

  • Filters — Optional filters to refine the query results. Includes Expand (to fetch referenced resources in detail), Sort (to order results), Limit (to restrict number of results), Offset (to skip a number of results), With Total (to include total count in results), and Where (to filter results by conditions).

Output shape

A list of discount code objects returned as JSON within an array, each representing a discount code matching the query criteria.

Results respect the specified filters such as limit and offset for pagination. The API response includes the discount codes data along with any expanded references if requested. Errors during the query are returned as node errors unless 'Continue On Fail' is enabled.

Examples

Example 1: Query all discount codes with a limit of 10 and sorted by creation date descending.

Set 'Limit' filter to '10' and 'Sort' filter to 'createdAt desc'.

Links

Discussion