---
title: ITR OTP Authorisation
slug: api-marketplace/itr-otp-authorisation
createdAt: 2023-12-06T05:44:18.988Z
---

# Introduction:

The Authorisation api is used to authorise the user in order to get the required data and create a session. Depending on the available userFlow, it supports the OTP or password or both flows. Once the authorisation is successful, the flow cannot be changed for the request ID.

### POST /authorisation

This endpoint is used to initiate a request for an ITR form by providing a userName.
Returns a requestId that patrons can use to fetch the ITR form.

### Sample Curl:

:::CodeblockTabs
Preproduction

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/itr/authorisation' \
--header 'Content-Type: application/json' \
--header 'Authorization: <authToken>' \
--data-raw '{
       "requestId": "12345a67-89b0-12c3-def4-5ghij67klmno",
       "otp": "123456",
       "callbackUrl": "https://example.com/callback",
       "itrDetailsRequired": ["itr_form", "itr_pull", "itr_v", "form_26_as"],
       "range": 3,
       "callbackAuth": {
           "x-api-key": "your-callback-auth-key"
       },
       "pdfBase64": false
   }'
```

Production

```curl
curl --location 'https://api.signzy.app/api/v3/itr/authorisation' \
--header 'Content-Type: application/json' \
--header 'Authorization: <authToken>' \
--data-raw '{
       "requestId": "12345a67-89b0-12c3-def4-5ghij67klmno",
       "otp": "123456",
       "callbackUrl": "https://example.com/callback",
       "itrDetailsRequired": ["itr_form", "itr_pull", "itr_v", "form_26_as"],
       "range": 3,
       "callbackAuth": {
           "x-api-key": "your-callback-auth-key"
       },
       "pdfBase64": false
   }'
```
:::

### Input Parameters:

| Parameter          | Type             | Description                                                                                                                                                                                                                                                                 | Mandatory/Optional      |
| ------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| requestId          | string           | The request ID generated in the generate reqeust ID api                                                                                                                                                                                                                     | Mandatory               |
| otp                | string           | The 6 digit OTP received                                                                                                                                                                                                                                                    | Conditionally Mandatory |
| password           | string           | The password associated with the userName                                                                                                                                                                                                                                   | Conditionally Mandatory |
| callbackUrl        | string           | The callback url to which the data must be posted                                                                                                                                                                                                                           | Conditionally Optional  |
| itrDetailsRequired | array of strings | The details that are to be posted to the callback url.<br />Accepted values :<br />'itr\_form', 'itr\_pull', 'itr\_v', 'form\_26\_as', 'itr\_ais' and 'itr\_analytics'<br />(itr\_analytics must be explicitly requested — unlike the others, it is not fetched by default) | Conditionally Optional  |
|                    |                  |                                                                                                                                                                                                                                                                             |                         |
| range              | number           | 1, 2 or 3.Default to 3                                                                                                                                                                                                                                                      | Conditionally Optional  |
| pdfBase64          | Boolean          | Flag to get base64 version of itr pdf                                                                                                                                                                                                                                       | Optional                |
| callbackAuth       | object           | Header key/value pairs sent with the callback request                                                                                                                                                                                                                       | Optional                |

Note: callbackUrl and itrDetailsRequired either passed together or not passed at all.

### Sample Response:

:::CodeblockTabs
200

```json
{
    "requestId": "12345a67-89b0-12c3-def4-5ghij67klmno",
    "userName": "<userName>",
    "userFlow": "otp",
    "sessionStatus": "OTP/password successful",
    "statusCode": "200",
    "messageCode": "Session successfully created"
}
```

200

```json
{
    "requestId": "12345a67-89b0-12c3-def4-5ghij67klmno",
    "userName": "<userName>",
    "userFlow": "otp",
    "sessionStatus": "Session could not be created",
    "statusCode": "412",
    "messageCode": "Previous session already in progress. Please try again in 15 mins",
}
```

201

```none
{
    "error": {
        "reason": "ERROR",
        "status": 201,
        "message": "Session created for the requestid, please proceed with fetching the report.",
        "type": "Payload Too Large",
        "statusCode": 413,
        "name": "error"
    }
}
```
:::

### Output Parameters:

| Parameter     | Type    | Description                                                                                                                                                                                        |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| requestId     | string  | A unique identifier (UUID) assigned to the request. This **requestId** is generated and returned by the API.                                                                                       |
| userName      | string  | The userName entered.                                                                                                                                                                              |
| userFlow      | string  | The userFlow lets the user know the chosen flow after the successful session creation                                                                                                              |
| sessionStatus | string  | Gives the status of the session.                                                                                                                                                                   |
| statusCode    | integer | The HTTP status code indicating the success or failure of the API request. In this case, the **statusCode&#x20;**&#x6F;f 200 denotes a successful response.                                        |
| messageCode   | string  | A code or identifier associated with the message. In this instance, the **messageCode&#x20;**"Session successfully created" provides additional context about the success of the session creation. |

# Sample Errors

:::CodeblockTabs
400

```json
{
    "error": {
        "reason": "VALIDATION_ERROR",
        "status": 400,
        "message": "Invalid otp",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "ERROR",
        "status": 400,
        "message": "The OTP entered is incorrect, Enter correct OTP.",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}
```

400

```json
{
    "error": {
        "reason": "ERROR",
        "status": 400,
        "message": "You have exceeded the maximum no. of attempts for the same OTP. Kindly try with fresh OTP",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}
```

400

```null
{
    "error": {
        "reason": "ERROR",
        "status": 400,
        "message": "Two-factor authentication (OTP,NETBANKING) is required for this login; password alone cannot complete it",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}
```

409

```json
{
    "error": {
        "reason": "CONFLICT",
        "status": 409,
        "message": "Unable to fetch data from upstream",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```

403

```none
{
     "error": {
       "reason": "FORBIDDEN",
       "status": 403,
       "message": "requestId does not belong to this consumer",
       "type": "Forbidden",
       "statusCode": 403,
       "name": "error"
     }
   }
```
:::

| **CODE** | **MESSAGE**                                                                                                      |
| -------- | ---------------------------------------------------------------------------------------------------------------- |
| 200      | Request successful                                                                                               |
| 201      |  A session already exists for this requestId — proceed directly to fetching the report, auth is not needed again |
| 409      | Unable to fetch data from upstream                                                                               |
| 400      | Bad Request - Mandatory parameters missing or Invalid inputs                                                     |
| 403      | Forbidden                                                                                                        |







