I am creating a headless solution with nextjs and the headless channel app. I want to make it possible for users to see their order status on my site. I need to know if it’s possible to use the Storefront API to get the orders. I read somewhere that I could use the Storefront API and there use the email and order ID to get the data I needed. Can someone tell me if this is possible, and if not, what other solutions are available.
At first I didn’t think this was possible, since on the Admin GraphQL side of the platform you have to apply for PII access.
But yes, it looks like as long as the StoreFront access token is associated with the current user, then you can retrieve the current customer and their orders using the customer
field:
So as long as the token is created using the customerAccessTokenCreate mutation, then it should have access to the current customer’s orders.
Won’t work for me unfortunately, i dont use auth in my app.