Storefront API: Get product details from barcode

Topic summary

Querying product details by barcode for a custom mobile app using Shopify APIs.

  • Current capability: Storefront API cannot search by barcode. Admin GraphQL API supports querying products via the query argument (e.g., query: “barcode:123456789012”). REST lacks equivalent support and orders.json doesn’t include barcode.

  • Security/architecture: Calling Admin API from the client triggers CORS and is insecure. Recommended approach is a server-side proxy/back end to make Admin API requests and return results to the app.

  • POS and multiple barcodes: Shopify POS only searches the barcode field; storing two barcodes per variant isn’t supported. Alphanumeric barcodes can be stored in the barcode field. Metafields can hold alternate codes, but Shopify APIs don’t allow querying products by metafield value. Workarounds include maintaining an external, synced product database keyed by the alternate barcode for lookup.

  • Outcomes: Some teams use Admin API plus metafields to pass additional codes (SKU/GTIN/UPC) to logistics providers. A Shopify rep noted the possibility of adding barcode search to Storefront, but no update or implementation was reported.

  • Status: No native Storefront or POS solution for barcode search/multi-barcode scanning. Discussion remains open.

  • Key terms: POS = point of sale; CORS = browser security restricting cross-origin requests; SKU/GTIN/UPC = product identifiers.

Summarized with AI on January 24. AI used: gpt-5.

Just to respond to this since you put the time into your comment (although not directed at me) - we actually found a workaround for this using Admin API and metafields based on your suggestion. By creating custom metafields we can pass along additional information that can then be pulled using the metafields portion of the Admin API. Unlike the other poster, our limitations were due to having multiple logistics providers whose ERPs were pulling different codes to fulfill orders (SKU, GTIN and UPC). In an ideal world they would all get on the same page and just use the SKU or GTIN, but for now we can still use the Admin API while passing the different values they need.