For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hi,
I am creating an app using the new POS UI Extensions and i want to hit a 3rd party api, after doing some research i got to know i have to create a route in the app backend and then hit that route from UI File ( POS Extension file ) and handle data in req,res manner.
I have create a route in the app backend file ( get - /testpos )
Now for the execution of route from UI File, i need to have a sessionToken with me that i have to send in the header.
For the session token a api is there in the POS UI documentations - https://shopify.dev/docs/api/pos-extensions/ui-extensions-reference/api/session,
upon following every instruction and replacing the entire code with the sample code in the doc, i receive the session Token as Null
Hey @LakshayLakshay . Any updates on this? I'm facing the same issue of receiving session token as null
Hi @raj02 , I reached out to shopify regarding this and the issue was i didnt install the app on the dev store.
Then they added a note to the documentation.
Hope this helps.
Thanks for the info @LakshayLakshay but doesn’t solve my issue. I have the app installed. It was working fine until few days back but suddenly faced this issue.
Any update, I'm facing the same issue!
Not sure but was able to repro with one finding, checkout if this helps. Firstly understand the difference between "userId" and "staffMemberId" in context of POS as per this doc. Lets concentrate on "userId" - this is the user who is authenticated on POS i.e. the user account used to log in once you logout from the store on POS. For the user corresponding to this "userID", go to Shopify Admin -> "Settings" -> "Users and permissions" -> Under "staff" check if this user has got the corresponding app permissions through which you are trying to generate the sessionToken.
In my case, it worked when I granted the apps permission to the logged in "userId" on POS. Hope this helps
I just solved it yesterday, In shopify library the context.php & utils.php I had to do some modifications to make it save the session and after that I needed to remove hashing from shopify access token from the model ( as it is laravel eloquent model ) it automatically hashed it. after more than 10 Hours of debugging it's resolved thanks.