ATPL OCR
Sign up

Developers

API reference

Send a letter of credit, shipping bill, bill of entry or EPCG licence. Get structured data back as JSON, XML or text.

Authentication

Send your API key in the X-Api-Key header on every request. Create keys under API keys in the app.

X-Api-Key: YOUR_API_KEY

Base URL

https://api.example.com/v1

Placeholder address. Your real base URL is shown in the app.

POST /extract

POST/extract

Upload a document and receive the extracted fields.

ParameterTypeDescription
filefileThe PDF or image (multipart form field).
typestringOne of: auto | lc | shipping_bill | bill_of_entry | epcg.
formatstringjson (default), xml or text.
curl -X POST https://api.example.com/v1/extract \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "type=auto" \
  -F "format=json"

Sample response

{
  "id": "doc_8f3a21c9",
  "type": "shipping_bill",
  "status": "done",
  "pages": 2,
  "fields": [
    { "name": "shipping_bill_number", "value": "SB-2041", "status": "filled" },
    { "name": "shipping_bill_date", "value": "2026-03-14", "status": "filled" },
    { "name": "fob_value", "value": "48,250.00", "status": "review" },
    { "name": "reference", "value": "", "status": "blank" },
    { "name": "licence_number", "value": null, "status": "not_found" }
  ]
}

GET /documents/{id}

GET/documents/{id}

Fetch one document and its fields.

GET /documents

GET/documents

List your documents, newest first. Supports limit and offset.

DELETE /documents/{id}

DELETE/documents/{id}

Delete a document and its results. This cannot be undone.

GET /usage

GET/usage

Pages used and pages left on your current plan.

Errors

Errors return the HTTP status and a JSON body with a message.

CodeMeaning
401Missing or invalid API key.
402Subscription expired. Renew your plan to continue.
403The key is valid but not allowed to do this, for example it was revoked.
404The document does not exist or belongs to another account.
413File too large. Split the document and try again.
422The request was understood but a parameter is wrong, such as an unknown type or format.
429Rate limit reached. Wait for the time in the Retry-After header.
500Something went wrong on our side. Retry; contact support if it persists.

Rate limits

Each key may send up to 60 requests per minute. Over the limit you receive 429 with a Retry-After header.

Webhooks

Add an HTTPS endpoint in the app and we will POST a JSON event to it.

  • document.doneA document finished and results are ready.
  • document.failedA document could not be read.
  • plan.expiringYour plan ends soon.

Status values

Every field carries one status so you know what to trust.

  • filledRead with confidence.
  • reviewRead, but worth a human look.
  • blankThe field is empty on the document.
  • not_foundThe field could not be located.