> ## Documentation Index
> Fetch the complete documentation index at: https://docs.accountingplus.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Token

> Get an access token for the client



## OpenAPI

````yaml POST /oauth/clients/accesstoken
openapi: 3.1.0
info:
  title: Accounting+ API
  description: >-
    A comprehensive accounting API that provides endpoints for managing bank
    cash flow vouchers and journal transactions
  version: 1.0.0
servers:
  - url: https://staging-openapi.accountingplus.id
    description: Main API Server
    variables:
      url:
        default: https://staging-openapi.accountingplus.id
        description: The API base URL
security:
  - bearerAuth: []
    signatureKey: []
    dataKey: []
tags:
  - name: Vouchers
    description: Bank cash flow voucher management
  - name: Journals
    description: Journal transaction management
  - name: Purchase Invoices
    description: Purchase invoice management
paths:
  /oauth/clients/accesstoken:
    post:
      tags:
        - OAuth
      summary: Get Access Token
      description: Get an access token for the client
      requestBody:
        description: Client credentials
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_id
                - client_secret
              properties:
                client_id:
                  type: string
                  example: thepartner
                client_secret:
                  type: string
                  example: abcdefghijklmnopqrstuvwxyz
      responses:
        '200':
          description: Access token generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: '00'
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      organization_name:
                        type: string
                        example: PT. Test
                      client_id:
                        type: string
                        example: thepartner
                      access_token:
                        type: string
                        example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                      expires_in:
                        type: integer
                        example: 172800
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  traceId:
                    type: string
              examples:
                Unauthorized 1:
                  summary: Invalid client ID
                  value:
                    status: ACC07
                    message: given client id is not found
                    traceId: 123e4567-e89b-12d3-a456-426614174000
                Unauthorized 2:
                  summary: Invalid client credentials
                  value:
                    status: ACC07
                    message: Invalid client credentials
                    traceId: 123e4567-e89b-12d3-a456-426614174000
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Generate a JWT signed with the `client_secret` and include the
        `client_id` as a claim in its payload.
    signatureKey:
      type: apiKey
      in: header
      name: A-Signature
      description: >-
        Generate the signature by creating an `SHA256-HMAC` hash from the plain
        signature above, using the `signature_secret` as the key. Then,
        `Base64-encode` the resulting hash and place the final value in the
        A-Signature header.
    dataKey:
      type: apiKey
      in: header
      name: A-Data
      description: Include the `email` and `tenant_id` in the payload as Base64 encoded.

````