> ## Documentation Index
> Fetch the complete documentation index at: https://docs.partners.inra.co.th/llms.txt
> Use this file to discover all available pages before exploring further.

# Offline reports

> Order a fresh investigation of a known company, or of a company INRA will identify from the details you send.

An **offline report** is a fresh investigation, not a copy of an on-file database report. The place-order response is `202 Accepted`. The order starts in status `Active` with no report attached. You poll, or you wait for a [callback](https://docs.partners.inra.co.th/guides/webhooks.md).

In production, INRA staff check business rules first (for example a repeat order for the same company within an agreed period) and then create the real order, so the request may later be cancelled instead of completed. In the sandbox the order completes automatically after a short delay with a sample report.

## Known company

`POST /v1/offline-reports` is for a company you already found with search. `company_id` is required.

`content_type` is `basic` (one time frame, two working days) or `regular` (the default). For `regular`, `speed` is:

| `speed` | Expected working days |
| - | - |
| `normal` (and the default if you omit it) | 7 |
| `urgent` | 4 |
| `super_urgent` | 2 |

Omit `speed` when `content_type` is `basic`. The response includes `expected_working_days` and an estimated `expected_due_date` (Monday–Friday, Asia/Bangkok; public holidays are not excluded). Some clients have agreed shorter times.

`reference` and `note` are optional. Callbacks always go to the single URL INRA registered for your client; they cannot be set per order.

```bash cURL theme={null}
curl -s -H "Authorization: Bearer $TOKEN"   -H "Accept: application/json"   -H "Content-Type: application/json"   -d '{"company_id":100001,"content_type":"regular","speed":"normal","reference":"INV-77"}'   https://partners-sandbox.inra.co.th/v1/offline-reports
```

```python Python theme={null}
import os
import requests

headers = {
    "Authorization": f"Bearer {os.environ['TOKEN']}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}
response = requests.post(
    "https://partners-sandbox.inra.co.th/v1/offline-reports",
    headers=headers,
    json={
        "company_id": 100001,
        "content_type": "regular",
        "speed": "normal",
        "reference": "INV-77",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["order_id"], response.json()["status"])
```

## Company not found in search

`POST /v1/offline-reports/by-details` is for a subject search did not return. Send at least `company_name`, `local_name`, or the 13-digit `registration_number`. Address, phone, website, and `country_code` help INRA identify the subject.

The order has no `company_id` until INRA identifies it. The `order.identified` callback and a later `GET /v1/orders/{order_id}` include the id afterwards. Delivery of the report is the same as for a known-company offline order (poll or callback).

```bash theme={null}
curl -s -H "Authorization: Bearer $TOKEN"   -H "Accept: application/json"   -H "Content-Type: application/json"   -d '{"company_name":"Example Co., Ltd.","local_name":"ตัวอย่าง จำกัด","registration_number":"0105550000999","country_code":"TH"}'   https://partners-sandbox.inra.co.th/v1/offline-reports/by-details
```

## Completing, cancelling, and downloading

Poll `GET /v1/orders/{order_id}` or list `GET /v1/orders?status=completed`. When the status is `Completed`, download the report from `GET /v1/orders/{order_id}/report` (JSON or XML, same schema as a database report).

* `409 order_not_completed` — the order is still `Active`
* `409 order_cancelled` — see `cancellation` on the order
* `406 pdf_not_available` — PDF is not offered in v1

In the sandbox only, a `reference` that starts with `test-cancel` is cancelled instead of completed, so you can practise that path. That prefix has no special meaning in production; do not send it on a real order.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.