> ## 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.

# Callback settings

> Show the callback INRA configured for this client and the last delivery.

Callbacks are configured by INRA (URL, extra allowed hosts, signing
secret) after a short review, not through the API. Each callback is an
HTTPS `POST` with a small JSON body (`event_id`, `event_type`,
`created_at`, `environment`, `data` with `order_id`, `status`, `links`).
Verify `X-INRA-Signature: v1=<hex>` = HMAC-SHA256(secret,
`<X-INRA-Timestamp>.<raw body>`), reject timestamps older than 5 minutes
and de-duplicate on `X-INRA-Event-Id`. Answer 2xx within 10 seconds;
other answers are retried with backoff for about 35 hours.



## OpenAPI

````yaml /openapi.json get /v1/webhook
openapi: 3.1.0
info:
  title: INRA Partners API
  description: >
    The INRA Partners API lets authorised partners search Thai companies and

    retrieve INRA database reports and offline investigations.


    Resource responses default to XML. Send `Accept: application/json` or

    `format=json` for JSON. `POST /oauth/token` is always JSON. Field names are

    `snake_case` in both formats. XML uses the namespace

    `https://partners.inra.co.th/schema/v1`.


    ## Environments


    | Environment | Base URL | Data |

    | --- | --- | --- |

    | Production | `https://partners.inra.co.th` | Live Thai-company data.
    Orders are real and may be billed. |

    | Sandbox | `https://partners-sandbox.inra.co.th` | Masked sample companies
    and reports. Nothing you do here creates an HQ order or a charge. |


    Credentials are not interchangeable between environments. In production,

    `company_id` is INRA's nine-digit `public_id`. The sandbox uses its own

    sample identifiers (for example `100001`).


    ## Getting started


    1. Request a `client_id` and `client_secret` from
    [inraasth@inra.co.th](mailto:inraasth@inra.co.th).
       They are issued out of band, not from this page.
    2. Call `POST /oauth/token` with HTTP Basic (`client_id` as the username,
       `client_secret` as the password) and `grant_type=client_credentials`.
    3. Send the access token as `Authorization: Bearer <token>` on `/v1` routes.
       The token is an RS256 JWT, is valid for 15 minutes, and has no refresh
       token. Verify it with `GET /.well-known/jwks.json`.
    4. Search with `GET /v1/companies`, then look up a company or order a
    report.


    Prefer the sandbox while you are integrating. A production

    `POST /v1/database-reports` or `POST /v1/offline-reports` can create a

    billable order.


    Human-written guides live at
    [docs.partners.inra.co.th](https://docs.partners.inra.co.th).
  version: 1.0.0
servers:
  - url: https://partners.inra.co.th
    description: Production
  - url: https://partners-sandbox.inra.co.th
    description: Sandbox
security: []
tags:
  - name: Authentication
    description: Issue and verify access tokens.
  - name: Companies
    description: Search Thai companies and read a company profile.
  - name: Reports
    description: Order a database report or an offline investigation.
  - name: Orders
    description: List orders, check status, and download a completed report.
  - name: Callbacks
    description: >-
      Inspect the callback INRA registered for your client, and send a test
      ping.
  - name: Dictionaries
    description: Reference lists used by coded report fields.
paths:
  /v1/webhook:
    get:
      tags:
        - Callbacks
      summary: Callback settings
      description: |-
        Show the callback INRA configured for this client and the last delivery.

        Callbacks are configured by INRA (URL, extra allowed hosts, signing
        secret) after a short review, not through the API. Each callback is an
        HTTPS `POST` with a small JSON body (`event_id`, `event_type`,
        `created_at`, `environment`, `data` with `order_id`, `status`, `links`).
        Verify `X-INRA-Signature: v1=<hex>` = HMAC-SHA256(secret,
        `<X-INRA-Timestamp>.<raw body>`), reject timestamps older than 5 minutes
        and de-duplicate on `X-INRA-Event-Id`. Answer 2xx within 10 seconds;
        other answers are retried with backoff for about 35 hours.
      operationId: get_webhook_v1_webhook_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookConfig'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Not Found
        '406':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Not Acceptable
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Conflict
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Gone
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Too Many Requests
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Service Unavailable
      security:
        - BearerAuth: []
        - OAuth2: []
components:
  schemas:
    WebhookConfig:
      properties:
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        allowed_hosts:
          items:
            type: string
          type: array
          title: Allowed Hosts
          default: []
        signature_algorithm:
          type: string
          title: Signature Algorithm
          default: HMAC-SHA256
        signature_header:
          type: string
          title: Signature Header
          default: X-INRA-Signature
        timestamp_header:
          type: string
          title: Timestamp Header
          default: X-INRA-Timestamp
        event_id_header:
          type: string
          title: Event Id Header
          default: X-INRA-Event-Id
        secret_configured:
          type: boolean
          title: Secret Configured
        events:
          items:
            type: string
          type: array
          title: Events
          default: []
        last_delivery:
          anyOf:
            - $ref: '#/components/schemas/WebhookDelivery'
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - secret_configured
      title: WebhookConfig
      description: >-
        Callback settings INRA configured for this client. The secret is never
        shown.
    ErrorBody:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      additionalProperties: false
      type: object
      required:
        - error
      title: ErrorBody
      description: >-
        JSON envelope. XML renders ErrorDetail directly so the root element is
        error.
    WebhookDelivery:
      properties:
        event_id:
          type: string
          title: Event Id
        event_type:
          type: string
          title: Event Type
        status:
          type: string
          title: Status
        attempts:
          type: integer
          title: Attempts
        http_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Http Status
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      additionalProperties: false
      type: object
      required:
        - event_id
        - event_type
        - status
        - attempts
      title: WebhookDelivery
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        request_id:
          type: string
          title: Request Id
      additionalProperties: false
      type: object
      required:
        - code
        - message
        - request_id
      title: ErrorDetail
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        RS256 access token from `POST /oauth/token`. Send `Authorization: Bearer
        <token>`.
    OAuth2:
      type: oauth2
      description: OAuth 2.0 client credentials. The token is valid for 15 minutes.
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes:
            companies:search: Search companies
            companies:read: Read a company profile
            reports:database: Order a database report
            reports:offline: Order an offline investigation
            orders:read: List and read orders, and download reports

````

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