Hey folks,
The api.session.currentSession API in Shopify POS extensibility is super bare-bones. Could we get the location country code added? Right now, it seems the only way is to fetch it via location ID, which slows things down and needs the read_locations scope.
Currently, the api.session.currentSession looks like this:
export interface Session {
/**
* The shop ID associated with the shop currently logged into POS.
*/
shopId: number;
/**
* The user ID associated with the Shopify account currently authenticated on POS.
*/
userId: number;
/**
* The shop domain associated with the shop currently logged into POS.
*/
shopDomain: string;
/**
* The location ID associated with the POS' current location.
*/
locationId: number;
/**
* The staff ID who is currently pinned into the POS.
* Note that this staff member ID may be different to the User ID, as the staff member who enters their PIN may be different to the User who logged onto POS.
*/
staffMemberId?: number;
/**
* The currency code associated with the location currently in on POS.
*/
currency: CurrencyCode;
/**
* The POS version.
*/
posVersion: string;
}
Hey again @Patrick_Jakubik, thanks for bringing this up, just out of curiosity, would the Locale API work for you?
This would let your POS Extension grab the merchant’s locale. If you’re open to sharing your use case here, I can for sure take a closer look into this and set up a feature request if needed on my end here for sure.
Hey @Alan_G! The Locale API isn’t suitable here - we specifically need the country code, since our extension searches for physical locations in the country of the POS and shows them in the extension.
Thanks @Patrick_Jakubik, thanks for clarifying here. You’re right that at the moment, the Locale API wouldn’t output a country code. Happy to send this up to our product team as a feature request. Just out of curiosity, when you mentioned that right now it seems to only be able to be grabbed via the location ID, that location ID query would be through the Admin API?
Just wanted to confirm my understanding here so I can understand your use case better and get this sent up, this could help streamline things for extensions like yours that rely on geo-specific logic without extra API hops there for sure. Hope to speak soon!
Hey Alan! Yep, the Admin API is the only way to get current POS location country now. We just need it for a small group of users and don’t want to expand our app’s scope just to handle this.
Hey again @Patrick_Jakubik - thanks for confirming! I’ve logged the feature request for you on my end here. As always, I can’t guarantee what the outcome will be, but just wanted to let you know that this has officially been sent up to our product team. Thanks again for flagging this, let me know if I can help out any further at all