---
title: "Send BTC from a virtual account to the blockchain"
method: POST
path: "/v3/offchain/bitcoin/transfer"
tags: ["Blockchain operations"]
---

# Send BTC from a virtual account to the blockchain

`POST /v3/offchain/bitcoin/transfer`

## Request

- Base URL: `https://api.tatum.io`
- URL: `https://api.tatum.io/v3/offchain/bitcoin/transfer`
- Auth: API key in header `x-api-key`

/v3/offchain/bitcoin/transfer

#### 2 credits per API call.

  

Send BTC (Bitcoin) from a virtual account to the blockchain. This will create Tatum internal withdrawal request with ID. If every system works as expected, withdrawal request is marked as complete and transaction id is assigned to it.

*   If Bitcoin server connection is unavailable, withdrawal request is cancelled.
*   If blockchain transfer is successful, but is it not possible to reach Tatum, transaction id of blockchain transaction is returned and withdrawal request must be completed manually, otherwise all other withdrawals will be pending.

There are two possibilites how the transaction on the blockchain can be created:

*   Using mnemonic - all of the addresses, that are generated from the mnemonic are scanned for the incoming deposits which are used as a source of the transaction. Assets, which are not used in a transaction are moved to the system address wih the derivation index 0. Address with index 0 cannot be assigned automatically to any account and is used for custodial wallet use cases. For non-custodial wallets, field **attr** should be present and it should be address with the index 1 of the connected wallet.
*   Using keyPair - addresses which are used as a source of the transaction are entered manually

It is possible to perform ledger to blockchain transaction for ledger accounts without blockchain address assigned to them.  
This method is a helper method, which internally wraps these steps:

1.  [Store withdrawal](https://apidoc.tatum.io/tag/Withdrawal#operation/storeWithdrawal) - create a ledger transaction, which debits the assets on the sender account.
2.  [Perform blockchain transaction](https://apidoc.tatum.io/tag/Bitcoin#operation/BtcTransferBlockchain)
3.  [Complete withdrawal](https://apidoc.tatum.io/tag/Withdrawal#operation/completeWithdrawal) - move the withdrawal to the completed state, when all of the previous steps were successful.

When some of the steps fails, [Cancel withdrawal](https://apidoc.tatum.io/tag/Withdrawal#operation/cancelInProgressWithdrawal) operation is used, which cancels withdrawal and creates refund transaction to the sender account. This operation needs the private key of the blockchain address. Every time the funds are transferred, the transaction must be signed with the corresponding private key. No one should ever send it's own private keys to the internet because there is a strong possibility of stealing keys and losing funds. In this method, it is possible to enter privateKey or signatureId. PrivateKey should be used only for quick development on testnet versions of blockchain when there is no risk of losing funds. In production, [Tatum KMS](https://github.com/tatumio/tatum-kms) should be used for the highest security standards, and signatureId should be present in the request. Alternatively, using the Tatum client library for supported languages.

## Request body

- union
  - TransferBtcMnemonic
    - `senderAccountId` string, required: Sender account ID
    - `address` string, required: Blockchain address to send assets to. For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain addresses as a comma separated string.
    - `amount` string, required: Amount to be withdrawn to blockchain.
    - `compliant` boolean: Compliance check, if withdrawal is not compliant, it will not be processed.
    - `fee` string: Fee to be submitted as a transaction fee to blockchain. If none is set, default value of 0.0005 BTC is used. Minimum fee is 0.00001 BTC.
    - `multipleAmounts` string[]: For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain amounts. List of recipient addresses must be present in the address field and total sum of amounts must be equal to the amount field.
    - `mnemonic` string, required: Mnemonic seed - usually 12-24 words with access to whole wallet. Either mnemonic, keyPair or signature Id must be present - depends on the type of account and xpub. Tatum KMS does not support keyPair type of off-chain transaction, only mnemonic based.
    - `xpub` string, required: Extended public key (xpub) of the wallet associated with the accounts and used mnemonic. Should be present, when mnemonic is used.
    - `paymentId` string: Identifier of the payment, shown for created Transaction within Tatum sender account.
    - `senderNote` string: Note visible to owner of withdrawing account
  - TransferBtcKeyPair
    - `senderAccountId` string, required: Sender account ID
    - `address` string, required: Blockchain address to send assets to. For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain addresses as a comma separated string.
    - `amount` string, required: Amount to be withdrawn to blockchain.
    - `compliant` boolean: Compliance check, if withdrawal is not compliant, it will not be processed.
    - `fee` string: Fee to be submitted as a transaction fee to blockchain. If none is set, default value of 0.0005 BTC is used. Minimum fee is 0.00001 BTC.
    - `multipleAmounts` string[]: For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain amounts. List of recipient addresses must be present in the address field and total sum of amounts must be equal to the amount field.
    - `keyPair` object[], required: Array of assigned blockchain addresses with their private keys. Either mnemonic, keyPair or signature Id must be present - depends on the type of account and xpub. Tatum KMS does not support keyPair type of off-chain transaction, only mnemonic based.
      - `address` string: Blockchain address assigned to account withdrawal is made from.
      - `privateKey` string: Private key of blockchain address.
    - `attr` string, required: Used to parametrize withdrawal as a change address for left coins from transaction.
    - `paymentId` string: Identifier of the payment, shown for created Transaction within Tatum sender account.
    - `senderNote` string: Note visible to owner of withdrawing account
  - TransferBtcKMS
    - `senderAccountId` string, required: Sender account ID
    - `address` string, required: Blockchain address to send assets to. For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain addresses as a comma separated string.
    - `amount` string, required: Amount to be withdrawn to blockchain.
    - `compliant` boolean: Compliance check, if withdrawal is not compliant, it will not be processed.
    - `fee` string: Fee to be submitted as a transaction fee to blockchain. If none is set, default value of 0.0005 BTC is used. Minimum fee is 0.00001 BTC.
    - `multipleAmounts` string[]: For BTC, LTC, DOGE and BCH, it is possible to enter list of multiple recipient blockchain amounts. List of recipient addresses must be present in the address field and total sum of amounts must be equal to the amount field.
    - `signatureId` string, uuid, required: Signature hash of the mnemonic, which will be used to sign transactions locally. All signature Ids should be present, which might be used to sign transaction. Tatum KMS does not support keyPair type of off-chain transaction, only mnemonic based.
    - `xpub` string, required: Extended public key (xpub) of the wallet associated with the accounts. Should be present, when mnemonic is used.
    - `paymentId` string: Identifier of the payment, shown for created Transaction within Tatum sender account.
    - `senderNote` string: Note visible to owner of withdrawing account

## Response `200`

OK

- union
  - OffchainTransactionResult
    - `id` string, required: ID of withdrawal. If transaction is not valid in blockchain, use this id to cancel withdrawal.
    - `txId` string, required: TX hash of successful transaction.
    - `completed` boolean, required: If set to "true", the withdrawal has been completed in the virtual account; if set to "false", the withdrawal has not been completed and you have to <a href="https://apidoc.tatum.io/tag/Withdrawal#operation/completeWithdrawal" target="_blank">complete it manually</a>
  - OffchainTransactionSignatureResult
    - `signatureId` string, uuid, required: ID of prepared payment template to sign. This is should be stored on a client side to retrieve ID of the blockchain transaction, when signing application signs the transaction and broadcasts it to the blockchain.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
- `403`: Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.
- `500`: Internal server error. There was an error on the server during the processing of the request.

---

[API](https://skmtc.dev/tatum/apis/virtual-accounts.md) - [All operations](https://skmtc.dev/tatum/apis/virtual-accounts/llms.txt) - [OpenAPI document](https://skmtc.dev/tatum/apis/virtual-accounts/revisions/ba220553084b?raw)
