I am trying to retrieve product information based on barcode/UPC and finding myself confused by the API documentation. I am a beginner for programming.
With Square each catalog object will have a unique object_id that is generated by Square. This ID is what is used in the GET /v2/catalog/object/{object_id}. The UPC of an item_variation is a field within the item_variation_data.
Thanks Bryan. Your description and link helped a lot. Under the description for UPC it says “This is a searchable attribute for use in applicable query filters.”
Could you point me in the right direction for how to search it?
Thanks. I moved on to playing with SearchCatalogItems
which should be able to search by upc rather than sku right? But I’m running into a problem with adding a upc value to the sandbox items (I can’t figure out how). What I’m trying to do is use UPC to grab some item details essentially, and I think the code below should work with upc: 123456789012 for example, if I can assign the value to a test item
result = client.catalog.search_catalog_items(
body = {
"text_filter": "123456789012"
}
)
Currently the UPC isn’t currently available in sandbox. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team.
Ok got it. But it should work in production then?
And following that, can I effectively code it in sandbox with sku then switch to upc text_filter for production?