1. Request credentials
INRA issues aclient_id and client_secret for your organisation. Email inraasth@inra.co.th to request a sandbox credential first, and a separate production credential when you are ready to go live.
We send these once, out of band — not from this page. Store the secret in your own secret manager. Do not put it in a mobile app, a front-end bundle, source control, or a screenshot. If a secret is ever lost or leaked, ask us to rotate it; the old value stops working immediately.
The examples below use placeholders. Replace them with the values you were issued.
2. Request an access token
The API uses OAuth 2.0 client credentials. Authenticate to the token endpoint with HTTP Basic (client_id as the username, client_secret as the password), then use the access token as a Bearer token on every /v1 call.
POST /oauth/token always returns JSON, even if you usually prefer XML.
- The access token is an RS256 JWT and is valid for 15 minutes. Request a new one when it is close to expiry; there is no refresh token.
- You can verify the signature with the keys at
GET /.well-known/jwks.json. The token header carries akid(sandbox-1in the sandbox,prod-1in production). - The token is scoped. If you call an endpoint your client has not been granted, the API returns
403with the codeinsufficient_scope. - If the client id or secret is wrong, the token endpoint returns the standard OAuth error
invalid_client, not the/v1error envelope. - The token endpoint itself is limited to 30 requests per minute per client.
3. Search for a company
Resource responses default to XML. SendAccept: application/json when you want JSON.
Company search matches a name with contains by default (at least three characters after wildcard characters are stripped), or matches a 13-digit registration number exactly.
In the sandbox the catalogue is small and deliberate. Searching a real Thai company name will usually return nothing. Use the samples below instead.
Each hit includes a
company_id. You will need that id for lookup and for ordering a report. One sandbox company (100003) can be found in search but has no database report — that is intentional, so you can practise the report_not_available case.
In production, company_id is INRA’s nine-digit public identifier, and only companies with a Thai address are returned. Sandbox ids such as 100001 do not work in production.
4. Look up the company
database_report: if that flag is true, you can order an on-file report for this company.
5. Optional: download a sandbox database report
This step is safe in the sandbox. Skip it against production until you intend to place a real order.
The reports are based on real INRA reports that have been masked: personal names, registration numbers, contact details, and other identifiers are replaced consistently throughout each file. Figures are adjusted. Treat them as realistic in shape, not as information about any actual company.
You can fetch the order again with
GET /v1/orders/{order_id}.
6. When something goes wrong
Every/v1 error uses a small envelope with a stable code, a human message, and a request_id. The same shape is used in JSON and XML. Every response also carries the X-Request-Id header — please include it when you email inraasth@inra.co.th.
A full list lives on the Errors page.
Next steps
- Authentication — scopes, token lifetime, JWKS, and rotating a secret
- Sandbox vs production — what is masked, what is identical, and what is billed
- Company search — matching rules and how to choose a
company_id - Database reports and Offline reports
- Dictionaries — codes and names you can cache
- The API reference — every endpoint, with a playground
X-Request-Id. The documentation should follow the API, not the other way around.
