API

Introduction


Welcome to CoinTree's API documentation. Our API lets you access the price ticker and perform account actions in a nice simple manner.

The API follows common industry standards such as REST and HMAC authentication. If you ever get stuck, contact our friendly staff for assistance.

We cater to both our personal users and our business customers. Please send us any feedback, requests or ideas.

Access


API access is currently provided on an 'ask and you shall receive' basis. API keys will be provided to all user accounts in the future.

Request limits


There is no cap on the number of requests just yet. Be responsible. API keys will be revoked if access is abused.

Authentication


All private API calls require authentication. We use HMAC, an industry standard that contains an API key, a nonce and a signature derived from a private key to ensure API calls are secure.

API key

To get an API key, please see the Access section above.

Nonce

Nonce is a regular integer number. It can be any number you wish as long as it hasn't been used before. Its purpose is to prevent replay attacks where a request is sent twice to perform double-actions. A common practice is to use unix time for the value.

Signature

Signature is a HMAC-SHA256 encoded message containing the nonce and API key. The HMAC code must be generated using a secret key that is provided along with your API key. This code must be converted to its hexadecimal representation (64 uppercase characters).

If you are new to HMAC, you can find a code example in your programming language of choice here.

Example

With the three pieces of data above ready, append them to the query string of the request.

This example uses the following sample values:

  • URL: https://api.cointree.com.au/v1/account
  • API Key: 30ee9c5a201c4913b69c048f8f3c2dbd
  • API Secret: F1x2b3jTYzgOP5j9fM8a++Qzp24I4Kp7UQy8EFbr4rA=
  • Nonce: 1112875570

Steps:

  • Concatenate the nonce with the API key. The result is 111287557030ee9c5a201c4913b69c048f8f3c2dbd
  • Use the API secret to generate the HMAC-SHA256 code of the concatenated text. The result is AAFABBD94EEF3BA9E7C95CFCF2C107748CA3C3F3C16DABFF5F5FF66132DA55F1
  • Append the nonce, API key and signature to the url. The result is https://api.cointree.com.au/v1/account?nonce=1112875570&key=30ee9c5a201c4913b69c048f8f3c2dbd&signature=AAFABBD94EEF3BA9E7C95CFCF2C107748CA3C3F3C16DABFF5F5FF66132DA55F1

Note: The signature is calculated from the nonce and API key only. Differences in urls, parameters or content does not matter.

Debugging


Sometimes things just don't work when it seems they should. Our API returns HTTP status codes and header responses to help you investigate issues.

  • 200 - Everything is good. Your API call is successful.
  • 401 - We're unable to verify the call. Check the header response for details.
  • 400 - Something wasn't right with the request values. Check the header response for details.
  • 500 - An unexpected error occurred while processing the request. Please notify support.

Client libraries


Our NuGet package can be found here.

We are happy to list your client libraries here.

Price


Our price ticker can be called without authentication. It lists the current buy price and sell price. This request is cached for performance reasons.

HTTP GET: https://api.cointree.com.au/v1/price/btc/aud

Response

Name Type Description
Ask Decimal Buy price
Bid Decimal Sell price
Spot Decimal Generally not useful. Used by some chart services.

Altcoin Price


Gets the conversion rate of bitcoin to a chosen altcoin. See the API call below for a list of altcoins. This request is cached for performance reasons. No authentication required.

HTTP GET: https://api.cointree.com.au/v1/price/btc/<altcoinsymbol>

Response

Name Type Description
Rate Decimal Bitcoin to altcoin conversion rate

Altcoin List


Lists the available altcoins alphabetically. No authentication required.

HTTP GET: https://api.cointree.com.au/v1/price/altcoins

Response

Name Type Description
Name Text Name of the altcoin
Symbol Text Abbreviation/symbol of the altcoin

Account details


Gets the account balance, bitcoin deposit address and other account details.

HTTP GET: https://api.cointree.com.au/v1/account

Response

Name Type Description
Email Text Email address the account belongs to
Currencies Array List of currencies associated with the account

Currencies array items

Name Type Description
Currency Text Currency symbol
Balance Decimal Current balance including reserved amount
Reserved Decimal Reserved amount for transactions that are in progress
DepositDetails Text For BTC, the bitcoin address associated with your account. Sending bitcoin here will add it to your account

Account history


Lists the account history similar to viewing the Transaction Log page. Ordered by latest entries first.

HTTP GET: https://api.cointree.com.au/v1/account/log

Response

Name Type Description
Items Array of item Account history log entries

Item

Name Type Description
Created DateTime Indicates when the entry was created
Description Text Details about the entry
Type Text Indicates the type of entry. Either 'Activity' or 'Account'

Get purchases


Lists the current and previous purchases on your account. Ordered by latest entries first. Limited to 50 entries.

HTTP GET: https://api.cointree.com.au/v1/account/buys

Response

Name Type Description
Items Array of item Latest 50 purchases

Item

Name Type Description
Created DateTime Indicates when the purchase was created
Amount Decimal Deposited amount (before the fee is factored in)
Fee Decimal Purchase fee
Bitcoin Decimal Amount of bitcoin received
Method Text Purchase method used
DepositDetails Text Payment details if the purchase hasn't been paid yet
Reference Text Unique reference number
State Text Current status

Create purchase


Creates a new purchase similar to using the Buy page in your account.

HTTP POST: https://api.cointree.com.au/v1/account/buy?amount=<amount>&method=<method>

Parameters

Name Type Description
Amount Decimal Purchase amount in AUD
Method Text Purchase method. Valid values (see the Buy page to view the current options):
  • cash (Cash at a local bank branch)
  • online (Internet or MobÍle Banking)
  • poli (POLi Payments)

Response

Name Type Description
Amount Decimal Purchase amount in AUD (before the fee is factored in)
Fee Decimal Purchase fee
Method Text Purchase method used
DepositDetails Text Payment details if the purchase hasn't been paid yet
Reference Text Unique reference number

Cancel purchase


Cancels a purchase that hasn't been paid yet.

HTTP DELETE: https://api.cointree.com.au/v1/account/buy?reference=<reference>

Parameters

Name Type Description
Reference Text Reference number of the purchase

No response. HTTP Status 200 is returned.

Get altcoin purchases


Lists the current and previous altcoin purchases on your account. Ordered by latest entries first. Limited to 50 entries.

HTTP GET: https://api.cointree.com.au/v1/account/altcoins

Response

Name Type Description
Items Array of item Latest 50 sells

Item

Name Type Description
Created DateTime Indicates when the altcoin purchase was created
Bitcoin Decimal Bitcoin amount sent
Amount Decimal Altcoin amount received
AltcoinSymbol Text Abbreviation/symbol of the altcoin
Reference Text Unique reference number
State Text Current status

Create altcoin purchase


Creates a new altcoin purchase similar to using the Buy Altcoins page in your account.

HTTP POST: https://api.cointree.com.au/v1/account/altcoins?altcoin=<altcoin>&amount=<amount>&address=<address>&field1=<field1>

Parameters

Name Type Description
Altcoin Text Abbreviation of the altcoin
Amount Decimal Bitcoin amount to swap
Address Text Altcoin to send the altcoin to
Field1 (optional) Text Additional altcoin parameter (only needed if the altcoin requires it)

Response

Name Type Description
Amount Decimal Bitcoin amount
Reference Text Unique reference number

Cancel altcoin purchase


Cancels an altcoin purchase that hasn't been processed yet.

HTTP DELETE: https://api.cointree.com.au/v1/account/altcoins?reference=<reference>

Parameters

Name Type Description
Reference Text Reference number of the altcoin purchase

No response. HTTP Status 200 is returned.

Get sells


Lists the current and previous sells on your account. Ordered by latest entries first. Limited to 50 entries.

HTTP GET: https://api.cointree.com.au/v1/account/sells

Response

Name Type Description
Items Array of item Latest 50 sells

Item

Name Type Description
Created DateTime Indicates when the sell was created
Bitcoin Decimal Sold amount
Amount Decimal AUD received
Reference Text Unique reference number
State Text Current status

Create sell


Creates a new sell similar to using the Sell page in your account.

HTTP POST: https://api.cointree.com.au/v1/account/sells?amount=<amount>

Parameters

Name Type Description
Amount Decimal Purchase amount in AUD

Response

Name Type Description
Amount Decimal Sell amount in BTC
Reference Text Unique reference number

Cancel sell


Cancels a sell that hasn't been processed yet.

HTTP DELETE: https://api.cointree.com.au/v1/account/sells?reference=<reference>

Parameters

Name Type Description
Reference Text Reference number of the sell

No response. HTTP Status 200 is returned.

Get sends


Lists the current and previous bitcoin transfers from your account. Ordered by latest entries first. Limited to 50 entries.

HTTP GET: https://api.cointree.com.au/v1/account/sends

Response

Name Type Description
Items Array of item Latest 50 sells

Item

Name Type Description
Created DateTime Indicates when the transfers was created
Destination Text Bitcoin address destination
Amount Decimal BTC the destination will receive
NetworkFee Decimal BTC paid to bitcoin miners
TransactionHash Text Bitcoin transfer hash (tx). Enter it on a blockchain explorer to monitor the transfer
Reference Text Unique reference number
State Text Current status

Create send


Creates a new bitcoin transfer similar to using the Send page in your account.

HTTP POST: https://api.cointree.com.au/v1/account/sends?desination=<desination>&amount=<amount>&highpriority=<highpriority>

Parameters

Name Type Description
Destination Text Bitcoin address to send bitcoin to
Amount Decimal Amount to send in BTC including network/miner fees
HighPriority Boolean Dictates the fee paid. See FAQ for actual amounts

Response

Name Type Description
Amount Decimal Sell amount in BTC
Reference Text Unique reference number
Amount Decimal Amount of BTC the destination will receive
NetworkFee Decimal Amount of BTC paid to bitcoin miners

Cancel send


Cancels a bitcoin transfer that hasn't been processed yet.

HTTP DELETE: https://api.cointree.com.au/v1/account/sends?reference=<reference>

Parameters

Name Type Description
Reference Text Reference number of the bitcoin transfer

No response. HTTP Status 200 is returned.

Get bill payments


Lists the current and previous bill payments from your account. Ordered by latest entries first. Limited to 50 entries.

HTTP GET: https://api.cointree.com.au/v1/account/payments

Response

Name Type Description
Items Array of item Latest 50 sells

Item

Name Type Description
Created DateTime Indicates when the transfers was created
BillerCode Text BPAY biller code
BillerName Text BPAY biller name
CustomerReference Text BPAY customer reference
Amount Decimal Bill amount
Bitcoin Decimal BTC paid
Reference Text Unique reference number
State Text Current status

Create bill payment


Creates a new bill payment similar to using the Pay Household Bills page in your account.

HTTP POST: https://api.cointree.com.au/v1/account/payments?billercode=<billercode>&customerreference=<customerreference>&amount=<amount>

Parameters

Name Type Description
BillerCode Text BPAY biller code
CustomerReference Text BPAY customer reference. Input is NOT checked to see if it is valid by BPAYs standards.
Amount Decimal Bill amount in AUD

Response

Name Type Description
Amount Decimal Bill amount in AUD
Reference Text Unique reference number

Cancel bill payment


Cancels a bill payment that hasn't been processed yet.

HTTP DELETE: https://api.cointree.com.au/v1/account/payments?reference=<reference>

Parameters

Name Type Description
Reference Text Reference number of the bill payment

No response. HTTP Status 200 is returned.

Coming soon


Over time we plan to add full account functionality.

If you have a specific needs please let our support team know.