BitBay

The BitBay Developer Hub

Welcome to the BitBay developer hub. You'll find comprehensive guides and documentation to help you start working with BitBay as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Suggest Edits

Introduction

 

We designed our BitBay API to provide our users with a convenient interface allowing access to service database, fetching data and performing various operations on third-party software. API allows users to create dynamic charts for various markets and to design autonomous trading apps.
If you by any chance have noticed an error while using API documentation or you would like to share with us your ideas and suggestions regarding new functionalities or future upgrades, please contact us using our Contact form.

The API is available under the following link: https://api.bitbay.net/rest

Calling a given method, e.g. ticker (method to be explained in more detail in further paragraphs) looks as follows: https://api.bitbay.net/rest/trading/ticker

All time format data returned by API follows UNIX timestamp format with milisecond precision.
Every request must contains Content-type: application/json header.

Responses return status code “200 OK”, therefore each method returns it’s execution status.
In case of failed execution, method returns status “Fail” and appropriate error message.

Suggest Edits

Open Source Libraries

 

You can take an advantage of our libraries to speed up the process of integrating your app with our API.
If you think your solution can be useful to other users feel free to share it with us - send your code and we will place it in this section if it’s valid.


Node REST API

PHP REST API

Got any interesting ideas how we could improve our platform? Experienced any troubles with an integration or even solved it?
Join to our Gitter community and share your knowledge and experience!

In order to offer the best service, operations are limited by the number of queries available per minute.

Action
Max. number of queries per minute

Place order

200

Cancel order

200

Get the list of placed order

200

Get list of transactions

100

Get market configuration

100

Change market configuration

20

Others

60

Suggest Edits

Error messages

 

In case of unsuccessful request execution a Fail status will be returned along with appropriate error message. List of common error messages is presented below; those not listed are related to specific method category which they are part of.

Error message
Description

PERMISSIONS_NOT_SUFFICIENT

API Key permissions are not sufficient to perform given action.

INVALID_HASH_SIGNATURE

API-Hash signature is not valid.

RESPONSE_TIMEOUT

Response time was exceeded.

TIMEOUT

Invalid: parameters / request type / path.

ACTION_BLOCKED

Action was blocked on user account.

ACTION_LIMIT_EXCEEDED

Action limit was exceeded. You need to wait one minute before making another request.

 
Suggest Edits

Ticker

To access a general view of configurations and statistics for given market or groups of markets user is required to attach the market code to the address. Ticker displays the value of the smallest transaction available and precision (number of decimal places) for each currency traded on selected market. Ticker also returns current best buy and sell order along with the price of most recent and next most recent transaction.

 
gethttps://api.bitbay.net/rest/trading/ticker/trading_pair
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/ticker",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/ticker',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/ticker")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.bitbay.net/rest/trading/ticker"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "ticker": {
    "market": {
      "code": "BTC-PLN",
      "first": {
        "currency": "BTC",
        "minOffer": 0.00003,
        "scale": 8
      },
      "second": {
        "currency": "PLN",
        "minOffer": 0.1,
        "scale": 2
      }
    },
    "time": 1529498308810,
    "highestBid": 24600.23,
    "lowestAsk": 24647,
    "rate": 24640,
    "previousRate": 24625.96
  }
}
{
  "status": "Fail",
  "errors": [
    "MARKET_NOT_RECOGNIZED"
  ]
}
 

Path Params

trading_pair
string

Optional: symbol of trading pair you want information about.

If you want to get information from specific market just use below path:
https://api.bitbay.net/rest/trading/ticker/BTC-PLN

Response details

Key
Type
Description

ticker

array

code

string

Currency pair for request

first / second

array

Arrays of data from first and second currency pair

  • currency

string

Currency shortcut

  • minOffer

decimal

Minimal value of currency that you can provide to order

  • scale

integer

Decimal precision

time

Unix Timestamp

Time of execute on server. For this time all values are actual

highestBid

decimal

The best price of buy order at the moment

lowestAsk

decimal

The best price of sell order at the moment

rate

decimal

Rate of the last transaction

previousRate

decimal

Rate of the penultimate transaction.

Suggest Edits

Market statistics

This method shows market statistics from last 24 hours: highest/lowest order and volume. Applies to selected market or all markets if market code parameter is left blank.

 
gethttps://api.bitbay.net/rest/trading/stats/trading_pair
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/stats",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/stats',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/stats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.bitbay.net/rest/trading/stats"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "stats": {
    "m": "BTC-PLN",
    "h": "25350",
    "l": "24538.65",
    "v": "737.16361855"
  }
}
{
  "status": "Fail",
  "errors": [
    "STATS_COULD_NOT_BE_LOADED"
  ]
}
 

Path Params

trading_pair
string

Optional: symbol of trading pair you want information about.

If you want to get information from specific market just use below path:
https://api.bitbay.net/rest/trading/stats/BTC-PLN

Response details

Key
Type
Description

stats

array

  • m

string

Currency pair of the market

  • h

decimal

Highest rate of the last 24 hours

  • l

decimal

Lowest rate of the last 24 hours

  • v

decimal

Volume of the last 24 hours

Suggest Edits

Orderbook

Returns 300 of highest bid orders and 300 of lowest ask orders.

 
gethttps://api.bitbay.net/rest/trading/orderbook/trading_pair
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/orderbook/BTC-PLN",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/orderbook/BTC-PLN',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/orderbook/BTC-PLN")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.bitbay.net/rest/trading/orderbook/BTC-PLN"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "sell": [
    {
      "ra": "25285.31",
      "ca": "0.02839638",
      "sa": "0.02839638",
      "pa": "0.02839638",
      "co": 1
    }
  ],
  "buy": [
    {
      "ra": "25280",
      "ca": "0.82618498",
      "sa": "3.59999",
      "pa": "0.82618498",
      "co": 1
    }
  ],
  "timestamp": "1529512856512"
}
{
  "status": "Fail",
  "errors": [
    "MARKET_NOT_RECOGNIZED"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair you want information about.

 

Response details

Key
Type
Description

sell / buy

array

  • ra

decimal

Rate of the order

  • ca

decimal

Current amount of cryptocurrency in the order

  • sa

decimal

Starting amount of cryptocurrency in the order

  • pa

decimal

Amount of cryptocurrency before the last change

  • co

integer

Amount of orders in the position at specific rate

timestamp

Unix Timestamp

Time of execution on server. For this time all above values are actual

Suggest Edits

Last transactions

Shows the list of most recent transactions for given market. By default returns list of 10 most recent transactions.

 
gethttps://api.bitbay.net/rest/trading/transactions/trading_pair
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/transactions/BTC-PLN",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/transactions/BTC-PLN',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/transactions/BTC-PLN")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.bitbay.net/rest/trading/transactions/BTC-PLN"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "items": [
    {
      "id": "f9ff807c-ec8d-4654-b12a-aa3f6fdcf94c",
      "t": "1529515852759",
      "a": "0.04016101",
      "r": "25111.14",
      "ty": "Sell"
    },
    {
      "id": "952d5907-f6db-4fc1-a01a-d39371233115",
      "t": "1529515819014",
      "a": "0.01491232",
      "r": "25147",
      "ty": "Buy"
    }
  ]
}
{
  "status": "Fail",
  "errors": [
    "MARKET_NOT_RECOGNIZED"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair you want information about.

Query Params

limit
int32

Limit of requested transactions. Maximum: 300.

fromTime
date-time

Time from transactions will be get.

 

Response details

Key
Type
Description

items

array

  • id

UUID

UUID of transaction

  • t

Unix Timestamp

Transaction time

  • a

decimal

Amount of cryptocurrency in the transaction

  • r

decimal

Rate of the transaction

  • ty

string

Transaction type: buy / sell

Suggest Edits

Candlestick chart

Returns candle statistics for user defined time parameters.

 
gethttps://api.bitbay.net/rest/trading/candle/history/trading_pair/resolution
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/candle/history/BTC-PLN/900?from=1543410329000&to=1543410329000",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/candle/history/BTC-PLN/900?from=1543410329000&to=1543410329000',
  headers: { 'content-type': 'application/json' },
  qs: { "from": "1514797200000", "to": "1514800800000"}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/candle/history/BTC-PLN/900?from=1543410329000&to=1543410329000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
import requests

url = "https://api.bitbay.net/rest/trading/candle/history/BTC-PLN/900?from=1543410329000&to=1543410329000"

querystring = {"from":"1514797200000","to":"1514800800000"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "items": [
    [
      "1530742800000",
      {
        "o": "25045.87",
        "c": "25046.03",
        "h": "25130.93",
        "l": "25043.59",
        "v": "0.22349329"
      }
    ],
    [
      "1530743100000",
      {
        "o": "25003.51",
        "c": "25125",
        "h": "25125",
        "l": "24960.81",
        "v": "0.15407649"
      }
    ]
  ]
}
{
  "status": "Fail",
  "errors": [
    "MARKET_NOT_RECOGNIZED"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair you want information about.

resolution
int32
required

Size of single candle (in seconds). You can find a list of available resolutions below.

Query Params

from
date-time

Get candles from specific time.

to
date-time

Get candles to specific time.

 

Available resolutions:

Resolution
Value

1 minute

60

3 minutes

180

5 minutes

300

15 minutes

900

30 minutes

1800

1 hour

3600

2 hours

7200

4 hours

14400

6 hours

21600

12 hours

43200

1 day

86400

3 days

259200

1 week

604800

Response details

Key
Type
Description

Unix Timestamp

Time of candle generation

o

decimal

Opening price

c

decimal

Closing price

h

decimal

Highest price

l

decimal

Lowest price

v

decimal

Volume

Suggest Edits

Authentication

 

To perform a valid authentication you need to use API public and secret keys to generate a sign.
Firstly, generate keys on this page: https://auth.bitbay.net/settings/api. Please pay attention to grant only permissions that are necessary for your application. Do not grant all permissions.

In the next step you need to generate specified headers that will be used to perform call to private endpoint.

Header
Description

API-Key

Public API key

API-Hash

HMAC("SHA512", public_key + current_timestamp + JSON_body_parameters, private_key)

operation-id

Disposable UUID generated for this operation

Request-Timestamp

Current time in Unix Timestamp

Content-Type

application/json

API-Hash is HMAC based hash generated for body parameters using SHA512 algorithm and your private key to sign. It contains following data:

  • Public key
  • Current timestamp for operation
  • Body parameters in JSON format
  • Private key to sign (in some libraries it will be additional parameter)

Example authorization headers and generation examples:

API-Key: 12345f6f-1b1d-1234-a973-a10b1bdba1a1
API-Hash: 8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720
operation-id: 78539fe0-e9b0-4e4e-8c86-70b36aa93d4f
Request-Timestamp: 1529897422
Content-Type: application/json
<?php

$pubkey  = '48249e33-fbad-4805-a752-a82fe216e933';
$privkey = '12cd3901-1d4f-4b24-82ef-fbbc36638b7c';


function GetUUID($data)
{
    assert(strlen($data) == 16);
    $data[6] = chr(ord($data[6]) & 0x0f | 0x40);
    $data[8] = chr(ord($data[8]) & 0x3f | 0x80);
    return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}

$body    = json_encode($body);
$time    = time();
$sign    = hash_hmac("sha512", $pubkey . $time . $body, $privkey);
$headers = array(
    'API-Key: ' . $pubkey,
    'API-Hash: ' . $sign,
    'operation-id: ' . GetUUID(random_bytes(16)),
    'Request-Timestamp: ' . $time,
    'Content-Type: application/json'
);
'use strict'

const uuidv4 = require('uuid/v4');
const crypto = require('crypto');

const apiKey = '48249e33-fbad-4805-a752-a82fe216e933';
const apiSecret = '12cd3901-1d4f-4b24-82ef-fbbc36638b7c';
var body = null;

function getHash(apiKey, timestamp, apiSecret, body) {
    const hmac = crypto.createHmac('sha512', apiSecret);

    if (body)
        hmac.update(apiKey + timestamp + JSON.stringify(body));
    else
        hmac.update(apiKey + timestamp);

    return hmac.digest('hex');
};

let timestamp = Date.now();
var headers = {
    'API-Key': apiKey,
    'API-Hash': getHash(apiKey, timestamp, apiSecret, body),
    'operation-id': uuidv4(),
    'Request-Timestamp': timestamp,
    'Content-Type': 'application/json'
};
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public abstract class APIHashGenerator {

  public static String gemerate(String data, String key) {

        String result = "";

        try{
            byte [] byteKey = key.getBytes("UTF-8");
            final String HMAC_SHA512 = "HmacSHA512";
            Mac sha512_HMAC = null;
            sha512_HMAC = Mac.getInstance(HMAC_SHA512);
            SecretKeySpec keySpec = new SecretKeySpec(byteKey, HMAC_SHA512);
            sha512_HMAC.init(keySpec);
            byte [] mac_data = sha512_HMAC.
                    doFinal(data.getBytes("UTF-8"));
            result = bytesToHex(mac_data);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return result;
    }
  
    private static String bytesToHex(byte[] hashInBytes) {

        StringBuilder sb = new StringBuilder();

        for (byte b : hashInBytes) {
            sb.append(String.format("%02x", b));
        }

        return sb.toString();

    }
}
 
Suggest Edits

New order

BitBay market allows you to place the following orders: limit, market, fill or kill and post only. See below for details. Each unused parameter should be assigned a null value.

 
posthttps://api.bitbay.net/rest/trading/offer/trading_pair
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/offer/BTC-PLN",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"amount\":0.45,\"rate\":23000,\"offerType\":\"sell\",\"mode\":\"limit\",\"postOnly\":false,\"fillOrKill\":false}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.bitbay.net/rest/trading/offer/BTC-PLN',
  headers: { 'content-type': 'application/json' },
  body: '{"amount":0.45,"rate":23000,"offerType":"sell","mode":"limit","postOnly":false,"fillOrKill":false}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/offer/BTC-PLN")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"amount\":0.45,\"rate\":23000,\"offerType\":\"sell\",\"mode\":\"limit\",\"postOnly\":false,\"fillOrKill\":false}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/trading/offer/BTC-PLN"

payload = "{\"amount\":0.45,\"rate\":23000,\"offerType\":\"sell\",\"mode\":\"limit\",\"postOnly\":false,\"fillOrKill\":false}"
response = requests.request("POST", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "completed": true,
  "offerId": "6388963b-1d0d-4a70-ab6b-2ada1f9c06ea",
  "transactions": [
    {
      "amount": "0.00005",
      "rate": "21980.02"
    }
  ]
}
{
  "status": "Fail",
  "errors": [
    "FUNDS_NOT_SUFFICIENT"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair that your request refers to

Body Params

amount
float
required

The amount of cryptocurrency

rate
float
required

Rate of the order

price
float

Total price of the order. Can be used only in market mode and replaces rate parameter. Proper use is presented below.

offerType
string
required

Order type: buy / sell

mode
string
required

Order mode: limit / market

postOnly
boolean

If order is postOnly

fillOrKill
boolean

If order is fillOrKill

firstBalanceId
string

UUID of the wallet for first currency from selected market. If not used - the transaction will be made using default wallet.

secondBalanceId
string

UUID of the wallet for second currency from selected market. If not used - the transaction will be made using default wallet.

 

Limit - standard method to perform order. Default view on the exchange.

Market - quick transaction. If you want to buy/sell cryptocurrency immediately. You only indicate the amount you want to spend on it, and the system automatically uses the best of the orders (at the lowest exchange rate) and exchanges funds for the digital currency you indicated.

Post only - order post only is to ensure that you always pay the MAKER commission. When you try to set up this type of order, you can be sure that it will be issued to the list of orders (orderbook) or canceled (in case of immediate transaction, which would result in collecting the TAKER commission)

Fill or Kill - order is a limit order that must be filled immediately in its entirety or it is canceled (killed). The purpose of a fill or kill order is to ensure that a position is entered instantly and at a specific price.

IOC (Immediate or Cancel) - a limit offer, which allows to buy or sell cryptocurrency immediately by selected exchange rate or more favourable. In contrast, to Fill or Kill - IOC allows to a partial realisation of your offer if it cannot be filled immediately.

If any of required parameters is unused - it shoulde be a null value.

{
  "offerType": "BUY",
  "amount": "20",
  "price": null,
  "rate": null,
  "postOnly": false,
  "mode": "market",
  "fillOrKill": false
}
{
  "offerType": "BUY",
  "amount": null,
  "price": "500",
  "rate": null,
  "postOnly": false,
  "mode": "market",
  "fillOrKill": false
}
{
  "offerType": "SELL",
  "amount": "1",
  "price": null,
  "rate": "24600",
  "postOnly": false,
  "mode": "limit",
  "fillOrKill": false
}
{
  "offerType": "BUY",
  "amount": "100",
  "price": null,
  "rate": "0.8",
  "postOnly": true,
  "mode": "limit",
  "fillOrKill": false
}
{
  "offerType": "BUY",
  "amount": "11",
  "price": null,
  "rate": "230.11",
  "postOnly": false,
  "mode": "limit",
  "fillOrKill": true
}
{
  "offerType": "SELL",
  "amount": "10",
  "price": null,
  "rate": "1.07",
  "postOnly": false,
  "mode": "limit",
  "immediateOrCancel": true
}

Response details

Key
Type
Description

completed

boolean

If the order was completed entirely

offerId

UUID

UUID of the order

transactions

array

Array of finished transactions during order execution

  • amount

decimal

Amount of cryptocurrency in the transaction

  • rate

decimal

Rate of finished transaction.

Suggest Edits

Active orders

Returns list of active orders on selected market or all available markets.

 
gethttps://api.bitbay.net/rest/trading/offer/trading_pair
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/offer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/offer',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/offer")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/trading/offer"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
   "status":"Ok",
   "items":[
      {
         "market":"BTC-PLN",
         "offerType":"Sell",
         "id":"f424817e-9910-4688-8f08-50336d88f4c6",
         "currentAmount":"0.001",
         "lockedAmount":"0.001",
         "rate":"30000",
         "startAmount":"0.001",
         "time":"1508230579837",
         "postOnly":false,
         "mode":"limit",
         "receivedAmount":"0",
         "firstBalanceId": "aa1c89b7-103a-4ad2-8002-b4a6fd03b60c",
         "secondBalanceId": "6c25f724-4b07-4a0f-bad2-8432ffc07b12"
      }
   ]
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}
 

Path Params

trading_pair
string

Optional: symbol of trading pair you want information about.

If you want to get information from specific market just use below path:
https://api.bitbay.net/rest/trading/offer/BTC-PLN

Response details

Key
Type
Description

data

array

market

string

Currency pair of the market

offerType

string

Order type: buy / sell

currentAmount

decimal

Current amount of cryptocurrency in the order

lockedAmount

decimal

Locked amount of cryptocurrency on a account

rate

decimal

Rate of the order

startAmount

decimal

Starting amount of cryptocurrency in the order

time

UNIX timestamp

Time of execution on server. For this time all above values are actual.

postOnly

boolean

True if order is postOnly.

mode

string

Order mode: limit / market

receivedAmount

decimal

Amount of received cryptocurrency

firstBalanceId

UUID

UUID of first currency from the market code.

secondBalanceId

UUID

UUID of second currency from the market code.

Suggest Edits

Cancel order

 
deletehttps://api.bitbay.net/rest/trading/offer/trading_pair/offer_id/offer_type/price
/// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/offer/BTC-PLN/71d78058-8c33-4806-871b-1493c29ba4bc/buy/23000",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.bitbay.net/rest/trading/offer/BTC-PLN/71d78058-8c33-4806-871b-1493c29ba4bc/buy/23000' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/offer/BTC-PLN/71d78058-8c33-4806-871b-1493c29ba4bc/buy/23000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication
  
import requests

url = "https://api.bitbay.net/rest/trading/offer/BTC-PLN/71d78058-8c33-4806-871b-1493c29ba4bc/buy/23000"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
	"status": "Ok",
	"errors": []
}
{
	"status": "Fail",
	"errors": [
		"OFFER_NOT_FOUND"
	]
}

Path Params

trading_pair
string
required

Symbol of trading pair.

offer_id
string
required

UUID of active order.

offer_type
string
required

Order type: buy / sell.

price
float
required

Price of the order.

 
Suggest Edits

Fee and market configuration

The method returns current fees and configuration for selected market including: minimum value of transaction and default trading wallets. Wallets can be changed using dedicated method explained below. If you want to know more about fee system please refer to the response details below.

 
gethttps://api.bitbay.net/rest/trading/config/trading_pair
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/config/BTC-PLN",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/config/BTC-PLN' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/config/BTC-PLN")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/trading/config/BTC-PLN"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status":"Ok",
  "config":{
    "buy":{
      "commissions":{
        "maker":"0.0028",
        "taker":"0.0041"
      }
    },
    "sell":{
      "commissions":{
        "maker":"0.0028",
        "taker":"0.0041"
      }
    },
    "first":{
      "balanceId":"ad9397c5-3bd9-4372-82ba-22da6a90cb56",
      "minValue":"0.00003"
    },
    "second":{
      "balanceId":"f1ed4490-54f6-450b-a87c-16f13d14a949",
      "minValue":"0.1"
    }
  }
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair you want information about.

 

Response detalis

Key
Type
Description

config

array

buy / sell

array

Arrays of fees for buy and sell orders

commissions

array

Array of fees

  • maker

decimal

Value of maker fee

  • taker

decimal

Value of taker fee

first / second

array

Arrays of minimal transaction values and assigned wallets

  • balanceId

UUID

UUID of the wallet

  • minValue

decimal

Minimal value to perform transaction

Suggest Edits

Change market configuration

This endpoint allows users to change wallets used for trading. One can change wallet for each currency traded on given market

 
posthttps://api.bitbay.net/rest/trading/config/trading_pair
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/config/BTC-PLN",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"first\":\"65049d0d-390d-4ce8-b430-3784de1a3bda\",\"second\":\"ed1c9dbc-7232-459f-9249-5846c03e5710\"}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.bitbay.net/rest/trading/config/BTC-PLN',
  headers: { 'content-type': 'application/json' },
  body: '{"first":"65049d0d-390d-4ce8-b430-3784de1a3bda","second":"ed1c9dbc-7232-459f-9249-5846c03e5710"}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/config/BTC-PLN")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"first\":\"65049d0d-390d-4ce8-b430-3784de1a3bda\",\"second\":\"ed1c9dbc-7232-459f-9249-5846c03e5710\"}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/trading/config/BTC-PLN"

payload = "{\"first\":\"65049d0d-390d-4ce8-b430-3784de1a3bda\",\"second\":\"ed1c9dbc-7232-459f-9249-5846c03e5710\"}"
response = requests.request("POST", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
	"status": "Ok",
	"errors": []
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}

Path Params

trading_pair
string
required

Symbol of trading pair.

Body Params

first
string
required

UUID of wallet for first currency.

second
string
required

UUID of wallet for second currency.

 
Suggest Edits

Error messages

 

Standard errors

Error message

MARKET_NOT_RECOGNIZED

TICKER_NOT_FOUND

NOT_RECOGNIZED_OFFER_TYPE

FUNDS_NOT_SUFFICIENT

OFFER_FUNDS_NOT_EXCEEDING_MINIMUMS

OFFER_FUNDS_SCALE_ISSUE

OFFER_COULD_NOT_BE_FILLED

OFFER_WOULD_HAVE_BEEN_PARTIALLY_FILLED

FILL_OR_KILL_COMBINED_WITH_POST_ONLY

INVALID_RESOLUTION

OFFER_NOT_FOUND

SECONDARY_AMOUNTONLY

ALLOWED_WITH_MARKET_OFFER

SELF_TRADING

PRICE_PRECISION_INVALID

USER_OFFER_COUNT_LIMIT_EXCEEDED

Invalid request errors

Error message

INVALID_REQUEST

MALFORMED_REQUEST

MARKET_CODE_CANNOT_BE_EMPTY

Trading overloaded errors

Error message

CONFIG_LOAD_TIMEOUT

SYSTEM_TIMEOUT

CORE_OVERFLOW

SYSTEM_OVERLOADED

System errors

Error message

UNKNOWN_ERROR

CONFIG_NOT_FOUND

NOT_SUPPORTED_RESULT

CANNOT_GET_REQUIRED_BALANCE

STATS_COULD_NOT_BE_LOADED

BALANCE_NOT_FOUND_OR_INCOMPATIBLE

BALANCE_NOT_FOUND

 
Suggest Edits

Transactions history

This endpoint returns a list of all finalized transactions. Offers various filtering options.

 
gethttps://api.bitbay.net/rest/trading/history/transactions
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

$params = array(
	"markets" => ["LSK-PLN"],
	"rateFrom"=> "10",
	"rateTo"=> "20",
	"userAction" => "Buy",
	"nextPageCursor" => "start"
);


curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/trading/history/transactions?query=" . urlencode(json_encode($params)),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/trading/history/transactions',
  headers: { 'content-type': 'application/json' },
  qs: {"markets":["LSK-PLN"], "rateFrom":"1", "rateTo":"20", "userAction":"Buy", "nextPageCursor":"start"}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/trading/history/transactions?query=%7B%22markets%22%3A%5B%22LSK-PLN%22%5D%2C%20%22rateFrom%22%3A%221%22%2C%20%22rateTo%22%3A%2220%22%2C%20%22userAction%22%3A%22Buy%22%2C%20%22nextPageCursor%22%3A%22start%22%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/trading/history/transactions"

querystring = '{"markets":["LSK-PLN"], "rateFrom":"1", "rateTo":"20", "userAction":"Buy", "nextPageCursor":"start"}'

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "totalRows": "31503",
  "items": [
    {
      "id": "d0e4746b-288e-4869-8107-d8277fcf4b9d",
      "market": "BTC-PLN",
      "time": "1529670604532",
      "amount": "0.01281693",
      "rate": "23572.84",
      "initializedBy": "Sell",
      "wasTaker": false,
      "userAction": "Buy",
      "offerId": "0325186f-c750-4aaa-98a2-d54e363f30bb",
      "commissionValue": "1.14"
    }
  ],
  "query": {
    "markets": [ "BTC-PLN" ],
    "limit": [],
    "offset": [],
    "fromTime": [],
    "toTime": [],
    "initializedBy": [],
    "rateFrom": [],
    "rateTo": [],
    "userAction": [],
    "nextPageCursor": [ "start" ]
  },
  "nextPageCursor": "QW9ON3cvcjk2T0lDUHdWallXVTRPRFV3WWkwelpUQTVMVFEyTXpndFlqVmtOQzA1TldJeU56RmxOR1U0WWpZL0kxc2lSVlJJTFZCTVRpSXNJakUxTWpNNU5ERXhNREkyTlRFaUxDSmpZV1U0T0RVd1lpMHpaVEE1TFRRMk16Z3RZalZrTkMwNU5XSXlOekZsTkdVNFlqWWlYUT09"
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}
 

JSON Array of Query Params

markets
array of strings

Array of markets.

rateFrom
float

Minimal rate value.

rateTo
float

Maximal rate value.

fromTime
date-time

Unix timestamp to start fetching operations from

toTime
date-time

Unix timestamp to end fetching operations

userAction
string

User role on finished transaction: buy / sell.

nextPageCursor
string

Pointer for starting page. Value of initial pointer is: start

All parameters must be sent by query in JSON format.
Use nextPageCursor parameter to go through pages. If requested parameter will be the same as received, it means that you have reached the last page.

Response details

Key
Type
Description

totalRows

integer

Total records number.

items

array

  • id

UUID

Transaction UUID.

  • market

string

Market symbol for transaction.

  • time

Unix Timestamp

Time of performed transaction.

  • amount

decimal

Amount of cryptocurrency.

  • rate

decimal

Transaction price.

  • initializedBy

string

Which side initiated the transaction: buy / sell.

  • wasTaker

boolean

True if user was taker.

  • userAction

string

User role in transaction: buy / sell.

  • offerId

UUID

Order UUID of performed transaction.

  • commissionValue

decimal

Value of charged commission.

query

array

Arrays of requested parameters.

nextPageCursor

string

Pointer to next page. If requested parameter will be the same as received, it means that you have reached the last page.

Suggest Edits

Operations history

This endpoint returns a list of all finalized operations. Offers various filtering options.

 
gethttps://api.bitbay.net/rest/balances/BITBAY/history
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

$params = paramarray (
  'balancesId' => NULL,
  'balanceCurrencies' => 
  array (
    0 => 'BTC',
  ),
  'balanceTypes' => NULL,
  'users' => NULL,
  'fromTime' => NULL,
  'toTime' => NULL,
  'limit' => '20',
  'offset' => 0,
  'types' => 
  array (
    0 => 'ADD_FOUNDS',
  ),
  'sort' => 
  array (
    0 => 
    array (
      'order' => 'DESC',
      'by' => 'time',
    ),
  ),
  'hasNextPage' => false,
  'nextPageCursor' => 'start',
)

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/balances/BITBAY/history?query=" . urlencode(json_encode($params)),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/balances/BITBAY/history',
  headers: { 'content-type': 'application/json' },
  qs: {"balancesId":null,"balanceCurrencies":["BTC"],"balanceTypes":null,"users":null,"fromTime":null,"toTime":null,"limit":"20","offset":0,"types":["ADD_FOUNDS"],"sort":[{"order":"DESC","by":"time"}],"hasNextPage":false,"nextPageCursor":"start"}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/balances/BITBAY/history?query=%7B%22balancesId%22%3Anull%2C%22balanceCurrencies%22%3A%5B%22BTC%22%5D%2C%22balanceTypes%22%3Anull%2C%22users%22%3Anull%2C%22fromTime%22%3Anull%2C%22toTime%22%3Anull%2C%22limit%22%3A%2220%22%2C%22offset%22%3A0%2C%22types%22%3A%5B%22ADD_FOUNDS%22%5D%2C%22sort%22%3A%5B%7B%22order%22%3A%22DESC%22%2C%22by%22%3A%22time%22%7D%5D%2C%22hasNextPage%22%3Afalse%2C%22nextPageCursor%22%3A%22start%22%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/balances/BITBAY/history"

querystring = '{"balancesId":null,"balanceCurrencies":["BTC"],"balanceTypes":null,"users":null,"fromTime":null,"toTime":null,"limit":"20","offset":0,"types":["ADD_FOUNDS"],"sort":[{"order":"DESC","by":"time"}],"hasNextPage":false,"nextPageCursor":"start"}'

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status":"Ok",
  "items":[
    {
      "historyId":"21607612-7b64-4e2a-bac3-22185c556183",
      "balance":{
        "id":"69d14efe-0b1b-413f-ada4-4a8a975b7d76",
        "currency":"PLN",
        "type":"FIAT",
        "userId":"b47f9af4-081d-4f5d-8cd7-9f3a1411d2e2",
        "name":"PLN"
      },
      "detailId":null,
      "time":1530265764420,
      "type":"CREATE_BALANCE",
      "value":0,
      "fundsBefore":{
        "total":null,
        "available":null,
        "locked":null
      },
      "fundsAfter":{
        "total":0,
        "available":0,
        "locked":0
      },
      "change":{
        "total":0,
        "available":0,
        "locked":0
      }
    }
  ],
  "hasNextPage":true,
  "fetchedRows":10,
  "limit":10,
  "offset":0,
  "queryTime":1,
  "totalTime":46,
  "settings":{
    "balancesId":null,
    "balanceCurrencies":[

    ],
    "balanceTypes":[

    ],
    "users":[
      "b47f9af4-081d-4f5d-8cd7-9f3a1411d2e2"
    ],
    "engine":"BITBAY",
    "fromTime":0,
    "toTime":2229729760000,
    "absValue":false,
    "fromValue":null,
    "toValue":null,
    "sort":[

    ],
    "limit":10,
    "offset":0,
    "types":null
  },
  "errors":null
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}
 

JSON Array of Query Params

balancesId
array of strings

Array of wallets UUID to get an informations about.

balanceCurrencies
array of strings

Array of currencies.

fromTime
date-time

Unix timestamp from which the operations start.

toTime
date-time

Unix timestamp for which they end.

fromValue
float

Minimal transaction price to be filtred.

toValue
float

Maximal transaction price to be filtred.

balanceTypes
string

Type of wallet: fiat / crypto.

types
array of strings

Array of operation types. The whole operations list is available below.

sort
array of objects

Array of sorting parameters: by - to which value sort by, order - type of sort: ASC/DESC.

All parameters must be sent by query in JSON format.

Response details

Key
Type
Description

items

array

historyId

UUID

Operation UUID.

balance

array

Array of data about balance.

  • id

UUID

Wallet UUID.

  • cyrrency

string

Cryptocurrency symbol.

  • type

string

Wallet type: crypto / fiat.

  • userId

UUID

User UUID.

  • name

string

Name of the wallet.

detailId

UUID

Operation detail UUID (if is available).

time

UNIX timestamp

Time of operation creation.

type

string

Operation type. The whole operations list is available below.

value

decimal

Operation value.

fundsBefore / fundsAfter / change

array

Array of parameters for wallet.

  • total

decimal

Total amount of funds.

  • avalilable

decimal

Available amount of funds.

  • locked

decimal

Locked amount of funds.

hasNextPage

boolean

True if there is a next page to fetch

fetchedRows

integer

Number of received records.

limit

integer

Limit of records per page.

settings

array

Array of received parameters to filter.

  • balancesId

array

Array of balances UUID.

  • balanceCurrencies

array

Array of currencies.

  • balanceTypes

array

Array of balance types.

  • engine

string

Wallet application: BITBAY / BITBAYPAY.

  • fromTime

Unix Timestamp

From what time get operations.

  • toTime

Unix Timestamp

To what time get operations.

  • absValue

boolean

Do apply absolute values filter
to fromValue and toValue parameters.

  • fromValue

decimal

Minimal value of cryptocurrency.

  • toValue

decimal

Minimal value of cryptocurrency.

  • sort

array

Array of parameters to sort: by - field to sort by, order - type of sort: ASC/DESC.

  • limit

integer

Limit of records for page.

  • types

array

Array types of operations. Available below.

Operation types

Key
Description

CREATE_BALANCE

Create new wallet balance.

ADD_FUNDS

Deposit on balance.

SUBTRACT_FUNDS

Withdrawal from balance.

TRANSFER_FROM

Internal transfer from balance.

TRANSFER_TO

Internal transfer to balance.

TRANSACTION_COMMISSION_OUTCOME

Fee charge for transaction.

TRANSACTION_PRE_LOCKING

Blocking funds on balance.

LOCK_FUNDS

Blocking funds on balance.

ADMIN_LOCK_FUNDS

Blocking funds on balance by admin.

UNLOCK_FUNDS

Unblocking funds.

ADMIN_UNLOCK_FUNDS

Unblocking funds by admin.

TRANSACTION_POST_INCOME

Received funds from transaction.

TRANSACTION_POST_OUTCOME

Taken funds from transaction.

ADMIN_ADD_FUNDS

Correction: received funds from admin.

ADMIN_SUBTRACT_FUNDS

Correction: taken funds by admin.

TRANSACTION_OFFER_ABORTED_RETURN

Refund funds for order cancel.

AFFILIATE_FUNDS_TRANSFER

Received funds from affiliate program.

PAY_WITHDRAW_LOCK

Locking funds before withdrawal: {name}

TRANSACTION_OFFER_COMPLETED_RETURN

Cancelling order below minimum value.

TRANSACTION_FAIL_UNLOCKING

Refund after failed make order try.

WITHDRAWAL_LOCK_FUNDS

Locking funds before withdrawal.

WITHDRAWAL_UNLOCK_FUNDS

Unlocking funds.

WITHDRAWAL_SUBTRACT_FUNDS

Funds withdrawal.

FUNDS_MIGRATION

Funds migration.

TRANSACTION_COMMISSION_RETURN

Fee refund.

ADD_FUNDS_ERROR_REFUND

Correction refund.

OLD_ADDRESS_CRYPTO_DEPOSIT

Trying to deposit to old crypto address.

FIAT_DEPOSIT_MIGRATED

Fiat funds migration.

ADMIN_WITHDRAWAL_REFUND

Funds refund after cancelling withdrawal.

SUBTRACT_FUNDS_ERROR_CORRECTION

Funds correction.

ADD_FUNDS_COMPENSATION

Funds compensation.

BITCOIN_GOLD_FORK

Funds received because of fork.

BALANCE_DEPOSIT_CORRECTION

Deposit correction.

WITHDRAWAL_CUSTOM_COMMISSION

Network withdrawal fee for.

Deprecated operations related with cards which are unavailable right now

Key

CARD_ADMISSION

CARD_ORDER

INCOME

OUTCOME

LOCK_CARD_ADMISSION

UNLOCK_CARD_ADMISSION

SUBTRACT_CARD_ADMISSION

LOCK_ORDER_COMISSION

SUBTRACT_CARD_ORDER

UNLOCK_CARD_ORDER

 
Suggest Edits

List of wallets

 
gethttps://api.bitbay.net/rest/balances/BITBAY/balance
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/balances/BITBAY/balance",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/balances/BITBAY/balance',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/balances/BITBAY/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/balances/BITBAY/balance"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
   "status":"Ok",
   "balances":[
      {
         "id": "01931d52-536b-4ca5-a9f4-be28c86d0cc3",
         "userId": "4bc43956-423f-47fd-9faa-acd37c58ed9f",
         "availableFunds": 9830.28785615,
         "totalFunds": 9840.28785615,
         "lockedFunds": 10.00000000,,
         "currency":"ETH",
         "type":"CRYPTO",
         "name":"Domyślny rachunek ETH",
         "balanceEngine":"BITBAY"
      },
...
   ],
   "errors":null
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}
 

Response details

Key
Type
Description

balances

array

id

UUID

Wallet UUID.

userId

UUID

User UUID.

availableFunds

decimal

Amount of available funds.

totalFunds

decimal

Total amount of funds.

lockedFunds

decimal

Amount of locked funds.

currency

string

Currency symbol.

type

string

Currency type: CRYPTO / FIAT.

name

string

Wallet name.

balanceEngine

string

Wallet application: BITBAY / BITBAYPAY.

Suggest Edits

New wallet

This method allows users to create additional wallets for given currency. Each currency can have up to 10 custom wallets along with 1 default wallet (11 in total).

 
posthttps://api.bitbay.net/rest/balances/BITBAY/balance
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/balances/BITBAY/balance",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"currency\":\"BTC\",\"type\":\"crypto\",\"name\":\"oszczednosci\"}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.bitbay.net/rest/balances/BITBAY/balance',
  headers: { 'content-type': 'application/json' },
  body: '{"currency":"BTC","type":"crypto","name":"oszczednosci"}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/balances/BITBAY/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"currency\":\"BTC\",\"type\":\"crypto\",\"name\":\"oszczednosci\"}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/balances/BITBAY/balance"

payload = "{\"currency\":\"BTC\",\"type\":\"crypto\",\"name\":\"oszczednosci\"}"
response = requests.request("POST", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status":"Ok",
  "items":[
    {
      "historyId":"21607612-7b64-4e2a-bac3-22185c556183",
      "balance":{
        "id":"69d14efe-0b1b-413f-ada4-4a8a975b7d76",
        "currency":"PLN",
        "type":"FIAT",
        "userId":"b47f9af4-081d-4f5d-8cd7-9f3a1411d2e2",
        "name":"PLN"
      },
      "detailId":null,
      "time":1530265764420,
      "type":"CREATE_BALANCE",
      "value":0,
      "fundsBefore":{
        "total":null,
        "available":null,
        "locked":null
      },
      "fundsAfter":{
        "total":0,
        "available":0,
        "locked":0
      },
      "change":{
        "total":0,
        "available":0,
        "locked":0
      }
    }
  ],
  "hasNextPage":true,
  "fetchedRows":10,
  "limit":10,
  "offset":0,
  "queryTime":1,
  "totalTime":46,
  "settings":{
    "balancesId":null,
    "balanceCurrencies":[

    ],
    "balanceTypes":[

    ],
    "users":[
      "b47f9af4-081d-4f5d-8cd7-9f3a1411d2e2"
    ],
    "engine":"BITBAY",
    "fromTime":0,
    "toTime":2229729760000,
    "absValue":false,
    "fromValue":null,
    "toValue":null,
    "sort":[

    ],
    "limit":10,
    "offset":0,
    "types":null
  },
  "errors":null
}
{
  "status": "Fail",
  "errors": [
    "BALANCE_COUNT_LIMIT_EXCEEDED"
  ]
}

Body Params

currency
string

Currency symbol.

type
string

Currency type: CRYPTO / FIAT.

name
string

Name for new wallet.

 

Response details

Key
Type
Description

balance

array

id

UUID

Wallet UUID.

userId

UUID

User UUID.

availableFunds

decimal

Amount of available funds.

totalFunds

decimal

Total amount of funds.

lockedFunds

decimal

Amount of locked funds.

currency

string

Currency symbol.

type

string

Currency type: CRYPTO / FIAT.

name

string

Name for new wallet.

balanceEngine

string

Wallet application: BITBAY / BITBAYPAY.

Suggest Edits

Change name

Provides the option to change the name of the previously created wallet. It is not possible to change the main wallet name.

 
puthttps://api.bitbay.net/rest/balances/BITBAY/balance/wallet_id
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/balances/BITBAY/balance/9c196289-fdbe-4a60-b89a-43594f8eae3c",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"name\":\"trading\"}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.bitbay.net/rest/balances/BITBAY/balance/9c196289-fdbe-4a60-b89a-43594f8eae3c',
  body: { name: 'trading' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/balances/BITBAY/balance/9c196289-fdbe-4a60-b89a-43594f8eae3c")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.body = "{\"name\":\"trading\"}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/balances/BITBAY/balance/9c196289-fdbe-4a60-b89a-43594f8eae3c"



payload = "{\"name\":\"trading\"}"
response = requests.request("PUT", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
   "status":"Ok",
   "message":null
}
{
   "status":"Fail",
   "errors": [
    "MALFORMED_REQUEST"
  ]
}

Path Params

wallet_id
string
required

UUID of the wallet to change.

Body Params

name
string

New name for specified wallet.

 

Response details

Key
Type
Description

message

string

Response message. Default: null.

Suggest Edits

Internal transfer

It provides a convenient way to send funds between your own wallets.

 
posthttps://api.bitbay.net/rest/balances/BITBAY/balance/transfer/source_id/destination_id
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/balances/BITBAY/balance/transfer/be7ddc36-e048-4f1f-b2f2-4c63de20caa6/4e76ee66-572f-476e-b769-b89a17319d68",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"currency\":\"BTC\",\"funds\":0.5}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.bitbay.net/rest/balances/BITBAY/balance/transfer/be7ddc36-e048-4f1f-b2f2-4c63de20caa6/4e76ee66-572f-476e-b769-b89a17319d68',
  headers: { 'content-type': 'application/json' },
  body: '{"currency":"BTC","funds":0.5}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/balances/BITBAY/balance/transfer/be7ddc36-e048-4f1f-b2f2-4c63de20caa6/4e76ee66-572f-476e-b769-b89a17319d68")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"currency\":\"BTC\",\"funds\":0.5}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/balances/BITBAY/balance/transfer/be7ddc36-e048-4f1f-b2f2-4c63de20caa6/4e76ee66-572f-476e-b769-b89a17319d68"

payload = "{\"currency\":\"BTC\",\"funds\":0.5}"
response = requests.request("POST", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
   "status":"Ok",
   "from":{
      "id":"ad9397c5-3bd9-4372-82ba-22da6a90cb56",
      "userId":"4bc43956-423f-47fd-9faa-acd37c58ed9f",
      "availableFunds":0.01803472,
      "totalFunds":0.01804161,
      "lockedFunds":0.00000689,
      "currency":"BTC",
      "type":"CRYPTO",
      "name":"BTC",
      "balanceEngine":"BITBAY"
   },
   "to":{
      "id":"01931d52-536b-4ca5-a9f4-be28c86d0cc3",
      "userId":"4bc43956-423f-47fd-9faa-acd37c58ed9f",
      "availableFunds":0.00010000,
      "totalFunds":0.00010000,
      "lockedFunds":0E-8,
      "currency":"BTC",
      "type":"CRYPTO",
      "name":"Prowizja",
      "balanceEngine":"BITBAY"
   },
   "errors":null
}
{
  "status": "Fail",
  "errors": [
    "MALFORMED_REQUEST"
  ]
}

Path Params

source_id
string
required

Source UUID of the wallet.

destination_id
string
required

Destination UUID of the wallet.

Body Params

currency
string

Currency symbol.

funds
string

Amount of funds to send.

 

Response details

Key
Type
Description

from / to

array

Arrays of data for source and destination wallets.

id

UUID

Wallet UUID.

userId

UUID

User UUID.

availableFunds

decimal

Amount of available funds.

totalFunds

decimal

Total amount of funds.

lockedFunds

decimal

Amount of locked funds.

currency

string

Currency symbol.

type

string

Currency type: CRYPTO / FIAT.

name

string

Wallet name.

balanceEngine

string

Wallet application: BITBAY / BITBAYPAY.

Suggest Edits

FIAT Cantor

 
Suggest Edits

Current rate

Return actual rate for chosen currency pair.

 
gethttps://api.bitbay.net/rest/fiat_cantor/rate/currency1/currency2
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/fiat_cantor/rate/PLN/EUR",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/fiat_cantor/rate/PLN/EUR',
  headers: { 'content-type': 'application/json' },
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/fiat_cantor/rate/PLN/EUR")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/fiat_cantor/rate/PLN/EUR"

headers = {'content-type': 'application/json'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "message": null,
  "currency1": "PLN",
  "currency2": "EUR",
  "rate": 4.2936
}
{
  "status": "Fail",
  "errors": [
    "PERMISSIONS_NOT_SUFFICIENT"
  ]
}

Path Params

currency1
string
required

First currency that we want to exchange.

currency2
string
required

Second currency which will be obtained from exchange.

 

Response details

Key
Type
Description

currency1

string

First currency that we want to exchange.

currency2

string

Second currency which will be obtained from exchange.

rate

decimal

Current rate.

Suggest Edits

Exchange

Perform exchange on chosen currency pair.

 
posthttps://api.bitbay.net/rest/fiat_cantor/exchange
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/fiat_cantor/exchange",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"currency1BalanceId\":\"c3b1d15b-3c94-4ed1-9010-0f538bbf17f7\",\"currency2BalanceId\":\"1a9ceaec-ddda-45e0-a1e8-ca8a82a625f8\",\"currency1\":\"EUR\",\"currency2\":\"PLN\",\"amount\":10,\"rate\":4.2935}",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.bitbay.net/rest/fiat_cantor/exchange',
  headers: { 'content-type': 'application/json' },
  body: '{"currency1BalanceId":"c3b1d15b-3c94-4ed1-9010-0f538bbf17f7","currency2BalanceId":"1a9ceaec-ddda-45e0-a1e8-ca8a82a625f8","currency1":"EUR","currency2":"PLN","amount":10,"rate":4.2935}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/fiat_cantor/exchange")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\"currency1BalanceId\":\"c3b1d15b-3c94-4ed1-9010-0f538bbf17f7\",\"currency2BalanceId\":\"1a9ceaec-ddda-45e0-a1e8-ca8a82a625f8\",\"currency1\":\"EUR\",\"currency2\":\"PLN\",\"amount\":10,\"rate\":4.2935}"

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/fiat_cantor/exchange"

payload = "{\"currency1BalanceId\":\"c3b1d15b-3c94-4ed1-9010-0f538bbf17f7\",\"currency2BalanceId\":\"1a9ceaec-ddda-45e0-a1e8-ca8a82a625f8\",\"currency1\":\"EUR\",\"currency2\":\"PLN\",\"amount\":10,\"rate\":4.2935}"
response = requests.request("POST", url, data=payload)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "message": null,
  "amount": 42.93
}
{
  "status": "Fail",
  "errors": [
    "RATE_CHANGED"
  ]
}

Body Params

currency1BalanceId
string
required

Wallet UUID of the first currency.

currency2BalanceId
string
required

Wallet UUID of the second currency.

currency1
string
required

First currency that we want to exchange.

currency2
string
required

Second currency which will be obtained from exchange.

amount
string
required

Amount of first currency to exchange.

rate
string
required

Current exchange rate for currency pair. Must be obtained from current rate endpoint.

 

Response details

Key
Type
Description

amount

decimal

Amount of obtained funds in second currency.

If rate will be changed during the exchange:

  • for favor: the exchange will be performed by better rate
  • for adverse: the exchange will be aborted with error:
    {"status":"Fail","errors":["RATE_CHANGED"]}
Suggest Edits

History

Return historical data of performed exchanges.

 
gethttps://api.bitbay.net/rest/fiat_cantor/history
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

<?php

$curl = curl_init();

$params = array (
  'page' => 1,
  'limit' => 10,
  'markets' => 
  array (
    0 => 'PLNEUR',
    1 => 'PLNUSD',
    2 => 'EURPLN',
    3 => 'EURUSD',
    4 => 'USDPLN',
    5 => 'USDEUR',
  ),
);


curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.bitbay.net/rest/fiat_cantor/history?params=" . urlencode(json_encode($params)),
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
// This is a private endpoint which requires authentication headers.
// See how to create a valid headers:
// https://docs.bitbay.net/v1.0.0-en/reference#authentication

var request = require("request");

var options = { method: 'GET',
  url: 'https://api.bitbay.net/rest/fiat_cantor/history?params=',
  headers: { 'content-type': 'application/json' },
  qs: {"page":1,"limit":2,"markets":["PLNEUR","PLNUSD","EURPLN","EURUSD","USDPLN","USDEUR"]}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

require 'uri'
require 'net/http'

url = URI("https://api.bitbay.net/rest/fiat_cantor/history?params=")
params = { :page => "1", :limit => "2", :markets => "PLNEUR" }
url.query = URI.encode_www_form( params )

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
# This is a private endpoint which requires authentication headers.
# See how to create a valid headers:
# https://docs.bitbay.net/v1.0.0-en/reference#authentication

import requests

url = "https://api.bitbay.net/rest/fiat_cantor/history"

querystring = '{"page":1,"limit":2,"markets":["PLNEUR","PLNUSD","EURPLN","EURUSD","USDPLN","USDEUR"]}'

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": "Ok",
  "message": null,
  "hasNextPage": true,
  "items": [
    {
      "time": 1538139352000,
      "currency1": "EUR",
      "currency2": "PLN",
      "amountGiven": 250000,
      "amountReceived": 1062900,
      "rate": 4.2516,
      "userId": "b2f415cc-c71a-406b-bcf0-bbbba4b196b9",
      "status": "finished"
    },
    {
      "time": 1534257506000,
      "currency1": "EUR",
      "currency2": "PLN",
      "amountGiven": 16897.56,
      "amountReceived": 71995.43,
      "rate": 4.2607,
      "userId": "b2f415cc-c71a-406b-bcf0-bbbba4b196b9",
      "status": "finished"
    }
  ]
}
{
  "status": "Fail",
  "errors": [
    "NO_MARKETS_GIVEN"
  ]
}
 

JSON Array of Query Params

page
int32

Page to fetch.

limit
int32

Amount of records on single page.

markets
array of strings

Array of currency pairs to fetch.

fromTime
int32

Unix timestamp from which the operations start.

toTime
date-time

Unix timestamp for which operations end.

Response details

Key
Type
Description

hasNextPage

boolean

True if there is a next page to fetch.

items

array

Array of performed exchanges.

  • time

Unix Timestamp

Time of performed exchange.

  • currency1

string

First currency - given.

  • currency2

string

Second currency - obtained.

  • amountGiven

decimal

Given amount of first currency.

  • amountReceived

decimal

Received amount of second currency.

  • rate

decimal

Rate of performed exchange.

  • userId

UUID

UUID of our user.

  • status

string

Status of performed exchange. Finished by default.

Suggest Edits

Error messages

 

Exchange

Error message

BALANCE_EXCEPTION

FUNDS_NOT_SUFFICIENT

EXTERNAL_API_EXCEPTION

RATE_CHANGED

INVALID_BALANCE_ID

AMOUNT_TOO_LOW

INVALID_AMOUNT_PRECISION

History

Error message

LIMIT_TOO_BIG_EXCEPTION

NO_MARKETS_GIVEN

Suggest Edits

Subscription

 

ConnectionClosed

We are using external proxy service called CloudFlare. To deliver best and reliable services our provider is changing routing policy few times per day. This might cause instantaneous lost of connection on WebSocket channel. We recommend to consider and solve such situations at the beginning of developing own application.

Secured Websocket URI:

wss://api.bitbay.net/websocket/

To perform a public subscription, you need to send: action subscribe-public, module and path to endpoint. Required format is JSON. This type of connection do not require any additional parameters.
To cancell subscription - just send action unsubscribe with previous module and path. This will close all active channels.

{
 "action": "subscribe-public",
 "module": "trading",
 "path": "ticker"
}
{
 "action": "unsubscribe",
 "module": "trading",
 "path": "ticker"
}

Snapshot

All of the presented public endpoints allows to catch a snapshot.
It is performed by action proxy to REST API endpoint. All of the REST API endpoints of type GET could be snapshotted. In this type of request you need to sent additional parameter: requestID, which is disposable UUID of the request.

{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "ticker/btc-pln",
}
{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "statusCode": 200,
  "body": {
    "status": "Ok",
    "ticker": {
      "market": {
        "code": "BTC-PLN",
        "first": {
          "currency": "BTC",
          "minOffer": "0.00003",
          "scale": 8
        },
        "second": {
          "currency": "PLN",
          "minOffer": "0.1",
          "scale": 2
        }
      },
      "time": "1530796785036",
      "highestBid": "24720.98",
      "lowestAsk": "24739.97",
      "rate": "24739.99",
      "previousRate": "24730.13"
    }
  }
}
Suggest Edits

Ping

Using this one you can implement a heartbeat system to check if the connection is still alive.

 
{
  "action": "ping"
}
{
  "action": "pong"
}
 
Suggest Edits

Ticker

To access a general view of configurations and statistics for given market or groups of markets user is required to attach the market code. Ticker displays update of the value of the smallest transaction available and precision (number of decimal places) for each currency traded on selected market. Ticker also returns current best buy and sell order along with the price of most recent and next most recent transaction.

 

If you want to get information from all markets just use path without market symbol:
"path": "ticker"

{
 "action": "subscribe-public",
 "module": "trading",
 "path": "ticker/btc-eur"
}
{
	"market": {
		"code": "BTC-EUR",
		"first": {
			"currency": "BTC",
			"minOffer": "0.00003",
			"scale": 8
		},
		"second": {
			"currency": "EUR",
			"minOffer": "0.1",
			"scale": 2
		}
	},
	"time": "1519758072515",
	"highestBid": "5000.08",
	"lowestAsk": "5200.89",
	"rate": "5100.08",
	"previousRate": "5098.14"
}
{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "ticker/btc-eur",
}

Response details:

Key
Type
Description

ticker

array

code

string

Currency pair for request.

first / second

array

Arrays of data from first and second currency pair.

  • currency

string

Currency symbol.

  • minOffer

decimal

Minimal value of currency that you could order.

  • scale

integer

Decimal precision.

time

Unix Timestamp

Time of execute on server. For this time all values are actual.

highestBid

decimal

The best price for buy order at the moment.

lowestAsk

decimal

The best price for sell order at the moment.

rate

decimal

Price of the last transaction.

previousRate

decimal

Price of the penultimate transaction.

Suggest Edits

Market statistics

This subscription is updating market statistics from last 24 hours: highest/lowest order and volume. Applies to selected market or all markets if market code parameter is left blank.

 

If you want to get information from all markets just use path without market symbol:
"path": "stats"

{
 "action": "subscribe-public",
 "module": "trading",
 "path": "stats/game-eur"
}
{
	"m": "GAME-EUR",
	"h": 1.99,
	"l": 1.7,
	"v": 15056.97671429
}
{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "stats/game-eur",
}

Response details

Key
Type
Description

stats

array

m

string

Currency pair of the market.

h

decimal

Highest price of the last 24 hours.

l

decimal

Lowest price of the last 24 hours.

v

decimal

Volume of the last 24 hours.

Suggest Edits

Orderbook

Updates of orders from orderbook.

 
{
 "action": "subscribe-public",
 "module": "trading",
 "path": "orderbook/btc-pln"
}
{
	"changes": [
		{
			"marketCode": "BTC-PLN",
			"entryType": "Buy",
			"rate": "15218.08",
			"action": "remove"
		},
		{
			"marketCode": "BTC-PLN",
			"entryType": "Sell",
			"rate": "15218.08",
			"action": "update",
			"state": {
				"ra": "15218.08",
				"ca": "1",
				"sa": "1",
				"pa": "1",
				"co": 1
			}
		}
	],
	"timestamp": "1519758072517"
}
{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "orderbook/btc-pln"",
}

Response details

Key
Type
Description

changes

array

mmarketCode

string

Symbol of the market.

entryType

string

Order type: buy / sell.

rate

decimal

Price of the order.

action

string

Type of change: remove / update. If update will occur you are going to get additional array of state.

state

array

Optional array for active orders.

  • ra

decimal

Price of the order.

  • ca

decimal

Current amount of cryptocurrency in the order.

  • sa

decimal

Starting amount of cryptocurrency in the order.

  • pa

decimal

Amount of cryptocurrency before the last change.

  • co

decimal

Amount of orders in the order.

timestamp

Unix Timestamp

Time of execute on server. For this time all above values are actual.

Suggest Edits

Last transactions

Get current transactions.

 
{
 "action": "subscribe-public",
 "module": "trading",
 "path": "transactions/btc-pln"
}
{
	"transactions": [
		{
			"id": "c99475e2-f08b-402e-a767-40723b38acc8",
			"t": "1519758072352",
			"a": "0.18413273",
			"r": "15218.08",
			"ty": "Sell"
		}
	]
}
{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "transactions/btc-pln",
}

Response details

Key
Type
Description

items

array

id

UUID

UUID of transaction.

t

Unix Timestamp

Transaction time.

a

decimal

Amount of cryptocurrency in the transaction.

r

decimal

Price of the transaction.

ty

string

Transaction type: buy / sell.

Suggest Edits

Subscription

 

ConnectionClosed

We are using external proxy service called CloudFlare. To deliver best and reliable services our provider is changing routing policy few times per day. This might cause instantaneous lost of connection on WebSocket channel. We recommend to consider and solve such situations at the beginning of developing own application.

Secured Websocket URI:

wss://api.bitbay.net/websocket/

To perform a valid private subscription, you need to send: action subscribe-private, module, path and required authentication parameters to the endpoint. Required format is JSON.
To cancell subscription - just send action unsubscribe with previous module and path. This will close all active channels.

Required parameters for authenctication:

Key
Description

hashSignature

HMAC("SHA512", public_key + current_timestamp, private_key)

publicKey

Public API key.

requestTimestamp

Current time in Unix Timestamp.

{
 "action": "subscribe-private",
 "module": "trading",
 "path": "offer",
 "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
 "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
 "requestTimestamp": 1529897422
}
{
 "action": "unsubscribe",
 "module": "trading",
 "path": "offer",
}
{
	"error": "Authentication failed"
}

Snapshot

Some of the endpoints allows to catch a snapshot.
In this case we need to use action proxy to specific module and path.
In private connection also additional parameters are required:

  • requestId - UUID value of our request
  • queryString - optional - query string, required only in specified endpoints
{
	"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
	"action": "proxy",
	"module": "trading",
	"path": "history/transactions",
	"queryString": "markets=BTC-PLN&rateFrom=23000",
	"hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
	"publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
	"requestTimestamp": 1529897422
}
{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "statusCode": 200,
  "body": {
    "status": "Ok",
    "totalRows": "31503",
    "items": [
      {
        "id": "d0e4746b-288e-4869-8107-d8277fcf4b9d",
        "market": "BTC-PLN",
        "time": "1529670604532",
        "amount": "0.01281693",
        "rate": "23572.84",
        "initializedBy": "Sell",
        "wasTaker": false,
        "userAction": "Buy"
      }
    ],
    "query": {
      "markets": [
        "BTC-PLN"
      ],
      "limit": [],
      "offset": [],
      "fromTime": [],
      "toTime": [],
      "initializedBy": [],
      "rateFrom": 2300,
      "rateTo": [],
      "userAction": [],
      "nextPageCursor": [
        "start"
      ]
    },
    "nextPageCursor": "QW9ON3cvcjk2T0lDUHdWallXVTRPRFV3WWkwelpUQTVMVFEyTXpndFlqVmtOQzA1TldJeU56RmxOR1U0WWpZL0kxc2lSVlJJTFZCTVRpSXNJakUxTWpNNU5ERXhNREkyTlRFaUxDSmpZV1U0T0RVd1lpMHpaVEE1TFRRMk16Z3RZalZrTkMwNU5XSXlOekZsTkdVNFlqWWlYUT09"
  }
}
 
Suggest Edits

Active orders

Monitor status of active orders.

 

If you want to get orders from all markets just use path without market symbol:
"path": "offers"

{
 "action": "subscribe-private",
 "module": "trading",
 "path": "offers/btc-pln",
 "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422
}
{
	"entryType": "Sell",
	"rate": "15929.85",
	"action": "update",
	"offerId": "94a4f38d-8bfd-4cfe-9ade-607e84cff262",
	"market": "BTC-PLN",
	"state": {
		"market": "BTC-PLN",
		"offerType": "Sell",
		"id": "94a4f38d-8bfd-4cfe-9ade-607e84cff262",
		"currentAmount": "0.61118341",
		"lockedAmount": "0.61118341",
		"rate": "15929.85",
		"startAmount": "1",
		"time": "1521405521083",
		"postOnly": false,
		"hidden": false,
		"mode": "limit",
		"receivedAmount": "6193.78"
	}
}
{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "action": "proxy",
  "module": "trading",
  "path": "history/transactions",
  "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422
}

Response details

Key
Type
Description

entryType

array

Order type: buy / sell.

rate

decimal

Price of the order.

action

string

Type of change: remove / update.

offerId

UUID

Order UUID.

market

string

Symbol of the market.

state

array

Array of detailed informations about order.

  • market

string

Symbol of the market.

  • offerType

string

Order type: buy / sell.

  • id

UUID

Order UUID.

  • currentAmount

decimal

Current amount of cryptocurrency in the order.

  • lockedAmount

decimal

Locked amount of cryptocurrency on a account.

  • rate

decimal

Price of the order.

  • startAmount

decimal

Starting amount of cryptocurrency in the order.

  • time

UNIX timestamp

Time of execute on server. For this time all above values are actual.

  • postOnly

boolean

Do order is postOnly.

  • mode

string

Order mode: limit / market.

  • receivedAmount

decimal

Amount of receive cryptocurrency.

 
Suggest Edits

Available funds

Show updates of funds.

 
{
 "action": "subscribe-private",
 "module": "balances",
 "path": "balance/bitbay/updatefunds",
 "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422
}
{
	"id": "60536b59-3fb2-4a8a-ad51-1ef880213da7",
	"userId": "578a2540-8594-4162-8742-26de0c568443",
	"availableFunds": 58934.53,
	"totalFunds": 58934.53,
	"lockedFunds": 0,
	"currency": "PLN",
	"type": "FIAT",
	"name": "Zaa",
	"balanceEngine": "BITBAY"
}

Response details

Key
Type
Description

id

UUID

Wallet UUID.

userId

UUID

User UUID.

availableFunds

decimal

Amount of available funds.

totalFunds

decimal

Total amount of funds.

lockedFunds

decimal

Amount of locked funds.

currency

string

Currency symbol.

type

string

Currency type: CRYPTO / FIAT.

name

string

Wallet name.

balanceEngine

string

Wallet application: BITBAY / BITBAYPAY.

 
Suggest Edits

Transactions history

 

To get a messages from every market - just subscribe on path: history/transactions

{
 "action": "subscribe-private",
 "module": "trading",
 "path": "history/transactions/xrp-pln",
 "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422 
}
{
	"id": "38f29b80-f5ae-48d3-9846-723e45f4ba71",
	"market": "XRP-PLN",
	"time": "1530812763363",
	"amount": "1",
	"rate": "1.77",
	"initializedBy": "Sell",
	"wasTaker": true,
	"userAction": "Sell"
}
{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "action": "proxy",
  "module": "trading",
  "path": "history/transactions",
  "queryString": "markets=BTC-PLN&rateFrom=23000",
  "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422
}

Snapshot Query Params

markets
array of strings

Array of markets.

rateFrom
float

Minimal price value.

rateTo
float

Maximal price value.

fromTime
date-time

Unix timestamp from which the operations start.

toTime
date-time

Unix timestamp for which they end.

userAction
string

User role on finished transaction: buy / sell.

nextPageCursor
string

Pointer for starting page. Value of initial pointer is: start

Snapshot response details are the same as for GET trading/history/transactions.

Response details

Key
Type
Description

id

UUID

Transaction UUID.

market

string

Market symbol for transaction.

time

UNIX timestamp

Time of performed transaction.

amount

decimal

Amount of cryptocurrency.

rate

decimal

Transaction price.

initializedBy

string

Which side initiated the transaction: buy / sell.

wasTaker

boolean

Do user is taker.

userAction

string

User role in transaction: buy / sell.

Suggest Edits

Operations history

 

This specified endpoint is available only by proxy action.

{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "action": "proxy",
  "module": "balances",
  "path": "bitbay/history",
  "queryString": "balanceCurrencies=BTC",
  "hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
  "publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
  "requestTimestamp": 1529897422
}
{
  "requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
  "statusCode": 200,
  "body": {
    "status": "Ok",
    "items": [
      {
        "historyId": "3dd7ad49-cb5c-4cd7-828a-8a14db017355",
        "balance": {
          "id": "6d1e6463-a4b5-440e-8d69-83154afce7d0",
          "currency": "LSK",
          "type": "CRYPTO",
          "userId": "578a2540-8594-4162-8742-26de0c568443",
          "name": "Domyślny rachunek LSK"
        },
        "detailId": "8b5dcabf-5a58-4834-9cf5-00b140d3b22c",
        "time": 1521458695099,
        "type": "TRANSACTION_POST_OUTCOME",
        "value": -1435.25890556,
        "fundsBefore": {
          "total": 10000,
          "available": 8564.74109444,
          "locked": 1435.25890556
        },
        "fundsAfter": {
          "total": 8564.74109444,
          "available": 8564.74109444,
          "locked": 0
        },
        "change": {
          "total": -1435.25890556,
          "available": 0,
          "locked": -1435.25890556
        }
      }
    ],
    "hasNextPage": true,
    "fetchedRows": 20,
    "limit": 20,
    "offset": 0,
    "queryTime": 1,
    "totalTime": 5,
    "settings": {
      "balancesId": null,
      "balanceCurrencies": [
        "BTC"
      ],
      "users": [
        "578a2540-8594-4162-8742-26de0c568443"
      ],
      "getHidden": false,
      "engine": "BITBAY",
      "fromTime": 0,
      "toTime": 2229729760000,
      "absValue": false,
      "fromValue": null,
      "toValue": null,
      "sort": [
        {
          "by": "time",
          "order": "DESC"
        }
      ],
      "limit": 20,
      "offset": 0,
      "types": null
    },
    "errors": null
  }
}

Snapshot Query Params

balancesId
array of strings

Array of wallets UUID to get an informations about.

balanceCurrencies
array of strings

Array of currencies.

fromTime
date-time

Unix timestamp from which the operations start.

toTime
date-time

Unix timestamp for which they end.

fromValue
float

Minimal transaction price to be filtred.

toValue
float

Maximal transaction price to be filtred.

balanceTypes
string

Type of wallet: fiat / crypto.

types
array of strings

Array of operation types. The whole operations list is available below.

sort
array of objects

Array of sorting parameters: by - to which value sort by, order - type of sort: ASC/DESC.

Response details are the same as for GET balances/BITBAY/history.