younifyd
Menu

products

Query products — supports a `where` predicate, `sort`, and `limit`/`offset` paging.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the products action (under Products).
  3. Fill in the fields below, then reference the result from later steps as {{products.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query Products($where: String, $sort: [String!], $limit: Int, $offset: Int, $projectExpandedProducts: Boolean, $localeProjection: [Locale!], $skus: [String!]) {
  products(
    where: $where
    sort: $sort
    limit: $limit
    offset: $offset
    projectExpandedProducts: $projectExpandedProducts
    localeProjection: $localeProjection
    skus: $skus
  ) {
    offset
    count
    total
    exists
    results {
      id
      key
      version
      productTypeRef {
        typeId
        id
      }
      productType {
        key
        name
        description
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      masterData {
        current
        staged
        published
        hasStagedChanges
      }
      skus
      createdAt
      lastModifiedAt
      stateRef {
        typeId
        id
      }
      state {
        id
        version
        key
        type
        roles
        nameAllLocales
        descriptionAllLocales
        builtIn
        transitionsRef
        transitions
        initial
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      priceMode
      taxCategoryRef {
        typeId
        id
      }
      taxCategory {
        name
        description
        rates
        key
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      reviewRatingStatistics {
        averageRating
        highestRating
        lowestRating
        count
        ratingsDistribution
      }
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

wherestring
sortarray<string>
limitnumber
offsetnumber
projectExpandedProductsboolean
localeProjectionarray<string>
skusarray<string>

Queries for products with specified SKUs

json
{
  "where": "string",
  "sort": [
    "string"
  ],
  "limit": 0,
  "offset": 0,
  "projectExpandedProducts": false,
  "localeProjection": [
    "string"
  ],
  "skus": [
    "string"
  ]
}

Response

Read the result with {{products.response.data.data.products}}. If the API returns errors, the step fails and they are at {{products.response.data.errors}}.

offsetnumber
countnumber
totalstring
existsboolean
resultsarray<object>
idobject
keyobject
versionobject
productTypeRefobject
productTypeobject
masterDataobject
skusobject
createdAtobject
lastModifiedAtobject
stateRefobject
stateobject
priceModeobject
taxCategoryRefobject
taxCategoryobject
reviewRatingStatisticsobject
createdByobject
lastModifiedByobject

Need more? See the Commercetools guide for connection setup and behaviour shared by every action.

Was this page helpful?