BitPro Get started New invoice Login
Overview

BitPro offers two public API endpoints. The first is a powerful and fast REST Application Programming Interface (a.k.a. API or api). The second api is is a curl interface available for creating new invoices.

Curl

The curl interface can be used to quickly generate new invoices. Compared to the REST api, the curl api is easier to implement. But its simplicity makes it less powerful compared to the REST api. In fact, the curl api itself has been built using the REST api.
The following parameters can be provided for creating a new invoice.

Required parameters
coin The id of the requested coin, e.g. monero. See the price API for a complete list
amount The requested amount of coins, i.e. 1.04 when requesting 1.04 ETH. If the currency parameter is provided the amount of coins is calculated automatically and the amount is expected to be in dollar, euros, etc.
address The address where the coins should be sent after payout
Optional parameters
currency The currency used for this invoice. When requesting a value in coins, i.e. BTC, LTC or XMR leave this parameter empty. If you provide this parameter we calculate the equivalent coin value. Supported currencies: USD, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HRK, HUF, IDR, ILS, INR, ISK, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, ZAR
identifier A custom identifier for this invoice for your own system, not shown to the buyer. Max. 50 characters
description A custom description, max. 250 chars, displayed to the buyer on the payment page
postback_url An HTTPS postback URL to send status updates to your server
postback_email An email address where status updates are sent
redirect An HTTPS URL where the buyer is redirected after payment
expiration An expiration time in minutes, after which the buyer can no longer complete this invoice
Return values
url A unique url where this invoice can be viewed
Examples
curl \
-d coin=bitcoincash \
-d amount=0.09 \
-d address=bitcoincash:qr9rg2532d930myr8j2e90pumrymxfhatcyakt4xul \
https://bitpro.cc/newinvoicecurl
curl \
-d coin=litecoin \
-d amount=0.45 \
-d address=LYPm4Kek2o7RvxiqSGs9W8j7KFJDjYbqQV \
-d currency= \
-d identifier="Invoice-1234-A" \
-d description="Thank you for ordering" \
-d postback_url=https://bitpro.cc/postback \
-d postback_email=info@bitpro.cc \
-d redirect=https://bitpro.cc \
-d expiration=600 \
https://bitpro.cc/newinvoicecurl
REST

All documentation from this point on describes the REST API.
The REST API returns all output in JSON format and all input should be valid JSON as well. The HTTP status code indicates whether an operations is successful.
The amount of API calls is limited to reduce spam. This limit automatically increases on successful payouts but you can also send us a message with your api key to have this limit increased.

The PHP examples make use of the PHP reference class, download the PHP reference class here

Basic REST API usage
There are many api functions available, only a few are needed for creating invoices and requesting a payout.
1. Request api key
An api key is required for all other methods. The api key is secured by a shared secret. Each subsequent api request requires both the api key and a caluclated HMAC value in the HTTP header, which is composed of a sha512 HMAC of the request method + nonce + URL + parameters. The nonce should be a positive integer, it should always be larger than the previous nonce. A good candidate is a timestamp with milliseconds.
2. Set address
When you create invoices the user pays an amount in Bitcoin or altcoins to our wallets. This amount is transferred to you upon payout and for that we need your coin address. You can set this address at any time before payout, i.e. you can create invoices before setting this address.
3. Create invoice
Create a new invoice where a user can pay the coin and amount you specified. All invoices under the same api key a combined into one account.
4. Payout
After an invoice is paid and has enough confirmations, you can request a payout. It is possible to payout each invoice seperately but combining multiple invoices may reduce network fees.

API overview:

API flow

API Key
Description
Get a new api key. The generated api key is case sensitive.
An api key is required for most of the other api calls.
You can create invoices for different types of coins with the same api key.
The api key is secured with a shared secret key, you should keep this key safe from others.
All other API calls need to be signed with this key.
Endpoint
/api/apikey
Method
POST
Required parameters
secret A secret value to protect this api key
Examples
Get a new api key, with the shared secret key set to change_to_your_secret

Shell PHP

METHOD=POST
SECRET=change_to_your_secret
BODY="{\"secret\":\"$SECRET\"}"
URL=https://bitpro.cc/api/apikey

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Change the secret value to your secret for this API key
$secret = 'change_to_your_secret';

try {
  $result = $api->getApiKey($secret);

  // apikey contains the new key
  $apikey = $result->apikey;
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Coin address
Description
Set a payout address for an api key and coin combination.
Paid invoices will be transferred to the address specified here.
You can use the same api key for multiple coins, e.g. monero, ethereum and bitcoin invoices can all be created and paid using the same api key.
Send a POST or a PUT request to initialize or update an address respectively.
Endpoint
/api/coinaddress
Method
POST / PUT
Required parameters
coin The id of the requested coin, e.g. monero. See the Price API for a complete list
address The address where the coins should be sent after payout
Return values
message Informative message
Examples
Request all bitcoin payouts to the specified address.

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=bitcoin
ADDRESS=12woB8X3PRWCpeaCfikUkGebAfjQngzU4b
BODY="{\"coin\":\"$COIN\",\"address\":\"$ADDRESS\"}"
URL=https://bitpro.cc/api/coinaddress
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'bitcoin';
  $address = '12woB8X3PRWCpeaCfikUkGebAfjQngzU4b';

  // json result contains a success message after a successful update
  $result = $api->setCoinAddress($apikey, $secret, $coin, $address);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Update ethereum address on the same api key.

Shell PHP

METHOD=PUT
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=ethereum
ADDRESS=0xe9267f7D8FD16e0bBd962604827cC2E88c8C242e
BODY="{\"coin\":\"$COIN\",\"address\":\"$ADDRESS\"}"
URL=https://bitpro.cc/api/coinaddress
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'ethereum';
  $address = '0xe9267f7D8FD16e0bBd962604827cC2E88c8C242e';
  $method = 'PUT';

  // json result contains a success message after a successful update
  $result = $api->setCoinAddress($apikey, $secret, $coin, $address, $method);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Invoice
Description
Create a new invoice. A value in dollars or in coins can be provided.
For example, to receive $100 worth of Monero (XMR) if the current rate of Monero is $86.97: set the amount to 100 and the currency to USD or set the amount to 1.15 and leave the currency empty.

A custom description can be provided, which is shown to the buyer on the invoice. The following markup is allowed in the description: <i> </i> <b> </b> <u> </u> <br>

Status updates for the invoice are sent to the postback URL and/or email address, if these are provided. The data sent as a postback is the (JSON encoded) invoice information, see invoice status for a list of fields that will be returned. Usually you will receive two updates, one when the invoice is paid and another one when the payment reaches the required amount of confirmations. To make sure the invoice update comes from our servers, calculate the HMAC of the posted JSON data with our shared secret. This HMAC value is provided in a HMAC header field and should match the one you calculate.

A redirect URL can be provided, if it exists a buyer is redirected to this page after payment. The redirect URL can be set at any time before the invoice is paid, even if the buyer is already viewing the invoice.

The expiration time defaults to 24 hours. A custom value between 1 minute and 43200 minutes (30 days) can be provided. After the expiration time the invoice becomes invalid.
Endpoint
/api/invoice
Method
POST
Required parameters
coin The id of the requested coin, e.g. "bitcoincash". See the Price API for a complete list
amount The requested amount of coins, i.e. 1.04 when requesting 1.04 ETH. If the currency parameter is provided the amount of coins is calculated automatically and the amount is expected to be in dollar, euros, etc.
Optional parameters
currency The currency used for this invoice. When requesting a value in coins, i.e. BTC, LTC or XMR leave this parameter empty. If you provide this parameter we calculate the equivalent coin value. Supported currencies: USD, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HRK, HUF, IDR, ILS, INR, ISK, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, RUB, SEK, SGD, THB, TRY, ZAR
identifier A custom identifier for this invoice for your own system, not shown to the buyer. Max. 50 characters
description A custom description, max. 250 chars, displayed to the buyer on the payment page
postback_url An HTTPS postback URL to send status updates to your server
postback_email An email address where status updates are sent
redirect An HTTPS URL where the buyer is redirected after payment
expiration An expiration time in minutes, after which the buyer can no longer complete this invoice
Return values
See invoice status for a list of return parameters
Examples
Request $500 worth of Monero.

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=monero
AMOUNT=500
CURRENCY=USD
BODY="{\"coin\":\"$COIN\",\"amount\":\"$AMOUNT\",\"currency\":\"$CURRENCY\"}"
URL=https://bitpro.cc/api/invoice
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'monero';
  $amount = 500;
  $currency = 'USD';

  // result contains the invoice information serialized to an object
  $result = $api->createInvoice($apikey, $secret, $coin, $amount, $currency);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Request 0.15 BTC

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=bitcoin
AMOUNT=0.15
BODY="{\"coin\":\"$COIN\",\"amount\":\"$AMOUNT\"}"
URL=https://bitpro.cc/api/invoice
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'bitcoin';
  $amount = 0.15;

  // result contains the invoice information serialized to an object
  $result = $api->createInvoice($apikey, $secret, $coin, $amount);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Request 2.05 ETH, setting all optional fields

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=ethereum
AMOUNT=2.05
IDENTIFIER="Your custom invoice ID"
DESCRIPTION="A custom message shown to the buyer, please pay within 15 minutes."
POSTBACK_URL=https://postbackurl
POSTBACK_EMAIL=noreply@bitpro.cc
REDIRECT=https://redirecturl
EXPIRATION=900
BODY="{\"coin\":\"$COIN\",
\"amount\":\"$AMOUNT\",
\"identifier\":\"$IDENTIFIER\",
\"description\":\"$DESCRIPTION\",
\"postback_url\":\"$POSTBACK_URL\",
\"postback_email\":\"$POSTBACK_EMAIL\",
\"redirect\":\"$REDIRECT\",
\"expiration\":\"$EXPIRATION\"}"

URL=https://bitpro.cc/api/invoice
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'ethereum';
  $amount = 2.05;
  $currency = '';
  $identifier = 'Your custom invoice ID';
  $description = 'A custom message shown to the buyer, please pay within 15 minutes.';
  $postback_url = 'https://postbackurl';
  $postback_email = 'noreply@bitpro.cc';
  $redirect = 'https://redirecturl';
  $expiration = '900';

  // result contains the invoice information serialized to an object
  $result = $api->createInvoice($apikey, $secret, $coin, $amount, $currency, $identifier, $description, $postback_url, $postback_email, $redirect, $expiration);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Invoice status
Description
Get details about an invoice. All date fields are returned in ISO 8601 format and are always in UTC time. The format is YYYY-MM-DDTHH:MM:SSZ, e.g. 2017-12-30T15:38:27Z

The status field can have the following values:
new New invoices and invoices not yet paid
paid Invoice has been paid but has not yet reached the minimum amount of confirmations
verified Paid and received enough verifications. This amount is ready for payout
complete The invoice has been paid, confirmed and transferred to you
expired The invoice has expired and is no longer valid
Endpoint
/api/invoice
Method
GET
Required parameters
invoice_id The unique invoice ID, append to the url
Return values
amount_coin The exact amount requested in coin value, e.g. 0.021 when requesting 0.021 BTC
amount_dollar The amount requested in dollar value at the time of creating the invoice
amount_paid The amount paid on an invoice
coin The requested coin, e.g. bitcoin
coin_address The address where the buyer should sent the coins
coin_token The requested coin token, e.g. XMR for Monero
confirmations The number of confirmations received by other nodes
creation_date UTC date of invoice creation
description A custom description, max. 250 chars, displayed to the buyer on the payment page
expiration_date UTC date when this invoice will expire
identifier A custom identifier for this invoice for your own system, not shown to the buyer. Max. 50 characters
invoice_id The unique invoice ID
modify_date UTC date of last invoice modification
postback_url An HTTPS postback URL to send status updates to your server
postback_email An email address where status updates are sent
redirect An HTTPS URL where the buyer is redirected after payment
required_conf The number of confirmations required for this invoice to be eligible for payout
server_date UTC date according to our servers
status Invoice status, see the description for a list of possible values
url A unique url where this invoice can be viewed
Examples

Shell PHP

METHOD=GET
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
INVOICE_ID=3ftyuw
BODY=
URL=https://bitpro.cc/api/invoice/$INVOICE_ID
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $invoice_id = 'uRx0el';

  // result contains the invoice information serialized to an object
  $result = $api->invoiceStatus($apikey, $secret, $invoice_id);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Invoice list
Description
Return a detailed list with information about the 100 latest invoices.
Endpoint
/api/invoicelist
Method
GET
Return values
list Details about recent invoices, see invoice status for a list
Examples

Shell PHP

METHOD=GET
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
BODY=
URL=https://bitpro.cc/api/invoicelist
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  // result contains a list with invoice objects
  $result = $api->invoiceList($apikey, $secret);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Update invoice
Description
Update an invoice with new settings. Add the invoice_id to the URL.
Only the provided parameters are updated, i.e. if you only provide the field identifer, all other fields keep their current value. To clear a field, send an empty string as parameter.
Updating the amount paid and received number of confirmations is only available on the test API.
Endpoint
/api/invoice
Method
PATCH
Optional parameters
identifier A custom identifier for this invoice for your own system, not shown to the buyer. Max. 50 characters
description A custom description, max. 250 chars, displayed to the buyer on the payment page
postback_url An HTTPS postback URL to send status updates to your server
postback_email An email address where status updates are sent
redirect An HTTPS URL where the buyer is redirected after payment
amount_paid The amount paid on an invoice
confirmations The number of confirmations for this payment
Return values
list Information about the updated invoice, see invoice status for a list.
Examples
Update, or add, a postback URL to an existing invoice. The invoice_id is added to the URL

Shell PHP

METHOD=PATCH
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
INVOICE_ID=9wBe1i
POSTBACK_URL=https://postbackurl2
BODY="{\"postback_url\":\"$POSTBACK_URL\"}"
URL=https://bitpro.cc/api/invoice/$INVOICE_ID
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $invoice_id = '9wBe1i';
  $postback_url = 'https://postbackurl2';

  // Providing null values for the parameters identifier and description,
  // keeps the current values for these fields
  $result = $api->updateInvoice($apikey, $secret, $invoice_id, null, null, $postback_url);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Update an invoice setting the amount paid to 1.05 and the number of confirmations to six.

Shell PHP

METHOD=PATCH
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
INVOICE_ID=9wBe1i
AMOUNT_PAID=1.05
CONFIRMATIONS=6
BODY="{\"amount_paid\":\"$AMOUNT_PAID\",\"confirmations\":\"$CONFIRMATIONS\"}"
URL=https://bitpro.cc/api/invoice/$INVOICE_ID
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $invoice_id = '9wBe1i';
  $identifier = null;
  $description = null;
  $postback_url = null;
  $postback_email = null;
  $redirect = null;
  $amount_paid = 1.05;
  $confirmations = 6;

  $result = $api->updateInvoice($apikey, $secret, $invoice_id, $identifier, $description, $postback_url, $postback_email, $redirect, $amount_paid, $confirmations);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Delete invoice
Description
Delete the invoice specified by invoice_id.
Invoices which have been paid cannot be deleted.
A deleted invoice is permanently removed and cannot be undeleted after this action.
Endpoint
/api/invoice
Method
DELETE
Return values
message
Success or error message
Examples
Delete the provided invoice_id

Shell PHP

METHOD=DELETE
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
INVOICE_ID=9wBe1i
BODY=
URL=https://bitpro.cc/api/invoice/$INVOICE_ID
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $invoice_id = '9wBe1i';

  // result contains the invoice information serialized to an object
  $result = $api->deleteInvoice($apikey, $secret, $invoice_id);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Balance
Description
Check the balance of received and pending coins on all invoices from an api key.
Endpoint
/api/balance
Method
GET
Return values
coin The coin on the invoice, e.g. bitcoin or ethereum
new New invoices and invoices not yet paid
paid Invoice has been paid but has not yet reached the minimum amount of confirmations
verified Paid and received enough verifications. This amount is ready for payout
complete The invoice has been paid, confirmed and transferred to you
Examples

Shell PHP

METHOD=GET
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
BODY=
URL=https://bitpro.cc/api/balance
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  // Each coin with an amount is returned in the resulting object
  $result = $api->balance($apikey, $secret);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Payout
Description
Transfer all the received funds for a specific coin and api key to you. All verified invoices with enough confirmations are paid out.
Make sure to set a payout address first, using the Payout API.
It usually takes a few minutes before you receive the payment.
Endpoint
/api/payout
Method
POST
Required parameters
coin The id of the coin to payout, e.g. bitcoin or ethereum
Return values
payout_id Unique transaction ID for internal use
amount The amount of coins transferred, the fee will be deducted from this amount
info Optional informational message
Examples

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
COIN=monero
BODY="{\"coin\":\"$COIN\"}"
URL=https://bitpro.cc/api/payout
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $coin = 'monero';

  // payout returns a unique payout ID, useful for storing in your own administration
  $result = $api->payout($apikey, $secret, $coin);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Price
Description
Get the supported coins and their current price.
Endpoint
/api/price
Method
GET
Examples

Shell PHP

<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  // Note: you do not need an api key for this method, omit it if you like
  $result = $api->price();
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>
Message
Description
Send a contact message
Endpoint
/api/message
Method
POST
Required parameters
name Your name
email Your email address
message The message contents
Examples

Shell PHP

METHOD=POST
APIKEY=change_to_your_api_key
SECRET=change_to_your_secret
NONCE=$(date +%s%3N)
NAME=Your\ Name
EMAIL=info@example.com
MESSAGE=Hello
BODY="{\"name\":\"$NAME\",\"email\":\"$EMAIL\",\"message\":\"$MESSAGE\"}"
URL=https://bitpro.cc/api/message
HMAC=$(echo -n "$METHOD$NONCE$URL$BODY" | openssl dgst -sha512 -hmac "$SECRET" | sed 's/.* //')

curl \
-X $METHOD \
-H "Content-Type: application/json" \
-H "BITPRO-APIKEY: $APIKEY" \
-H "BITPRO-NONCE: $NONCE" \
-H "BITPRO-HMAC: $HMAC" \
-d "$BODY" \
$URL
<?php
/* Download the BitProApi class here: https://bitpro.cc/BitProApi.zip
   Require it using the following line, or place it somewhere your framework autoloader can find it */

require 'BitProApi.php';

// Set testnet = false to make api calls to the production environment
$testnet = true;
$api = new BitProApi($testnet);

// Set the API key and shared secret
$apikey = '';
$secret = 'change_to_your_secret';

try {
  $name = 'Your Name';
  $email = 'info@example.com';
  $message = 'Hello';

  $result = $api->message($apikey, $secret, $name, $email, $message);
} catch(Exception $e) {
  // status contains the http status code, i.e. 404 when an object is not found
  $status = $api->getStatus();

  // json contains the error message, if any is available
  $json = $api->getJson();

  // error contains a generic API error message
  $error = $e->getMessage();
}
?>