← SmartLog

SmartLog API v1

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.

Authentication

Authorization: Bearer tmg_live_...

Keys are shown once at creation and can be revoked at any time. Rate limit: 60 requests/minute per key.

Billing

The billing unit is a goods item (a declaration line). An export charges MAX(positions, plan minimum) units, once per declaration.

Endpoints

GET/api/v1/me

The calling account and its credit balance.

curl -H "Authorization: Bearer $KEY" https://your-host/api/v1/me
POST/api/v1/declarations

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"
GET/api/v1/declarations/{id}

Read a declaration you own: status, draft data, confidence scores.

curl -H "Authorization: Bearer $KEY" https://your-host/api/v1/declarations/dec-123
GET/api/v1/declarations/{id}/xml

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

Errors

400Malformed request (missing files, bad multipart)
401Missing, malformed or revoked API key
402Insufficient credits
404Declaration not found or not yours
413File larger than 4 MB
422Declaration failed format-logic validation
429Rate limit exceeded (60 req/min)

Questions or a partnership integration (e.g. TMS / freight platforms)? Message us on WhatsApp.