Add fiscalDeviceIdentifier to the POS Device API - #4682
Draft
shopifyzach wants to merge 1 commit into
Draft
Conversation
Assisted-By: devx/1708ff34-a106-41ca-9351-71084c02cdf4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Some countries require every POS installation acting as a cash register to be registered with the tax authority under a Shopify-assigned register identifier (for example, Sweden's manufacturing number / tillverkningsnummer), and fiscal compliance extensions must stamp that identifier on every receipt, journal entry, and report — including while the device is offline.
The GraphQL Admin API exposes this value as
PointOfSaleDevice.fiscalDeviceIdentifier(API version2026-10). Today the only way for a POS UI extension to read it isshopify.session.deviceId→ build a GID → querypointOfSaleDevice(id:)via the Direct API. That path is online-only, requires an Admin API access scope, costs a network round-trip before the first fiscal receipt can print, and couples the extension to two API versions.Solution
Adds an optional, static property to the POS Device API:
devicealongsidenameandregisterName, which already mirrors the Admin API'sPointOfSaleDevice.handle— same class of Shopify-assigned device identity data.sessiondescribes who/where (shop, user, location, staff);devicedescribes the hardware.registerName).undefinedwhen the device's location doesn't require fiscal device registration. Only available on API version2026-10and later; the host exposes it version-gated (same approach assession.deviceId).Companion changes: the extensibility host
devicePluginreads it from the POS domain bridge and exposes it for2026-10+; POS Mobile supplies the value it already holds locally after device registration.Docs generate from the JSDoc; the checked-in
generated_docs_data_v2.jsonis regenerated in the usualdocs(pos): generate …PR rather than here.🎩
yarn type-check✅ · eslint + prettier on the touched files ✅ui-extensions-testerPOS factories don't need a change: the property is optional and the default mock device isn't in a fiscal-registration country.api_version = "2026-10"running on a POS device at a Swedish location readsshopify.device.fiscalDeviceIdentifier(e.g."SH-9IX-7"); on any other device it isundefined; on2026-07and earlier the property is absent.Checklist