Hi,
I am developing a mobile APP in Angular Js using storefront API. I want to create a simple search field where customer can enter the barcode of the product and it returns product details like product price description etc.
The physical store has thousands of products and this simple mobile app will let customers to get product price without going to POS counter.
I am aware of store front API getProductByID function that is availble in angular example on github. But what will be the best way (least resource expensive way) to get product details by Product barcode. In the store itself the Barcodes are saved in
While you cannot query on the barcode over the storefront API, you can use the Admin GraphQL API's query argument to search on bar code. https://help.shopify.com/en/api/graphql-admin-api/reference/queryroot
I'm not sure why you can't do this via the storefront API seeing how that property of the product is surfaced there, so I'll talk to some teams about perhaps implementing that improvement if it makes sense.
Cheers.
I'm not sure why you can't do this via the storefront API seeing how that property of the product is surfaced there, so I'll talk to some teams about perhaps implementing that improvement if it makes sense.
Hi @Alex any update on this by chance? It seems VERY strange to me that querying orders.json doesn't include the product's barcode/UPC/ISBN etc - many warehousing/shipping/logistics services absolutely require this to be included with orders, not just the SKU. Many thanks in advance!
Is there any plan to add the barcode attribute to the record? I think it belongs together and would make the work a bit easier
The solution appears to be querying products for the barcode using the GraphQL API. Example below, pulling the first 5 variants for the first 5 products that have a barcode value of 123456789012.
{
products(first: 5, query: "barcode:123456789012") {
edges {
node {
id
title
variants(first: 5) {
edges{
node
{
id
title
price
}
}
}
}
}
}
}
While this query doesn't appear to exist in the REST API, the fact that it does exist in the GraphQL API should be a workaround, correct?
I believe you are correct from my understanding of reading all the documentation (APIs are something I'm only mildly familiar with). The issue for us though is that one of our logistics suppliers is using REST and for the moment aren't able to switch to GraphQL. I know there are a few 3rd-party integrations that do the same, so I think it would make sense to include it in REST at some point.
User | Count |
---|---|
12 | |
11 | |
10 | |
8 | |
7 |