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

# OAuth 2.0 client credentials

> Issue a 15-minute RS256 access token. Response is always JSON.



## OpenAPI

````yaml /openapi.json post /oauth/token
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:
  /oauth/token:
    post:
      tags:
        - Authentication
      summary: OAuth 2.0 client credentials
      description: Issue a 15-minute RS256 access token. Response is always JSON.
      operationId: oauth_token_oauth_token_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Body_oauth_token_oauth_token_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BasicAuth: []
components:
  schemas:
    Body_oauth_token_oauth_token_post:
      properties:
        grant_type:
          type: string
          title: Grant Type
        scope:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope
        client_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Id
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
      type: object
      required:
        - grant_type
      title: Body_oauth_token_oauth_token_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        OAuth client credentials. Username is `client_id`, password is
        `client_secret`.

````

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