{"openapi":"3.0.3","info":{"title":"TOP PACK — FEFCO Box API","version":"1.0.0","description":"Generate 1:1 millimetre PDF/SVG box blueprints with CUT/CREASE lines and optional dimension cotations. Geometry uses the same generators as TOP PACK Studio. Validate a physical folding sample before production."},"servers":[{"url":"https://fefcobox.top-pack.tn/api/public/v1"}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Project-level server-to-server generation key. Store in your calling project's secrets, never in browser code. Replace FEFCO_API_KEY in TOP PACK Secrets to revoke the previous value."}},"schemas":{"BoxRequest":{"type":"object","properties":{"model":{"type":"string","enum":["200","201","203","427"]},"length":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":3000,"description":"Length in millimetres"},"width":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":3000,"description":"Width in millimetres"},"height":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":3000,"description":"Height in millimetres"},"mode":{"type":"string","enum":["interior","exterior","diecut"],"description":"Default interior for 2xx; diecut only for 427"},"flute":{"type":"string","enum":["F","E","B","C","BF","BE","BC"],"default":"B"},"thickness":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":20,"description":"Overrides flute thickness; 427 requires 3"},"kerf":{"type":"number","minimum":0,"maximum":10,"default":0},"glueTab":{"type":"object","properties":{"width":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":3000},"angleTopDeg":{"type":"number","minimum":0,"exclusiveMaximum":true,"maximum":90},"angleBotDeg":{"type":"number","minimum":0,"exclusiveMaximum":true,"maximum":90}},"required":["width","angleTopDeg","angleBotDeg"],"additionalProperties":false},"handHoles":{"type":"array","items":{"type":"object","properties":{"panel":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]},{"type":"number","enum":[2]},{"type":"number","enum":[3]}]},"width":{"$ref":"#/properties/glueTab/properties/width"},"height":{"$ref":"#/properties/glueTab/properties/width"},"offsetX":{"type":"number","minimum":-3000,"maximum":3000,"description":"Hole centre offset from panel centre"},"offsetY":{"type":"number","minimum":0,"maximum":3000,"description":"Hole top offset below body top crease"},"cornerR":{"type":"number","minimum":0,"maximum":1500}},"required":["panel","width","height","offsetX","offsetY","cornerR"],"additionalProperties":false},"maxItems":16,"default":[]},"style":{"type":"object","properties":{"cutColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#dc2626"},"creaseColor":{"$ref":"#/properties/style/properties/cutColor","default":"#0066cc"},"cutWidth":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":5,"default":0.5},"creaseWidth":{"type":"number","exclusiveMinimum":true,"minimum":0,"maximum":5,"default":0.3}},"additionalProperties":false},"withDimensions":{"type":"boolean","default":true},"format":{"type":"string","enum":["pdf","svg","json"],"default":"pdf"}},"required":["model","length","width","height"],"additionalProperties":false},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}},"paths":{"/models":{"get":{"operationId":"listModels","summary":"Supported models and constraints","responses":{"200":{"description":"Model catalogue in JSON"}}}},"/generate":{"post":{"operationId":"generateBox","summary":"Generate a complete box blueprint","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoxRequest"},"example":{"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"}}}},"responses":{"200":{"description":"PDF (default), SVG, or shared BlankResult JSON. Files are actual size; print at 100%, not fit-to-page. PDF includes header and CUT/CREASE legend.","headers":{"Content-Disposition":{"schema":{"type":"string"}},"X-Blank-Width-Mm":{"schema":{"type":"number"}},"X-Blank-Height-Mm":{"schema":{"type":"number"}},"X-Box-Warnings":{"description":"URI-encoded JSON validation warnings","schema":{"type":"string"}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid JSON","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Body exceeds 32 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"415":{"description":"Content type must be application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid fields or infeasible geometry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Generation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"API key not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}