Skip to content

Expand

Use $expand to request optional aggregate information in a Catalog API response.

On supported Product and Category reads, $expand adds the number of related items. It does not embed those items in the response.

$expand is not documented in the current DAM OpenAPI specification.

When to use $expand

Use $expand when an integration needs a relationship count without retrieving the related records. The values and response fields differ by resource:

Resource$expand valueCount field added
ProductsVariantsVariants@count
ProductsCategoriesCategories@count
CategoriesProductsProducts___count
CategoriesSubCategoriesSubCategories___count

Check the endpoint reference for the values supported by the operation you call. Variants and Custom Entities have no supported related-item expansion; an unsupported value returns 400 Bad Request.

Syntax

$expand=Variants
$expand=Products

Example:

GET https://api2.saleslayer.com/catalog/Products?$select=prod_ref,prod_title&$expand=Variants
GET https://api2.saleslayer.com/catalog/Categories?$select=cat_ref,cat_title&$expand=Products

Get product variants

$expand=Variants adds Variants@count to each Product; it does not return the variant records.

To retrieve the variants associated with a specific product, use the Filter Product Variants endpoint:

GET https://api2.saleslayer.com/catalog/Products({productIdentifier})/Variants?$select=frmt_ref&$top=20

Replace {productIdentifier} with the product identifier. You can use the supported query parameters on that endpoint, such as $select, $filter, $orderby, $top, $skip, and $skipToken, to shape and paginate the returned Variant collection.

Supported expansions

Supported expansions depend on the resource and endpoint. Check the OpenAPI reference for each operation before using $expand.

For Products and Categories, use the values in the table above. Request related records through their own collection endpoints when you need the items themselves.

Notes

  • Expansion is optional. Omit it when you do not need the related-item count.
  • $expand requests counts only; it does not include the related collection.
  • Combine $expand with $select and pagination where appropriate.