Cryptocurrency Forwarding

V 1.0

Contents

We designed this API is fully compatible with existing applications based on Blockchain.info's Receive Payments API v1. The API methods work exactly the same way, have same structure and answers.

After Blockchain.info took down their original Receive Payments API v1, many online shops stopped receiving payments. We created our payment processing API with new tools and interfaces, but now here to provide an additional solution to merchants like you. Feel free to use an existing code of Blockchain.info's API v1 or applications to utilize our API; simply change your system's configured root API URL from "blockchain.info" to "apirone.com" and you'll be good to go. Also, you can find a lot of Modules for e-commerce CMS soon.

This function generates a unique address to which the customer may send payments. This address is infinite without transactions limits.

You can generate bitcoin or litecoin addresses for one-time payments or for periodic payments as a linked address to a user account. For example, if a customer re-uses it to buy the same product again or to top up the account balance with cryptocurrency.

Generated addresses never expire. Will be permanently monitored.

Please note that micropayments are not efficient in bitcoin network because of high network fee.

HTTP and HTTPS protocol schemas in URL are required. Also, we support callback to TOR project logo network.

As the destination address, you can indicate any type of bitcoin addresses that exists at the moment: standard addresses starting with "1" (P2PKH); Pay to Script Hash addresses with the SegWit support (P2SH-P2WPKH), starting with "3"; as well as new SegWit addresses starting with "bc" (P2WPKH).

Notice: Please send amounts more than 1000 Satoshies (0.00001 BTC) for forwarding. Because network commissions may not be enough to send a transaction and the transaction will get stuck. Less amounts will be donation for service.


Simple requests:

{address} Your destination bitcoin address where confirmed payments will be forwarded Required
{callback} Your server's callback URL to receive data about the payment. You can add any optional GET parameters. This must be a valid URL.
Callback URL should be url encoded or attached at the end of query. Otherwise it will return an error.
Required
{currency} Currency type: "btc", "ltc". Default: btc Optional

Code Example

<?php
  $my_address = "bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4";
  $my_callback_url = "http://example.com/callback?invoice_id=1234&secret=7j0ap91o99cxj8k9";
  $api_base = "https://apirone.com/api/v1/receive";
 
  $curl = curl_init();
  curl_setopt_array($curl, array(
      CURLOPT_RETURNTRANSFER =< 1,
      CURLOPT_URL =< $api_base . "?method=create&currency=btc&address=" . $my_address .
		"&callback=" . urlencode($my_callback_url)
  ));
  $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 "Please send the payment to the following bitcoin address: " .
			$decoded["input_address"];
  } else {
      echo "Sorry, an error occurred: " . $response;
  }
?>
<?php
  $my_address = "bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4";
  $my_callback_url = 
  		urlencode("http://example.com/callback?invoice_id=1234&secret=7j0ap91o99cxj8k9");
  $data = file_get_contents("https://apirone.com/api/v1/receive?method=create&currency=btc&address=". 
  		$my_address. "&callback=" . $my_callback_url);
  $respond = json_decode($data,true);
  $address = $respond["input_address"]; // bitcoin address for customer payments
  echo $address;
?>
import requests
import urllib
my_address = 'bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4'
my_callback_url = urllib.parse.urlencode({"r":"http://example.com/callback?invoice_id=1234&secret=7j0ap91o99cxj8k9"})[2:]
url = 'https://apirone.com/api/v1/receive?method=create&currency=btc&address=%s&callback=%s' % (my_address, my_callback_url)
response = requests.get(url)
print(response.text)
Method and Variables:
Parameter Description Required Experiment with a value
method=create

This method generates a new deposit address

Required
currency

Currency type: "btc", "ltc". Default: btc

Optional
{address}
base58,
32 chars

Destination address
Your destination bitcoin address where confirmed payments will be forwarded

Required
{callback}
text,
=< 1024 chars

Callback URL
Your server's callback URL to receive data about the payment. You can add any optional GET parameters. This must be a valid URL.
Callback URL should be url encoded or attached at the end of query. Otherwise it will return an error.

Required
  Reset Values Send request
Response from server:
{ "fee_percent": 1, "destination": "bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4", "input_address": "1FEGJSLDJJ6oSuJwur3fCD7TtQbYUjBV4z", "callback_url": "http://example.com/addbalance.php?user=118" }

Success Response

Success response returns four parameters in JSON format:
{fee_percent} Percentage that is taken as a service fee. Default: 1 integer
{destination} Merchant's destination (a bitcoin address) where confirmed payments will be forwarded base58 (32 chars)
{input_address} The generated bitcoin address to receive a payment from a customer. base58 (32 chars)
{callback_url} Your server callback URL to receive data about the payment. text (max. 1024 chars)
Response example:
{
    "destination": "bc1qggg2ys8duv4qvnfgzng2p75m6ehklcmfygr9m4",
    "input_address": "1FEGJSLDJJ6oSuJwur3fCD7TtQbYUjBV4z",
    "callback_url": "http://example.com/callback?invoice_id=1234&secret=7j0ap91o99cxj8k9"
}

Error Response

Error response return messages in plain text format below:
The supplied address is not a valid bitcoin address.
The supplied callback URL is not valid.
Wrong method.
Not enough parameters.
Incorrect address type.