d
Topic
npeartree Member
Posts:
6
9 days ago

Admin API -barcode property when listing products

When you list products using the API, one of the properties under variants is "barcode". According to the documentation, this can contain the barcode, UPC or ISBN. When I get the response, is there a way for me to determine the value in the barcode property is a UPC, barcode or an ISBN?

i
Replies
Josh Wheeler Shopify Employee
Posts:
203
9 days ago

Hey there, 

You can essentially enter just about anything into the barcode field on a product, so you shouldn't be assuming that everything in that field will always be a real barcode.

UPC codes and barcodes, etc. all follow their own formats as far as I know though so I'm sure there is a way to pull these values and evaluate if they're a valid UPC/ISBN format.