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

# Confirm the code

> Sends back the code the person typed. A wrong code returns 400 and can be tried again, up to three times per session. The third wrong code returns status DECLINED.

Sends back the code the person typed. On success the response carries the
`customerId`.

A wrong code returns `400` and can be tried again. The third wrong code on a
session returns `200` with `status: DECLINED`, and the person needs a new session
to try again. Sending the right code twice gives the same answer both times.


## OpenAPI

````yaml POST /pub/v2/kyc/sessions/{id}/verify-otp
openapi: 3.0.0
info:
  title: Paj Public API
  description: >-
    Programmatic access to Paj's on/off ramp. Register a Nigerian bank account,
    get

    the on-chain address that pays it, create offramp orders for a specific
    amount,

    and read the live conversion rates.


    Every request must carry an `x-api-key` header. Keys are scoped to a
    business,

    and the rates you receive already have that business's fee applied.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.paj.cash
    description: Production
security: []
tags: []
paths:
  /pub/v2/kyc/sessions/{id}/verify-otp:
    post:
      tags:
        - Pub V2
      summary: Confirm the code
      description: >-
        Sends back the code the person typed. A wrong code returns 400 and can
        be tried again, up to three times per session. The third wrong code
        returns status DECLINED.
      operationId: PubV2Controller_verifyKycOtp
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyKycOtpDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycSessionResDto'
        '400':
          description: The code is wrong or has expired
        '401':
          description: Missing or invalid API key (x-api-key header)
        '404':
          description: No session with that id is yours
        '429':
          description: Too many wrong codes for this person today
      security:
        - x-api-key: []
components:
  schemas:
    VerifyKycOtpDto:
      type: object
      properties:
        otp:
          type: string
          description: The code sent to the phone on the BVN record
          example: '4821'
      required:
        - otp
    KycSessionResDto:
      type: object
      properties:
        sessionId:
          type: string
          description: >-
            Absent when this person was already verified for you, since no new
            session was needed.
          example: kys_9fa17c2e4b6d8a0c1e3f5a7b
        status:
          type: string
          enum:
            - OTP_SENT
            - VERIFIED
            - IN_REVIEW
            - DECLINED
          example: OTP_SENT
        customerId:
          type: string
          description: >-
            What to send on orders for this person. Present on `VERIFIED` and
            `IN_REVIEW`. Orders are refused until the status is `VERIFIED`.
          example: cus_8f2a6c1d9e4b7f03a5c8d2e6b1f4a790
        externalUserId:
          type: string
          example: acme-user-123
        tier:
          type: number
          description: The verification tier reached. Present on `VERIFIED`.
          example: 1
        declineCode:
          type: string
          enum:
            - ID_NOT_VERIFIED
            - ATTEMPTS_EXCEEDED
            - ALREADY_LINKED
          description: Why, in general terms. Present on `DECLINED`.
        expiresAt:
          format: date-time
          type: string
          description: When the code stops working. Present on `OTP_SENT`.
      required:
        - status
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````

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