> For the complete documentation index, see [llms.txt](https://apidocs.juicefin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.juicefin.com/apis/card-status-and-management/verify-otp.md).

# Verify OTP

The **Verify OTP** API validates the One-Time Password previously generated by **Request OTP** and either returns the requested sensitive data **or** sets a new card PIN, depending on the original `RequestedResult`.

* **Retrieve data** – `RequestedResult` was `CardNumberCvv` or `ProcessorAccountNumber`.
* **Change PIN** – `RequestedResult` was `ChangeCardPin`; include `<NewPin>` in the request.

> **NOTE:** A valid `SessionId` from the successful **Request OTP** call is mandatory.

## 📥 Input Parameters

| Name     | Required | Definition                                                              | Comments                                            |
| -------- | -------- | ----------------------------------------------------------------------- | --------------------------------------------------- |
| `Token`  | Y        | <p><em>Numeric (6)</em><br>Six-digit OTP supplied by the cardholder</p> | Unique within the OTP validity window               |
| `NewPin` | —        | <p><em>Numeric (4)</em><br>New PIN value</p>                            | **Required when** `RequestedResult = ChangeCardPin` |

## 💻 Output Parameters

| Name              | Definition                                                      | Failure Case | Success Case             | Comments                            |
| ----------------- | --------------------------------------------------------------- | ------------ | ------------------------ | ----------------------------------- |
| `RequestedResult` | One of: `CardNumber`, `ProcessorAccountNumber`, `ChangeCardPin` | —            | Returned                 | Mirrors the original purpose        |
| `RequestedValue`  | Sensitive value corresponding to `RequestedResult` (e.g. PAN)   | Not returned | Returned when applicable | Not present for PIN-change requests |

***

## 📄 XML Samples

### Retrieve Card Number (data access)

```xml
<?xml version="1.0"?>
<PraxellXMLRequest>
  <AuthenticationDetails>
    <SessionId>38097317201110064</SessionId>
  </AuthenticationDetails>
  <ServiceDetails>
    <UniqueRequestId>963369551</UniqueRequestId>
    <ServiceName>VerifyOTP</ServiceName>
  </ServiceDetails>
  <Origin>
    <OriginType>ExtAPI</OriginType>
  </Origin>
  <ServiceParams>
    <Token>123456</Token>
  </ServiceParams>
</PraxellXMLRequest>
```

**Success response**

```xml
<?xml version="1.0"?>
<PraxellXMLResponse>
  <ResponseDetails>
    <ServiceName>VerifyOTP</ServiceName>
    <SessionId>38097317201110064</SessionId>
    <StatusCode>0</StatusCode>
    <StatusName>StatusOK</StatusName>
    <StatusDescription>OK</StatusDescription>
    <ServiceDate>2025-05-29 05:20:40</ServiceDate>
    <ServiceId>38097317201110064</ServiceId>
  </ResponseDetails>
  <ResponseParams>
    <RequestedResult>CardNumberCvv</RequestedResult>
    <RequestedValue>5434640304073511,123</RequestedValue>
  </ResponseParams>
</PraxellXMLResponse>
```

### Change Card PIN

```xml
<?xml version="1.0"?>
<PraxellXMLRequest>
  <AuthenticationDetails>
    <SessionId>2a995fa8-7a61-4322-95da-1a85af108806</SessionId>
  </AuthenticationDetails>
  <ServiceDetails>
    <UniqueRequestId>875221</UniqueRequestId>
    <ServiceName>VerifyOTP</ServiceName>
  </ServiceDetails>
  <Origin>
    <OriginType>ExtAPI</OriginType>
  </Origin>
  <ServiceParams>
    <Token>996522</Token>
    <NewPin>3511</NewPin>
  </ServiceParams>
</PraxellXMLRequest>
```

**Success response**

```xml
<?xml version="1.0"?>
<PraxellXMLResponse>
  <ResponseDetails>
    <ServiceName>VerifyOTP</ServiceName>
    <SessionId>2a995fa8-7a61-4322-95da-1a85af108806</SessionId>
    <StatusCode>0</StatusCode>
    <StatusName>StatusOK</StatusName>
    <StatusDescription>OK</StatusDescription>
    <ServiceDate>2025-05-29 05:22:06</ServiceDate>
    <ServiceId>f0336c90-68e8-4981-9237-c7c289b64950</ServiceId>
  </ResponseDetails>
  <ResponseParams>
    <RequestedResult>ChangeCardPin</RequestedResult>
    <RequestedValue/>
  </ResponseParams>
</PraxellXMLResponse>
```

***

ℹ️ The OTP is valid for 10 minutes. A second failed attempt will invalidate the `SessionId`, requiring a new **Request OTP** cycle.
