TOP PACKTOP PACK · API v1
Die-cut studio

DEVELOPER REFERENCE

FEFCO Box API

PDF, SVG and JSON · millimetres · 1:1 geometry · dimension cotations · CUT / CREASE legend

POSThttps://fefcobox.top-pack.tn/api/public/v1/generate
OpenAPI 3.0

Authentication & deployment

Send X-API-Key using the private FEFCO_API_KEY saved for this project. Save the same value in your calling project's secrets and call from its server—not browser code. One project-level key grants generation only; no account or stored files are exposed.

Replace FEFCO_API_KEY in TOP PACK Secrets to revoke the old key. Publish TOP PACK after adding or changing the key or API code to update the live domain. The endpoint above targets this current site; use your published TOP PACK domain for production.

Files are returned directly and are not stored. CORS allows any origin without cookies. Every generation call requires the key. Models and OpenAPI are public. Print at 100% actual size and validate a folding sample before production.

Models

FEFCO 200

Half slotted container — open top

7 flutes · glue tab · hand holes

FEFCO 201

Regular slotted container

7 flutes · glue tab · hand holes

FEFCO 203

Full overlap container

7 flutes · glue tab · hand holes

FEFCO 427

Self-locking mailer

3 mm · panel dimensions · fixed locks

427 limits: L > 38, H > 30, W > 142 and W > 2H + 14 mm. Dimensions remain adjustable; locking clearances stay fixed.

GET /api/public/v1/models

Request parameters

FieldTypeRules & defaults
model"200" | "201" | "203" | "427"Required. Model code as a string.
length / width / heightnumber · mmRequired. Positive, finite, ≤ 3000 each. Blank limited to 5000 × 5000 mm.
mode"interior" | "exterior" | "diecut"2xx defaults to interior. Exterior converts L−2T, W−2T, H−T; interior/diecut use supplied panel sizes. 427: diecut only (default).
flute / thicknessstring / number · mmB by default. F 0.8, E 1.6, B 3, C 4, BF 4, BE 4.5, BC 7 mm. thickness overrides the preset, >0 and ≤20. 427: B / 3 mm only.
kerfnumber · mm0 by default; 0–10. Slot production allowance for 2xx. 427: zero only.
glueTabobject · 2xx onlywidth in mm (>0, ≤3000); angleTopDeg and angleBotDeg in [0,90). Default width clamps W×0.5 to 30–40 mm; both angles 30°. Overlapping chamfers rejected.
handHolesarray · 2xx onlyDefault []. Maximum 16. Each: panel 0=L1, 1=W1, 2=L2, 3=W2; width, height, offsetX, offsetY, cornerR in mm. offsetX from panel centre; offsetY from top crease to hole top. Must fit with 5 mm crease clearance; overlapping bounding boxes rejected.
styleobjectcutColor / creaseColor: six-digit hex. cutWidth / creaseWidth: >0 to 5 mm. Defaults red cut, blue crease, 0.5 / 0.3 mm. Preview and exports share geometry.
withDimensionsbooleantrue by default. Includes cotation values, arrows and extension lines; false omits them. PDF always includes CUT/CREASE legend.
format"pdf" | "svg" | "json"pdf by default. Returns binary PDF, SVG text, or JSON {version, units, result, issues}. JSON includes paths, panels, dimensions, bounds and parameters.

All unknown fields are rejected. JSON body maximum: 32 KB. Geometrically infeasible requests return 422, never a fallback drawing.

Integration examples

curl 'https://fefcobox.top-pack.tn/api/public/v1/generate' \
  -H 'Content-Type: application/json' \
  -H "X-API-Key: $FEFCO_API_KEY" \
  --data '{"model":"201","length":200,"width":150,"height":120,"mode":"interior","flute":"B","kerf":0.1,"glueTab":{"width":35,"angleTopDeg":30,"angleBotDeg":30},"handHoles":[],"style":{"cutColor":"#dc2626","creaseColor":"#0066cc","cutWidth":0.5,"creaseWidth":0.3},"withDimensions":true,"format":"pdf"}' \
  --fail-with-body --output box.pdf

Live request

Used for this request only. Not saved in browser storage.

—

Responses & errors

200 returns your file, with Content-Disposition, X-Blank-Width-Mm, X-Blank-Height-Mm and X-Box-Warnings (URI-encoded JSON). PDF includes the model, input sizes, board, kerf, blank dimensions and legend.

{
  "error": {
    "code": "INVALID_GEOMETRY",
    "message": "Invalid box geometry",
    "issues": [
      {
        "level": "error",
        "message": "Chamfers overlap — reduce tab width or angles"
      }
    ]
  }
}

400 malformed JSON · 401 invalid key · 413 oversized body · 415 wrong content type · 422 invalid fields/geometry · 500 generation failed · 503 key not configured