Qrop logoQrop

Building a packaging pipeline: one QR code per SKU at ship time

By Qrop Team ·

Putting a QR code on every product sounds like a job for the moment a box is packed: an order comes in, the warehouse system asks the API for a code, the label printer prints it. That design works, and for some products it is the right one. For most catalogues it spends credits and adds a failure point for no gain, because the code on a SKU's box is the same every time.

This guide walks through the decisions that shape a packaging pipeline built on the Qrop API: what the code should encode, whether to generate once or at ship time, static or tracked, which output format a label printer wants, and what to do when a request fails in the middle of a shift. It assumes you already have an API key and a plan. The batch guide covers the mechanics of the endpoint itself.

Decide what the code encodes before anything else

A packaging code is read months after it is printed, sometimes years, so the one decision you can't change later is what it points at. Encode a URL on a domain you control, with the SKU in the path, such as https://example.com/p/ABC-123. Don't encode the final destination page directly if that page might move, and don't encode a raw SKU or barcode number. A URL you own can be redirected, rewritten or moved to a new platform without touching a printed label.

That choice also decides how many codes you need. A code per SKU means one code for every product variant, however many units ship. A code per unit means a different code for each box or serial number, which is only worth it when the destination really differs per unit: a warranty registration tied to a serial number, a lot number for a recall, a gift message for one order. Be honest about which one you are building, because the two have very different costs.

Generate once and store the image unless the destination changes per unit

Every successful generation call consumes a credit, whatever the content. If 40 boxes of one SKU ship in a month and you call the API for each, you have bought 40 identical images. Generating a SKU's code once, when the product is created, and storing the file next to the product record costs one credit for the life of the product.

Ship-time generation earns its place when the code carries something per unit. In that case generate at the moment the data exists: after the serial number is assigned, or when the order is confirmed, and not earlier. A good split is a stored code for the catalogue and a ship-time code only for the products that need one per unit, which is usually a small share of the range.

  • Per SKU, same on every box: generate when the product is created, store the file, reuse it.
  • Per unit (serial number, lot, order): generate when that value is assigned, then print straight away.
  • Mixed catalogue: keep the two flows separate so a spike in unit-level codes never delays the label line for everything else.

Static or tracked: packaging lasts longer than a tracked code

A static code encodes your URL directly and never expires. A tracked code encodes a Qrop redirect link, logs scans, and lets you change the destination later, but it is bought for a period of up to 120 days at one credit per 30 days. When that period ends the code stops working and a scanner sees a message that the code is no longer active. Your account also has a limit on how many tracked codes can be active at once, and the limit rises with your plan.

Put those facts next to a box that may sit on a shelf for a year and the default is clear: use static codes on packaging, and make the URL you encode one you control. If you want scan data, put the measurement on your own page, where it keeps working however long the box is on the shelf. Tracked codes are better suited to short-lived print such as a seasonal insert, a promotion sleeve or a trade-show leaflet, where the code's life matches the campaign.

Choose the output format for the printer you actually have

A label printer or a print shop wants either a vector file or a raster file sized for the physical print. SVG scales to any label size without blurring and is the usual choice for software that places graphics onto a label template. PNG suits a template that expects a bitmap. PDF suits a print shop that asks for one. The format and resolution guide covers the trade-offs in detail.

Work out the resolution from the printed size and the printer's dots per inch, then ask for that many pixels with room to spare, up to your plan's resolution cap. A code printed 25 mm wide on a 300 dpi printer needs about 300 pixels across. Asking for 1024 does no harm, and a code that is too small in pixels will print soft and scan badly. Leave a blank margin of four modules around the code, because a label that crops it will fail to scan whatever the quality of the file.

Set error correction once, for the label and not the request

Machine-applied labels are handled consistently and rarely take the abuse a hand-placed sticker does, so a moderate level of error correction is a sound default for a label line. A code with a logo is raised to the highest level automatically. The high-volume guide explains the reasoning, and the logo guide covers the cases where a logo is dropped.

Choose the setting once, in one place in your code, and not per request. A pipeline where the value drifts between services produces labels that scan differently, and that is the sort of fault found only after a pallet has shipped.

Make the line survive a failed request

A label line can't wait on a retry loop, so decide in advance what each failure means. A 402 means the account is out of credits: stop requesting, alert someone, and fall back to stored codes for catalogue items. A 429 carries a Retry-After header: wait that long, then try again. A 422 means the request itself was rejected, for example a bad URL or a colour pair that wouldn't scan, and no credit was used. Retrying it unchanged will fail again, so log it and fix the input.

There is no idempotency key on the generation endpoint, and a request that times out may still have been processed. Store the result against the SKU or serial number as soon as it arrives, and check that store before asking again. That turns a retry after a dropped connection into a lookup for everything except the one request that was truly lost. If credits running out would stop the line, poll the usage endpoint on a schedule and alert at a threshold, as the usage polling guide describes, so you hear about it before the line does.

Test the physical label, not the file

A code that scans perfectly on screen can fail on the real label. Print a sample on the actual stock, with the actual printer, at the actual size, and scan it with a mid-range phone in poor light and at an angle. Check a curved surface if the label will go on a bottle or tube. A glossy laminate that reflects the warehouse lights is the classic failure.

Do this before the run, once per label design, and again whenever the stock, printer or size changes. Ten minutes of scanning costs far less than relabelling a pallet.

Worked example: a homeware seller with 1,200 SKUs

A seller has 1,200 SKUs and wants every box to link to a care and warranty page at https://example.com/p/{sku}. About 40 boxes of each SKU ship in a month. Calling the API at ship time would use roughly 48,000 credits a month for 1,200 distinct images.

Instead, the seller backfills the catalogue once with the batch endpoint: 1,200 items in 48 batches of 25, one credit each, 1,200 credits in total. Each file is stored against its SKU and the label template pulls it by SKU at print time. New products trigger a single generation call when they are created. The 300 or so premium units a month that carry a serial number and a registration link are generated at ship time, once the serial is assigned, which adds 300 credits a month and nothing else.

The result is a label line that never waits on the API for most of what it prints, and a credit bill that follows the size of the catalogue, not the volume of shipments.

Frequently asked questions

Should I generate a QR code at ship time or in advance?

In advance, unless the code carries something that differs per unit, such as a serial number, lot or order. A code for a SKU is the same on every box, so generate it once when the product is created, store the file, and reuse it. Each generation costs a credit, so regenerating the same code for every shipment is the main avoidable cost in a packaging pipeline.

Should packaging use static or tracked QR codes?

Static codes for almost all packaging. A static code never expires, while a tracked code is bought for up to 120 days and stops working when that period ends. Packaging can sit in a warehouse or on a shelf for much longer. Encode a URL on a domain you control and measure scans on your own page.

What should the QR code on a product point to?

A URL on a domain you control, with the SKU in the path, so you can redirect or rebuild the page later without reprinting labels. Avoid encoding a raw SKU, a barcode number or a third-party page that may move.

How do I generate codes for a whole catalogue at once?

Use the batch endpoint, which returns up to 25 codes per request. A 1,200-SKU catalogue is 48 batch calls. Items in a batch share the format, resolution and logo, so run separate batches if part of the range needs different settings. Stay within your plan's rate limit if you run batches in parallel.

What happens if the API is down or I run out of credits mid-run?

Stored codes keep working, which is the main reason to generate once and store. For new requests, a 402 means no credits and a 429 means slow down and retry after the Retry-After delay. Poll the usage endpoint and alert before credits run out. Because there is no idempotency key, record each result against its SKU or serial number before asking again.

Related guides

Ready to create your QR code?

Generate a free QR code in seconds: custom colours, logos, and PNG, SVG or PDF output.

Open the generator

We use strictly necessary cookies to run Qrop, and (only with your consent) advertising cookies. See our privacy policy for details.