Introduction
The KabyTech Delivery Order (D/O) Intelligence API lets you parse Delivery Order documents (PDF, image, or scanned copies) and receive structured JSON with 25+ fields extracted. The API is designed for Thai port and terminal operations, supporting cargo release authorization at Laem Chabang (THLCH), Bangkok Port (THBKK), and Map Ta Phut (THMTP).
Delivery Orders authorize the release of cargo from port terminals to the consignee or their agent. The API automatically matches each D/O against its originating AWB or B/L reference, validates container numbers per ISO 6346, and tracks release authorization status in real time.
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/do/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 Delivery Order parsed in under 5 minutes. This example uses the Python SDK to upload a scanned D/O and receive structured release authorization data.
POST /v1/do/parse
Parse a single Delivery Order document and return structured data. Accepts PDF, PNG, JPG, TIFF images, or scanned copies. Returns 25+ fields including release authorization status, container validation, and reference matching against the originating AWB or B/L.
Parses a Delivery Order document and extracts all structured fields. Container numbers are validated per ISO 6346 (check digit verification). The D/O is automatically matched against its originating AWB or B/L reference when available. Average processing time is 1.0–1.5 seconds per document.
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, tiff |
include_confidence Optional | boolean | Include per-field confidence scores (default: true) |
validate_iso6346 Optional | boolean | Validate container numbers per ISO 6346 check digit (default: true) |
match_reference Optional | boolean | Match D/O against originating AWB or B/L in your account (default: true) |
webhook_url Optional | string | URL to receive a POST callback when processing completes |
Example Request (cURL)
Response (200 OK)
GET /v1/do/{id}
Retrieve a previously parsed Delivery Order 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. The release authorization status is refreshed on each retrieval.
Returns the full parsed result for a specific Delivery Order. The {id} is the unique identifier returned by the /do/parse endpoint (e.g., do_7k2m9f3n1p4q). Returns the same response schema as the parse endpoint with updated release status.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id Required | string | The unique D/O result ID (e.g., do_7k2m9f3n1p4q) |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
include_raw Optional | boolean | Include raw OCR text in the response (default: false) |
refresh_status Optional | boolean | Re-check release authorization status from terminal (default: false) |
POST /v1/do/batch
Submit multiple Delivery Order documents for batch processing. The API accepts up to 50 documents per batch request and processes them asynchronously. Ideal for processing daily port release batches or bulk digitization of historical D/O records.
Submits a batch of D/O documents for asynchronous processing. Returns immediately with a batch ID and individual document IDs. Each document is processed independently — one failure won't affect the others. Container validation and reference matching are applied to each document.
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_iso6346 Optional | boolean | Validate all container numbers per 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 before submitting batch jobs.
D/O Sections Reference
The KabyTech API parses all standard Delivery Order sections. Below are the primary sections returned in the response for every parsed D/O document. Each section groups related fields for easy integration with terminal management systems (TOS) and customs workflows.
| # | Section | Key | Description |
|---|---|---|---|
| 1 | Header | header | D/O number, issue date, document type (original/copy), issuing terminal |
| 2 | Parties | parties | Issuer (shipping line/agent), consignee, cargo agent, notify party |
| 3 | Reference | reference | AWB or B/L number matching, booking reference, vessel/voyage or flight |
| 4 | Container | container | Container number (ISO 6346 validated), size/type, seal number, tare weight |
| 5 | Cargo Details | cargo | Goods description, HS codes, packages count, gross weight, measurement (CBM) |
| 6 | Terminal & Release | release | Terminal name/code, berth, release type (full/partial), authorization status & timestamp |
| 7 | Customs | customs | Customs declaration reference, import permit number, duty payment status |
| 8 | Charges | charges | Free time expiry, storage charges (daily rate, accrued), demurrage, handling fees |
Each section is returned as a nested object within the response. Fields that could not be extracted are returned as null with a confidence score of 0. Use include_confidence: true to get per-field scores.
Response Field Reference
Every API response includes these top-level fields alongside the section objects. All 25+ fields are extracted with individual confidence scores.
name, address, and code.
name, address, and tax_id.
name and iata_code.
match_reference is enabled.
full (complete release) or partial (split delivery).
currency, daily_rate, accrued.
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. |
| 400 | invalid_container | Container number failed ISO 6346 check digit validation. |
| 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 | do_not_found | No parsed result found for the given ID. Results expire after 90 days. |
| 422 | parse_failed | Document was read but no D/O data could be extracted. Verify document content. |
| 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 D/O API to your Terminal Operating System (TOS), CargoWise, or customs management platform.