Box BlanksParametric packaging dielines

API

Free during beta. The same generator this site runs, callable from your own code. 374 templates, of which 107 have been checked against the published standard drawings — and the API tells you which.

Getting a key. Keys are issued by hand during the beta. Email [email protected], say briefly what you are building, and we will send you one. There is no form and no sales call — but we do read the replies, and what people are building is the main thing we are trying to learn from the beta.

Start here

Once you have a key, this works from any terminal:

curl -H "Authorization: Bearer YOUR_KEY" -o box.dxf \
  "https://boxblanks.com/api/v1/dieline?code=0201&L=400&W=300&D=200&format=dxf"

That is a 400 × 300 × 200 mm regular slotted case as a DXF, ready for a cutting table. Change format to pdf, svg or json and everything else stays the same.

The key can go in an Authorization: Bearer header, an X-API-Key header, or as ?key= on the query string — whichever your system can manage. Plenty of the things that would call this are report writers and spreadsheet macros that cannot set a header.

What "free during beta" means

It means free, now, with no card and no commitment — and that we are not promising it is free forever. Saying so plainly at the start seems better than saying "free" and revisiting it later, which is the sort of thing that makes people feel caught out.

If it does become paid, it will be because enough people are running it inside real products for that to make sense, and we would come to those people directly rather than switching something off. Anything built during the beta will get fair notice.

Endpoints

Base URL https://boxblanks.com/api/v1. Everything returns JSON except a generated drawing, which returns the file itself with its own content type. Responses carry Access-Control-Allow-Origin: *, so browser code can call this directly.

GET /dieline

Generate a dieline. The only required parameter is code; every dimension falls back to that template's own sensible default, so ?code=0201 alone returns a real box.

ParameterMeaning
codeWhich template — 0201, 0427, RTE. Required.
L, W, DLength, width and depth in millimetres, 1–5000.
modeinside (default), crease or outside — which face of the board your dimensions describe.
formatsvg (default), dxf, pdf or json.
gradeBoard grade id. Sets caliper, which drives the fold allowances.
thicknessBoard caliper in mm, if you would rather state it than name a grade.
paramsPer-template settings — glue lap width, flap depth and so on. POST only, as an object. Ask /templates/{code} what a template accepts.

format=json returns no drawing at all — just the blank's size, area and piece count. That is the cheap call for a quoting system that needs to price board and never renders anything:

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://boxblanks.com/api/v1/dieline?code=0201&L=400&W=300&D=200&format=json"
{
  "code": "0201",
  "name": "Regular Slotted Container (RSC)",
  "verified": "plate",
  "blank": { "widthMm": 1447, "heightMm": 506, "areaM2": 0.732182, "pieces": 1 },
  "counts": { "panels": 13, "creases": 12, "outline": 1 },
  "warnings": []
}

POST /dieline

Identical, but takes JSON — which is how you set a template's own parameters, since those are an object rather than a flat query string:

curl -X POST https://boxblanks.com/api/v1/dieline \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "content-type: application/json" \
  -d '{"code":"0201","L":400,"W":300,"D":200,"format":"dxf","params":{"glueLap":40}}' \
  -o box.dxf

GET /templates

The whole catalogue. Filter with ?family=FEFCO, ?verified=plate, or ?q= for a free-text search across codes, names, descriptions and tags.

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://boxblanks.com/api/v1/templates?verified=plate" | jq '.count'

GET /templates/{code}

One template in full, including every parameter with its range and default. Call this before generating if you are building a form — it tells you exactly what that template accepts, so you never have to hard-code a list that goes stale.

POST /report

The one route that needs no key — it is the form on every template page, used by people who have no reason to have one. Tell us a template is wrong. Send code, a category, and actual describing what you got; expected, evidence and a state object are all worth including because they are what makes a report fixable. Give an email and set notify to be told when it is fixed.

The field no other generator returns

Every template carries verified. "plate" means that blank has been compared by machine against the drawing published in the FEFCO Code and matched it. "approx" means the construction is right and it folds, but it has not been matched against a plate in that detail.

This matters if you are putting our output in front of your own customers. You can filter to only the checked ones, or show the distinction rather than implying a confidence nobody measured. How the check works explains what it does, and — just as importantly — the four things it cannot do.

Rate limits

1,000 calls a day per key, and no more than 60 in any minute. Generating a drawing counts as 4 against the per-minute figure, since it is the only call that does real work; reading the catalogue counts as 1.

The daily figure is set well above what a real integration needs. It is not there to meter you — during a beta the point is to find out what people build, not to ration them. What it actually prevents is a loop in somebody's code quietly running all night and turning into a hosting bill.

Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; a refusal is a 429 with Retry-After in seconds. Cache what you can — a template's parameters change about never. If your job genuinely needs more, email us and say what it is doing; that is exactly the sort of thing we want to hear.

Errors

Standard status codes, and a JSON body with an error that says what to change. Bad input is rejected rather than quietly corrected: ask for a 20-metre box and you get a 400, not a silently clamped 5-metre one, because the first is a bug you want to hear about and the second is one you find at the cutting table.

StatusMeaning
400Something in the request is wrong — an unknown parameter, a dimension out of range, a value outside a template's own limits.
401No key was sent. Email [email protected] for one.
403The key was not recognised. Check it was copied whole.
404No template with that code, or no such endpoint.
429Rate limited. Wait Retry-After seconds.
500The generator failed on a request that looked legal. That is our bug — please report it, either through the form on any template page or by email.

Terms, briefly

Free during beta, including inside a product you charge for. No attribution required, though a link is always welcome. There is no uptime guarantee and no support contract — this is run properly but it is run free, so do not put it on a critical path without caching. And as everywhere else on this site: a dieline is a drawing, not a guarantee — always cut and fold a sample before committing to a die.

Building something with this? Tell us. Knowing what people actually call is how the limits, the formats and the eventual pricing get set sensibly — and during a beta it is most of the point.