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

# Add TRACES credentials

> Save TRACES administrator or sub-user credentials for a TAN to use with enriched APIs.

Save TRACES credentials for enriched APIs, which manage login and sessions for you. Use the deductor's TAN in `tan` for either login.

| Login | Request fields |
| :- | :- |
| Administrator | Send the administrator's TRACES password in `password`. Omit `pan`. |
| Sub-user | Send the sub-user's PAN in `pan` and that sub-user's TRACES password in `password`. |

Your workspace can save one credential per TAN. To replace saved credentials, [delete the existing credentials](https://developer.sandbox.co.in/api-reference/tds/compliance/traces-credentials/endpoints/delete_credential.md), then add the new credentials.

To obtain tokens for vanilla APIs, use [Authenticate a TRACES deductor](https://developer.sandbox.co.in/api-reference/tds/compliance/traces/endpoints/authenticate.md).


## OpenAPI

````yaml api-reference/tds/compliance/openapi.json POST /tds/traces/deductors/credential
openapi: 3.1.0
info:
  title: compliance
  description: >-
    Tax Deducted at Source (TDS) is an indirect method of collecting Income Tax.
    TDS is based on the principle of “Pay as you earn” which is beneficial for
    both the Government and the taxpayer. It is where a person making a payment
    of specified nature is liable to deduct tax at a prescribed rate. This
    ensures continuous revenue for the Government by way of Tax Deducted at the
    Source.


    The Payer making a payment is also responsible to deposit TDS with the
    Income Tax Department within a specified date and file a TDS Return. Once
    filed, the deposited amount will be shown in the Payee's Form 26AS which
    they can then use to claim tax credits when filing ITR.


    However, staying TDS compliant can be a hassle for businesses, as they are
    required to :


    1. Deduct TDS from payments that are liable for TDS Deduction at an
    appropriate rate.
        
    2. Deposit TDS to Government before the due date.
        
    3. File TDS Returns on a Quarterly basis.
        
    4. Issue a TDS Certificate by the deductor to the deductee.
        

    Organizations deducting TDS have to remain compliant with each of the steps.
    Failure to do so results in TDS Penalties by Authorities. Sandbox provides
    TDS Compliance APIs to help you automate end-to-end TDS compliance.
  version: 1.0.0
servers:
  - url: https://test-api.sandbox.co.in
    description: test
  - url: https://api.sandbox.co.in
    description: prod
security: []
tags:
  - name: TDS Compliance Check
  - name: Download CSI
  - name: FVU Generation
  - name: TDS
  - name: TDS Certificate
  - name: TRACES Credentials
  - name: E-File TDS Return
paths:
  /tds/traces/deductors/credential:
    post:
      tags:
        - TRACES Credentials
      summary: Add TRACES credentials
      description: >-
        Store one TRACES credential for a deductor TAN in your workspace. Omit
        pan to use the administrator account. To use a sub-user account, include
        the sub-user PAN and password. Enriched TRACES APIs use the stored
        account and its assigned permissions. To replace the stored account,
        delete the existing credential before you add another.
      operationId: AddTracesCredentials
      parameters:
        - name: Authorization
          in: header
          description: >-
            JWT access token. For token-generation steps, refer to 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: API key used to identify and authenticate the client.
          required: true
          example: '{{api_key}}'
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Request body format.
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                '@entity':
                  type: string
                  description: Entity identifier for the request.
                tan:
                  type: string
                  description: TAN for the TRACES account.
                pan:
                  type: string
                  pattern: ^[A-Z]{5}[0-9]{4}[A-Z]$
                  description: >-
                    PAN of the TRACES sub-user. Omit to use the administrator
                    account.
                password:
                  type: string
                  format: password
                  writeOnly: true
                  description: >-
                    TRACES password for the sub-user when pan is provided, or
                    for the administrator when pan is omitted.
              required:
                - '@entity'
                - tan
                - password
            examples:
              Success:
                value:
                  '@entity': in.co.sandbox.tds.traces.deductor.credential.request
                  tan: AHMS45586C
                  password: '{{password}}'
                summary: Success
              'Failure: Invalid Request Body':
                value:
                  '@entity': in.co.sandbox.tds.traces.deductor.credential.request
                  tan: AHMS45586C
                summary: 'Failure: Invalid Request Body'
              'Failure: Credential already exists':
                value:
                  '@entity': in.co.sandbox.tds.traces.deductor.credential.request
                  tan: AHMS45586C
                  password: '{{password}}'
                summary: 'Failure: Credential already exists'
              Sub-user credentials added:
                value:
                  '@entity': in.co.sandbox.tds.traces.deductor.credential.request
                  tan: AHMQ00112A
                  pan: '{{traces_sub_user_pan}}'
                  password: '{{traces_sub_user_password}}'
                summary: Sub-user credentials added
                description: >-
                  The sub-user credential is stored for the deductor TAN. Delete
                  an existing credential before you add another.
        required: true
      responses:
        '200':
          description: The TRACES credentials were added.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - transaction_id
              examples:
                Success:
                  summary: Success
                  value:
                    code: 200
                    timestamp: 1788414642383
                    transaction_id: 45a5d0e7-d428-47c3-906e-b039d0e4e157
                Sub-user credentials added:
                  summary: Sub-user credentials added
                  value:
                    code: 200
                    timestamp: 1793006237023
                    transaction_id: 612d5613-e113-4943-a239-cceb2e4e21f8
          headers: {}
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  message:
                    type: string
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - message
                  - transaction_id
              examples:
                'Failure: Invalid Request Body':
                  summary: 'Failure: Invalid Request Body'
                  value:
                    code: 400
                    timestamp: 1788414799493
                    message: Invalid request body
                    transaction_id: 1113442c-0914-42d5-91e8-c372f67f902f
          headers: {}
        '409':
          description: >-
            Credentials already exist for the TAN. Delete the existing
            credentials before you add new credentials.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  message:
                    type: string
                  transaction_id:
                    type: string
                required:
                  - code
                  - timestamp
                  - message
                  - transaction_id
              examples:
                'Failure: Credential already exists':
                  summary: 'Failure: Credential already exists'
                  value:
                    code: 409
                    timestamp: 1788415156044
                    message: TRACES credential already exists
                    transaction_id: 57e1ee72-71ae-4c5d-bc6b-eab44cccab3c
          headers: {}
      deprecated: false
      security: []

````

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