Barcode field in Order/Create hook and Orders.json endpoint

Barcode field in Order/Create hook and Orders.json endpoint

Mafimi
Visitor
1 0 1

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!

Reply 1 (1)

Kudosi-Carlos
Explorer
147 11 43

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.

- Was my answer helpful? Please hit Like or Mark it as solution!
- Kudosi Product Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!