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

# Company search



## OpenAPI

````yaml /openapi.json get /v1/companies
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/companies:
    get:
      tags:
        - Companies
      summary: Company search
      operationId: company_search_v1_companies_get
      parameters:
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Company name to search (English or Thai). The server applies the
              match itself and ignores client-supplied wildcard characters (* %
              _ ? [ ]). After those characters are removed, at least three
              characters must remain.
            title: Name
          description: >-
            Company name to search (English or Thai). The server applies the
            match itself and ignores client-supplied wildcard characters (* % _
            ? [ ]). After those characters are removed, at least three
            characters must remain.
        - name: reg_no
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Full 13-digit registration number. Matched exactly after
              client-supplied wildcard characters (* % _ ? [ ]) are removed,
              regardless of the match parameter.
            title: Reg No
          description: >-
            Full 13-digit registration number. Matched exactly after
            client-supplied wildcard characters (* % _ ? [ ]) are removed,
            regardless of the match parameter.
        - name: match
          in: query
          required: false
          schema:
            enum:
              - contains
              - prefix
            type: string
            description: >-
              How to match name. contains (the default) finds the text anywhere
              in the English or Thai name and ranks names that start with the
              text first. prefix is a starts-with match. Ignored when searching
              only by reg_no.
            default: contains
            title: Match
          description: >-
            How to match name. contains (the default) finds the text anywhere in
            the English or Thai name and ranks names that start with the text
            first. prefix is a starts-with match. Ignored when searching only by
            reg_no.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyList'
        '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:
    CompanyList:
      properties:
        companies:
          items:
            $ref: '#/components/schemas/Company'
          type: array
          title: Companies
      additionalProperties: false
      type: object
      required:
        - companies
      title: CompanyList
    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.
    Company:
      properties:
        company_id:
          type: integer
          title: Company Id
        company_name:
          type: string
          title: Company Name
        local_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Local Name
        registration_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Registration Number
        established_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Established Date
        operating_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Operating Address
        country_code:
          anyOf:
            - type: string
              maxLength: 2
              minLength: 2
              pattern: ^[A-Z]{2}$
            - type: 'null'
          title: Country Code
          description: >-
            ISO 3166-1 alpha-2 (including user-assigned XK/XX and withdrawn
            codes such as YU).
        country_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Name
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        last_update:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Last Update
        latest_fs:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Latest Fs
        database_report:
          type: boolean
          title: Database Report
      additionalProperties: false
      type: object
      required:
        - company_id
        - company_name
        - database_report
      title: Company
    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.