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

# Withdraw fiat

> Withdraw funds to a bank account. The amount is specified in the lowest denomination of the currency (e.g., Kobo for NGN). You must first verify the bank account using the Name Enquiry endpoint before initiating a withdrawal.



## OpenAPI

````yaml post /withdraw
openapi: 3.0.1
info:
  title: Mavapay API
  description: API documentation for Mavapay
  license:
    name: MIT
  version: 1.0.0
  contact:
    name: Mavapay
    url: https://mavapay.co
    email: info@mavapay.co
servers:
  - url: https://staging.api.mavapay.co/api/v1
    description: Staging server
  - url: https://api.mavapay.co/api/v1
    description: Live server
security:
  - ApiKeyAuth: []
    bearerAuth: []
tags:
  - name: Price
    description: Price related endpoints
  - name: Payment Link
    description: Payment Link endpoints for creating and managing hosted payment pages
paths:
  /withdraw:
    post:
      tags:
        - Withdraw
      summary: Withdraw fiat
      description: >-
        Withdraw funds to a bank account. The amount is specified in the lowest
        denomination of the currency (e.g., Kobo for NGN). You must first verify
        the bank account using the Name Enquiry endpoint before initiating a
        withdrawal.
      operationId: withdraw
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
                - beneficiary
              properties:
                amount:
                  type: string
                  description: >-
                    The amount to withdraw in the lowest denomination (e.g.,
                    Kobo for NGN). For example, 100000 = 1,000.00 NGN
                  example: '100000'
                currency:
                  type: string
                  description: The currency to withdraw
                  enum:
                    - NGN
                beneficiary:
                  type: object
                  description: >-
                    The beneficiary bank account details. Use the exact values
                    returned from the Name Enquiry endpoint.
                  required:
                    - bankAccountNumber
                    - bankAccountName
                    - bankCode
                    - bankName
                  properties:
                    bankAccountNumber:
                      type: string
                      description: The recipient's bank account number
                      example: '0123456789'
                    bankAccountName:
                      type: string
                      description: >-
                        The account holder's name as returned by the Name
                        Enquiry endpoint. Must match exactly.
                      example: JOHN DOE
                    bankCode:
                      type: string
                      description: The NIP bank code (nipBankCode) from the bank list
                      example: '000013'
                    bankName:
                      type: string
                      description: The bank name as returned from the bank list
                      example: GTBANK PLC
            examples:
              withdrawNgn:
                summary: Withdraw NGN to Bank Account
                description: Withdraw Nigerian Naira to a verified bank account
                value:
                  amount: '100000'
                  currency: NGN
                  beneficiary:
                    bankAccountNumber: '0123456789'
                    bankAccountName: JOHN DOE
                    bankCode: '000013'
                    bankName: GTBANK PLC
        required: true
      responses:
        '200':
          description: Withdraw response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    format: string
                    example: ok
                  data:
                    $ref: '#/components/schemas/Transaction'
                    type: object
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    Transaction:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: d1614a76-9c7f-4111-98a7-43199f307e5b
          description: The unique identifier for the transaction
        walletId:
          type: string
          format: uuid
          example: d1614a76-9c7f-4111-98a7-43199f307e5b
          description: The unique identifier for the wallet
        ref:
          type: string
          format: string
          example: 99eeff854ffd345fffs67890
          description: The reference for the transaction
        hash:
          type: string
          format: string
          example: 189727ef2e0f35921af7858b96e27cbad960b0ec2bb2a4ab73b6a231f9ce8727
          description: >-
            The payment hash for the lightning invoice attached to the quote
            related to the transaction
        amount:
          type: number
          format: number
          example: 1000
          description: The amount of the transaction in its lowest denomination
        fees:
          type: number
          format: number
          example: 0
          description: The fees for the transaction in its lowest denomination
        currency:
          type: string
          format: string
          enum:
            - NGN
            - KES
            - BTC
            - ZAR
            - GHS
          description: The currency of the transaction
        type:
          type: string
          format: string
          enum:
            - WITHDRAWAL
            - DEPOSIT
          description: The type of the transaction
        status:
          type: string
          format: string
          enum:
            - SUCCESS
            - PENDING
            - FAILED
          description: The status of the transaction
        autopayout:
          type: boolean
          format: boolean
          example: true
          description: Whether the transaction is an instant payout
        createdAt:
          type: string
          format: date-time
          example: '2021-07-01T12:00:00Z'
          description: The date and time the transaction was created
        updatedAt:
          type: string
          format: date-time
          example: '2021-07-01T12:00:00Z'
          description: The date and time the transaction was last updated
        metadata:
          $ref: '#/components/schemas/TransactionMetadata'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        status:
          type: string
          format: string
          example: error
        message:
          type: string
    TransactionMetadata:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: d1614a76-9c7f-4111-98a7-43199f307e5b
        orderId:
          type: string
          format: string
          example: 99854-2345
        bankCode:
          type: string
          format: string
          example: '090267'
        bankAccountName:
          type: string
          format: string
          example: Satoshi Nakamoto
        bankAccountNumber:
          type: string
          format: string
          example: '0123456789'
        customerInternalFee:
          type: number
          format: number
          example: 0
        createdAt:
          type: string
          format: date-time
          example: '2021-07-01T12:00:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2021-07-01T12:00:00Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    bearerAuth:
      type: http
      scheme: bearer

````