decode a digikey product 2d barcode via barcode api
domain: digikey.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Register an application, subscribe to the Barcode API product, and complete the OAuth 2.0 3-legged (authorization code) flow; this API only supports 3-legged OAuth.
Obtain the QR code text printed on the label on the product's anti-static bag.
URL-encode the barcode string, making sure the special Record Separator and Group Separator control characters are encoded as \u241E and \u241D respectively.
Call GET https://api.digikey.com/Barcoding/v3/Product2DBarcodes/{barcode} with Authorization: Bearer <token> and X-DIGIKEY-Client-Id headers, optionally adding an includes query param (e.g. 'DigiKeyPartNumber,Quantity') to limit returned fields.
Parse the Product2DBarcodeResponse for DigiKeyPartNumber, ManufacturerPartNumber, Quantity, LotCode, DateCode, CountryOfOrigin, and (if applicable) SalesorderId/InvoiceId/PurchaseOrder.
For legacy 1D bag barcodes use GET /Barcoding/v3/ProductBarcodes/{barcode} instead; for pack-list barcodes use /PackListBarcodes/{barcode} or /PackList2DBarcodes/{barcode}.
Known gotchas
Barcode API is 3-legged-OAuth-only — an end user must authenticate via DigiKey login; client-credentials tokens don't work.
The QR code contains special ASCII symbols that must be encoded correctly (\u241E, \u241D) or the lookup will fail.
SalesorderId/InvoiceId/PurchaseOrder fields are not populated when the barcode comes from a 'Prepack' label.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?