Introduction
The KabyTech B/L Intelligence API lets you parse ocean Bills of Lading documents (PDF, image, or scanned copies) and receive structured JSON with all shipping details extracted. The API supports B/L documents from all major ocean carriers including Evergreen, ONE, MSC, Maersk, COSCO, Hapag-Lloyd, Yang Ming, and HMM.
Extract shipper, consignee, notify party, vessel/voyage details, port information, container details with ISO 6346 validation, goods descriptions, freight terms, and more. The API handles both Master and House B/L formats, original and telex release copies, and supports multi-container shipments with individual container-level extraction.
All API requests are made over HTTPS. Responses are returned in JSON format. The API follows RESTful conventions and uses standard HTTP status codes.
Base URL
All endpoints described in this documentation are relative to this base URL. For example, the parse endpoint is available at https://api.kabytech.co.th/v1/bl/parse.
Authentication
All API requests require authentication via an API key. Include your API key in the X-API-Key header with every request. You can obtain your API key from the KabyTech Dashboard after creating an account.
API keys are prefixed with kby_live_ for production and kby_test_ for sandbox. Test keys process documents but return synthetic data — they're free to use during development.
| Header | Value | Required |
|---|---|---|
X-API-Key | Your API key (kby_live_... or kby_test_...) | Required |
Content-Type | application/json or multipart/form-data | Required |
Accept | application/json | Optional |
Quick Start
Get your first Bill of Lading parsed in under 5 minutes. This example uses the Python SDK to upload a PDF and receive structured data with container details.
POST /v1/bl/parse
Parse a single Bill of Lading document and return structured data. Accepts PDF, PNG, JPG, and TIFF images. Returns all B/L fields as structured JSON including multi-container extraction with ISO 6346 container number validation.
Parses an ocean Bill of Lading document and extracts all shipping data fields. Supports documents from Evergreen, ONE, MSC, Maersk, COSCO, Hapag-Lloyd, Yang Ming, HMM, and other carriers. Average processing time is 1.4–2.2 seconds per document depending on container count.
Request Body (JSON)
| Parameter | Type | Description |
|---|---|---|
document Required | string | Base64-encoded document content (PDF, PNG, JPG, TIFF) |
format Required | string | Document format: pdf, png, jpg, or tiff |
include_confidence Optional | boolean | Include per-field confidence scores (default: true) |
validate_containers Optional | boolean | Validate container numbers against ISO 6346 check digit (default: true) |
extract_all_containers Optional | boolean | Extract all containers from multi-page B/L (default: true) |
webhook_url Optional | string | URL to receive a POST callback when processing completes |
carrier_hint Optional | string | Carrier SCAC code hint for improved accuracy (e.g., EGLV, MAEU) |
Example Request (cURL)
Response (200 OK)
GET /v1/bl/{id}
Retrieve a previously parsed B/L result by its unique ID. Results are stored for 90 days. Use this endpoint to fetch results asynchronously when using webhooks, or to re-access previously parsed documents.
Returns the full parsed result for a specific Bill of Lading document. The {id} is the unique identifier returned by the /bl/parse endpoint (e.g., bl_7k4m9p2n6j1x). Returns the same response schema as the parse endpoint.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id Required | string | The unique B/L result ID (e.g., bl_7k4m9p2n6j1x) |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
include_raw Optional | boolean | Include raw OCR text alongside structured data (default: false) |
container_filter Optional | string | Filter containers by number prefix (e.g., EGHU) |
POST /v1/bl/batch
Submit multiple B/L documents for batch processing. The API accepts up to 50 documents per batch request and processes them asynchronously. Use the webhook_url parameter or poll the GET /bl/{id} endpoint for results. Ideal for processing shipment manifests or digitizing archived B/L records.
Submits a batch of Bill of Lading documents for asynchronous processing. Returns immediately with a batch ID and individual document IDs. Each document is processed independently — one failure will not affect the others. Supports mixed carrier documents in a single batch.
Request Body
| Parameter | Type | Description |
|---|---|---|
documents Required | array | Array of document objects (max 50). Each object has document and format fields. |
webhook_url Optional | string | URL to receive a POST callback when the entire batch is complete |
priority Optional | string | normal (default) or high (Professional/Enterprise plans only) |
validate_containers Optional | boolean | Validate all container numbers against ISO 6346 (default: true) |
GET /v1/status
Check the API health and your account usage. Returns current API status, your plan details, and remaining request quota for the current billing period.
Returns API health status, your account plan information, and current usage statistics. Use this to monitor your quota or verify connectivity.
B/L Sections Reference
The KabyTech API parses all standard sections of an ocean Bill of Lading. Below are the primary section groups returned in the response, each containing multiple structured fields.
| # | Section Group | Key | Description |
|---|---|---|---|
| 1 | Header | header | B/L number, date of issue, B/L type (original, copy, telex release), number of originals, carrier name and SCAC code |
| 2 | Shipper | shipper | Full shipper/exporter name, registered address, contact phone/fax, email, tax ID |
| 3 | Consignee | consignee | Consignee name, full address, contact details. Supports "To Order" and "To Order of" clauses |
| 4 | Notify Party | notify_party | Notify party name, address, contact. Multiple notify parties supported with also_notify field |
| 5 | Vessel & Voyage | vessel_voyage | Vessel name, Lloyd's IMO number, voyage number, flag state, pre-carriage vessel (if feeder) |
| 6 | Ports | ports | Port of Loading (POL), Port of Discharge (POD), Place of Receipt (POR), Place of Delivery (POD) — all with UN/LOCODE |
| 7 | Containers | containers | Container number (ISO 6346 validated), seal number, size/type (20GP, 40HC, etc.), tare weight, gross weight, packages, marks & numbers, goods description per container |
| 8 | Goods Description | goods | Combined goods description, HS codes, marks and numbers, total packages, package type, gross weight, measurement (CBM) |
| 9 | Freight & Charges | freight | Freight terms (Prepaid/Collect), freight amount, currency, additional charges, exchange rate, total charges |
| 10 | Terms & Conditions | terms | Applicable law jurisdiction, clause paramount, Hague-Visby rules indicator, additional clauses |
Response Field Reference
Every API response includes these top-level fields alongside the detailed section data. The B/L parser extracts 45+ fields from each document.
original, copy, telex_release, express, or switch
name, address, contact, tax_id
name, address, contact. May contain to_order flag
name, address, contact
name and UN/LOCODE code
name and UN/LOCODE code
name and code
name and code
number, iso6346_valid, seal, type, size_type_code, weight_kg, packages, package_type, description
Prepaid or Collect
value (number), currency (ISO 4217)
field, message, and severity properties.
Error Codes
The API uses standard HTTP status codes. All error responses include a JSON body with error, message, and code fields.
| Status | Code | Description |
|---|---|---|
| 400 | invalid_document | The document could not be read. Check encoding and format parameter. |
| 400 | unsupported_format | Document format not supported. Use pdf, png, jpg, or tiff. |
| 401 | invalid_api_key | API key is missing, invalid, or expired. |
| 403 | plan_limit_exceeded | Monthly request quota exceeded. Upgrade your plan or wait for reset. |
| 404 | bl_not_found | No parsed result found for the given ID. Results expire after 90 days. |
| 422 | parse_failed | Document was read but no B/L data could be extracted. Verify document content. |
| 422 | container_validation_failed | One or more container numbers failed ISO 6346 check digit validation. |
| 429 | rate_limited | Too many requests. Respect the rate limits for your plan tier. |
| 500 | internal_error | Unexpected server error. Retry the request. If persistent, contact support. |
| 503 | service_unavailable | API is temporarily unavailable for maintenance. Typically under 5 minutes. |
Rate Limits
Rate limits vary by plan tier. All limits are applied per API key on a per-minute and per-month basis. Rate limit headers are included in every response.
60
requests/min
Starter Plan
300
requests/min
Professional Plan
1,000
requests/min
Enterprise Plan
| Response Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per minute for your plan |
X-RateLimit-Remaining | Remaining requests in the current minute window |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
Official SDKs
We provide official SDKs for the most popular languages in the Thai logistics tech ecosystem. All SDKs are open source and available on GitHub.
Python
Python 3.8+
pip install kabytech
Node.js
Node 16+
npm i @kabytech/sdk
PHP
PHP 8.0+
composer require kabytech/sdk
Java
Java 11+
co.th.kabytech:sdk:1.4.0
Need help integrating?
Our integration team can help you connect the KabyTech B/L API to CargoWise, SAP, Oracle TMS, or your custom freight management system.