Generate barcodes
POST
/ admin/ v1/ stores/ {store_id}/ products/ barcodes- products:write
- Idempotency-Key supported
Give variants without a barcode an in-store EAN-13 (starting with 2, unique in the store), so they can be labelled and scanned.
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
variant_idsarray of stringsVariants; those with a barcode keep it. 1–250 with the products' variants.
product_idsarray of stringsEvery variant of these products.
Returns
200 Each variant with its barcode.
Errors
- 403
forbiddenMissing permission. - 404
not_foundA variant that doesn't exist. - 422
validation_failedNo variants, or more than 250.