How do i know which associations are available in a shopware 6 store api endpoint

Viewed 72

I'm using the Shopware 6 store-api for my headless application. But i cannot figure out which associations are available in the Shopware store-api for example:

  1. I call store-api/account/customer but also want for example the last order.

  2. I call store-api/login and i also want the customer details (like name, email etc).

  3. I call store-api/seo-urls. And if the routeName is frontend.detail.page i want to get the product details

Is this possible in one api-call? Or do i need to make another request with response data? And how can i check this in the future?

1 Answers

With the Store-API it depends if the endpoint allows you to provide a Criteria that lets you include additional associations. See the corresponding request body in documentation for example in the Shopware Docs.

To find which associations are available per entity you could look at the code in the respective extensions of EntityDefinition, e.g. the ProductDefintion.

Related