Create Saving Wallet

The Saving wallet consist of a bitcoin addresses. Using a wallet, you can accept all incoming payments and transfer bitcoins to one or several recipients via an API request.

Bitcoin QR code icon

Contents

Request:

JSON Schema parameters

Use POST string request containing the object in JSON format.

{type} Wallet type: "saving" or "forwarding" Required
Callback URL (Optional)

Callback is an array of callback URL and user's Data parameters.

{callback:url}
string,
=< 1024 chars

Callback URL
Your server's callback URL to receive data about the payment. This must be a valid URL.

Optional
{callback:data}
array

Data
The associative array is based on key-value pairs. You can use as additional identification or secure a generated bitcoin address.

For example 'secret' = '7j0ap91o99cxj8k9' or 'invoice_id'='1234'

Optional

Request example:
{
  "type": "saving",                #required
  "callback":{                     #optional
      "url": "your_callback_URL",  #optional
      "data":{                     #optional
         "optional_key": "value"
      }
   }
}

Success Response Reference:

{wallet}
string
Wallet identificator. Wallet contain bitcoin addresses. Required
{transfer_key}
string
Key for payment transfer (withdrawal). Required
{type}
string
Wallet type: "saving" or "forwarding". Required
{currency}
string
Currency type: btc. Required
{callback}
array
Specified array of callback URL and user's Data parameters. Optional
Response example:
{
  "wallet": "8e9c53a62755bcc66e4d2aaae3a2af6d",
  "transfer_key": "7j0ap91o99cxj8k97j0ap91o99cxj8k9",
  "type": "saving",
  "currency": "btc",
  "callback":
  {
     "url": "http://example.com/callback",
     "data":
     {
        "invoice_id": "1234",
        "secret": "7j0ap91o99cxj8k9",
     }
  }
}

Error Response:

Playground and Code examples:

Callback URL KeyValue

+

{
   "type": "forwarding",
   "callback":{
      "url" :  "http://example.com/callback"
   }
}
  
<?php
  $json_data = array (
    'type' => "forwarding",
    'callback' => array(
        'url'=> "http://example.com/callback"
    )
  );
  
  $api_endpoint = "https://apirone.com/api/v2/btc/wallet";
 
  $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 "Wallet: " . $decoded["wallet"] . "<BR>";
	  echo "Key: " . $decoded["transfer_key"];
  } else {
      var_dump($response);
  }
?>
Send request
Response from server: