App reviews, troubleshooting, and recommendations
Hello everyone,
I hope you're all doing well!
I’m working on integrating the Order/Create hook and Orders.json endpoint in the latest version of the Shopify API. I’m considering adding a barcode field to these endpoints so that when I receive the hook information, I can immediately display the barcode, making it easier to scan and accurately identify products.
Would this functionality be available in the latest API updates, or could it be implemented? Any insights or suggestions would be greatly appreciated.
If you need any additional details, feel free to ask! I’m happy to provide more context.
Thank you in advance for your help!
Hello @Mafimi,
Right now the REST orders.json payload and the default orders/create webhook only give you each line item’s sku and variant_id—there’s no built‑in barcode field in that hook. If you need the barcode upfront, you’ve got two solid paths:
1. Fetch it after the fact
When you get the order hook, grab each variant_id from line_items, then hit the /admin/api/2025-04/variants/{variant_id}.json endpoint. That response includes barcode, which you can then display immediately in your system.
2. Use a GraphQL webhook subscription
With the Admin GraphQL API you can subscribe to OrderCreated and explicitly include the barcode on the variant node. That way your webhook payload contains variant.barcode right out of the gate. For example:
subscription {
ordersCreated {
id
lineItems(first: 10) {
edges {
node {
variant {
id
barcode
}
}
}
}
}
}
The REST endpoints haven’t changed to add barcode directly on orders, so fetching it via the variants endpoint—or moving to GraphQL subscriptions—is your best bet.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025