• I’m currently developing a NuxtJS app with WordPress as a headless CMS. I’m having issues coming up with a good solution for retrieving all of my products and their variations via the REST API.

    Here’s my scenario: A user views the galleries page, where I fetch all of the products. Then a user clicks into one of the galleries, where I need to retrieve a single product and its variations.

    I realize there’s an endpoint specifically for variations, however I am required to know its ID to retrieve those. Additionally, there is other information I would like to use from the base /products endpoint.

    The /products endpoint includes an array of variations as their IDs. Honestly, the solution would be to just turn those into the full variation object, however I don’t want to have to run several requests on page load for something this simple.

    Is there a way to include the full variations objects from the /products endpoint? Thanks!

  • The topic ‘Include variations objects in /products REST API endpoint?’ is closed to new replies.