> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payx.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit OTP / Voucher

> Submit a one-time passcode or authorization voucher for transactions requiring verification

### Authentication

This endpoint requires your v2 secret API key:

* Header: `x-api-key: px_live_v2_...` or `Authorization: Bearer px_live_v2_...`

### Body Parameters

<ParamField body="transactionId" type="string" required>
  The transaction ID requiring OTP verification.
</ParamField>

<ParamField body="otp" type="string" required>
  The one-time passcode or authorization voucher code provided by the customer.
</ParamField>

***

### Response

<ResponseField name="message" type="string">
  Status message describing the verification attempt.
</ResponseField>

<ResponseField name="transactionId" type="string">
  The unique transaction ID.
</ResponseField>

<ResponseField name="status" type="string">
  The updated transaction status (e.g. `PENDING`, `SUCCESSFUL`, `FAILED`).
</ResponseField>

***

<RequestExample>
  ```bash curl theme={null}
  curl -X POST https://payx.company/api/v1/submit-otp \
    -H "x-api-key: px_live_v2_YOUR_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "transactionId": "sample_tx_12345678",
      "otp": "123456"
    }'
  ```

  ```javascript Node.js theme={null}
  const { PayX } = require('payx-node');
  const payx = new PayX({ apiKey: process.env.PAYX_SECRET_KEY });

  const res = await payx.charge.submitOtp({
    transactionId: 'sample_tx_12345678',
    otp: '123456'
  });

  console.log('Result:', res.status);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "OTP verified successfully",
    "transactionId": "sample_tx_12345678",
    "status": "SUCCESSFUL"
  }
  ```
</ResponseExample>
