Nested resources
Traede endpoints return the resource's own fields by default. Related resources (children, parents, siblings) are only included when you explicitly ask for them via the includes[] query parameter. This keeps responses small.
Syntax
includes is an array parameter, so each value goes on its own occurrence of includes[] in the query string:
GET https://api.traede.com/v10/products/1000?includes[]=variants&includes[]=variants.costPrices
The example above eager-loads the variants of the product, and for each variant, its cost prices. Nested relations use dot notation (variants.costPrices, lines.product, and so on) and can be nested to any depth the endpoint allows.
The exact set of relations accepted by each endpoint is listed on that endpoint's reference page under "Available nested resources for including".
caution
The parameter is always called includes[]. Names like include_categories, include_lines or include_variants are not REST parameters and are silently ignored. Use includes[]=categories, includes[]=lines, includes[]=variants instead.
Unknown parameters and unknown values
Unknown top-level query parameters are silently ignored. This is why a request that uses the wrong parameter name still succeeds — the parameter is dropped and the response comes back without the data you wanted.
Unknown values inside includes[], on the other hand, return a 422 validation error with the message <value> is an unknown include for this endpoint. If you see that error, check the endpoint's reference page for the allowed values.