Skip to content

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_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • variant_idsarray of strings

    Variants; those with a barcode keep it. 1–250 with the products' variants.

  • product_idsarray of strings

    Every variant of these products.

Returns

200 Each variant with its barcode.

Errors

  • 403forbiddenMissing permission.
  • 404not_foundA variant that doesn't exist.
  • 422validation_failedNo variants, or more than 250.