> ## 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 BTC

> Withdraw BTC to a wallet



## OpenAPI

````yaml post /withdraw/btc
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/btc:
    post:
      tags:
        - Withdraw
      summary: Withdraw BTC
      description: Withdraw BTC to a wallet
      operationId: withdrawBtc
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                invoice:
                  type: string
                  format: string
                  example: >-
                    lntbs1234567890n1pjnruqtpp5xmrq39nwyhgde4a94wsnuacj4stacls05g4x5du2req9pvjpqz6sdz9296k7ar98gsxgdm9vvmx2v3s95ckyceh956xvd3595uxyetr95cnydrxxv6nvwrxv5mngcqzpuxqzfvsp578t78k4628snkkhc43eqrpn6sem28w4cwgzn7ceyyr320kwm4uss9qyyssqcwxw8wy2qenwgm7gagx9lwvcs9w9tw47ntuc823yclasjqczvvj545hr4d9nmg996l0cswudgeawclwytafmh66a2fafk4heksyae5sq3vzd28
                memo:
                  type: string
                  format: string
                  example: Withdrawal to wallet
        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

````