Turn import documents into KEDEN-ready customs declarations from your own system. Create a key in Dashboard → Settings → API access, then authenticate every request with a Bearer header.
Authorization: Bearer tmg_live_...
Keys are shown once at creation and can be revoked at any time. Rate limit: 60 requests/minute per key.
The billing unit is a goods item (a declaration line). An export charges MAX(positions, plan minimum) units, once per declaration.
The calling account and its credit balance.
curl -H "Authorization: Bearer $KEY" https://your-host/api/v1/me
Create a declaration from documents (multipart/form-data, 1–5 files ≤ 4 MB each: PDF/JPEG/PNG/WebP; the first file drives extraction). Optional field shortName. Returns 201 with the draft, confidence scores and remaining credits.
curl -X POST https://your-host/api/v1/declarations \ -H "Authorization: Bearer $KEY" \ -F "files=@invoice.pdf" -F "files=@packing_list.pdf" \ -F "shortName=Shanghai inverters"
Read a declaration you own: status, draft data, confidence scores.
curl -H "Authorization: Bearer $KEY" https://your-host/api/v1/declarations/dec-123
Validate and export the KEDEN-ready XML (text/xml). Returns 422 with details when format-logic checks fail.
curl -H "Authorization: Bearer $KEY" \ -o declaration.xml https://your-host/api/v1/declarations/dec-123/xml
| 400 | Malformed request (missing files, bad multipart) |
| 401 | Missing, malformed or revoked API key |
| 402 | Insufficient credits |
| 404 | Declaration not found or not yours |
| 413 | File larger than 4 MB |
| 422 | Declaration failed format-logic validation |
| 429 | Rate limit exceeded (60 req/min) |
Questions or a partnership integration (e.g. TMS / freight platforms)? Message us on WhatsApp.