Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, sorry if this may seem like a stupid question but I can't find any tutorials specifically for the post-purchase extensions. I have created a post-purchase UI extension following this tutorial: https://shopify.dev/docs/apps/checkout/product-offers/post-purchase/getting-started .
Now I want to query the Admin API via HTTP request for which I need the access token, e.g.
let response = await fetch(`https://${shopName}.myshopify.com/admin/api/${apiVersion}/graphql.json`, {
method: "POST",
headers: {
"Content-Type": "application/graphql",
"X-Shopify-Access-Token": <ACCESS-TOKEN>,
},
body: <query>
}
1) How do I get the token? I have tried hardcoding the token which I got after running npm run prisma studio but this is not a permanent solution because the token is different for every merchant.
2) What are the best practices for querying the Admin API? Does it matter whether I query the API from my-extension/src/index.js or from app/routes/api.sign-changeset.jsx? I would be grateful for any pointers or tutorials for that.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024