{"openapi":"3.1.0","info":{"title":"FreightAPI","version":"1.0.0-alpha","description":"Developer-first infrastructure for electronic freight documents in the EU: eCMR, ePOD, signatures, inspection links and the eFTI dataset behind one `POST /v1/shipments`.","contact":{"name":"FreightAPI","url":"https://freightapi.eu","email":"support@freightapi.eu"}},"servers":[{"url":"https://api.eftisandbox.app","description":"staging"}],"security":[{"bearer":[]}],"tags":[{"name":"system","description":"Health, version and the OpenAPI document."},{"name":"shipments","description":"Create, read, list, update, issue and cancel shipments; per-shipment events and integrity."},{"name":"documents","description":"PDF versions, attachments and HMAC-signed download URLs stored in R2 (eu)."},{"name":"signatures","description":"Signatures with roles, methods, trust levels and evidence; signature requests for the sign PWA."},{"name":"sign","description":"Token-scoped endpoints the sign PWA calls: context, submit, handoff."},{"name":"remarks","description":"Reservations at pickup or delivery, with photos stored as documents."},{"name":"pod","description":"The electronic proof of delivery: consignee signature, remarks, photos, time and location."},{"name":"webhooks","description":"Webhook endpoints (CRUD, secret, test ping) and deliveries (log, retry)."},{"name":"events","description":"Organisation-wide event feed with cursor and filters (90 days)."},{"name":"inspect","description":"Read-only inspection endpoint behind the QR code, with view logging."},{"name":"providers","description":"The provider catalogue with capabilities and routing rules."},{"name":"requirements","description":"Country requirements for a lane: e-CMR ratification, Benelux pilot, ADR, cabotage, combined transport."},{"name":"validate","description":"The public validator without an API key (Turnstile, 10 requests per minute per IP, CORS)."},{"name":"test","description":"Sandbox helpers, only with a test key: simulate sign, deliver, remark or auto-advance."},{"name":"driver","description":"Driver overview for the PWA: OTP on driver.phone, 12-hour session, own shipments."},{"name":"efti","description":"The eFTI projection: CMDS per subset, UIL, and the gate-facing platform interface."},{"name":"export","description":"GDPR export of organisation data as a zip of JSON and documents."},{"name":"auth","description":"The better-auth mount for the console: magic link, sessions, organisations, members."},{"name":"providers-webhook","description":"Inbound provider webhooks, verified per provider and mapped onto shipment events."}],"externalDocs":{"url":"https://freightapi.eu/docs","description":"Guides, concepts and changelog"},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"sk_test_… or sk_live_…","description":"API key in the Authorization header; the prefix decides test or live mode."}},"schemas":{"Problem":{"type":"object","properties":{"type":{"type":"string","description":"URI of the error documentation"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string","description":"Stable error code"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"JSON path of the field, for example \"goods[0].gross_weight_kg\""},"code":{"type":"string","description":"Stable code of the finding"},"message":{"type":"string","description":"Human-readable message in the requested language"},"rule":{"type":"string","description":"Business rule that produced the finding"},"source":{"type":"string","description":"Law or standard the rule refers to"},"params":{"type":"object","additionalProperties":{},"description":"Values the message was built from"}},"required":["path","code","message"],"description":"Field-level error or warning"}},"warnings":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"JSON path of the field, for example \"goods[0].gross_weight_kg\""},"code":{"type":"string","description":"Stable code of the finding"},"message":{"type":"string","description":"Human-readable message in the requested language"},"rule":{"type":"string","description":"Business rule that produced the finding"},"source":{"type":"string","description":"Law or standard the rule refers to"},"params":{"type":"object","additionalProperties":{},"description":"Values the message was built from"}},"required":["path","code","message"],"description":"Field-level error or warning"}}},"required":["type","title","status","code","errors","warnings"],"description":"Problem details (RFC 9457)"},"Health":{"type":"object","properties":{"ok":{"type":"boolean"},"checks":{"type":"object","properties":{"d1":{"type":"string","enum":["ok","error"],"description":"Outcome of one binding probe"},"kv":{"type":"string","enum":["ok","error"],"description":"Outcome of one binding probe"},"r2":{"type":"string","enum":["ok","error"],"description":"Outcome of one binding probe"}},"required":["d1","kv","r2"]},"environment":{"type":"string"},"request_id":{"type":"string"}},"required":["ok","checks","environment","request_id"]},"Version":{"type":"object","properties":{"name":{"type":"string"},"api_version":{"type":"string"},"schema_version":{"type":"integer"},"environment":{"type":"string"}},"required":["name","api_version","schema_version","environment"]}},"parameters":{}},"paths":{"/healthz":{"get":{"tags":["system"],"summary":"Liveness and binding check","description":"Probes D1, KV and R2. Returns 503 with the failing check when a binding is down.","security":[],"responses":{"200":{"description":"All bindings answer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"A binding failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/version":{"get":{"tags":["system"],"summary":"API and schema version","security":[],"responses":{"200":{"description":"Version information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}}}}}}}},"webhooks":{}}