> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate OTP

> Generate OTP to authenticate tax payer.

<Warning>
  **Prerequisites:** You must enable API access to get access to GST APIs. If not done already, [enable API access](/api-reference/gst/compliance/guides/taxpayer/authentication/enable_api_access).
</Warning>


## OpenAPI

````yaml api-reference/gst/compliance/openapi.json POST /gst/compliance/tax-payer/otp
openapi: 3.0.1
info:
  title: compliance
  description: >-
    **GST Compliance API** enables businesses to automate compliance
    requirements like [Taxpayer
    verification](https://developer.sandbox.co.in/reference/search-gstin-api),
    [GSTR
    Filing](https://developer.sandbox.co.in/reference/gst-taxpayer-authentication),
    [Generating
    E-Invoices](https://developer.sandbox.co.in/reference/e-invoice-authentication-api),
    and [E-Way
    Bills](https://developer.sandbox.co.in/reference/e-way-bill-authentication-api).We
    provide these APIs from GSTN-authorised GST Suvidha Providers, handling the
    encryption-decryption and signing so you don't have to handle the
    complexities.
  version: 1.0.0
servers:
  - url: https://api.sandbox.co.in
  - url: https://test-api.sandbox.co.in
security: []
tags:
  - name: Public
  - name: Taxpayer
  - name: Taxpayer Auth
  - name: Returns
  - name: GSTR-1 Documents
  - name: File GSTR-1
  - name: GSTR-2A Documents
  - name: GSTR-2B Document
  - name: File GSTR-3B
  - name: GSTR-4
  - name: File GSTR-9
  - name: Invoice Management System
  - name: GSTR-1A Documents
  - name: File GSTR-1A
  - name: Ledgers
  - name: e-Invoice
  - name: Sales e-Invoices for return period
  - name: Purchase e-Invoices for return period
  - name: Front Office Notices
  - name: Front Office
  - name: AATO
  - name: e-Invoice1
  - name: Authentication
  - name: e-Invoice12
  - name: E-Way Bill
  - name: E-Way Bill1
  - name: Authentication1
  - name: Consignor
  - name: Consolidated E-Way Bill
  - name: Multi-Vehicle Movement
  - name: Consignee
  - name: Transporter
  - name: Consolidated E-Way Bill1
  - name: Multi-vehicle Movement
  - name: Common
paths:
  /gst/compliance/tax-payer/otp:
    post:
      tags:
        - Taxpayer
        - Taxpayer Auth
      summary: Generate OTP
      description: Generate OTP to authenticate tax payer.
      operationId: generateOtp
      parameters:
        - name: authorization
          in: header
          description: JWT access token
          required: true
          example: '{{access_token}}'
          schema:
            type: string
        - name: x-source
          in: header
          description: 'Source. Possible Values: primary (default) or secondary'
          required: false
          example: primary
          schema:
            type: string
            default: primary
            example: primary
        - name: x-api-key
          in: header
          description: API key for identification
          required: true
          example: '{{api_key}}'
          schema:
            type: string
        - name: x-api-version
          in: header
          description: API version
          required: false
          example: ''
          schema:
            type: string
            default: 1.0.0
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - username
                - gstin
              properties:
                username:
                  type: string
                  description: Username as per GST portal
                gstin:
                  type: string
                  description: GSTIN of the taxpayer
            examples:
              200 Success:
                value:
                  username: TN_NT2.2477
                  gstin: 33ABKCS2033B1ZW
                summary: 200 Success
              TEC4001 OTP generation failed:
                value:
                  username: globex.edu.co
                  gstin: 23ABCCQ2000E000
                summary: TEC4001 OTP generation failed
              AUTH403 Maximum sessions reached:
                value:
                  username: acme.gj.com
                  gstin: 24AAACQ3770E000
                summary: AUTH403 Maximum sessions reached
      responses:
        '200':
          description: >-
            200 Success / TEC4001 OTP generation failed / AUTH403 Maximum
            sessions reached
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: number
                    example: 200
                  data:
                    type: object
                    properties:
                      error:
                        type: object
                        properties:
                          error_cd:
                            type: string
                            example: TEC4001
                          message:
                            type: string
                            example: >-
                              OTP generation failed as OTP server is down.
                              Contact Support
                      status_cd:
                        type: string
                        example: '1'
                  timestamp:
                    type: number
                    example: 1712926086000
                  transaction_id:
                    type: string
                    example: 9a6ce7b9-de63-48a8-b45b-0c5420538b25
              examples:
                200 Success:
                  summary: 200 Success
                  value:
                    code: 200
                    data:
                      status_cd: '1'
                    timestamp: 1712926086000
                    transaction_id: 9a6ce7b9-de63-48a8-b45b-0c5420538b25
                AUTH403 Maximum sessions reached:
                  summary: AUTH403 Maximum sessions reached
                  value:
                    code: 200
                    data:
                      error:
                        error_cd: AUTH403
                        message: >-
                          Maximum session allowed for user with this GSP account
                          exceeded.
                      status_cd: '0'
                    timestamp: 1763446641000
                    transaction_id: 7047f26a-0993-4cab-8e7c-553034d3a3b4
                TEC4001 OTP generation failed:
                  summary: TEC4001 OTP generation failed
                  value:
                    code: 200
                    data:
                      error:
                        error_cd: TEC4001
                        message: >-
                          OTP generation failed as OTP server is down. Contact
                          Support
                      status_cd: '0'
                    timestamp: 1763446641000
                    transaction_id: c0cba77f-4942-49f5-8a18-6c62d69f354b
          headers: {}
        '422':
          description: Invalid GSTIN Pattern
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: number
                    example: 422
                  message:
                    type: string
                    example: Invalid GSTIN pattern
                  timestamp:
                    type: number
                    example: 1763446641000
                  transaction_id:
                    type: string
                    example: 021ff404-5b8b-468b-ab92-68ff5a54590b
              examples:
                Invalid GSTIN Pattern:
                  summary: Invalid GSTIN Pattern
                  value:
                    code: 422
                    message: Invalid GSTIN pattern
                    timestamp: 1763446641000
                    transaction_id: 021ff404-5b8b-468b-ab92-68ff5a54590b
          headers: {}
      deprecated: false
      security: []

````