Transfer from Wallet

V 2.0

Transfer exact amount or percent from whole balance to one or a couple of receivers.

Send Bitcoins icon

Contents

Simple requests:

{"transfer_key": "key_for_withdrawal"}
{
   "destinations":[
      {"address": "receiver_bitcoin_address", "amount": <amount_in_satoshies|"percent">},
	  ... #up to 255 receivers
   ]
}

If a sent transaction has a change, then it will be sent to the new wallet address.

Code Example

Format and Variables:
Parameter Variables Present Experiment with a value
{walletid}
string, 32 chars

Wallet identificator

Required
{transfer_key}
string, 32 chars
Key for payment transfer (withdrawal) Required
{destinations}
array

The dictionary of destination addresses and amounts.

Required  
Address Amount

+

Execute
Response from server:
{"change-address": "1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH", "txid": "f697a5e33e8becc00cb48761299dbe9e29b8665fd4983a0a8c04aee814bd1ff4", "currency": "btc" }
{  
   "transfer_key":"42HWdOw5qlm9ioGjrXaU4c02R3KcZxmn",
   "destinations":[

   ]
}
<?php
  $WalletID = "2a96097067fbc62b00c02d49495f8ad9";
  $json_data =
  array ( 
    'transfer_key' => "42HWdOw5qlm9ioGjrXaU4c02R3KcZxmn",
  );
  $api_endpoint = "https://apirone.com/api/v2/btc/wallet/" .
        $WalletID . "/transfer";
  $curl = curl_init($api_endpoint);
  curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  curl_setopt($curl, CURLOPT_POST, 1);
  curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($json_data));
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  $response = curl_exec($curl);
  $http_status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  curl_close($curl);
 
  if ($http_status_code==200){
    $decoded = json_decode($response, true);
    echo "Transaction sent. Hash: " . $decoded["txs"][0];
  } else {
      var_dump($response);
  }
?>

Success response:

{ "txs": ["f697a5e33e8becc00cb48761299dbe9e29b8665fd4983a0a8c04aee814bd1ff4"], "change-address": "1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH" }

Error Response

Error response return messages in plain text format below:
Invalid wallet.
Not enought funds to transfer.
Wrong destination.
Invalid transfer key.
No inputs available.
Destination address is not valid.