Skip to main content
Every report request becomes an order that belongs to your client. You can always read your own orders; you cannot read another client’s.

Kinds of order

In the sandbox, a database order never reaches INRA’s head-office system and is not billed. An offline sandbox order completes automatically after a short delay with a sample report (or is cancelled if your reference starts with test-cancel). In production, both kinds are real orders and may be billed. Offline orders are reviewed by INRA staff first, for example to catch a repeat order for the same company within an agreed period, and may be cancelled instead of completed.

Status values

A database order is created already Completed (or the request fails and no order is stored). An offline order stays Active until it is completed or cancelled.

Polling

You can:
  • GET /v1/orders/{order_id} for a single order
  • GET /v1/orders?status=completed&since=... to pick up finished work, and follow next_cursor for later pages
If you download GET /v1/orders/{order_id}/report while the order is still Active, the API returns 409 with the code order_not_completed. If it was cancelled, the code is order_cancelled.

Callbacks

INRA can register one callback URL per client. You cannot set a URL per order, and you cannot change the registered URL through the API. When you have a URL, email it to inraasth@inra.co.th; INRA will review it and configure the subscription (and a signing secret) for you. Each callback is an HTTPS POST with a small JSON body. Typical event types include a ping, order identification (when an offline-by-details order receives a company_id), completion, and cancellation. The body carries event_id, event_type, created_at, environment, and data with order_id, status, and links. Verify every callback:
  • X-INRA-Signature: v1=<hex> must equal HMAC-SHA256 of secret over <X-INRA-Timestamp>.<raw body>
  • Reject timestamps older than five minutes
  • De-duplicate on X-INRA-Event-Id
Answer with a 2xx within 10 seconds. Other answers are retried with backoff for about 35 hours. GET /v1/webhook shows the URL INRA configured and the last delivery. POST /v1/webhook/test queues a signed webhook.ping so you can check your receiver. The full request shape and a verification example are in Callbacks.