# Authentication

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /oauth/token:
    post:
      summary: Authentication
      deprecated: false
      description: >-

        :::highlight orange 📌

        <br> <Icon icon="solar-bold-alt-arrow-right"/> Get `userName` and
        `password` from EnKash 

        <Icon icon="solar-bold-alt-arrow-right"/> Call Auth Token Api to
        generate Bearer Token

        <Icon icon="solar-bold-alt-arrow-right"/> Bearer and refresh tokens are
        valid for 5 minutes and must be regenerated after expiry

        <Icon icon="solar-bold-alt-arrow-right"/> The Distribution Platform
        validates the identity and parameters of each OAuth2.0 API request.
        After 3 consecutive failed attempts, the account will be locked and an
        invalid response returned </br>

        :::
      tags:
        - Petty Cash/API - Petty Cash/Token APIs
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          example: >-
            Basic
            Q0VLMUdaQk82QTo2NGIwZmYwMzMyZjA1OGI1NjQwMmI2M2E5YmFhNjAyMTRmMmQ2MWQz
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/x-www-form-urlencoded
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                username:
                  example: '9167019711'
                  type: string
                password:
                  example: Test@1234567
                  type: string
                grant_type:
                  example: password
                  type: string
                clientId:
                  example: CEK1GZBO6A
                  type: string
              required:
                - username
                - password
                - grant_type
                - clientId
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  token_type:
                    type: string
                  refresh_token:
                    type: string
                  expires_in:
                    type: integer
                  scope:
                    type: string
                required:
                  - access_token
                  - token_type
                  - refresh_token
                  - expires_in
                  - scope
                x-apidog-orders:
                  - access_token
                  - token_type
                  - refresh_token
                  - expires_in
                  - scope
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Petty Cash/API - Petty Cash/Token APIs
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-24480514-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
