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

# Estimate send-onchain fee

> Estimates the total fee for sending bitcoin from the Ark wallet to an on-chain address. The fee depends on the destination address type and current fee rates. The gross amount is what the user pays (including VTXOs spent), and the net amount is what the recipient receives on-chain.



## OpenAPI

````yaml https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json get /api/v1/fees/send-onchain
openapi: 3.1.0
info:
  title: barkd REST API
  description: >-
    A simple REST API for barkd, a wallet daemon for integrating bitcoin
    payments into your app over HTTP. Supports self-custodial Lightning, Ark,
    and on-chain out of the box.


    barkd is a long-running daemon best suited for always-on or
    high-connectivity environments like nodes, servers, desktops, and
    point-of-sale terminals.


    All endpoints return JSON. Amounts are denominated in satoshis.
  contact:
    name: Second Team
    email: hello@second.tech
  license:
    name: MIT
    identifier: MIT
  version: 0.1.4
servers: []
security:
  - bearer: []
tags:
  - name: boards
    description: Move on-chain bitcoin onto the Ark protocol.
  - name: exits
    description: Move bitcoin back on-chain without server cooperation.
  - name: fees
    description: Estimate fees for wallet operations before executing them.
  - name: lightning
    description: Create Lightning invoices and track receives.
  - name: onchain
    description: Manage barkd's on-chain bitcoin wallet.
  - name: wallet
    description: Manage Ark balances and VTXOs, send payments via Ark, LN, and on-chain.
  - name: bitcoin
    description: Query bitcoin network data.
  - name: notifications
    description: Receive real-time notifications from barkd.
paths:
  /api/v1/fees/send-onchain:
    get:
      tags:
        - fees
      summary: Estimate send-onchain fee
      description: >-
        Estimates the total fee for sending bitcoin from the Ark wallet to an
        on-chain address. The fee depends on the destination address type and
        current fee rates. The gross amount is what the user pays (including
        VTXOs spent), and the net amount is what the recipient receives
        on-chain.
      operationId: send_onchain_fee
      parameters:
        - name: amount_sat
          in: query
          description: The amount in satoshis to send on-chain
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: address
          in: query
          description: The destination Bitcoin address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Returns the fee estimate
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeEstimateResponse'
        '400':
          description: Invalid amount or address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    FeeEstimateResponse:
      type: object
      description: A fee estimate for an Ark wallet operation.
      required:
        - gross_amount_sat
        - fee_sat
        - net_amount_sat
        - vtxos_spent
      properties:
        fee_sat:
          type: integer
          format: int64
          description: The fee portion (in satoshis)
          minimum: 0
        gross_amount_sat:
          type: integer
          format: int64
          description: The total amount including fees (in satoshis)
          minimum: 0
        net_amount_sat:
          type: integer
          format: int64
          description: >-
            The amount excluding fees (in satoshis). For sends, this is the
            amount

            the recipient receives. For receives, this is the amount the user
            gets.
          minimum: 0
        vtxos_spent:
          type: array
          items:
            type: string
          description: The VTXOs that would be spent for this operation
    BadRequestError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    InternalServerError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: AuthToken
      description: Base64url-encoded auth token

````