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

# Verify OTP for tax payment

> Verify the tax payment OTP and get a taxpayer access token to create and fetch challans for the PAN.

> [!NOTE]
>
> This endpoint is in development. The request and response can change before release.

Send the `data.reference_id` returned by [Generate OTP](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/generate-otp.md), the same PAN and mobile number, and the OTP received on the mobile number. This endpoint uses your Sandbox access token in the `Authorization` header.

## Use the taxpayer access token

Save `data.access_token`. Send it in the `Authorization` header of [Create challan](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/create-challan.md) and [Get challan](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/get-challan.md) in place of your Sandbox access token. Keep sending your API key in `x-api-key`.

The token expires at `data.access_token_expiry`. After it expires, generate and verify a new OTP.


## OpenAPI

````yaml api-reference/it/compliance/openapi.json POST /it/compliance/portal/public/tax-payment/tax-payer/otp/verify
openapi: 3.1.0
info:
  title: in-co-sandbox-it-compliance
  version: '1.0'
servers:
  - url: https://test-api.sandbox.co.in
    description: test
  - url: https://api.sandbox.co.in
    description: prod
security:
  - {}
paths:
  /it/compliance/portal/public/tax-payment/tax-payer/otp/verify:
    post:
      tags:
        - in.gov.incometax
        - public
        - tax-payment
        - tax-payer
      summary: Verify OTP
      description: >-
        Verify the OTP sent by Generate OTP and get a taxpayer access token for
        the PAN.


        Send the taxpayer access token in the `Authorization` header of Create
        challan and Get challan. The token expires at
        `data.access_token_expiry`. After it expires, generate and verify a new
        OTP.


        Send your Sandbox access token in the `Authorization` header of this
        request. Example data is fictional.
      operationId: verifyTaxPaymentOtp
      parameters:
        - name: Authorization
          in: header
          description: >-
            Sandbox access token. Send the token without the `Bearer` prefix.
            For token-generation steps, see the [Quickstart
            guide](https://developer.sandbox.co.in/guides/get-started/quickstart).
          required: true
          example: '{{access_token}}'
          schema:
            type: string
        - name: x-api-key
          in: header
          description: Sandbox API key.
          required: true
          example: '{{api_key}}'
          schema:
            type: string
        - name: x-api-version
          in: header
          description: >-
            API version, such as `1.0`. If you omit it, the latest version is
            used.
          required: false
          example: '1.0'
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Request body format.
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                '@entity':
                  type: string
                  enum:
                    - in.co.sandbox.it.compliance.tax_payment.otp.verify.request
                reference_id:
                  type: string
                  description: >-
                    Reference ID of the OTP request, returned as
                    `data.reference_id` by [Generate
                    OTP](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/generate-otp).
                  examples:
                    - FOS007123456789
                pan:
                  type: string
                  pattern: ^[A-Z]{5}[0-9]{4}[A-Z]$
                  description: PAN sent to Generate OTP.
                  examples:
                    - ABCPS1234K
                mobile_number:
                  type: string
                  pattern: ^[6-9][0-9]{9}$
                  description: Mobile number sent to Generate OTP.
                  examples:
                    - '9876543210'
                otp:
                  type: string
                  pattern: ^[0-9]{6}$
                  description: 6-digit OTP sent to the mobile number.
                  examples:
                    - '482913'
              required:
                - '@entity'
                - reference_id
                - pan
                - mobile_number
                - otp
            examples:
              OTP verified:
                summary: OTP verified
                description: The OTP is correct and the taxpayer access token is returned.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.verify.request
                  reference_id: FOS007123456789
                  pan: ABCPS1234K
                  mobile_number: '9876543210'
                  otp: '482913'
              Incorrect OTP:
                summary: Incorrect OTP
                description: The OTP does not match the one sent to the mobile number.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.verify.request
                  reference_id: FOS007123456789
                  pan: ABCPS1234K
                  mobile_number: '9876543210'
                  otp: '111111'
              Expired OTP:
                summary: Expired OTP
                description: The OTP is no longer valid. Generate a new OTP.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.verify.request
                  reference_id: FOS007123456789
                  pan: ABCPS1234K
                  mobile_number: '9876543210'
                  otp: '482913'
      responses:
        '200':
          description: >-
            The OTP is verified. Use `data.access_token` as the taxpayer access
            token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    const: 200
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  data:
                    type: object
                    properties:
                      '@entity':
                        type: string
                        enum:
                          - >-
                            in.co.sandbox.it.compliance.tax_payment.otp.verify.response
                      access_token:
                        type: string
                        description: >-
                          Taxpayer access token. Send it in the `Authorization`
                          header of Create challan and Get challan.
                      access_token_expiry:
                        type: integer
                        format: int64
                        description: >-
                          Expiry of the taxpayer access token, in epoch
                          milliseconds.
                    required:
                      - '@entity'
                      - access_token
                      - access_token_expiry
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - data
              examples:
                OTP verified:
                  summary: OTP verified
                  description: Fictional example data.
                  value:
                    code: 200
                    timestamp: 1793700000000
                    transaction_id: 3a9f0c7d-5e2b-41d8-9c6a-b7e4f1a2d058
                    data:
                      '@entity': >-
                        in.co.sandbox.it.compliance.tax_payment.otp.verify.response
                      access_token: >-
                        eyJhbGciOiJSU0FTU0FfUFNTX1NIQV81MTIiLCJ0eXAiOiJKV1QiLCJraWQiOiJleGFtcGxlLXNpZ25pbmcta2V5In0.eyJpc3MiOiJhcGkuc2FuZGJveC5jby5pbiIsInN1YiI6IkFCQ1BTMTIzNEsiLCJhdWQiOiJBUEkiLCJpbnRlbnQiOiJBQ0NFU1NfVE9LRU4iLCJpYXQiOjE3OTM3MDAwMDAsImV4cCI6MTc5MzcwMzYwMH0.invalid-example-signature
                      access_token_expiry: 1793703600000
        '400':
          description: >-
            The Income Tax Department rejected the OTP. `message` contains the
            reason.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Incorrect OTP:
                  summary: Incorrect OTP
                  description: Fictional example data.
                  value:
                    code: 400
                    timestamp: 1793700000000
                    transaction_id: c2d7e4a9-8f1b-4e36-a5d0-9b3c6f2e1a84
                    message: The OTP you have entered is incorrect.
                Expired OTP:
                  summary: Expired OTP
                  description: Fictional example data.
                  value:
                    code: 400
                    timestamp: 1793700000000
                    transaction_id: 5f1a3c8e-7b2d-4a96-8e4f-0d6c9b1a7e32
                    message: OTP has expired
        '401':
          description: The `Authorization` header is missing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Unauthorized:
                  summary: Unauthorized
                  description: Fictional example data.
                  value:
                    code: 401
                    timestamp: 1793700000000
                    transaction_id: 9a3e6d1f-5c8b-4e42-b7a0-2d9f6c3e1b84
                    message: Unauthorized
        '403':
          description: The Sandbox access token or API key is invalid or expired.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Forbidden:
                  summary: Forbidden
                  description: Fictional example data.
                  value:
                    code: 403
                    timestamp: 1793700000000
                    transaction_id: 2c9f5b8e-1a6d-4c75-9e3b-7a0d4f2c8e19
                    message: Forbidden
        '422':
          description: A required field is missing, or a value has the wrong format.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Invalid OTP format:
                  summary: Invalid OTP format
                  description: Fictional example data.
                  value:
                    code: 422
                    timestamp: 1793700000000
                    transaction_id: 6d4b1e7a-8f3c-4a29-a5e8-9c2f0b6d3a57
                    message: Invalid OTP format
        '429':
          description: The rate limit is exceeded. Retry after some time.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
        '500':
          description: The request could not be completed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Internal server error:
                  summary: Internal server error
                  description: Fictional example data.
                  value:
                    code: 500
                    timestamp: 1793700000000
                    transaction_id: b0e8c4f2-3d9a-47b6-8e1c-5a7f2d9b0c64
                    message: Failed to verify OTP using PAN
        '502':
          description: >-
            The connection to the Income Tax Department failed. Retry the
            request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Bad gateway:
                  summary: Bad gateway
                  description: Fictional example data.
                  value:
                    code: 502
                    timestamp: 1793700000000
                    transaction_id: 5e2a7d9c-6b4f-4d13-9a8e-1f3c7b0e5d28
                    message: Bad gateway
        '503':
          description: >-
            The Income Tax Department's service is temporarily unavailable.
            Retry after some time.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: HTTP status code.
                  timestamp:
                    type: integer
                    format: int64
                    description: Response timestamp in epoch milliseconds.
                  transaction_id:
                    type: string
                    description: Unique identifier for this API request.
                  message:
                    type: string
                    description: Reason for the error.
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - message
              examples:
                Source unavailable:
                  summary: Source unavailable
                  description: Fictional example data.
                  value:
                    code: 503
                    timestamp: 1793700000000
                    transaction_id: f7c1e3a8-0d5b-4b96-a2f4-8e6c9d1b3a75
                    message: Source Unavailable
      deprecated: false

````

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