company_id is the identifier you store, pass to lookup, and send when you order a report. Its meaning depends on the environment.
Production: the public_id
In production,company_id is INRA’s public company identifier (public_id):
- It is a nine-digit number. The first digit is never
0. The last digit is a Luhn check digit computed from the first eight, so a mistyped id is usually rejected as404rather than silently resolved to the wrong company. - It is unique and is bound to one company record for as long as that record exists.
- It is not the 13-digit DBD registration number, and it is not INRA’s internal filing number. Search can accept a registration number; every later call uses
company_id. - If INRA removes a company record, that
public_idis retired. It is never issued again. A lookup of a retired id returns410with the codecompany_retired. Store the id, but treat a410as final.
company_id from GET /v1/companies (and later from an offline order once INRA has identified the subject). Do not try to invent or reuse one.
Sandbox: sample identifiers
The sandbox catalogue uses its own short sample ids —100001, 100002, 100005, 100006, 100007, and so on. Those values are convenient for fixtures. They are not valid production public_id values, and they will not resolve on https://partners.inra.co.th.
Likewise, a production public_id will not resolve in the sandbox. Keep the two sets of identifiers separate in your own records, or use a distinct sandbox tenant in your system.
What to persist
When a search or lookup succeeds, persist:company_id— the handle you will use on later callscompany_name/local_nameandregistration_number— useful for display and for support- the environment you called (
sandboxorproduction)
company_id until INRA identifies the subject. The order.identified callback and a later GET /v1/orders/{order_id} include the id once it exists. See Orders and callbacks.
