Hi: I’m creating a POS UI Extension and I need to be able to read customer and product tags from the extension. I need to access the Admin Api. Is there a way to do this?
Thanks,
Luis
Hi: I’m creating a POS UI Extension and I need to be able to read customer and product tags from the extension. I need to access the Admin Api. Is there a way to do this?
For customers, just create in your backend an endpoint to gather shopify’s information via rest or via graphql.
Once you have your own backend, you simply have to fetch any endpoint developed to gather the information you need. To do so, the fetch must be secure, this means getting a valid session token and include it in the fetch headings under ‘Authentication’. To get the session token from the extension you can use the session api (https://shopify.dev/docs/api/pos-extensions/ui-extensions-reference/api/session).
If I understood Luis’ question, he needs to get access to the customer that the staff selected in the POS. Do you know how to do that? I am facing the same problem here.
At the time of this answer, Shopify does not provide any POS UI Extensions API to access customer data. So you have to build it yourself.
As I told Luis, the only way I found to get that information in my app is developing a custom backend connected to my Shopify account (in my case I developed a Node server with Express) and make the API calls from your extension to your custom API. This API will gather the information from Shopify and return it to your app.
Maybe you are developing a POS Link app or Cart App Extension app instead of a POS UI Extension app? useExtensionAPI() is only available in this third type.