---
title: Submit OTP API
slug: api-marketplace/submit-otp-api
description: Learn how to use the API for submitting One-Time Passwords (OTP). This document covers the validation process, required headers and body parameters, and provides sample requests and responses. Find error codes and messages to troubleshoot any issues encou
createdAt: 2023-04-07T08:40:35.000Z
---

# Description

This API is used to submit the OTP received by the user on his/her mobile number in response to the OTP request made in the Get OTP API call. This API validates the OTP and returns a response with the request ID and status.

# Request

- **Method**: POST
- **URL**:&#x20;
  - Preproduction - https\://api-preproduction.signzy.app/api/v3/underwriting/submit-passbook-otp
  - Production - https\://api.signzy.app/api/v3/underwriting/submit-passbook-otp
- **Headers**:
  - Authorization: The API key required to authenticate the request. Please use the key that you will receive from our sale, csm or the support team.
  - Content-Type: application/json
- **Body**:

:::CodeblockTabs
Body

```json
{
  "txnId": "<txn ID>",
  "otp": "<OTP>"
}
```
:::

- **Request Parameters:**

| **Key** | **Description**                                                                          | **Mandatory/Optional** | **Type** |
| ------- | ---------------------------------------------------------------------------------------- | ---------------------- | -------- |
| txnId   | The txnId that is received during the create otp api.                                    | Mandatory              | String   |
| otp     | The OTP received by the user on his/her mobile number which is linked to the UAN number. | Mandatory              | String   |

## Sample Request

:::CodeblockTabs
Preproduction

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/underwriting/submit-passbook-otp' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Auth-token> \
--data '{
    "txnId": "",
    "otp": ""
}'
```

Production

```curl
curl --location 'https://api.signzy.app/api/v3/underwriting/submit-passbook-otp' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Auth-token> \
--data '{
    "txnId": "",
    "otp": ""
}'
```
:::

# Response

- **Headers**:
  - Content-Type: application/json
- **Body**:

:::CodeblockTabs
JSON

```json
{
    "httpResponseCode": 200,
    "message": "OTP Accepted",
    "resultCode": 202,
    "txnId": <txnId>
}
```
:::

- **Response Parameters:**

| **Key**          | **Description**                                        | **Type** |
| ---------------- | ------------------------------------------------------ | -------- |
| httpResponseCode | The http status code of the request.                   | Number   |
| message          | The message showing the description about the request. | String   |
| resultCode       | The result code of the request.                        | Number   |
| txnId            | The txnId                                              | String   |

## Sample Responses

:::CodeblockTabs
Valid OTP

```json
{
    "httpResponseCode": 200,
    "message": "OTP Accepted",
    "resultCode": 202,
    "txnId": <txnId>
}
```

Invalid OTP

```json
{
    "httpResponseCode":400,
    "message":"One or more parameters format is wrong",
    "txnId": <txnId>
}
```
:::

# Error Codes

| **Error Code** | **Description**  |
| -------------- | ---------------- |
| 400            | Bad Request      |
| 409            | Upstream is down |

## Sample Error Responses

:::CodeblockTabs
400

```json
{
    "error": {
        "name": "error",
        "message": "",
        "status": 400,
        "reason": "Error",
        "type": "OK",
        "statusCode": 200
    }
}
```

409

```json
{
    "error": {
        "name": "error",
        "message": "Upstream is down",
        "status": 409,
        "reason": "Error",
        "type": "OK",
        "statusCode": 409
    }
}
```
:::

