Forwarding Wallet

V 2.0

Bitcoin QR code icon

Contents

Forwarding wallet accept and immediately forward payment to your wallet. Also, it has the ability to split forwarding payment.

Income payment can be split to list up to 255 addresses. These receivers will get part in exact specified amount or by percent (quota) from income amount. It's a very convenient way to immediately pay to referral, for multi-level marketing, receive a royalty, split to cold storage and hot wallet from all income payments. In the case of the specified amount, the rest will be sent to the last address. You can create a lot of wallets for your project.

Each payment is divided by the order of the list until the last Satoshi. Payouts are made on the list from the first to the last. The order of the list is important.

Request:

JSON Schema parameters

Use POST string request containing the object in JSON format.

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

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.

Required
{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

Destination address and amount

Your destination(s) bitcoin address(es) where confirmed payments will be forwarded. Minimum 1, maximum 255 destination address.

Parameter Description Required Examples
{destinations}
string,
32 - 42 chars
Destination address

Your destination bitcoin address where confirmed payments will be forwarded.

Required

1apiKcJM95jENZeom2dQo8ShK7dUQkRaS

bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4

{amount}
(integer | "percent in string")

Amount

An amount in Satoshi or in percent. This parameter may be missing or empty. In this case, the rest amount will be forwarded there.

Optional

253999

"20%"

"31.55%"

Request example:
{
"type": "forwarding",
"callback":{                       #optional
      "url": "your_callback_URL",  #optional
      "data":{                     #optional
         "optional_key": "value"
      }
   },
	"destinations":[           #Destinations for Forwarding wallet type only
      {"amount": <amount|"percents">, "address": "<bitcoin_address>"},
		... #from 1 to 255 addresses
	]
}

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
{destinations} Your destination bitcoin address where confirmed payments will be forwarded. Required
Response example:

{
  "wallet": "8e9c53a62755bcc66e4d2aaae3a2af6d",
  "type": "saving",
  "transfer_key": "7j0ap91o99cxj8k97j0ap91o99cxj8k9",
  "currency": "btc",
  "callback":
  {
     "url": "http://example.com/callback",
     "data":
     {
        "invoice_id": "1234",
        "secret": "7j0ap91o99cxj8k9",
     }
  },
  "destinations":[
	{"address": "1apiKcJM95jENZeom2dQo8ShK7dUQkRaS", "amount": 40330},
	{"address": "1ApiwpetcWnBbkpU7cb7biPfc6Tiucasf8", "amount": 40330}
  ]
}

Error Response

Playground and Code examples:

Callback URL KeyValue

+

AddressAmount

+


{
   "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: