Introduction
The CMR Consignment Note API extracts structured data from CMR (Convention relative au contrat de transport international de Marchandises par Route) road consignment notes using advanced OCR and machine learning. Specifically designed for the Greater Mekong Subregion (GMS) and Cross-Border Transport Agreement (CBTA) compliance, the API handles the unique requirements of ASEAN road freight documentation.
The API features specialized Thai-script OCR for vehicle registration parsing, enabling accurate extraction of Thai license plates written as ทะเบียนรถ in both standard and handwritten formats. It supports all major GMS road corridors: Thailand-Laos (Nong Khai/Mukdahan), Thailand-Cambodia (Aranyaprathet/Poipet), Thailand-Myanmar (Mae Sot/Myawaddy), and Thailand-Vietnam (via Laos transit).
Key capabilities include CBTA permit number verification, ASEAN border checkpoint validation against the official GMS checkpoint database, Thai-script vehicle and trailer registration parsing, driver license extraction, and automated GMS route code identification. The API returns 30+ structured fields with per-field confidence scores.
Supported file formats: PDF, JPEG, PNG, TIFF (max 20 MB per file). Average processing time: 0.9-1.8 seconds. Optimized for mobile-captured images of CMR notes taken at border checkpoints.
Authentication
All API requests must include a valid API key in the Authorization header using the Bearer token scheme. API keys are scoped to your organization and can be created, rotated, and revoked from the dashboard.
Authorization: Bearer YOUR_API_KEY
Obtain your API key from dashboard.kabytech.com → Settings → API Keys. Each key can be assigned granular permissions (read, write, batch) and rate limit tiers. We recommend creating separate keys for development and production environments.
Security best practices:
- Never expose API keys in client-side code or public repositories
- Rotate keys every 90 days or immediately if compromised
- Use environment variables or a secrets manager to store keys
- Enable IP allowlisting for production keys in the dashboard
Quick Start
Parse a CMR road consignment note in seconds. Upload a document image or PDF and receive structured JSON with 30+ extracted fields, including Thai-script vehicle registration and CBTA permit data.
curl -X POST https://api.kabytech.com/v1/cmr/parse \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F "file=@/path/to/cmr-note.pdf" \ -F "language=th" \ -F "validate_checkpoint=true"
The API automatically detects Thai-script text for vehicle registrations and applies ASEAN checkpoint validation. For documents photographed at border checkpoints, the image enhancement pipeline corrects for skew, lighting, and low resolution before OCR processing.
Example response for a Bangkok-Nong Khai-Vientiane agricultural products shipment:
{
"id": "job_cmr_4a7c1d9e2f5b",
"status": "completed",
"document_type": "cmr",
"data": {
"cmr_number": "CMRKBT2026012345",
"date_of_issue": "2026-03-20",
"sender": {
"name": "Chiang Mai Organic Farm Cooperative",
"address": "234 Huay Kaew Road, Muang, Chiang Mai 50200, Thailand",
"country": "TH",
"tax_id": "0105563012345"
},
"carrier": {
"name": "GMS Express Transport Co., Ltd.",
"address": "89 Mittraphap Road, Muang, Nong Khai 43000, Thailand",
"country": "TH",
"transport_license": "TH-DLT-2026-04567"
},
"consignee": {
"name": "Vientiane Fresh Market Import Co., Ltd.",
"address": "45 Lan Xang Avenue, Chanthabouly District, Vientiane, Laos",
"country": "LA"
},
"place_of_loading": "Chiang Mai Cold Storage Facility, Thailand",
"place_of_delivery": "Vientiane Morning Market Distribution Center, Laos",
"date_of_loading": "2026-03-20T06:00:00+07:00",
"goods_description": "Fresh organic longan (600 kg), dried longan (400 kg), organic jasmine rice (2000 kg)",
"hs_codes": ["0810.90", "0813.40", "1006.30"],
"gross_weight": "3200 kg",
"number_of_packages": 180,
"packaging_type": "Corrugated cartons (longan), woven polypropylene bags (rice)",
"volume_m3": 14.5,
"vehicle_registration": "กท 5678 กรุงเทพมหานคร",
"vehicle_registration_latin": "KT 5678 Bangkok",
"trailer_registration": "ผส 1234 นนทบุรี",
"trailer_registration_latin": "PS 1234 Nonthaburi",
"vehicle_type": "refrigerated_truck",
"driver_name": "Somchai Prasert",
"driver_license": "TH-51012345678",
"driver_nationality": "TH",
"border_checkpoint": "Nong Khai / Thanaleng",
"border_checkpoint_code": "GMS-NKI-TNL",
"customs_reference": "TH-LA-2026-007890",
"cbta_permit_number": "CBTA-GMS-2026-01234",
"cbta_permit_valid_until": "2026-12-31",
"gms_route_code": "R1",
"gms_corridor": "North-South Economic Corridor",
"phytosanitary_certificate": "TH-PHYTO-2026-003456",
"temperature_requirement": "2-8°C (longan), ambient (rice)",
"insurance_reference": "INS-GMS-2026-005678",
"special_instructions": "Maintain cold chain. Inspect at border for phytosanitary compliance."
},
"confidence": 0.95,
"field_confidences": {
"cmr_number": 0.99,
"sender.name": 0.97,
"vehicle_registration": 0.94,
"cbta_permit_number": 0.96,
"goods_description": 0.93,
"border_checkpoint": 0.98
},
"processing_time_ms": 1340,
"pages_processed": 2,
"thai_script_detected": true,
"checkpoint_validated": true
}POST /v1/cmr/parse
Upload a CMR road consignment note for parsing. The API accepts PDF, JPEG, PNG, and TIFF files up to 20 MB. Optimized for both clean scans and mobile-captured photos taken at ASEAN border checkpoints — the image pipeline automatically corrects for skew, uneven lighting, and partial occlusion.
Thai-script OCR is enabled by default. The parser identifies Thai vehicle registration patterns (ทะเบียนรถ) and transliterates them to Latin characters in a parallel field for integration with international logistics systems.
Request Parameters
th (Thai), en (English), lo (Lao), km (Khmer), my (Myanmar). Default: auto.normal or high. High priority costs 2x credits. Default: normal.true.true.false.true.true.Response Fields
completed, processing, or failed.cmr for road consignment notes.GET /v1/cmr/{id}
Retrieve the parsed results for a previously submitted CMR consignment note by its job ID. Use this endpoint when the initial parse returned a "processing" status or to re-fetch results at any time within the retention period.
Results are retained for 30 days after parsing. After this period, the job ID expires and a 404 error is returned.
Path Parameters
job_cmr_4a7c1d9e2f5b).Query Parameters
false.cmr_number,sender,vehicle_registration,border_checkpoint.curl https://api.kabytech.com/v1/cmr/job_cmr_4a7c1d9e2f5b \ -H "Authorization: Bearer YOUR_API_KEY" \ -G -d "fields=cmr_number,sender,carrier,consignee,vehicle_registration,border_checkpoint,cbta_permit_number"
{
"id": "job_cmr_4a7c1d9e2f5b",
"status": "completed",
"document_type": "cmr",
"data": {
"cmr_number": "CMRKBT2026012345",
"sender": {
"name": "Chiang Mai Organic Farm Cooperative",
"address": "234 Huay Kaew Road, Muang, Chiang Mai 50200, Thailand",
"country": "TH"
},
"carrier": {
"name": "GMS Express Transport Co., Ltd.",
"address": "89 Mittraphap Road, Muang, Nong Khai 43000, Thailand",
"country": "TH"
},
"consignee": {
"name": "Vientiane Fresh Market Import Co., Ltd.",
"address": "45 Lan Xang Avenue, Chanthabouly District, Vientiane, Laos",
"country": "LA"
},
"vehicle_registration": "กท 5678 กรุงเทพมหานคร",
"vehicle_registration_latin": "KT 5678 Bangkok",
"border_checkpoint": "Nong Khai / Thanaleng",
"cbta_permit_number": "CBTA-GMS-2026-01234"
},
"confidence": 0.95,
"processing_time_ms": 1340
}POST /v1/cmr/batch
Submit up to 50 CMR consignment notes for batch processing. Ideal for processing daily border crossing manifests, fleet compliance audits, or digitizing historical CBTA documentation. Each file is processed independently and results are aggregated.
Batch jobs always run asynchronously. Use the returned batch_id to poll for results or provide a webhook_url to receive a callback when all documents are complete.
Request Parameters
auto.true.3.curl -X POST https://api.kabytech.com/v1/cmr/batch \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "files[]=@cmr-bangkok-vientiane.pdf" \ -F "files[]=@cmr-aranyaprathet-poipet.pdf" \ -F "files[]=@cmr-mae-sot-myawaddy.jpg" \ -F "language=th" \ -F "validate_checkpoint=true" \ -F "webhook_url=https://your-server.com/webhooks/cmr-batch"
{
"batch_id": "batch_cmr_3n8k5w2j",
"status": "processing",
"total_files": 3,
"completed": 0,
"failed": 0,
"estimated_completion_seconds": 8,
"results_url": "https://api.kabytech.com/v1/cmr/batch/batch_cmr_3n8k5w2j"
}GET /v1/status
Health check endpoint for the CMR parsing service. Returns current operational status, API version, and queue depth. This endpoint does not require authentication and can be used for monitoring and uptime checks.
curl https://api.kabytech.com/v1/status{
"service": "cmr-parser",
"status": "operational",
"version": "2.4.1",
"queue_depth": 3,
"avg_processing_time_ms": 1280,
"supported_corridors": ["TH-LA", "TH-KH", "TH-MM", "TH-VN"],
"thai_ocr_engine": "active",
"cbta_database_updated": "2026-03-15T00:00:00Z",
"checkpoint_database_updated": "2026-03-20T00:00:00Z",
"uptime_percent": 99.98,
"last_incident": "2026-01-22T08:15:00Z"
}CMR Sections Reference
CMR consignment notes follow a standardized layout defined by the CMR Convention, adapted for ASEAN/GMS cross-border transport. The API maps extracted data to these logical sections corresponding to the standard CMR box numbers. Each section groups related fields for easy access.
Header Section
Core identification fields from the top of the CMR note.
Parties Section (Sender / Carrier / Consignee)
The three parties to the CMR contract. Corresponds to CMR Boxes 1 (Sender), 2 (Consignee), and 16 (Carrier).
name, address, country, tax_id.name, address, country.name, address, country, transport_license.name and segment.Vehicle Details Section
Vehicle and driver information from Box 18. The API's Thai-script OCR engine parses Thai vehicle registrations (ทะเบียนรถ) and provides both original Thai and Latin transliterations.
กท 5678 กรุงเทพฯ).truck, refrigerated_truck, tanker, flatbed, container_truck.Route Section
Loading/delivery locations and border crossing details. ASEAN checkpoint names are validated against the official GMS database when validate_checkpoint is enabled.
GMS-NKI-TNL).R1 (North-South), R2 (East-West), R3 (Southern), etc.Goods Section
Cargo details from CMR Boxes 6-12.
Customs and Border Section
CBTA compliance data, customs references, and border clearance documentation specific to GMS cross-border transport.
Response Field Reference
Complete reference of all 30+ fields extracted from CMR road consignment notes. Each field includes a confidence score (0.0 to 1.0) in the field_confidences object. Fields not present on the source document are returned as null.
name, address, country, tax_id.name, address, country, transport_license.name, address, country.currency, amount, terms.prepaid, collect, third_party.Error Codes
The API returns standard HTTP status codes along with a JSON error body containing a machine-readable code and a human-readable message. Use the code field for programmatic error handling.
Retry-After header interval.Rate Limits
Rate limits are applied per API key and vary by plan tier. Limits are enforced using a sliding window algorithm. The API returns rate limit headers with every response:
X-RateLimit-Limit— Maximum requests allowed per minuteX-RateLimit-Remaining— Requests remaining in the current windowX-RateLimit-Reset— Unix timestamp when the window resetsRetry-After— Seconds to wait before retrying (only on 429 responses)
Official SDKs
KabyTech provides official SDKs for popular languages to simplify integration with the CMR API. All SDKs handle authentication, retries, file uploads, and response parsing automatically.
# Python pip install kabytech from kabytech import KabyTech client = KabyTech(api_key="YOUR_API_KEY") result = client.cmr.parse("cmr-note.pdf", language="th", validate_checkpoint=True) print(result.data.cmr_number) print(result.data.vehicle_registration) # Thai script print(result.data.vehicle_registration_latin) # Latin transliteration print(result.data.cbta_permit_number)
// Node.js npm install @kabytech/sdk const { KabyTech } = require("@kabytech/sdk"); const client = new KabyTech({ apiKey: "YOUR_API_KEY" }); const result = await client.cmr.parse("cmr-note.pdf", { language: "th", validateCheckpoint: true, validateCbta: true, transliterateThai: true }); console.log(result.data.cmrNumber); console.log(result.data.vehicleRegistration); console.log(result.data.borderCheckpoint); console.log(result.data.cbtaPermitNumber);
Additional SDKs available: Go (go get github.com/kabytech/kabytech-go), Java (Maven Central: com.kabytech:kabytech-sdk), PHP (composer require kabytech/sdk). Full SDK documentation is available at docs.kabytech.com/sdks.