> ## 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 for tax payment

> Send an OTP to a mobile number to start an income tax payment session for a PAN.

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

Use the tax payment APIs to create and track income tax challans through the Income Tax Department's e-Pay Tax service:

1. Generate an OTP for the taxpayer's PAN and a mobile number.
2. [Verify the OTP](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/verify-otp.md) to get a taxpayer access token.
3. [Create a challan](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/create-challan.md) with the taxpayer access token and pay it by RTGS or NEFT before it expires.
4. [Get the challan](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/get-challan.md) or [get its payment status](https://developer.sandbox.co.in/api-reference/it/compliance/tax-payment/endpoints/get-payment-status.md) to confirm the payment.

This endpoint uses your Sandbox access token in the `Authorization` header. See the [Quickstart guide](https://developer.sandbox.co.in/guides/get-started/quickstart.md) for Sandbox authentication.

Save `data.reference_id` from the response. You need it, with the same PAN and mobile number, to verify the OTP.


## OpenAPI

````yaml api-reference/it/compliance/openapi.json POST /it/compliance/portal/public/tax-payment/tax-payer/otp
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:
    post:
      tags:
        - in.gov.incometax
        - public
        - tax-payment
        - tax-payer
      summary: Generate OTP
      description: >-
        Start a tax payment session for a PAN. The Income Tax Department's e-Pay
        Tax service sends an OTP to the mobile number in the request.


        Pass the returned `data.reference_id` and the OTP to Verify OTP to get a
        taxpayer access token. Use the taxpayer access token to create and fetch
        challans for the PAN.


        Send your Sandbox access token in the `Authorization` header. Example
        data is fictional.
      operationId: generateTaxPaymentOtp
      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.request
                pan:
                  type: string
                  pattern: ^[A-Z]{5}[0-9]{4}[A-Z]$
                  description: PAN of the taxpayer making the payment.
                  examples:
                    - ABCPS1234K
                mobile_number:
                  type: string
                  pattern: ^[6-9][0-9]{9}$
                  description: >-
                    10-digit Indian mobile number to send the OTP to, without
                    the country code. It does not have to be the mobile number
                    registered on the e-Filing portal.
                  examples:
                    - '9876543210'
                consent:
                  type: string
                  enum:
                    - 'Y'
                    - 'y'
                  description: >-
                    Consent of the taxpayer to process their information for
                    this request.
                reason:
                  type: string
                  minLength: 20
                  description: Purpose of the request. Minimum 20 characters.
              required:
                - '@entity'
                - pan
                - mobile_number
                - consent
                - reason
            examples:
              OTP sent:
                summary: OTP sent
                description: The Income Tax Department sends an OTP to the mobile number.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.request
                  pan: ABCPS1234K
                  mobile_number: '9876543210'
                  consent: 'Y'
                  reason: Pay advance tax for TY 2026-27
              PAN rejected:
                summary: PAN rejected
                description: The Income Tax Department does not accept the PAN.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.request
                  pan: ABCPZ9999Z
                  mobile_number: '9876543210'
                  consent: 'Y'
                  reason: Pay advance tax for TY 2026-27
              Consent missing:
                summary: Consent missing
                description: The request does not include consent.
                value:
                  '@entity': in.co.sandbox.it.compliance.tax_payment.otp.request
                  pan: ABCPS1234K
                  mobile_number: '9876543210'
                  reason: Pay advance tax for TY 2026-27
      responses:
        '200':
          description: The OTP is sent. Use `data.reference_id` with the OTP to verify it.
          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.response
                      reference_id:
                        type: string
                        description: >-
                          Reference ID of the OTP request. Pass it with the OTP
                          to Verify OTP.
                    required:
                      - '@entity'
                      - reference_id
                required:
                  - code
                  - timestamp
                  - transaction_id
                  - data
              examples:
                OTP sent:
                  summary: OTP sent
                  description: Fictional example data.
                  value:
                    code: 200
                    timestamp: 1793700000000
                    transaction_id: 0c6f8a52-3b1e-4d7a-9f20-5e8b1c4d2a71
                    data:
                      '@entity': in.co.sandbox.it.compliance.tax_payment.otp.response
                      reference_id: FOS007123456789
        '400':
          description: >-
            The Income Tax Department did not send the OTP, for example because
            it does not accept the PAN. `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:
                PAN rejected:
                  summary: PAN rejected
                  description: Fictional example data.
                  value:
                    code: 400
                    timestamp: 1793700000000
                    transaction_id: 7d2e9b14-6a3f-4c58-8e01-b9f4a2c7d356
                    message: Portal rejected the OTP request
        '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:
                Missing Sandbox access token:
                  summary: Missing Sandbox access token
                  description: Fictional example data.
                  value:
                    code: 401
                    timestamp: 1793700000000
                    transaction_id: e8b5d1f6-2c4a-47e9-a3b0-6f1d8c2e5b97
                    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: 3e5a9d7c-0f2b-4a86-b4c1-8d7e1f6a3b92
                    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:
                Consent missing:
                  summary: Consent missing
                  description: Fictional example data.
                  value:
                    code: 422
                    timestamp: 1793700000000
                    transaction_id: a41c7e03-9d5b-4f2a-b6e8-1c3d7f9a0e24
                    message: Consent is required
        '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: a5d0f8b3-7e1c-4f64-9b2a-3c6e9d0f4a58
                    message: Failed to generate 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: e1c7b5a9-2d4f-4b30-a8e6-5f9a0c3d7b26
                    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: 4f8a2c6e-9b3d-41f7-8c5a-0e7b4d1f9c63
                    message: Source Unavailable
      deprecated: false

````

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