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

# Confirm a payin with a code

> Completes a payin whose creation returned `otpRequired: true` (e.g. Orange Money Côte d'Ivoire and Burkina Faso).
Show the customer `otpInstructions`, collect the code they generate on their phone, then send it here.

On success the payin moves to `PROCESSING`; the final result arrives by webhook. Errors: `bad_status` (payin no longer `PENDING`), `otp_unsupported` (this payin doesn't use a code), `otp_failed` (wrong code or refused by the operator — let the customer generate a new code and retry).

**API key scope:** `payins:write`



## OpenAPI

````yaml POST /v1/payins/{reference}/confirm-otp
openapi: 3.1.0
info:
  title: KryptaPay API
  version: 1.0.0
  description: >-
    Collect and pay out across Africa — Mobile Money, bank transfers and
    stablecoins — through one REST API.


    Authenticate every request with your secret API key: `Authorization: Bearer
    kp_<env>_…`.

    All responses use the envelope `{ "ok": boolean, "data"?: …, "error"?: {
    "code", "message", "details"? } }`.
  contact:
    name: KryptaPay Support
    email: support@krypta-pay.com
    url: https://krypta-pay.com
servers:
  - url: https://staging.api.krypta-pay.com
    description: Sandbox
  - url: https://api.krypta-pay.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Payins
    description: Collect money from your customers' Mobile Money wallets.
  - name: Payouts
    description: Send money to Mobile Money wallets, bank accounts and crypto addresses.
  - name: Fees
    description: Know the exact fee before you move money.
  - name: FX
    description: Exchange rates, quotes and conversions between your wallets.
  - name: Wallets
    description: Balances of your multi-currency wallets.
  - name: Transactions
    description: Unified history of every movement on your account.
  - name: Networks
    description: Which payment networks are currently available.
  - name: Status
    description: Public platform status.
paths:
  /v1/payins/{reference}/confirm-otp:
    post:
      tags:
        - Payins
      summary: Confirm a payin with a code
      description: >-
        Completes a payin whose creation returned `otpRequired: true` (e.g.
        Orange Money Côte d'Ivoire and Burkina Faso).

        Show the customer `otpInstructions`, collect the code they generate on
        their phone, then send it here.


        On success the payin moves to `PROCESSING`; the final result arrives by
        webhook. Errors: `bad_status` (payin no longer `PENDING`),
        `otp_unsupported` (this payin doesn't use a code), `otp_failed` (wrong
        code or refused by the operator — let the customer generate a new code
        and retry).


        **API key scope:** `payins:write`
      operationId: confirmPayinOtp
      parameters:
        - schema:
            type: string
          in: path
          name: reference
          required: true
          description: Payin reference (`tx_…`) or id.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                otp:
                  type: string
                  minLength: 3
                  maxLength: 12
                  description: Code generated by the customer, as they typed it.
              required:
                - otp
              additionalProperties: false
            example:
              otp: '482913'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      reference:
                        type: string
                      status:
                        $ref: '#/components/schemas/TransactionStatus'
                    required:
                      - reference
                      - status
                    additionalProperties: false
                required:
                  - ok
                  - data
                additionalProperties: false
              example:
                ok: true
                data:
                  reference: tx_3Jk9QwErTy7uIoPa2Sd
                  status: PROCESSING
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    TransactionStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
        - CANCELLED
        - REFUNDED
      description: >-
        Lifecycle status. `COMPLETED`, `FAILED`, `CANCELLED` and `REFUNDED` are
        final.
    Error:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable, machine-readable code. Branch on this, not on `message`.
            message:
              type: string
              description: Human-readable explanation. May change; do not parse.
            details:
              description: >-
                Extra context. For `validation_error`: `{ formErrors,
                fieldErrors }`.
          required:
            - code
            - message
      required:
        - ok
        - error
  responses:
    Unauthorized:
      description: Missing, invalid or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: unauthorized
              message: Invalid or expired API key
    Forbidden:
      description: >-
        The key lacks the required scope (`insufficient_scope`), or the account
        is not KYB-approved (`kyb_required`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: kyb_required
              message: Your organization must complete KYB verification.
    NotFound:
      description: The resource does not exist or belongs to another account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: not_found
              message: Payout not found
    ValidationError:
      description: >-
        The request failed validation or a business rule. See `error.code` and,
        for `validation_error`, `error.details.fieldErrors`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: validation_error
              message: 'amount: Invalid amount'
    RateLimited:
      description: >-
        Too many requests. Wait for the number of seconds in the `retry-after`
        header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error:
              code: rate_limited
              message: Rate limit exceeded, retry in 1 minute
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Secret API key from **Dashboard → Developers**: `kp_sandbox_…` for
        Sandbox, `kp_live_…` for Production. Server-side only.

````

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