Transfert depuis un portefeuille

Transférez une somme précise ou un pourcentage du solde total vers un ou plusieurs destinataires.

Send Bitcoins icon

Contents

Request:

{WalletID}, string Wallet Identificator. Obligatoire
{transfer_key}, string Key for payment transfer (withdrawal). Obligatoire
{destinations}, array Liste des adresses de destination et leur montant. Obligatoire
Request example:
{"transfer_key": "key_for_withdrawal"}
{
   "destinations":[
      {"address": "receiver_bitcoin_address", "amount": <amount_in_satoshies|"percent">},
	  ... #up to 255 receivers
   ]
}

Success Response Reference:

{txs}, array The array of transactions hash. Obligatoire
{change-address}, string Si une transaction déjà envoyée connait une modification, elle sera envoyée dans une nouvelle adresse de portefeuille. We create new clear address without any callbacks in same wallet. Facultatif
Response example:
{ "txs": ["f697a5e33e8becc00cb48761299dbe9e29b8665fd4983a0a8c04aee814bd1ff4"], "change-address": "1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH" }

Message d'erreur:

Playground and Code examples:

Paramètres Expérience avec une valeur
Wallet ID
Transfer key
Destinations
Address Amount

+

Exécuter
Réponse du serveur:
{"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);
  }
?>