NAV
shell

Introduction

Welcome to the Bitwyre API!

All API URLs should use the base URL https://api.bitwyre.com for REST, and wss://api.bitwyre.com/ws for Websocket.

We have APIs for REST Public, REST Private, Websocket Public, and Websocket Private.

All endpoints returns either a JSON object or array along with some error messages (REST only, if any).

REST APIs

Example: REST On success

{
  "error": [],
  "result": {"some array or object of result(s)"}
}

Example: REST On error

{
  "error": ["some (array) of error message(s)"],
  "result": {}
}

Websocket APIs

All of the examples are using Websocat, to install it you need Rust's Cargo and execute cargo install --features=ssl websocat.

By its responses, both Public & Private, Websocket APIs both Public and Private can be categorized as:

Authentication

Bitwyre uses HTTP Header authentication to allow access to the Private API.

REST Private API Request Headers

Example: REST GET private/account/balance

curl "https://api.bitwyre.com/private/orders" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"cd94e66609492952b26a4f3b29949d58548e9bd5e7bdd72598e441c6a57e57f4\",\
        \"payload\": {\
          \"pair\": \"btc_idr\",\
          \"type\": \"buy\",\
          \"ordertype\": \"limit\",\
          \"price\": \"125000000\",\
          \"volume\": \"500000\"\
        }\
      }"

Make sure to fill all fields with the correct ones.

All Private API endpoints expects for the following headers to be included in all API requests:

Header Key Data Type Required Remark
"API-Key" string true unique API-Key bounded to a user, see API Key.
"API-Sign" string true request signature, see API Sign.
"Content-type" string varies always application/json for POST & DELETE

API Key

You can get a new Bitwyre API key pairs (api-key and api-secret) at our developer portal.

API Sign

The signature, we call it API-Sign, is created using HMAC-SHA512 of (URI path + SHA256(nonce + checksum)) and api-secret, see REST Private API Data.

The URI path is the endpoint path, e.g /private/orders.

REST Private API Request Data

All Private API endpoints expect for the follow json data structure (form/query url for GET) to be included in all API requests:

JSON Field Data Type Required Remark
"nonce" big-integer true always increasing unsigned 64 bit integer, see Cryptographic Nonce.
"checksum" string true SHA256 hash of "payload".
"payload" json-object/json-array varies endpoint specific request payload data.

Websocket Private API Request Data

Example: Websocket Subscribe Request (Note: minify the json request for websocat)

websocat -E wss://api.bitwyre.com/ws/private/orders
>{
  "command": "create",
  "nonce": 1573882687533732677,
  "checksum": "cd94e66609492952b26a4f3b29949d58548e9bd5e7bdd72598e441c6a57e57f4",
  "api_key": "user_apikey",
  "api_sign": "request_signature",
  "payload": {
    "pair": "btc_idr_spot",
    "type": "buy",
    "ordertype": "limit",
    "price": "125000000",
    "volume": "500000"
  }
}

The Websocket Private API expects no HTTP Headers, bellow json data structure is needed for any secure request.

JSON Field Data Type Required Remark
"command" string true endpoint specific command.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object/array true endpoint specific request payload data.

Public API

Server Time

Request

curl "https://api.bitwyre.com/public/time" -X GET

Response

{
    "error": [],
    "result": {
        "unixtime": 1571744594571020435
    }
}

Returns server's time.

This helps in approximating the time difference between the server and client.

Endpoint

https://api.bitwyre.com/public/time

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
unixtime big-integer unix time in nanoseconds

Markets

Request

curl "https://api.bitwyre.com/public/markets" -X GET

Response

{
    "error": [],
    "result": [
        "crypto",
        "equities",
        "stablecoin",
        "commodities",
        "fixed_income",
        "carbon"
    ]
}

Returns an underscore _ delimited tradable markets array

Endpoint

https://api.bitwyre.com/public/markets

Request Fields/Parameters

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string Returns an underscore _ delimited tradable markets array

Products

Request

curl "https://api.bitwyre.com/public/products" -X GET

Response

{
    "error": [],
    "result": [
        "spot",
        "futures",
        "options",
        "swaps",
        "spreads",
    ]
}

Returns an underscore _ delimited tradable products array

Endpoint

https://api.bitwyre.com/public/products

Request Fields/Parameters

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string Returns an underscore _ delimited tradable products array

Assets

Request

curl "https://api.bitwyre.com/public/assets" -X GET

Response

{
    "error": [],
    "result": [
        {
            "asset": "btc",
            "btc_equivalent": "1",
            "icon_url": "https://storage.bitwyre.com/assets/btc.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Bitcoin",
            "precision": "1e-8",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "eth",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/ETH_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Ethereum",
            "precision": "1e-9",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "xmr",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/XMR_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Monero",
            "precision": "1e-12",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "zec",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/ZEC_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "ZCash",
            "precision": "1e-8",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "usdt",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/assets/usdt.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "USD Tether Stablecoin",
            "precision": "1e-6",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "idr",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/IDR.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "100000000",
            "min_withdrawal": "100000",
            "name": "Indonesian Rupiah",
            "precision": "1",
            "withdrawal_fee": "0"
        },
        {
            "asset": "usd",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/assets/usd.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "United States Dollar",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "brl",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/fiats/raster/brl.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "Brazilian Real",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "mxn",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/fiats/raster/mxn.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "Mexican Peso",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        }
    ]
}

Returns an array filled with supported assets.

Endpoint

https://api.bitwyre.com/public/assets

Request Fields/Parameters

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string Returns an an array filled with tradable products

Crypto Assets

Request

curl "https://api.bitwyre.com/public/assets/crypto" -X GET

Response

{
    "error": [],
    "result": [
        {
            "asset": "btc",
            "btc_equivalent": "1",
            "icon_url": "https://storage.bitwyre.com/assets/btc.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Bitcoin",
            "precision": "1e-8",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "usdt",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/assets/usdt.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "USD Tether Stablecoin",
            "precision": "1e-6",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "xmr",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/XMR_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Monero",
            "precision": "1e-12",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "zec",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/ZEC_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "ZCash",
            "precision": "1e-8",
            "withdrawal_fee": "0.00000001"
        },
        {
            "asset": "eth",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/ETH_500px.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "10",
            "min_withdrawal": "0.001",
            "name": "Ethereum",
            "precision": "1e-9",
            "withdrawal_fee": "0.00000001"
        }
    ]
}

Returns an array filled with supported crypto assets.

Endpoint

https://api.bitwyre.com/public/assets/crypto

Request Fields/Parameters

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string Returns an an array filled with tradable products

Fiat Assets

Request

curl "https://api.bitwyre.com/public/assets/fiat" -X GET

Response

{
    "error": [],
    "result": [
        {
            "asset": "idr",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/coins/raster/IDR.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "100000000",
            "min_withdrawal": "100000",
            "name": "Indonesian Rupiah",
            "precision": "1",
            "withdrawal_fee": "0"
        },
        {
            "asset": "mxn",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/fiats/raster/mxn.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "Mexican Peso",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "brl",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/public/images/fiats/raster/brl.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "Brazilian Real",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        },
        {
            "asset": "usd",
            "btc_equivalent": "",
            "icon_url": "https://storage.bitwyre.com/assets/usd.png",
            "is_deposit_enabled": true,
            "is_trading_enabled": true,
            "is_withdraw_enabled": true,
            "local_equivalent": "",
            "local_reference": "",
            "max_withdrawal": "",
            "min_withdrawal": "20000",
            "name": "United States Dollar",
            "precision": "1e-2",
            "withdrawal_fee": "10000"
        }
    ]
}

Returns an array filled with supported fiat assets.

Endpoint

https://api.bitwyre.com/public/assets/fiat

Request Fields/Parameters

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string Returns an an array filled with tradable products

Instruments

Request

curl "https://api.bitwyre.com/public/pairs?market=crypto&product=spot&country=ID" -X GET

Response

{
    "error": [],
    "result": [
        {"instrument": "btc_idr_spot", "symbol" : "BTC/IDR"},
        {"instrument": "bch_idr_spot", "symbol": "BCH/IDR"},
        {"instrument": "eth_idr_spot", "symbol": "ETH/IDR"},
    ]
}

Returns an underscore _ delimited tradable asset pairs array.

A sample response for a futures market in crypto:

Request

curl "https://api.bitwyre.com/public/pairs?market=crypto&product=futures&country=PA" -X GET

Response

{
    "error": [],
    "result": [
        {"instrument": "btcusdtx_usdt_200607F1000000", "symbol": "BTCM20"}, // BTC USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 10000 USD
        {"instrument": "bchusdtx_usdt_200607F30000", "symbol": "BCHM20"}, // BCH USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 300 USD
        {"instrument": "ethusdtx_usdt_200607F50000", "symbol": "ETHM20"}, // ETH USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 300 USD
    ]
}

For long product codes, we are using an _ (underscore) delimited convention to refer our futures and options product: underlying_settlementcurrency_productdetails.

  1. Underlying financial instrument price. btcusdtx here is the Bitcoin to USD index on Bitwyre's exchange; a weighted average of worldwide Bitcoin spot market index price.
  2. Settlement currency, USD.
  3. Product details:
    • Expiration date: 6 digits in the YYMMDD format.
    • Products:
      • F for Futures.
      • For Options, either P for put or C for call.
      • SW for Swaps.
      • SP for Spreads
    • Strike price: settlement currency in cents (For this USD example, 10000 here means 100 dollars).

For short product codes, we are using the Chicago Mercantile Exchange (CME) convention with asset traded, month code and year code concatenated in capital letters.

Month Month Code
January F
February G
March H
April J
May K
June L
July M
August Q
September U
October V
November X
December Z

A sample response for an options market in crypto:

Request

curl "https://api.bitwyre.com/public/pairs?market=crypto&product=options&country=PA" -X GET

Response

{
  "error": [],
  "result": [
    {"instrument": "btcusdtx_usdt_200607C1000000", "symbol": "BTCM20"}, // BTC USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 10000 USD
    {"instrument": "bchusdtx_usdt_200607C30000", "symbol": "BCHM20"}, // BCH USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 300 USD
    {"instrument": "ethusdtx_usdt_200607C50000", "symbol": "ETHM20"}, // ETH USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 300 USD
    {"instrument": "btcusdtx_usdt_200607P500000", "symbol": "BTCM20"}, // BTC USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 5000 USD
    {"instrument": "bchusdtx_usdt_200607P10000", "symbol": "BCHM20"}, // BCH USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 100 USD
    {"instrument": "ethusdtx_usdt_200607P10000", "symbol": "ETHM20"}, // ETH USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 100 USD
  ]
}

The product btcusdtx_usdt_200607C1000000 means a call contract with delivery on June 7th, 2020, at the strike price of 10,000 of the underlying financial instrument BTCUSDX). btcusdtx_usdt_200607P200000 means a put contract with delivery on June 7th, 2020, at the strike price of 2,000 of the underlying financial instrument BTCUSDX).

Where the short product code follows the futures market convention with the underlying financial instrument, month code and year code.

Endpoint

https://api.bitwyre.com/public/pairs

Request Fields/Parameters

Query Parameter Data Type Required Remark
"market" string true crypto, equity, stablecoin, fixed_income, commodities or carbon
"product" string true spot, futures, options, swaps, or spreads
"country" string true ISO 3166-2 Country Code. Only ID or PA for now

Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string base asset, quote asset, product filter, delimited with an _ (underscore).

Ticker

Request

curl "https://api.bitwyre.com/public/ticker?instrument=btc_idr_spot" -X GET

Response

{
    "error": [],
    "result": [
        {
            "instrument": "btc_idr_spot",
            "asset_base": "btc",
            "asset_quote": "idr",
            "high": "126989000",
            "low": "115201000",
            "percent_change": "-2.123",
            "volume_base": "611.66499447",
            "volume_quote": "7434324.9431",
            "last": "124783000",
            "best_bid": "124761000",
            "best_ask": "124777000",
            "timestamp": 1571744594571020435,
            "market": "crypto",
            "is_frozen": false
        },
        {
            "instrument": "btc_usdt_spot",
            "asset_base": "btc",
            "asset_quote": "usdt",
            "high": "126989000",
            "low": "115201000",
            "percent_change": "-2.123",
            "volume_base": "611.66499447",
            "volume_quote": "7434324.9431",
            "last": "124783000",
            "best_bid": "124761000",
            "best_ask": "124777000",
            "timestamp": 1571744594571020435,
            "market": "crypto",
            "is_frozen": false
        },
    ]
}

Returns ticker information for an asset pair.

Endpoint

https://api.bitwyre.com/public/ticker

Request Fields/Parameters

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).

If the instrument paremeter is empty or omitted, will return the ticker data of all available asset pairs.

Response Types (JSON Object)

JSON Field Data Type Remark
"instrument" string base asset, quote asset, product filter, delimited with an _ (underscore).
"asset_base" string base asset in the trade pair
"asset_quote" string quote asset in the trade pair
"high" float-string highest market price in the last 24 hours
"low" float-string lowest market price in the last 24 hours
"percent_change" float-string market price change percentage in the last 24 hours (up to 8 precision)
"volume_base" float-string total market volume of the base asset in the last 24 hours
"volume_quote" float-string total market volume of the quote asset in the last 24 hours
"last" float-string last market price for the base asset
"best_bid" float-string current highest bid price
"best_ask" float-string current lowest ask price
"timestamp" big-integer unix time in nanoseconds
"market" enum-string equities, crypto, fixed_income, or commodiities
"is_frozen" boolean market frozen status

Trades

Request

curl "https://api.bitwyre.com/public/trades?instrument=btc_usdt_spot&trade_num=2" -X GET

Response

{
    "error": [],
    "result": [
        {
            "instrument": "btc_usd_spot",
            "price": "70000.0",
            "side": 1,
            "timestamp": 1617701262147203562,
            "trade_uuid": "7d0cec66-f130-4fc6-b314-622d394ccec2",
            "value": "4900.0",
            "volume": "0.07"
        },
        {
            "instrument": "btc_usd_spot",
            "price": "70000.0",
            "side": 2,
            "timestamp": 1617701262147203562,
            "trade_uuid": "7d0cec66-f130-4fc6-b314-622d394ccec2",
            "value": "4900.0",
            "volume": "0.07"
        }
    ]
}

Returns last trade_num trades for an asset pair.

Limited to a maximum of 50 last trades.

Endpoint

https://api.bitwyre.com/public/trades

Request Fields/Parameters

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).
"trade_num" number true last trade_num trades to get

Response Types (Array of JSON Object)

JSON Field Data Type Remark
instrument string base asset, quote asset, product filter, delimited with an _ (underscore).
price float-string price/quote asset of the traded base asset
volume float-string volume of the traded base asset
value float-string quote value (price x volume)
side enum-number trade type ( 1 - buy; 2 - sell )
id uuid-string universal unique id of the trade
timestamp big-integer trade time, unixtime in nanoseconds

Depth

Request

curl "https://api.bitwyre.com/public/depth?instrument=btc_idr_futures&depth_num=2" -X GET

Response

{
  "error": [],
  "result": {
    "bids": [
      ["124112000", "0.18154050"],
      ["124110000", "0.47319750"]
    ],
    "asks": [
      ["124130000", "0.03701609"],
      ["124251000", "0.03223585"]
    ],
    "is_frozen": 0
  }
}

Response For All Instrument

{
    "error": [],
    "result": {
        "asks": {
            "btc_usd_spot": [
                []
            ],
            "btc_idr_spot": [
                ["124112000", "0.18154050"],
                ["124110000", "0.47319750"]
            ],
            // ... other instrument
        },
        "bids": {
            "btc_usd_spot": [
                []
            ],
            "btc_idr_spot": [
                ["124130000", "0.03701609"],
                ["124251000", "0.03223585"]
            ],
            // ... other instrument
        },
        "is_frozen": 0
    }
}

Returns depth data for an asset pair.

Limited to a maximum of 150 data points.

Endpoint

https://api.bitwyre.com/public/depth

Request Fields/Parameters

Query Parameter Data Type Required Remark
instrument string false base asset, quote asset, product filter, delimited with an _ (underscore). If instrument empty will fetch all depth from all instrument
depth_num number true depth_num count of data points to get

Response Types (JSON Object)

JSON Field Data Type Remark
bids array-of-float-string-tuple depth_num count of current bid orders in the orderbook
asks array-of-float-string-tuple depth_num count of current ask orders in the orderbook
is_frozen boolean market frozen status

Contract

Request

curl "https://api.bitwyre.com/public/contract?instrument=btcusdtx_usdt_200607F1000000" -X GET

Response

{
    "error": [],
    "result": {
        "instrument": "btcusdtx_usdt_200607F1000000",
        "details": "contract for cash delivery of BTC/USD index settled for July 6th, 2020 for the strike price of 10,000 USD",
        "pricing_source": "CME Bitcoin Real Time Index",
        "bitwyre_index_price": "11500.00",
        "bitwyre_index_price_currency": "USD",
        "24h_volume": "800,000,000.00",
        "24h_volume_currency": "USD",
        "open_interest": "600,000,000.00",
        "interest_rate": "0.001%",
        "contract_value": "1 USD",
        "initial_margin_base_value": "1%",
        "maintenance_margin_base_value": "0.5%"
    }
}

Returns contract details for a derivative instrument/asset pair.

Endpoint

https://api.bitwyre.com/public/contract

Request Fields/Parameters

Query Parameter Data Type Required Remark
instrument string true base asset, quote asset, product filter, delimited with an _ (underscore).

Response Types (JSON Object)

JSON Field Data Type Remark
instrument string base asset, quote asset, product filter, delimited with an _ (underscore).
details string detail of financial contract
pricing_source string source of index pricing
bitwyre_index_price float-string price of index
bitwyre_index_price_currency string currency of price index
24h_volume string 24 hour traded volume of instrument
24h_volume_currency string currency reference for 24 hour traded volume
open_interest string the number of contracts or commitments outstanding in futures and options that are trading on an official exchange at any one time.
interest_rate percentage-string interest rate reference for valuation reference
contract_value string 1 contract value equivalent in USD
initial_margin_base_value string initial margin percentage
maintenance_margin_base_value string maintenance margin percentage

Insider Profiles

Request

curl "https://api.bitwyre.com/public/insider"
-X GET

Response

{
    "error": [],
    "result": [
        {
            "email": "[email protected]",
            "email_verified": 0,
            "has_submitted_kyc": null,
            "insider": 1,
            "institution": 0,
            "is_otp_activated": 0,
            "kyc_level": 0,
            "master_account": 1,
            "master_account_uuid": null,
            "monthly_avg_trading_volumes": null,
            "nationality": "ID",
            "preference_pairs": null,
            "pseudonym": null,
            "reference_asset": null,
            "restricted": 0,
            "sub_account": 0,
            "subaccount_code": "541ebc38-6bef-4d65-aefd-c3575d4e4a21",
            "suspended": 0,
            "user_uuid": "2952e311-cfc9-412e-9ff3-e5cb8131ed45",
            "username": "Insider 1"
        },
        {
            "email": "[email protected]",
            "email_verified": 0,
            "has_submitted_kyc": 1,
            "insider": 1,
            "institution": 0,
            "is_otp_activated": 0,
            "kyc_level": 0,
            "master_account": 1,
            "master_account_uuid": null,
            "monthly_avg_trading_volumes": null,
            "nationality": "ID",
            "preference_pairs": null,
            "pseudonym": null,
            "reference_asset": null,
            "restricted": 1,
            "sub_account": 0,
            "subaccount_code": "55e77e70-bfba-46be-aad1-dc986312da5a",
            "suspended": 0,
            "user_uuid": "04761f29-0288-4fff-97c8-14d58413e720",
            "username": "Insider 2"
        }
    ]
}

Request

curl "https://api.bitwyre.com/public/insider?username=<username>"
-X GET

Response

{
    "error": [],
    "result": {
        "email": "[email protected]",
        "email_verified": 0,
        "has_submitted_kyc": null,
        "insider": 1,
        "institution": 0,
        "is_otp_activated": 0,
        "kyc_level": 0,
        "master_account": 1,
        "master_account_uuid": null,
        "monthly_avg_trading_volumes": null,
        "nationality": "ID",
        "preference_pairs": null,
        "pseudonym": null,
        "reference_asset": null,
        "restricted": 0,
        "sub_account": 0,
        "subaccount_code": "541ebc38-6bef-4d65-aefd-c3575d4e4a21",
        "suspended": 0,
        "user_uuid": "2952e311-cfc9-412e-9ff3-e5cb8131ed45",
        "username": "Insider 1"
    }
}

Returns insider user profiles info

Endpoint

https://api.bitwyre.com/public/insider

Request Fields/Parameters

Query Parameter Data Type Required Remark
username string false Username

Response Types (JSON Object/Arrays)

JSON Field Data Type Remark
email string Insider Email
email_verified boolean 1 if email is already verified
has_submitted_kyc boolean 1 if user is already submitted kyc
insider boolean 1 if user is an insider
institution boolean 1 if user has an institution
is_otp_activated boolean 1 if user is already activated otp
kyc_level integer User KYC Level
master_account boolean 1 if user is a master account
master_account_uuid string User Master Account UUID
monthly_avg_trading_volumes integer User Monthly Average Trading Volumes
nationality string User Nationality
preference_pairs boolean User preference pairs
reference_asset array-of-string User reference asset
restricted boolean User trading status
sub_account boolean 1 if user has a sub account
subaccount_code string User Sub Account User Code
suspended boolean User Status
user_uuid string User UUID
username string Username

Insider Trades

Request

curl "https://api.bitwyre.com/public/insider/trades"
-X GET

Response

{
    "error": [],
    "result": [
        {
            "btc_usdt_spot": [
                {
                    "exec_price": 1.21,
                    "exec_qty": 10.0,
                    "exec_type": 13,
                    "exec_value": 12.1,
                    "fee_paid": -0.015,
                    "fee_paid_asset": "btc",
                    "fee_rate": -0.0015,
                    "fee_type": 1,
                    "notes": null,
                    "order_price": 1.21,
                    "order_qty": 10.0,
                    "order_remaining": 0.0,
                    "order_type": 2,
                    "side": 1,
                    "status": 2,
                    "timestamp": 1609027200000000000,
                    "username": "Insider 1"
                }
            ],
            "eth_usdt_spot": [
                {
                    "exec_price": 1.21,
                    "exec_qty": 1.0,
                    "exec_type": 13,
                    "exec_value": 12.1,
                    "fee_paid": 36300.0,
                    "fee_paid_asset": "idr",
                    "fee_rate": 0.003,
                    "fee_type": 2,
                    "notes": null,
                    "order_price": 1.21,
                    "order_qty": 1.0,
                    "order_remaining": 0.0,
                    "order_type": 2,
                    "side": 2,
                    "status": 2,
                    "timestamp": 1609027200000000000,
                    "username": "Insider 2"
                }
            ]
        }
    ]
}

Request

curl "https://api.bitwyre.com/public/insider/trades?username=<username>"
-X GET

Response

{
    "error": [],
    "result": [
        {
            "btc_usdt_spot": [
                {
                    "exec_price": 1.21,
                    "exec_qty": 10.0,
                    "exec_type": 13,
                    "exec_value": 12.1,
                    "fee_paid": -0.015,
                    "fee_paid_asset": "btc",
                    "fee_rate": -0.0015,
                    "fee_type": 1,
                    "notes": null,
                    "order_price": 1.21,
                    "order_qty": 10.0,
                    "order_remaining": 0.0,
                    "order_type": 2,
                    "side": 1,
                    "status": 2,
                    "timestamp": 1609027200000000000
                }
            ]
        }
    ]
}

Returns user insider's trades data info

Endpoint

https://api.bitwyre.com/public/insider/trades

Request Fields/Parameters

Query Parameter Data Type Required Remark
username string false Username

Response Types (JSON Arrays)

JSON Field Data Type Remark
exec_price float Order Execution Price
exec_qty float Order Execution Quantity
exec_type integer Order Execution Type
exec_value float Order Execution Value
fee_paid float Order Paid Fees
fee_paid_asset string Asset of Fees
fee_rate float Fees Rate
fee_type integer Type of Fees
notes string Order Notes
order_price float Order Price
order_qty float Order Quantity
order_remaining integer Order Remaining Quantity
order_type enum-number order type
side enum-number trade type ( 1 - buy; 2 - sell)
status enum-number order status
timestamp big-integer unix time in nanoseconds

Announcements

Request

curl "https://api.bitwyre.com/public/announcements" -X GET

Response

{
    "error": [],
    "result": {
        "unixtime": 1571744594571020435,
        "announcement": "halting btc_usdt_spot"
    }
}

Returns announcement with the server's time.

Endpoint

https://api.bitwyre.com/public/announcements

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
unixtime big-integer unix time in nanoseconds
announcement string announcement

Order Types

Request

curl "https://api.bitwyre.id/public/ordertypes" -X GET

Response

{
    "error": [],
    "result": {
        "1": "Market",
        "2": "Limit",
        "3": "Stop",
        "4": "Stop Limit"
    }
}

Returns enumeration of order types

Endpoint

https://api.bitwyre.id/public/ordertypes

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
result JSON Enumeration of order types

Supported Languages

Request

curl "https://api.bitwyre.id/public/languages" -X GET

Response

{
    "error": [],
    "result": [
        {
            "iso639-2_code": "eng",
            "language": "English"
        },
        {
            "iso639-2_code": "rus",
            "language": "Russian"
        },
        {
            "iso639-2_code": "hin",
            "language": "Hindi"
        },
        {
            "iso639-2_code": "ind",
            "language": "Bahasa Indonesia"
        },
        {
            "iso639-2_code": "chi",
            "language": "官话"
        },
        {
            "iso639-2_code": "fra",
            "language": "Français"
        },
        {
            "iso639-2_code": "spa",
            "language": "Español"
        },
        {
            "iso639-2_code": "por",
            "language": "Portugais"
        }
    ]
}

Returns pairs of supported languages

Endpoint

https://api.bitwyre.id/public/languages

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
"result" JSON Pairs of supported languages

Get Search Results

Request

curl 'https://api.bitwyre.com/public/search \
  -X GET

Response

{
    "error": [],
    "result": {
        [
            {"keyword": "btc_usdt_spot", "url": "https://www.bitwyre.com/terminal/btc_usdt_spot"},
            {"keyword": "btc_idr_spot", "url": "https://www.bitwyre.com/terminal/btc_idr_spot"},
        ]
        ....
    }
}

Retrieve search query

Endpoint

https://api.bitwyre.com/public/search

Request Fields/Parameters

None needed yet

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
Nearest neighbor search of words string Closest word
... ... ...

Price Index

An aggregate of an instrument's current market price, collected from multiple third party sources and major exchanges Indices are calculated by fetching orderbook per exchanges, getting their bid-ask spread, then averaging their prices. It is calculated every second by our backend. Current sources are: 1. Binance 2. Bitfinex 3. Bitstamp 4. Coinbase 5. Huobi 6. Okex

Request

curl "https://api.bitwyre.id/public/index?instrument=btc_usdt_spot" -X GET

Response

{
    "error": [],
    "result": {
        "btc_usdt_spot": [
            {
                "price": "400000.0",
                "timestamp": "2021-08-13 04:26:34.086636",
                "timestamp_integer": 1628828794
            },
            {
                "price": "500000.0",
                "timestamp": "2021-08-18 05:08:29.128583",
                "timestamp_integer": 1629263309
            }
        ]
    }
}

Endpoint

https://api.bitwyre.id/public/index

Request Fields/Parameters

Query Parameter Data Type Required Remark
"instrument" string true base asset, quote asset, product filter, delimited with an _ (underscore).
"amount" integer false amount of data to be fetched
"to_time" integer false end time of data to be fetched
"from_time" integer false start time of data to be fetched
"ascending" boolean false true to sort data ascending bytime

Notes: 1. Example for instruments: btc_usdt_spot, eth_usdc_spot. 2. If no amount is specified, endpoint will returns only 1 data, depends on whether it is ascending/descending. Current limit is 100 data points per request. 3. If no to_time is specified, endpoint will fetch the latest data. 4. If no from_time is specified, endpoint will try to fetch data from earliest possible point given the maximum limit of data per request. 5. Default for ascending is false (0), ie the data is sorted descending by time, change to 1 to sort ascending

Response Types (JSON Object)

Returns | JSON Field | Data Type | Remark | | ---------- | --------- | -------------------------- | | error | list | Error messages, if any | | result | dictionaries | contain list of dictionaries of the data, grouped by instrument |

and the list of dictionaries for the results: | JSON Field | Data Type | Remark | | ---------- | --------- | -------------------------- | | price | string | String representation of the price, up to two decimals | | timestamp | string | Human-readable UTC timestamp | | timestamp_integer | integer | UNIX timestamp, in seconds |

Search ticker, trades, and depth data in one endpoint

Request

curl "https://api.bitwyre.id/public/search?country=ID" -X GET

Response

{
    "error": [],
    "result": {
        "spot": {
            "crypto": {
                "btc_usdt_spot": {
                    "high": "11000",
                    "low": "10000",
                    "percent_change": "110.0",
                    "volume_base": "34",
                    "volume_quote": "267346.0",
                    "last": "10100",
                    "best_bid": "10075",
                    "best_ask": "11000",
                    "timestamp": 1571747594573320135,
                    "last_trade_price": "10000.0",
                    "last_trade_side": 1,
                    "last_trade_uuid": "752837c7-aec6-41f8-bb07-286f859f2718",
                    "last_trade_value": "20000.0",
                    "last_trade_volume": "2.0",
                    "last_trade_timestamp": 1571747594573320135,
                    "bidbook": [
                        [
                            "310.0",
                            "5.0"
                        ]
                    ],
                    "askbook": [
                        [
                            "400.0",
                            "2.0"
                        ]
                    ]
                }
            }
        }
    }
}

Endpoint

https://api.bitwyre.id/public/search

Request Fields/Parameters

Query Parameter Data Type Required Remark
"country" string true two-character of country of interest (eg. US, ID, HK)
"instrument" string false Instrument of interest (eg btc_usdt_spot)

Notes: if no instrument is specified, endpoint will return all available instrument

Response Types (JSON Object)

Returns | JSON Field | Data Type | Remark | | ---------- | --------- | -------------------------- | | error | list | Error messages, if any | | result | dictionaries | contain list of dictionaries of the data, grouped by product, market, instrument |

Please check ticker, trades, and depth endpoint documentation for explanation of the dictionary members

Matching Engine Order Lag

Request

curl "https://api.bitwyre.id/public/orderlag?instrument=<instrument>"
-X GET

Response

{
    "error": [],
    "result": {
        "btc_usdt_spot": "1",
        "eth_usdt_spot": "0"
    }
}

Return order lag of matching engine per instrument (in events)

Endpoint

https://api.bitwyre.id/public/orderlag

Request Fields/Parameters

Parameter Data Type Required Remark
instrument string false Instrument of interest (eg btc_usdt_spot)

Notes: if no instrument is specified, endpoint will return all available instrument

Response Types (JSON Object)

JSON Field Data Type Remark
instrument string amount of order event lag

Please check ticker, trades, and depth endpoint documentation for explanation of the dictionary members

Matching Engine Throughput

Request

curl "https://api.bitwyre.id/public/throughput?instrument=<instrument>"
-X GET

Response

{
    "error": [],
    "result": {
        "Consumer":
        [
            {
                "instrument": "btc_usdt_spot",
                "throughput": "1000 events/second",
            },
            {
                "instrument": "eth_usdt_spot",
                "throughput": "500 events/second",
            }
        ],
        "Matching":
        [
            {
                "instrument": "btc_usdt_spot",
                "throughput": "1000 events/second",
            },
            {
                "instrument": "eth_usdt_spot",
                "throughput": "500 events/second",
            }
        ],
        "Producer":
        [
            {
                "instrument": "btc_usdt_spot",
                "throughput": "500 events/second",
            },
            {
                "instrument": "eth_usdt_spot",
                "throughput": "1000 events/second",
            }
        ]
    }
}

Return throughput rate data of matching engine of the instrument (in events/second)

Endpoint

https://api.bitwyre.id/public/throughput

Request Fields/Parameters

Parameter Data Type Required Remark
instrument string false Instrument of interest (eg btc_usdt_spot)

Notes: if no instrument is specified, endpoint will return all available instrument if no type is specified, endpoint will return all available type

Response Types (JSON Object)

JSON Field Data Type Remark
Consumer array-of-objects consumer matching engine throughput rate of the instrument
Matching array-of-objects mathcing engine throughput rate of the instrument
Producer array-of-objects producer matching engine throughput rate of the instrument

Private API

Getting Preferential Pairs

Request

curl "https://api.bitwyre.com/private/pairs?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": ["btc_usdt_spot"]
}

Return user preferential pairs for trading.

Endpoint

https://api.bitwyre.com/private/pairs

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

Returns an underscore _ delimited tradable asset pairs array.

JSON Field Data Type Remark
- list list of pairs/instruments

Add Preferential Pairs

Request

curl "https://api.bitwyre.com/private/pairs?nonce=17081945&checksum=<payload_checksum>&payload=payload={\"instruments\":[\"btc_usdt_spot\"]}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X PUT

Response

{
  "error": [],
  "result": {
    "message": "Successfully set btc_usdt_spot to preferred pairs"
  }
}

Add pairs to user preference list for trading.

Endpoint

https://api.bitwyre.com/private/pairs

Request Fields/Parameters

JSON Field Value Required Description
instruments list true list of instrument

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
message string response message

Remove Preferential Pairs

Request

curl "https://api.bitwyre.com/private/pairs?nonce=17081945&checksum=<payload_checksum>&payload=payload={\"instruments\":[\"btc_usdt_spot\"]}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X DELETE

Response

{
  "error": [],
  "result": {
    "message": "Successfully remove btc_usdt_spot from preferred pairs"
  }
}

Remove pairs for user preference list for trading.

Endpoint

https://api.bitwyre.com/private/pairs

Request Fields/Parameters

JSON Field Value Required Description
instruments list true list of instruments

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
message string response message

Getting Spot Account Balance

Request

curl "https://api.bitwyre.com/private/account/spotbalance?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": [
    {
      "asset": "btc",
      "available_balance": 10.0,
      "btc_equivalent": 1,
      "constant_multiplier": 100000000,
      "icon_url": "https://robin.bitwyre.id/app/Raster/BTC_500px.png",
      "is_deposit_enabled": true,
      "is_trading_enabled": true,
      "is_withdraw_enabled": true,
      "local_equivalent": 0,
      "local_reference": "",
      "locked_balance": 0.0,
      "max_withdrawal": "10",
      "min_withdrawal": "0.001",
      "name": "Bitcoin",
      "precision": "1e-8",
      "total_balance": 10.0,
      "type": "crypto",
      "usd_equivalent": 472580,
      "withdrawal_fee": "0.00000001"
    },
    {
      "asset": "eth",
      "available_balance": 100.0,
      "btc_equivalent": 0,
      "constant_multiplier": 1000000000,
      "icon_url": "https://robin.bitwyre.id/app/Raster/ETH_500px.png",
      "is_deposit_enabled": true,
      "is_trading_enabled": true,
      "is_withdraw_enabled": true,
      "local_equivalent": 0,
      "local_reference": "",
      "locked_balance": 0.0,
      "max_withdrawal": "10",
      "min_withdrawal": "0.001",
      "name": "Ethereum",
      "precision": "1e-9",
      "total_balance": 10000.0,
      "type": "crypto",
      "usd_equivalent": 34095000,
      "withdrawal_fee": "0.00000001"
    }
    // ... and all other asset balances
  ]
}

Retrieve all user's fiat and crypto balance.

Endpoint

https://api.bitwyre.com/private/account/spotbalance

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
asset string asset
available_balance float availabe asset balance
constant_multiplier integer asset constant multiplier
icon_url string asset icon image url
is_deposit_enabled bool 1 if asset deposit is enabled
is_trading_enabled bool 1 if asset trade is enabled
is_withdraw_enabled bool 1 if asset withdraw is enabled
btc_equivalent integer balance in bitcoin
local_equivalent ineger balance in local reference
local_reference string local reference asset
locked_balance integer amount of locked balance
max_withdrawal string maximum amount of withdrawal
min_withdrawal string minimum amount of withdrawal
name string name of asset
precision string precision of asset
total_balance integer amount of total balance
type string type of asset (crypto/fiat)
usd_equivalent integer asset equivalent in USD
withdrawal_fee string asset withdrawal fees

Getting Derivatives Account Balance

Request

curl "https://api.bitwyre.com/private/account/derivativesbalance?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": [
    {
      "asset": "btc",
      "available_balance": 10.0,
      "btc_equivalent": 1,
      "constant_multiplier": 100000000,
      "icon_url": "https://robin.bitwyre.id/app/Raster/BTC_500px.png",
      "is_deposit_enabled": true,
      "is_trading_enabled": true,
      "is_withdraw_enabled": true,
      "local_equivalent": 0,
      "local_reference": "",
      "locked_balance": 0.0,
      "max_withdrawal": "10",
      "min_withdrawal": "0.001",
      "name": "Bitcoin",
      "precision": "1e-8",
      "total_balance": 10.0,
      "type": "crypto",
      "usd_equivalent": 472580,
      "withdrawal_fee": "0.00000001"
    },
    {
      "asset": "eth",
      "available_balance": 100.0,
      "btc_equivalent": 0,
      "constant_multiplier": 1000000000,
      "icon_url": "https://robin.bitwyre.id/app/Raster/ETH_500px.png",
      "is_deposit_enabled": true,
      "is_trading_enabled": true,
      "is_withdraw_enabled": true,
      "local_equivalent": 0,
      "local_reference": "",
      "locked_balance": 0.0,
      "max_withdrawal": "10",
      "min_withdrawal": "0.001",
      "name": "Ethereum",
      "precision": "1e-9",
      "total_balance": 10000.0,
      "type": "crypto",
      "usd_equivalent": 34095000,
      "withdrawal_fee": "0.00000001"
    }
    // ... and all other asset balances
  ]
}

Retrieve all user's fiat and crypto balance that are set aside for derivatives trading.

Endpoint

https://api.bitwyre.com/private/account/derivativesbalance

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
asset string asset
available_balance float availabe asset balance
constant_multiplier integer asset constant multiplier
icon_url string asset icon image url
is_deposit_enabled bool 1 if asset deposit is enabled
is_trading_enabled bool 1 if asset trade is enabled
is_withdraw_enabled bool 1 if asset withdraw is enabled
btc_equivalent integer balance in bitcoin
local_equivalent ineger balance in local reference
local_reference string local reference asset
locked_balance integer amount of locked balance
max_withdrawal string maximum amount of withdrawal
min_withdrawal string minimum amount of withdrawal
name string name of asset
precision string precision of asset
total_balance integer amount of total balance
type string type of asset (crypto/fiat)
usd_equivalent integer asset equivalent in USD
withdrawal_fee string asset withdrawal fees

Moving Spot Account Balance to Derivatives Account Balance

Request

curl "https://api.bitwyre.com/private/account/spotbalance?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X POST

Response

{
  "error": [],
  "result": [
    {
      "asset": "btc",
      "amount": 100,
      "to_derivatives": true,
      "to_spot": false,
      "success": true
    },
    {
      "asset": "usdt",
      "amount": 100,
      "to_derivatives": true,
      "to_spot": false,
      "success": true
    }
  ]
}

Move a user's fiat and crypto balance for derivatives trading.

Endpoint

https://api.bitwyre.com/private/account/spotbalance

Request Fields/Parameters

JSON Field Value Required Description
asset string true the asset to be moved from the spot balance to the derivatives account balance
amount integer true the amount of the asset to be moved from the spot balance to the derivatives account balance (in the currency's normal unit e.g bitcoin, ether)

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
asset string name of asset
amount integer asset amount moved
to_derivatives boolean if the direction is spot -> derivatives
to_spot boolean if the direction is derivatives -> spot
success boolean if the move operation is a success

Moving Derivatives Account Balance to Spot Account Balance

Request

curl "https://api.bitwyre.com/private/account/derivativesbalance?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X POST

Response

{
  "error": [],
  "result": [
    {
      "asset": "btc",
      "amount": 100,
      "to_derivatives": false,
      "to_spot": true,
      "success": true
    },
    {
      "asset": "usdt",
      "amount": 100,
      "to_derivatives": false,
      "to_spot": true,
      "success": true
    }
  ]
}

Move a user's fiat and crypto balance for derivatives trading.

Endpoint

https://api.bitwyre.com/private/account/derivativesbalance

Request Fields/Parameters

JSON Field Value Required Description
asset string true the asset to be moved from the spot balance to the derivatives account balance
amount integer (in the currency's normal unit e.g bitcoin, ether) true the amount of the asset to be moved from the spot balance to the derivatives account balance

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
asset string name of asset
amount integer asset amount moved
to_derivatives boolean if the direction is spot -> derivatives
to_spot boolean if the direction is derivatives -> spot
success boolean if the move operation is a success

Getting Derivatives Positions

Request

curl "https://api.bitwyre.com/private/derivatives/position?payload={somepayload}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": [
    {
      "instrument": "btcusdtx_usdt_210430F70000000000",
      "qty": 100.0,
      "value": 1000.0,
      "price": 1000.0,
      "trade_timestamp": 1630323641000000000,
      "clear_timestamp": 1630323642000000000,
      "trade_id": "c66297d0-7835-4943-a8c2-216fa5f4d572",
      "side": 1,
      "exposure": 1000000000,
      "exposure_currency": "btc",
      "index": "1000000000",
      "original_time_to_expiry": 1630323643000000000,
      "original_days_to_expiry": 1234,
      "current_time_to_expiry": 1630322663000000000,
      "current_days_to_expiry": 123,
      "created_at": 1630323652000000000
    }
  ]
}

Retrieve users derivative positions

Endpoint

https://api.bitwyre.com/private/derivatives/position

Request Fields/Parameters

JSON Field Value Required Description
instrument string false the instrument of interest, eg btcusdtx_usdt_210430F70000000000 for BTC/USD Futures Contract for Expiry 30 April 2021 at strike 70,000 USD/BTC. Will return all if not specified
from_time integer false start timestamp in nanoseconds. Will return from first if not specified
to_time integer false end timestamp in nanoseconds Will return untill current if not specified

Getting Account Statement

Request

curl "https://api.bitwyre.com/private/account/statement?nonce=17081945&checksum=<payload_checksum>&asset=idr&payload={\"assets\": [\"btc\", \"idr\"]}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "deposit": {
      "brl": [],
      "btc": [
        {
          "fee": 5e-5,
          "gross_amount": 0.01,
          "id": 4,
          "nett_amount": 0.00995,
          "network_confirmation": 0,
          "provider": "duitku",
          "status": "pending",
          "submit_time": 1571747594573320135,
          "success_time": 0,
          "transaction_id": "26a13a32-2e11-472a-84cc-242d765a88dg",
          "tx_id": "26a13a32-2e11-472a-84cc-242d765a88dg",
          "type": "crypto"
        }
      ],
      "eth": [],
      "idr": [
        {
          "centralized_confirmation": 0,
          "fee": 1000.0,
          "gross_amount": 5000.0,
          "id": 5,
          "nett_amount": 4000.0,
          "provider": "duitku",
          "status": "pending",
          "submit_time": 1571747594573320135,
          "success_time": 0,
          "transaction_id": "26a13a32-2e11-472a-84cc-242d765a88dg",
          "type": "fiat"
        }
      ],
      "mxn": [],
      "usd": [],
      "usdt": [],
      "xmr": [],
      "zec": []
    },
    "withdrawal": {
      "brl": [],
      "btc": [
        {
          "fee": 5e-5,
          "gross_amount": 0.01,
          "id": 6,
          "nett_amount": 0.00995,
          "network_confirmation": 0,
          "provider": "duitku",
          "status": "pending",
          "submit_time": 1571747594573320135,
          "success_time": 0,
          "transaction_id": "26a13a32-2e11-472a-84cc-242d765a88dj",
          "tx_id": "26a13a32-2e11-472a-84cc-242d765a88dj",
          "type": "crypto"
        }
      ],
      "eth": [],
      "idr": [
        {
          "centralized_confirmation": 0,
          "fee": 1000.0,
          "gross_amount": 10000.0,
          "id": 1,
          "nett_amount": 9000.0,
          "provider": "duitku",
          "status": "pending",
          "submit_time": 1571747594573320135,
          "success_time": 0,
          "transaction_id": "26a13a32-2e11-472a-84cc-242d765a88de",
          "type": "fiat"
        },
        {
          "centralized_confirmation": 0,
          "fee": 1000.0,
          "gross_amount": 5000.0,
          "id": 3,
          "nett_amount": 4000.0,
          "provider": "duitku",
          "status": "pending",
          "submit_time": 1571747594573320135,
          "success_time": 0,
          "transaction_id": "26a13a32-2e11-472a-84cc-242d765a88df",
          "type": "fiat"
        }
      ],
      "mxn": [],
      "usd": [],
      "usdt": [],
      "xmr": [],
      "zec": []
    }
  }
}

Retrieve user's withdraw and deposit history.

Endpoint

https://api.bitwyre.com/private/account/statement

Request Payload Fields

When no payload specified, it will return all statements

Payload Fields Value Required Description
assets list false list of assets for the statements

Please refer to Authentication.

Response Base Structure

JSON Field Data Type Remark
withdrawal asset-statement-object historical withdrawal data for specific asset (array).
deposit asset-statement-object historical deposit data for specific asset (array).

Getting User Withdrawal Fees

Request (All Instruments)

curl "https://api.bitwyre.com/private/account/fees/withdrawal?nonce=17081945&checksum=<payload_checksum>&payload={\"asset\":\"all\"}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response (All Instruments)

{
  "error": [],
  "result": {
    "btc": {
      "global_fee": "0.0001",
      "user_fee": "0.0001"
    },
    "eth": {
      "global_fee": "0.001",
      "user_fee": "0.001"
    }
  }
}

Request (One Instrument)

curl "https://api.bitwyre.com/private/account/fees/withdrawal?nonce=17081945&checksum=<payload_checksum>&payload={\"asset\":\"btc\"}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response (One Instrument)

{
  "error": [],
  "result": {
    "btc": {
      "global_withdrawal_fee": "0.0001",
      "user_withdrawal_fee": "0.0001"
    }
  }
}

Retrieve user's withdraw fees.

Endpoint

https://api.bitwyre.com/private/account/fees/withdrawal

Request Payload Fields

When no payload specified, it will return all statements

Payload Fields Value Required Description
asset string true Crypto asset, e.g btc, eth.

Please refer to Authentication.

Response Base Structure

Dictionary of asset and it's withdrawal fees data, withdrawal fees fields:

JSON Field Data Type Remark
global_withdrawal_fee string withdrawal fees data for specific asset
user_withdrawal_fee string withdrawal fees data for specific user

Getting Transaction Histories

Request

curl "https://api.bitwyre.com/private/account/transactions?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "deposit": {
      "idr": [
        {
          "account_balance_id": 1,
          "address": "thisisaddress",
          "amount": "100000000.0",
          "asset": "idr",
          "fee": "0.0",
          "final_balance": "1100000000.0",
          "notes": "",
          "status": "Cancelled",
          "time": 1618206392203845000,
          "type": 1
        }
      ],
      "btc": [
        {
          "account_balance_id": 2,
          "address": "thisisaddress",
          "amount": "1.0",
          "asset": "btc",
          "fee": "0.0",
          "final_balance": "10.0",
          "notes": "",
          "status": "Cancelled",
          "time": 1618206125002066000,
          "type": 1
        }
      ]
      // ... other coins
    },
    "withdrawal": {
      "btc": [
        {
          "account_balance_id": 4,
          "address": "thisisaddress",
          "amount": "-1.0",
          "asset": "btc",
          "fee": "0.0",
          "final_balance": "9.0",
          "notes": "",
          "status": "Pending",
          "time": 1617974544507879000,
          "type": 2
        }
      ],
      "idr": [
        {
          "account_balance_id": 3,
          "address": "thisisaddress",
          "amount": "-1000.0",
          "asset": "idr",
          "fee": "0.0",
          "final_balance": "1099999000.0",
          "notes": "",
          "status": "Pending",
          "time": 1618207558627212000,
          "type": 2
        }
      ]
      // ... other coins
    },
    "clearing": {
      "idr": [
        {
          "account_balance_id": 5,
          "address": "thisisaddress",
          "amount": "-1000.0",
          "asset": "BTC IDR spot clearing",
          "fee": "0.0",
          "final_balance": "1099999000.0",
          "notes": "",
          "status": "Pending",
          "time": 1618207558627212000,
          "type": 3
        }
      ],
      "btc": [
        {
          "account_balance_id": 3,
          "address": "thisisaddress",
          "amount": "-1000.0",
          "asset": "BTC IDR spot clearing",
          "fee": "0.0",
          "final_balance": "1099999000.0",
          "notes": "",
          "status": "Pending",
          "time": 1618207558627212000,
          "type": 3
        }
      ]
      // ... other coin clearing
    }
  }
}

Retrieve user's withdraw, deposit, and clearing history.

Endpoint

https://api.bitwyre.com/private/account/transactions

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Base Structure

JSON Field Data Type Remark
withdrawal asset-statement-object historical withdrawal data for specific asset (array).
deposit asset-statement-object historical deposit data for specific asset (array).

Opening a New Order

Example: New Market Order

curl "https://api.bitwyre.com/private/orders" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
          \"instrument\": \"btc_usdt_spot\",\
          \"side\": 2,\
          \"ordtype\": 1,\
          \"orderqty\": \"2.9301\",\
        }\
      }"

Response (Execution Report)

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 0,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_usdt_spot",
    "leavesqty": "2.9301",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "2.9301",
    "ordrejreason": "",
    "ordstatus": 0,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 1,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "10.0",
    "side": 2,
    "stoppx": "0",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Example: New Limit Order

curl "https://api.bitwyre.com/private/orders" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
          \"instrument\": \"btc_usdt_spot\",\
          \"side\": 1,\
          \"ordtype\": 2,\
          \"price\": \"9800.5\",\
          \"orderqty\": \"2.9301\",\
        }\
      }"

Response (Execution Report)

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 0,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_usdt_spot",
    "leavesqty": "2.9301",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "2.9301",
    "ordrejreason": "",
    "ordstatus": 0,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 2,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "9800.5",
    "side": 1,
    "stoppx": "0",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Example: New Stop Order

curl "https://api.bitwyre.com/private/orders" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
          \"instrument\": \"btc_usdt_spot\",\
          \"side\": 2,\
          \"ordtype\": 3,\
          \"stoppx\": \"9850.35\",\
          \"orderqty\": \"2.9301\",\
        }\
      }"

Response (Execution Report)

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 0,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_usdt_spot",
    "leavesqty": "2.9301",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "2.9301",
    "ordrejreason": "",
    "ordstatus": 0,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 3,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "0",
    "side": 2,
    "stoppx": "9850.35",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Example: New Stop-Limit Order

curl "https://api.bitwyre.com/private/orders" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
          \"instrument\": \"btc_usdt_spot\",\
          \"side\": 1,\
          \"ordtype\": 4,\
          \"price\": \"9800.5\",\
          \"stoppx\": \"9750\",\
          \"orderqty\": \"2.9301\",\
        }\
      }"

Response (Execution Report)

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 0,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_usdt_spot",
    "leavesqty": "2.9301",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "2.9301",
    "ordrejreason": "",
    "ordstatus": 0,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 4,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "9800.5",
    "side": 1,
    "stoppx": "9750",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Create a new trade order.

Endpoint

https://api.bitwyre.com/private/orders

Create Order Payload

JSON Field Value Required Description
clordid uuid-string false client generated uuid string, no mandatory.
instrument string true base asset, quote asset, product filter, delimited with an _ (underscore).
side enum-number true side of order, currently only supports buy (1) or sell (2).
ordtype enum-number true Currently only supports market (1), limit (2), stop (3), or stop_limit (4) order.
price float-string false mandatory for limit and stop_limit order.
stoppx float-string false mandatory for stop and stop_limit order.
orderqty float-string true order quantity for the base asset.
timeinforce enum-number false order lifetime enforcement, see Time In Force.
expiretime big-integer false mandatory when "timeinforce" is set to gtd, unix time in nanoseconds.
execinst string false not-yet-supported, reserved for future.
cancelondisconnect bool false cancel order on disconnection, not supported in REST (yet).

One must make sure that price, quantity and also value are in the the currency unit that are from the base and quote pairs. For example if the instrument is btc_usdt_spot, the quantity is btc and the price and value are in usdt. Note that our clearing engine does clearing inside our database based on 64-bit integer computations. Thus, to reduce the amount of increment errors, we also highly suggest you to compute the quantity in the smallest unit of the base asset and the value in the smallest unit of the quote asset. For the previous example of btc_usdt_spot the smallest unit of btc is satoshi, 10^-8 of a btc, and for usdt it is 10^-6 of a usdt. For a quantity of 1 btc we will process in our backend in the integer 100,000,000and for1 usdtit will be1,000,000`. This is the same for Monero (piconero) and ZCash (zatoshi), the exception is only for Ethereum, where we use GWei in our backend computations.

Getting Open Orders

Request

Getting specific open orders
curl 'https://api.bitwyre.com/private/orders/open?nonce=17081945&checksum=<payload_checksum>&payload={"instrument":"btc_usdt_spot", "from_time": 1593487780108470000, "to_time": 1593487786824088000 }' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET
Getting all open orders
curl 'https://api.bitwyre.com/private/orders/open/all?nonce=17081945&checksum=<payload_checksum>&payload=' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc_usdt_spot": [
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_usdt_spot",
        "leavesqty": "1",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "orderqty": "1",
        "ordrejreason": "",
        "ordstatus": 0,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "price": "10.0",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 123123132123,
        "transacttime": 0,
        "value": "100.0"
      }
    ]
  }
}

Retrieves curent open orders.

Endpoint

https://api.bitwyre.com/private/orders/open https://api.bitwyre.com/private/orders/open/all

Request Payload Fields

When no payload specified, it will return all orders symbols that currently in open position. Otherwise on /open/all it automatically returns all open order, no payload necessary

Payload Fields Value Required Description
instrument string false base asset, quote asset, product filter, delimited with an _ (underscore).
from_time int false nanosecond timestamp for oldest order to be enumerated.
to_time int false nanosecond timestamp for newest order to be enumerated.

Response Data

A dictionary, where the keys are the symbols and the values are an array of currently open order(s), see Execution report Response.

Getting Closed Orders

Request

Getting specific closed order
curl 'https://api.bitwyre.com/private/orders/closed?nonce=17081945&checksum=<payload_checksum>&payload={"instrument":"btc_usdt_spot", "from_time": 1593487780108470000, "to_time": 1593487786824088000}' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET
Getting all closed order
curl 'https://api.bitwyre.com/private/orders/closed/all?nonce=17081945&checksum=<payload_checksum>&payload=' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc_idr_spot": [
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_idr_spot",
        "leavesqty": "1",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "orderqty": "1",
        "ordrejreason": "",
        "ordstatus": 1,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "price": "10.0",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 123123132123,
        "transacttime": 0,
        "value": "100.0"
      },
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_idr_spot",
        "leavesqty": "1",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc1",
        "orderqty": "1",
        "ordrejreason": "",
        "ordstatus": 1,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc1",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc1",
        "price": "10.0",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 2345676543246,
        "transacttime": 0,
        "value": "100.0"
      }
    ],
    "btc_usd_spot": [
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_usd_spot",
        "leavesqty": "1",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "orderqty": "1",
        "ordrejreason": "",
        "ordstatus": 1,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "price": "0.1",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 123123132123,
        "transacttime": 0,
        "value": "1.0"
      }
    ]
  }
}

Retrieves currently closed orders. Similar to order history.

Endpoint

https://api.bitwyre.com/private/orders/closed https://api.bitwyre.com/private/orders/closed/all

Request Payload Fields

For showing closed order based on parameters on /closed. Otherwise on /closed/all it automatically returns all closed order, no payload necessary

Payload Fields Value Required Description
instrument string false base asset, quote asset, product filter, delimited with an _ (underscore).
from_time int false nanosecond timestamp for oldest order to be enumerated.
to_time int false nanosecond timestamp for newest order to be enumerated.

Response Data

A dictionary, where the keys are the symbols and the values are an array of currently closed order(s), see Execution report Response.

Getting All Cancelled Orders

Request

curl 'https://api.bitwyre.com/private/orders/cancelled?nonce=17081945&checksum=<payload_checksum>&payload=' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc_idr_spot": [
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_idr_spot",
        "leavesqty": "10",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "orderqty": "10",
        "ordrejreason": "",
        "ordstatus": 4,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "price": "10.0",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 123123132123,
        "transacttime": 0,
        "value": "100.0"
      }
    ],
    "btc_usd_spot": [
      {
        "AvgPx": "0",
        "LastLiquidityInd": "0",
        "LastPx": "0",
        "LastQty": "0",
        "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
        "cancelondisconnect": 0,
        "clorderid": "",
        "cumqty": "0",
        "execid": "",
        "exectype": 1,
        "expiry": 0,
        "fill_price": "0",
        "instrument": "btc_usd_spot",
        "leavesqty": "10",
        "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "orderqty": "10",
        "ordrejreason": "",
        "ordstatus": 4,
        "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "ordtype": 1,
        "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
        "price": "0.1",
        "side": 1,
        "stoppx": "0",
        "time_in_force": 0,
        "timestamp": 123123132123,
        "transacttime": 0,
        "value": "1.0"
      }
    ]
  }
}

Retrieves all cancelled orders. Similar to order history.

Endpoint

https://api.bitwyre.com/private/orders/cancelled

Request Payload Fields

This API does not require request payload

Response Data

A dictionary, where the keys are the symbols and the values are an array of currently cancelled order(s), see Execution report Response.

Getting Order Info

Request


Getting one specific order detail

curl "https://api.bitwyre.com/private/orders/info/732f066e-feed-baad-beef-e000ed83243a?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Getting all orders details

curl "https://api.bitwyre.com/private/orders/info/all?nonce=<nonce>&checksum=<checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

Getting orders details

{
  "error": [],
  "result": [
    {
      "AvgPx": "0",
      "LastLiquidityInd": "0",
      "LastPx": "0",
      "LastQty": "0",
      "account": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fb",
      "cancelondisconnect": 0,
      "clorderid": "",
      "cumqty": "1e-06",
      "execid": "",
      "exectype": 1,
      "expiry": 0,
      "fill_price": "5500.0",
      "instrument": "btc_idr_spot",
      "leavesqty": "9e-06",
      "orderid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fc",
      "orderqty": "1e-05",
      "ordrejreason": "",
      "ordstatus": 1,
      "ordstatusReqID": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fe",
      "ordtype": 1,
      "origclid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fd",
      "price": "5000.0",
      "side": 1,
      "stoppx": "6000.0",
      "time_in_force": 0,
      "timestamp": 1231123123,
      "transacttime": 123123,
      "value": "5000000.0"
    }
  ]
}

Retrieves information on a specific order or all orders.

Endpoint

https://api.bitwyre.com/private/orders/info/:order_id

Request Fields/Parameters

Query Parameter Value Required Description
order_id uuid True specific order_id to get info from. When specified as all, the endpoint will return all orders (open and closed)

Response Data

See Execution report Response.

Getting Order Histories

Request

curl 'https://api.bitwyre.com/private/orders/histories?nonce=17081945&checksum=<payload_checksum>&payload={"instrument":"btc_usdt_futures", "from_time": 1593487780108470000, "to_time": 1593487786824088000}' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc_usdt_futures": [
      {
        "cancel_order_id": "",
        "filled": "1",
        "instrument": "btc_usd_spot",
        "order_id": 1,
        "remaining": "1",
        "fill_price": "1000",
        "status": 1,
        "time": 123123
      }
    ]
  }
}

Retrieves all order histories for current instrument.

Endpoint

https://api.bitwyre.com/private/orders/histories

Request Payload Fields

When no payload specified, it will return all order histories.

Payload Fields Value Required Description
instrument string false base asset, quote asset, product filter, delimited with an _ (underscore).
from_time int false nanosecond timestamp for oldest order to be enumerated.
to_time int false nanosecond timestamp for newest order to be enumerated.

Getting Order Journey

Request

curl 'https://api.bitwyre.com/private/orders/journey?nonce=17081945&checksum=<payload_checksum>&payload={"order_id":"da5f12ea-8c7c-4cab-83a2-c21912aa51e9"}' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "da5f12ea-8c7c-4cab-83a2-c2191": [
      {
        "cancel_order_id": "",
        "qty": "10000", // total number of order requested
        "filled": "8500",
        "instrument": "btc_usd_spot",
        "order_id": "da5f12ea-8c7c-4cab-83a2-c2191",
        "remaining": "1500",
        "cancelled": "0",
        "accumulated_percentage": "85%",
        "incremental_percentage": "85%",
        "status": 1,
        "time": 1621570548809209000
      },
      {
        "cancel_order_id": "",
        "qty": "10000", // total number of order requested
        "filled": "9000",
        "instrument": "btc_usd_spot",
        "order_id": "da5f12ea-8c7c-4cab-83a2-c2191",
        "remaining": "1000",
        "cancelled": "0",
        "accumulated_percentage": "90%",
        "incremental_percentage": "5%",
        "status": 1,
        "time": 1621570557593313000
      }
    ]
  }
}

Retrieves all order histories for current order_id

Endpoint

https://api.bitwyre.com/private/orders/journey

Request Payload Fields

When no payload specified, it will return all order histories.

Payload Fields Value Required Description
order_id string true Order UUID

Cancelling an Open Order or All Open Orders

Request

curl "https://api.bitwyre.com/private/orders/cancel?nonce=17081945&checksum=<payload_checksum>&payload={'order_ids':['a9e3d010-3169-489d-9063-ced912b0fdc9', 'a9e3d010-3169-489d-9063-ced912b0fdc9'], 'qtys':[1, 3]}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X DELETE

Response

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 5,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_idr_spot",
    "leavesqty": "10",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "10",
    "ordrejreason": "",
    "ordstatus": 6,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 3,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "10.0",
    "side": 1,
    "stoppx": "0",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Cancels a specific order.

Endpoint

https://api.bitwyre.com/private/orders/cancel/

Request Fields/Parameters

Query Parameter Value Required Description
order_ids list True list of order_ids to cancel. When specified as an empty list, the endpoint will cancel all open orders
qtys list True list of qtys to cancel corresponding to the order_ids with the same list index

When qtys specified as an empty list, the endpoint will cancel max amount on every order_ids , when only one is specified, endpoint will cancel every order_ids to that amount, if -1 is specified, it cancels all amount

Response Data

See Execution report Response.

Cancelling an Open Order per Instrument

Request

curl "https://api.bitwyre.com/private/orders/cancel/instrument/btc_usdt_spot?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X DELETE

Response

{
  "error": [],
  "result": {
    "AvgPx": "0",
    "LastLiquidityInd": "0",
    "LastPx": "0",
    "LastQty": "0",
    "account": "a9e3d010-3169-489d-9063-ced912b0fdc8",
    "cancelondisconnect": 0,
    "clorderid": "",
    "cumqty": "0",
    "execid": "",
    "exectype": 5,
    "expiry": 0,
    "fill_price": "0",
    "instrument": "btc_usdt_spot",
    "leavesqty": "10",
    "orderid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "orderqty": "10",
    "ordrejreason": "",
    "ordstatus": 6,
    "ordstatusReqID": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "ordtype": 3,
    "origclid": "a9e3d010-3169-489d-9063-ced912b0fdc9",
    "price": "10.0",
    "side": 1,
    "stoppx": "0",
    "time_in_force": 0,
    "timestamp": 123123132123,
    "transacttime": 0,
    "value": "100.0"
  }
}

Cancels all open orders for a specific instrument.

Endpoint

https://api.bitwyre.com/private/orders/cancel/instrument/<string:instrument>

Request Fields/Parameters

Query Parameter Value Required Description
instrument string True specific instrument

Response Data

See Execution report Response.

Getting Trade History

curl 'https://api.bitwyre.com/private/trades?nonce=17081945&checksum=<payload_checksum>&payload={"count": 2, "from_time": 1509225871147236500, "to_time": 1709225871147236500, "instrument":"btc_usd_spot"}' \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc_usd_spot": [
      {
        "exec_price": 20.0,
        "exec_qty": 1.0,
        "exec_type": 1,
        "exec_value": 20000.0,
        "fee_paid": 0.005,
        "fee_rate": 0.0001,
        "fee_type": 1,
        "notes": "insert notes",
        "order_price": 0,
        "order_qty": 0,
        "order_remaining": 0,
        "order_type": 1,
        "order_uuid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fd",
        "side": 1,
        "status": 1,
        "symbol": "btc_usd_spot",
        "timestamp": 123123,
        "user_uuid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fb"
      },
      {
        "exec_price": 20.0,
        "exec_qty": 1.0,
        "exec_type": 1,
        "exec_value": 20000.0,
        "fee_paid": 0.005,
        "fee_rate": 0.0001,
        "fee_type": 1,
        "notes": "insert notes",
        "order_price": 0,
        "order_qty": 0,
        "order_remaining": 0,
        "order_type": 1,
        "order_uuid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fe",
        "side": 1,
        "status": 1,
        "symbol": "btc_usd_spot",
        "timestamp": 123123,
        "user_uuid": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fb"
      }
    ]
  }
}

Retrieves some latest buying/selling transaction history.

Endpoint

https://api.bitwyre.com/private/trades

Request Payload Fields

JSON Field Data Type Required Remark
instrument string false base asset, quote asset, product filter, delimited with an _ (underscore).
count number false limit the latest historical trade data.
from_time big-integer false inclusive historical time offset, unixtime in nanoseconds.
to_time big-integer false exclusive historical time limit, unixtime in nanoseconds.

Response Types

Dictionary of instrument and it's trades info, trade info fields:

JSON Field Data Type Remark
id uuid-string universal unique id of the trade.
time big-integer Trade time, unixtime in nanoseconds.
type enum-string "buy" for buy, "sell" for sell.
price float-string quote price for the base asset of the trade.
volume float-string base asset amount of the trade.
total float-string total quote value of the trade.
fee_percentage float-string percentage of the fee.
fee float-string fee value.
fee_currency string asset of the fee, in most case is the quote asset.

Creating a New Crypto Withdrawal Request

curl "https://api.bitwyre.com/private/account/withdrawal/crypto" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"asset\": \"btc\",\
      \"amount\": \"1\",\
      \"address\": \"12dRugNcdxK39288NjcDV4GX7rMsKCGn6B\",\
      \"notes\": \"Buying new shoes\"\
    }\
  }"

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "btc": [
        {
          "fee": "to-be-determined",
          "gross_amount": "to-be-determined",
          "id": "f98c7277-881a-46f8-a260-99c626619c2f",
          "nett_amount": "1.0",
          "network_confirmation": 0,
          "provider": "hot",
          "status": "Pending",
          "submit_time": 1617971125374549000,
          "success_time": 0,
          "tx_id": "",
          "type": "crypto",
          "verification_uuid": "db6547d6-dc9e-404f-982f-75cc2fa7b919"
        }
      ]
    }
  }
}

Creates a new withdrawal request for a given asset with the given amount.

A confirmation email will be sent and contains instruction on how to confirm the withdrawal request.

The transaction will not be processed before a confirmation is conducted.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto

Request Fields/Parameters

JSON Field Value Required Description
asset string true Asset to withdraw.
amount string true Amount to withdraw.
address string true Destination address.
notes string false Optional annotation, e.g. "Buying new shoes".

Response Data

See Response Asset Statement Object.

Verify Crypto Withdrawal Request

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/verify/65792f1b-a4b5-4b41-befd-f1e5bb8815ef/4cd1ff2d-cda0-4e9f-b1d5-2b59f1b17154?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "withdrawal_verified": [
      {
        "id": "65792f1b-a4b5-4b41-befd-f1e5bb8815ef",
        "transaction_uuid": "4cd1ff2d-cda0-4e9f-b1d5-2b59f1b17154",
        "is_verified": 1
      }
    ]
  }
}

Confirms that the crypto withdrawal requeset is verified.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/verify/:withdrawal_id/:verification_uuid

Request Fields/Parameters

Path Parameter Value Required Description
"withdrawal_id" uuid-string true specific withdrawal_id to get info from. If specified as all it will return all crypto withdrawal request statuses
"verification_uuid" uuid-string true specific verification_uuid to verified withdrawal request

Getting a Crypto Withdrawal Request Status

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/btc/65792f1b-a4b5-4b41-befd-f1e5bb8815ef?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "btc": [
        {
          "fee": "0",
          "gross_amount": "1.0",
          "id": "65792f1b-a4b5-4b41-befd-f1e5bb8815ef",
          "is_verified": 0,
          "nett_amount": "100000000",
          "network_confirmation": 0,
          "provider": "",
          "status": "Pending",
          "submit_time": 1617974544503655000,
          "success_time": 0,
          "tx_id": "",
          "verification_uuid": "3b577d3e-8e15-4ff9-aee6-4e95c3042a05",
          "withdrawal_type": "crypto"
        }
      ]
    }
  }
}

Retrieves a withdrawal request's details.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/:asset/:withdrawal_id

Request Fields/Parameters

Path Parameter Value Required Description
asset string true Crypto asset, e.g btc, bch.
withdrawal_id uuid-string true specific withdrawal_id to get info from. If specified as all it will return all crypto withdrawal request statuses

Creating a New Fiat Withdrawal Request

curl "https://api.bitwyre.com/private/account/withdrawal/fiat" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"asset\": \"usdt\",\
      \"amount\": \"15000000\",\
      \"notes\": \"Buying a new computer\"\
      \"address\": \"An address\"\
    }\
  }"

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "idr": [
        {
          "centralized_confirmation": 0,
          "fee": "to-be-determined",
          "gross_amount": "1000.0",
          "id": "9a149eae-be9e-49f4-b209-6b333a19659e",
          "nett_amount": "to-be-determined",
          "provider": "",
          "status": "pending",
          "submit_time": 1618207558621551000,
          "success_time": 0,
          "tx_id": "",
          "type": "fiat",
          "verification_uuid": "3af17d81-499d-496e-b2cf-8b061ad63735"
        }
      ]
    }
  }
}

Creates a new withdrawal request for a given asset with the given amount.

A confirmation email will be sent and contains instruction on how to confirm the withdrawal request.

The transaction will not be processed before a confirmation is conducted.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/fiat

Request Fields/Parameters

JSON Field Value Required Description
asset string true Asset to withdraw.
amount string true Amount to withdraw.
address string true Address to transfer.
notes string false Optional annotation, e.g. "Buying new shoes".

Response Data

See Banking Details.

Verify Fiat Withdrawal Request

curl "https://api.bitwyre.com/private/account/withdrawal/fiat/verify/65792f1b-a4b5-4b41-befd-f1e5bb8815ef/4cd1ff2d-cda0-4e9f-b1d5-2b59f1b17154?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "withdrawal_verified": [
      {
        "id": "65792f1b-a4b5-4b41-befd-f1e5bb8815ef",
        "transaction_uuid": "4cd1ff2d-cda0-4e9f-b1d5-2b59f1b17154",
        "is_verified": 1
      }
    ]
  }
}

Confirms that the fiat withdrawal requeset is verified.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/fiat/verify/:withdrawal_id/:verification_uuid

Request Fields/Parameters

Path Parameter Value Required Description
"withdrawal_id" uuid-string true specific withdrawal_id to get info from. If specified as all it will return all crypto withdrawal request statuses
"verification_uuid" uuid-string true specific verification_uuid to verified withdrawal request

Getting a Fiat Withdrawal Request Status

curl "https://api.bitwyre.com/private/account/withdrawal/fiat/idr/65792f1b-a4b5-4b41-befd-f1e5bb8815ef?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "idr": [
        {
          "id": "073ba6e5-24d2-4532-8b02-58c1d7a104be",
          "tx_id": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
          "status": "pending",
          "type": "fiat",
          "provider": "bitwyre_bank",
          "gross_amount": "15000000",
          "fee": "0.001",
          "nett_amount": "14990000",
          "centralized_confirmation": true,
          "submit_time": 1571747594573320135,
          "success_time": null
        }
      ]
    }
  }
}

Retrieves a withdrawal request's details.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/fiat/:asset/:withdrawal_id

Request Fields/Parameters

Path Parameter Value Required Description
"asset" string true Fiat asset, e.g idr, usdt.
"withdrawal_id" uuid-string true specific withdrawal_id to get info from. If specified as all it will return all fiat withdrawal requests

Response Data

See Response Asset Statement Object.

Getting a New Crypto Deposit Address

curl "https://api.bitwyre.com/private/account/deposit/crypto" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"asset\": \"btc\"\
    }\
  }"

Response

{
  "error": [],
  "result": {
    "deposit": {
      "btc": [
        {
          "address": "3MzqqLdsYA7mL7re49JMLHJUjbFQ5RHHc6"
        }
      ]
    }
  }
}

Gets a new deposit address for a given asset.

Endpoint

https://api.bitwyre.com/private/account/deposit/crypto

Request Fields/Parameters

JSON Field Value Required Description
asset string true Asset to get a deposit deposit address for.

Getting a Crypto Deposit Address' History

curl "https://api.bitwyre.com/private/account/deposit/crypto/btc/3MzqqLdsYA7mL7re49JMLHJUjbFQ5RHHc6?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "deposit": {
      "3MzqqLdsYA7mL7re49JMLHJUjbFQ5RHHc6": [
        {
          "id": "4b6dc35a-ab03-4f55-bb81-8efb5a8569e0",
          "tx_id": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
          "status": "success",
          "type": "crypto",
          "provider": "warm",
          "gross_amount": "150.00",
          "fee": "0.1",
          "nett_amount": "149.9",
          "network_confirmation": 4,
          "submit_time": 1571747594573320135,
          "success_time": 1571747594573320135,
          "url": "https://live.blockcypher.com/btc-testnet/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16/"
        }
      ]
    }
  }
}

Gets a crypto deposit address' transaction history.

Basically this is a subset operation of Getting Account Statement.

Endpoint

https://api.bitwyre.com/private/account/deposit/crypto/:asset/:address

Request Fields/Parameters

Path Parameter Value Required Description
asset string true Crypto asset, e.g btc.
address string true Crypto deposit address. If specified as all it will return all crypto deposit history

Getting a New Fiat Deposit Address

curl "https://api.bitwyre.com/private/account/deposit/fiat/all" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET

Response

{
  "error": [],
  "result": {
    "idr": [
      {
        "account": "1079026031",
        "bank": "PT Artha Graha International Tbk",
        "city": "Jakarta",
        "country": "Republic of Indonesia",
        "currency": "idr",
        "notes": "US Citizens are prohibited from sending wires in USD for trading. If we find out have the right to return the money and cancel all trades.",
        "routing_number": "",
        "swift_code": "ARTGIDJAXXX"
      }
    ],
    "usd": [
      {
        "account": "596971587",
        "bank": "JP Morgan Chase",
        "city": "New York",
        "country": "United States of America",
        "currency": "usd",
        "notes": "US Citizens are prohibited from sending wires in USD for trading. If we find out have the right to return the money and cancel all trades.",
        "routing_number": "021000021",
        "swift_code": "CHASUS33XXX"
      }
    ]
  }
}

Gets a new deposit address for a given asset

Endpoint

https://api.bitwyre.com/private/account/deposit/fiat/<asset>

Request Fields/Parameters

JSON Field Value Required Description
asset string true Asset to get a deposit address for e.g. USD, IDR, if ALL then return every deposit address

Getting a Fiat Deposit Address' History

curl "https://api.bitwyre.com/private/account/deposit/fiat/idr/address?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "deposit": {
      "address": [
        {
          "centralized_confirmation": 0,
          "fee": "0",
          "gross_amount": "0",
          "id": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fb",
          "nett_amount": "0",
          "provider": "",
          "status": "pending",
          "submit_time": 0,
          "success_time": 0,
          "tx_id": "9927e7e9-c6d0-43ad-9443-8bb6b56ce1fb",
          "type": "fiat"
        }
      ]
    }
  }
}

Gets a fiat deposit address' transaction history.

Basically this is a subset operation of Getting Account Statement.

Endpoint

https://api.bitwyre.com/private/account/deposit/fiat/:asset/:address

Request Fields/Parameters

Path Parameter Value Required Description
asset string true Fiat asset, e.g idr.
address string true Fiat deposit address. If specified as `all it will return all fiat deposit history

Cancel Pending Crypto Withdrawal

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/btc/fd15191a-7fe5-406d-91e8-fdfcb9476234?nonce=17081945&checksum=<payload_checksum>&payload="
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X DELETE

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "btc": [
        {
          "id": "073ba6e5-24d2-4532-8b02-58c1d7a104be",
          "status": "Cancelled",
          "submit_time": 1571747594573320135,
          "success_time": 1571747594573321111
        }
      ]
    }
  }
}

We conduct crypto withdrawal transfers 4 times a day 6:00 Jakarta/WIB, 12:00 Jakarta/WIB, 18:00 Jakarta/WIB, 00:00 Jakarta/WIB. A cancel pending withdrawal for crypto operation can only be done 1 hour before those designated withdrawal times.

For example, for the withdrawal batch of 6:00 Jakarta/WIB, the cancel time window closes on 5:00 Jakarta/WIB.

Any attempt to cancel a withdrawal after the cancel time window is rejected and will be returned a status of "cancel rejected" and be automatically processed on the next batch.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/:crypto/:withdrawal_id

Request Fields/Parameters

Path Parameter Value Required Description
withdrawal_id String True Withdrawal pending UUID. If specified as `all it cancel all pending withdrawals

Response Data

JSON Field Data Type Remark
id string UUID of pending request
status string Cancel Success/Cancel Rejected
submit_time integer-timestamp Nanosecond timestamp of submit time
success_time integer-timestamp Nanosecond timesamp of success time, null on cancel rejecteed

Cancel Pending Fiat Withdrawal

curl "https://api.bitwyre.com/private/account/withdrawal/fiat/usdt/fd15191a-7fe5-406d-91e8-fdfcb9476234?nonce=17081945&checksum=<payload_checksum>&payload="
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X DELETE

Response

{
  "error": [],
  "result": {
    "withdrawal": {
      "usdt": [
        {
          "id": "073ba6e5-24d2-4532-8b02-58c1d7a104be",
          "status": "Cancelled",
          "submit_time": 1571747594573320135,
          "success_time": 1571747594573321111
        }
      ]
    }
  }
}

We conduct fiat withdrawal transfers 1 time a day 9:00 Jakarta/WIB. A cancel pending withdrawal for fiat operation can only be done 24 hours before those designated withdrawal times.

For example, for the withdrawal batch of 9:00 Jakarta/WIB, the cancel time window closes on 8:59 Jakarta/WIB the previous day

Any attempt to cancel a withdrawal after the cancel time window is rejected and will be returned a status of "cancel rejected" and be automatically processed on the next batch.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/fiat/:fiat/:withdrawal_id

Request Fields/Parameters

Path Parameter Value Required Description
withdrawal_id String True Withdrawal pending UUID. If specified as `all it cancel all pending withdrawals

Response Data

JSON Field Data Type Remark
id string UUID of pending request
status string Cancel Success/Cancel Rejected
submit_time integer-timestamp Nanosecond timestamp of submit time
success_time integer-timestamp Nanosecond timesamp of success time, null on Cancel rejecteed

Getting Crypto Withdrawal Addresses

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/address"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET

Response

{
  "error": [],
  "result": {
    "btc": [
      {
        "address": "3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",
        "address_name": "mybtcaddress1",
        "created_at": "30/07/2021, 00:00:00"
      }
    ],
    "eth": [
      {
        "address": "0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7",
        "address_name": "myethaddress1",
        "created_at": "30/07/2021, 00:00:00"
      }
    ]
  }
}

Response If User have no existing addresses

{
  "error": ["No addresses found yet. Please insert and confirm to list one."],
  "result": []
}

Return all user's existing and verified crypto withdrawal addresses

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/address

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Data

JSON Field Data Type Remark
asset string Crypto asset
address string Crypto address
address_name string Address name
created_at string Datetime of address creation

Add Crypto Withdrawal Address

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/address"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
            \"asset\": \"btc\",\
            \"address\": \"3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5\",\
            \"address_name\": \"mybtcaddress1\",\
      }"
  -X PUT

Response if Success

{
  "error": [],
  "result": {
    "message": "Successfully add btc withdrawal address 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",
    "success": 1,
    "timestamp": 1627473142470220000
  }
}

Response if a duplicate address was inserted

{
  "error": ["You are inserting a duplicate address that has been confirmed"],
  "result": {}
}

Add a crypto withdrawal address for the user

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/address

Request Fields/Parameters

JSON Field Value Required Description
asset string True crypto asset
address string True crypto address
address_name string True address name

Response Data

JSON Field Data Type Remark
message string response message
success integer return 1 if the operation success
timestamp integer Nanosecond timestamp

Remove Crypto Withdrawal Address

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/address"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
            \"asset\": \"btc\",\
            \"address\": \"3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5\",\
      }"
  -X DELETE

Response if Success

{
  "error": [],
  "result": {
    "message": "Successfully remove btc withdrawal address 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",
    "success": 1,
    "timestamp": 1627473142470220000
  }
}

Response if the address was already deleted

{
  "error": ["You have deleted your address, you cannot use it anymore"],
  "result": {}
}

Remove a crypto withdrawal address for the user

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/address

Request Fields/Parameters

JSON Field Value Required Description
asset string True crypto asset
address string True crypto address

Response Data

JSON Field Data Type Remark
message string response message
success integer return 1 if the operation success
timestamp integer Nanosecond timestamp

Verify Crypto Withdrawal Address

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/address"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
            \"asset\": \"btc\",\
            \"address\": \"3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5\",\
            \"withdrawal_confirmation_uuid\": \"c2025d42-e0c6-47a4-9f0f-bdc627983163\",\
      }"
  -X POST

Response if Success

{
  "error": [],
  "result": {
    "message": "Successfully verify btc withdrawal address 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",
    "success": 1,
    "timestamp": 1627473142470220000
  }
}

Response if the address was already verified

{
  "error": ["You have already confirmed the address"],
  "result": {}
}

Response if wrong withdrawal confirmation uuid was inserted.

{
  "error": ["Wrong withdrawal confirmation code"],
  "result": {}
}

Verify a crypto withdrawal address for the user

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/address

Request Fields/Parameters

JSON Field Value Required Description
asset string True crypto asset
address string True crypto address
withdrawal_confirmation_uuid string True withdrawal address confirmation uuid

Response Data

JSON Field Data Type Remark
message string response message
success integer return 1 if the operation success
timestamp integer Nanosecond timestamp

Resend Verification Crypto Withdrawal Address

curl "https://api.bitwyre.com/private/account/withdrawal/crypto/address"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
            \"asset\": \"btc\",\
            \"address\": \"3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5\",\
      }"
  -X PATCH

Response if Success

{
  "error": [],
  "result": {
    "message": "Successfully resend verification code for btc withdrawal address 3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",
    "success": 1,
    "timestamp": 1627473142470220000
  }
}

Response if the address was already verified

{
  "error": ["You have already confirmed the address"],
  "result": {}
}

Response if wrong address was inserted.

{
  "error": ["Address is not found. Please add the address first."],
  "result": {}
}

Resend the verification code for a crypto withdrawal address to the user via e-mail.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/crypto/address

Request Fields/Parameters

JSON Field Value Required Description
asset string True crypto asset
address string True crypto address

Response Data

JSON Field Data Type Remark
message string response message
success integer return 1 if the operation success
timestamp integer Nanosecond timestamp

Getting Banking Details

curl "https://api.bitwyre.com/private/account/banking/get/<asset>?nonce=17081945&checksum=<payload_checksum>&payload="
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "account_nickname": "Nakamoto Chase Account",
    "asset": "idr",
    "bank_account": 123456,
    "bank_account_name": "Satoshi Nakamoto",
    "bank_name": "JP Morgan Chase",
    "details": "routing code XXXXX",
    "id": "1d987421-e850-4efe-85a8-30efb9665c2f",
    "swift_code": "CHASUSXX"
  }
}

Endpoint

https://api.bitwyre.com/private/account/banking/get

Request Fields/Parameters

Parameter asset to get its associated bank detail, use all to query all asset bank detail Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Setting Banking Details

curl "https://api.bitwyre.com/private/account/banking/post"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\
          \"bank_name\": \"JP Morgan Chase\",\
          \"swift_code\": \"CHASUSXX\",\
          \"bank_account\": \"xxxxxxxxxxx\",\
          \"bank_account_name\": \"Satoshi Nakamoto\",\
          \"address\": \"23 Embarcadero Road, California, USA\",
          \"details\": \"routing code XXXXX\"\
          \"account_nickname\": \"Nakamoto Chase Account\",
          \"asset\": \"idr\",
        }\
      }"

Response

{
  "error": [],
  "result": {
    "result": true
  }
}

Endpoint

https://api.bitwyre.com/private/account/banking

Request Fields/Parameters

JSON Field Value Required Description
bank_name The bank name True The bank name designated for deposit/withdrawal
swift_code The bank SWIFT code True The bank's SWIFT code
bank_account The bank account number or IBAN True The designated deposit/withdrawal bank account number or IBAN
bank_account_name The bank account owner's name True The customer's name according to KYC/AML details
address The address of the customer True The customer's address according to KYC/AML details
details Other details to ease the process of transfer True The banking specific details needed to conduct the transfer that are country specific
account_nickname The nickname for this banking account False The customer's preference nickname for the account
asset Asset name True The Asset to be associated with the bank account

Response Data

JSON Field Data Type Remark
id string-uuid the UUID of the insertion

Getting List of Deposit Payment Gateways

curl "https://api.bitwyre.com/private/account/deposit/gateway?nonce=17081945&checksum=<payload_checksum>&payload={\"asset\": \"usdt\"}"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "payment_gateway_name": "IDR Dana",
    "url_payment": "https://dana.id/payment/id=xxxxxxxxx",
    "url_callback": "https://api.bitwyre.com/private/account/gateway/callback"
  }
}

Endpoint

https://api.bitwyre.com/private/account/deposit/gateway

Request Fields/Parameters

JSON Field Value Required Description
"asset" string true Fiat asset for e.g. USD, IDR

Response Data

JSON Field Data Type Remark
payment_gateway_name string payment gateway name
url_payment string-url URL to be redirected for payment gateway
url_callback string-url URL to get callback after payment gateway operation finished

Getting List of Withdrawal Payment Gateways

curl "https://api.bitwyre.com/private/account/withdrawal/gateway?nonce=17081945&checksum=<payload_checksum>&payload={\"asset\": \"idr\"}"
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "payment_gateway_name": "IDR Duitku",
    "url_payment": "https://dana.id/payment/id=xxxxxxxxx",
    "url_callback": "https://api.bitwyre.com/private/account/withdrawal/callback"
  }
}

Endpoint

https://api.bitwyre.com/private/account/withdrawal/gateway

Request Fields/Parameters

JSON Field Value Required Description
"asset" string true Fiat asset for e.g. USD, IDR

Response Data

JSON Field Data Type Remark
payment_gateway_name string payment gateway name
url_payment string-url URL to be redirected for payment gateway
url_callback string-url URL to get callback after payment gateway operation finished

Get Chat Message

Request

curl "https://api.bitwyre.com/private/chat?nonce=17081945&checksum=<payload_checksum>&payload={\"counterparty\": <counterparty_username>}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "Counterparty": [
      {
        "from": "Active User",
        "message": "Say Hi",
        "timestamp": 1617946673962115000,
        "to": "Counterparty"
      },
      {
        "from": "Counterparty",
        "message": "Say Hi Back",
        "timestamp": 1617946673962115002,
        "to": "Active User"
      },
      {
        "from": "Active User",
        "message": "Ask Question",
        "timestamp": 1617946673962115004,
        "to": "Counterparty"
      },
      {
        "from": "Counterparty",
        "message": "Answer Question",
        "timestamp": 1617946673962115002,
        "to": "Active User"
      }
    ],
    "Counterparty2": [
      {
        "from": "Active User",
        "message": "Say Hi 2",
        "timestamp": 1617946673962115000,
        "to": "Counterparty2"
      }
    ]
  }
}

Retrieve user's chat message encrypted in Elliptic Curve Integrated Encryption Scheme (ECIES).

Endpoint

https://api.bitwyre.com/private/chat

Request Fields/Parameters

For showing chats on another username. Otherwise on if payload is not specified it automatically returns all valid chat

Payload Fields Value Required Description
counterparty string false the other user username chat to retrieve

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
chat counter party string the person who you are chatting with
list of timestamp, encrypted messages string timestamp and encrypted messages
... ... ...

Send Chat Message

Request

curl "https://api.bitwyre.com/private/chat?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": \"I really like that painting\",\
      }"

Response

{
  "error": [],
  "result": {
    "timestamp": 1590654854095640000,
    "message_id": "3e00e9f4-fe7a-45c9-9ed7-456d9e6518b3"
  }
}

In the event that sending the chat is not successful

{
  "error": ["Internal server error"],
  "result": {}
}

Send a chat message.

Endpoint

https://api.bitwyre.com/private/chat

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True Chat message

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
timestamp Integer Nanosecond timestamp
message_id UUID-String The message ID

Get Chat Message with Limit

Request

curl "https://api.bitwyre.com/private/chat/list?nonce=17081945&checksum=<payload_checksum>&payload={\"counterparty\": <counterparty_username>, limit: 5}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "Counterparty": [
      {
        "from": "Active User",
        "message": "Say Hi",
        "timestamp": 1617946673962115000,
        "to": "Counterparty"
      },
      {
        "from": "Counterparty",
        "message": "Say Hi Back",
        "timestamp": 1617946673962115002,
        "to": "Active User"
      },
      {
        "from": "Active User",
        "message": "Ask Question",
        "timestamp": 1617946673962115004,
        "to": "Counterparty"
      },
      {
        "from": "Counterparty",
        "message": "Answer Question",
        "timestamp": 1617946673962115002,
        "to": "Active User"
      }
    ],
    "Counterparty2": [
      {
        "from": "Active User",
        "message": "Say Hi 2",
        "timestamp": 1617946673962115000,
        "to": "Counterparty2"
      }
    ]
  }
}

Retrieve user's chat message encrypted in Elliptic Curve Integrated Encryption Scheme (ECIES) with limit data.

Endpoint

https://api.bitwyre.com/private/chat/list

Request Fields/Parameters

For showing chats on another username. Otherwise on if payload is not specified it automatically returns all valid chat

Payload Fields Value Required Description
counterparty string false the other user username chat to retrieve
limit int false number of retrieved chat data

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
chat counter party string the person who you are chatting with
list of timestamp, encrypted messages string timestamp and encrypted messages
... ... ...

Search Chat Message

Request

curl "https://api.bitwyre.com/private/chat/search?nonce=17081945&checksum=<payload_checksum>&payload={\"keyword\":\"Hello\"}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET

Response

{
  "error": [],
  "result": {
    "Counterparty": [
      {
        "from": "Active User",
        "message": "Hello whats good?",
        "timestamp": 1617946673962115000,
        "to": "Counterparty"
      },
      {
        "from": "Counterparty",
        "message": "Hello, BTC is to the moon",
        "timestamp": 1617946673962115002,
        "to": "Active User"
      }
    ]
  }
}

In the event that searching the chat is not successful

{
  "error": ["Internal server error"],
  "result": {}
}

Search inside historial chats.

Endpoint

https://api.bitwyre.com/private/chat/search

Request Fields/Parameters

Payload Fields Value Required Description
keyword string True Chat message to be search
counterparty string False The other user username chat to retrieve

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
chat counter party string the person who you are chatting with
list of timestamp, encrypted messages string timestamp and encrypted messages
... ... ...

Send Escrow Request

Request

curl "https://api.bitwyre.com/private/escrow" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {
            \"base_asset\": \"btc\",\
            \"base_asset_amount\":\"1000\",\
            \"quote_asset\": \"eth\",\
            \"quote_asset_amount\":\"3000\",\
            \"counterparty\": \"counterparty\"}\
      }"

Response

{
  "error": [],
  "result": {
    "status": "pending",
    "escrow_id": "76f7704b-85c7-4cb8-9a71-e48293616705",
    "implied_price": "0.00000001 BTC/IDR",
    "instrument": "btc_idr_spot",
    "action": "Exchange 1 BTC for 100000000 IDR",
    "counterparty": "John",
    "fee_percentage": "0.01%",
    "fee_amount": "0.01 BTC",
    "order_time": 1495324800000000001,
    "order_expiry_time": 1495424800000000001
  }
}

Send an OTC escrow request

Endpoint

https://api.bitwyre.com/private/escrow

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True base_asset, base_asset_amount, quote_asset, quote_asset_amount, counterparty

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
status String Acknoledgement that the post has been sent
escrow_id UUID-String Unique ID for the escrow request
implied_price Float-String Base Amount/Quote Amount
instrument String Instrument Base/Quote
action String A simple message about the trade
counterparty String The counterparty username
fee_percentage Float-String Amount of fee in percentage
fee Float-String Amount of fee in quote asset
order_time Float-String Nanosecond timestamp when order is specified
order_expiry_time Integer Nanosecond timestamp when order would be expired

Accepting An Escrow Request

Request

curl "https://api.bitwyre.com/private/escrow" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X PUT \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\"escrow_id\": \"9fa11e7f-afdf-4e89-a8a7-5a2d95a34026\"}
      }"

Response

{
  "error": [],
  "result": {
    "status": "processing",
    "escrow_id": "9fa11e7f-afdf-4e89-a8a7-5a2d95a34026"
  }
}

Accepting a OTC escrow request

Endpoint

https://api.bitwyre.com/private/escrow

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True escrow_id

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
status string Current status of the trade
escrow_id UUID-String Unique ID for the escrow request

Declining An Escrow Request

Request

curl "https://api.bitwyre.com/private/escrow" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X DELETE \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\"escrow_id\": \"9fa11e7f-afdf-4e89-a8a7-5a2d95a34026\"}"

Response

{
  "error": [],
  "result": {
    "status": "rejected",
    "escrow_uuid": "76f7704b-85c7-4cb8-9a71-e48293616701",
    "status_reason": "counterparty_reject"
  }
}

Declining a OTC escrow request

Endpoint

https://api.bitwyre.com/private/escrow

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True escrow_id

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
status string Current status of the trade
escrow_id UUID-String Unique ID for the escrow request
status_reason Stringtring Reason of the current status

Escrow History

Request

curl "https://api.bitwyre.com/private/escrow/history/<escrow_uuid>" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET

Response

{
  "error": [],
  "result": [
    {
      "base_amount": 1.0,
      "escrow_uuid": "cb60899c-7fd2-47b7-9de3-55d2f65e8855",
      "counterparty": "John",
      "counterparty_id": "0950831861a05539f5ec74f8d5faafddad70fdf385804955532beb91052e458a",
      "fee_amount": "0.01 BTC",
      "fee_percentage": "0.01%",
      "implied_price": "0.00000001 BTC/IDR",
      "instrument": "btc_idr_spot",
      "message": "Lee asks John to exchange 1.0 BTC for 100000000.0 IDR",
      "order_expiry_time": 1618825892598826000,
      "order_time": 1618822292598826000,
      "quote_amount": 100000000.0,
      "requester": "Lee",
      "requester_id": "127e50eb9a6646e2833fee8d69477c7371e2cbc5fbb0a37b7f83b58f02f512d9",
      "status": "processing",
      "status_reason": ""
    },
    {
      "base_amount": 1.0,
      "escrow_uuid": "cb60899c-7fd2-47b7-9de3-55d2f65e8857",
      "counterparty": "John",
      "counterparty_id": "0950831861a05539f5ec74f8d5faafddad70fdf385804955532beb91052e458a",
      "fee_amount": "0.01 BTC",
      "fee_percentage": "0.01%",
      "implied_price": "0.00000001 BTC/IDR",
      "instrument": "btc_idr_spot",
      "message": "Lee asks John to exchange 1.0 BTC for 100000000.0 IDR",
      "order_expiry_time": 1618825892598826000,
      "order_time": 1618822292598826000,
      "quote_amount": 100000000.0,
      "requester": "Lee",
      "requester_id": "127e50eb9a6646e2833fee8d69477c7371e2cbc5fbb0a37b7f83b58f02f512d9",
      "status": "rejected",
      "status_reason": "counterparty_reject"
    }
  ]
}

History of a user's OTC escrow trades

Endpoint

https://api.bitwyre.com/private/escrow

Request Fields/Parameters

Please refer to Authentication.

Payload Fields Value Required Description
escrow_uuid string false the unique escrow identifier, when speficied "all" will return every escrow transaction

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
status string The current status of the trade
status_reason string Reason for the status
requester string The username who initiated the trade
requester_id Hash-string The hashed uuid who initiated the trade
counterparty string The counterparty username
counterparty_id Hash-string The counterparty hashed uuid
escrow_id UUID-String Unique ID for the escrow request
implied_price Float-String Base Amount/Quote Amount
instrument String Instrument Base/Quote
base_amount String The base amount to be traded
quote_amount String The quote amount to be traded
message String A simple message explaining the trade
fee_percentage Float-String Amount of fee in percentage
fee Float-String Amount of fee in quote asset
timestamp Integer Nanosecond timestamp when order was specified
order_expiry_time Integer Nanosecond timestamp when order would be expired

Escrow History Pending

Request

curl "https://api.bitwyre.com/private/escrow/pending" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET

Response

{
  "error": [],
  "result": [
    {
      "base_amount": 1.0,
      "escrow_uuid": "cb60899c-7fd2-47b7-9de3-55d2f65e8855",
      "counterparty": "John",
      "counterparty_id": "0950831861a05539f5ec74f8d5faafddad70fdf385804955532beb91052e458a",
      "fee_amount": "0.01 BTC",
      "fee_percentage": "0.01%",
      "implied_price": "0.00000001 BTC/IDR",
      "instrument": "btc_idr_spot",
      "message": "Lee asks John to exchange 1.0 BTC for 100000000.0 IDR",
      "order_expiry_time": 1618825892598826000,
      "order_time": 1618822292598826000,
      "quote_amount": 100000000.0,
      "requester": "Lee",
      "requester_id": "127e50eb9a6646e2833fee8d69477c7371e2cbc5fbb0a37b7f83b58f02f512d9",
      "status": "processing",
      "status_reason": ""
    },
    {
      "base_amount": 1.0,
      "escrow_uuid": "cb60899c-7fd2-47b7-9de3-55d2f65e8857",
      "counterparty": "John",
      "counterparty_id": "0950831861a05539f5ec74f8d5faafddad70fdf385804955532beb91052e458a",
      "fee_amount": "0.01 BTC",
      "fee_percentage": "0.01%",
      "implied_price": "0.00000001 BTC/IDR",
      "instrument": "btc_idr_spot",
      "message": "Lee asks John to exchange 1.0 BTC for 100000000.0 IDR",
      "order_expiry_time": 1618825892598826000,
      "order_time": 1618822292598826000,
      "quote_amount": 100000000.0,
      "requester": "Lee",
      "requester_id": "127e50eb9a6646e2833fee8d69477c7371e2cbc5fbb0a37b7f83b58f02f512d9",
      "status": "processing",
      "status_reason": ""
    }
  ]
}

Return all still pending escrow request for the current user only

Endpoint

https://api.bitwyre.com/private/escrow

Request Fields/Parameters

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
status string The current status of the trade
status_reason string Reason for the status
requester string The username who initiated the trade
requester_id Hash-string The hashed uuid who initiated the trade
escrow_id UUID-String Unique ID for the escrow request
implied_price Float-String Base Amount/Quote Amount
instrument String Instrument Base/Quote
base_amount String The base amount to be traded
quote_amount String The quote amount to be traded
message String A simple message explaining the trade
fee_percentage Float-String Amount of fee in percentage
fee Float-String Amount of fee in quote asset
timestamp Integer Nanosecond timestamp when order was specified
order_expiry_time Integer Nanosecond timestamp when order would be expired

Send Forum Posts

Request

curl "https://api.bitwyre.com/private/forum?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
        \"nonce\": 17081945,\
        \"checksum\": \"somechecksum\",\
        \"payload\": {\"post\": \"this be posts\",\"tagged\":\"john\"}\
      }"

Response

{
  "error": [],
  "result": {
    "success": true,
    "timestamp": 1590654854095640000
  }
}

Send a forum post

Endpoint

https://api.bitwyre.com/private/forum

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True Post message

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
success Bool Acknoledgement that the post has been sent
timestamp Integer Nanosecond timestamp

Get Forum Posts

Request

curl "https://api.bitwyre.com/private/forum?nonce=17081945&checksum=<payload_checksum>&payload={\"tagged\":\"John\",\"poster\":\"Jane\",\"from_time\":\"123123\",\"to_time\":\"123123123\"}" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X GET \

Response

{
  "error": [],
  "result": [
    {
      "post": "ola",
      "poster": "Jane",
      "tagged": "John",
      "timestamp": 1618212090462703000
    }
  ]
}

Send a forum post

Endpoint

https://api.bitwyre.com/private/forum

Request Fields/Parameters

Please refer to Authentication.

JSON Field Value Required Description
"Payload" string True Tagged user, time range

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
success Bool Acknoledgement that the post has been sent
timestamp Integer Nanosecond timestamp
Posts String Received posts

Uploading Identity

Request

curl "https://api.bitwyre.id/private/upload_identity" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"type\": \"passport\",\
    },\
    \"file\": \"somefile.jpg\"
  }"

Response

{
  "error": [],
  "result": {
    "success": true,
    "message": "Image uploaded"
  }
}

Endpoint for user to upload Identities.

Endpoint

https://api.bitwyre.id/private/upload_identity

Request Fields/Parameters

JSON Field Value Required Description
type string true Identity type (passport, id)
file .png or .jpg true the image file

Uploading Selfie

Request

curl "https://api.bitwyre.id/private/upload_selfie" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"type\": \"selfie\",\
    },\
    \"file\": \"somefile.jpg\"
  }"

Response

{
  "error": [],
  "result": {
    "success": true,
    "message": "Image uploaded"
  }
}

Endpoint for user to upload Identities.

Endpoint

https://api.bitwyre.id/private/upload_selfie

Request Fields/Parameters

JSON Field Value Required Description
type string true Image type (selfie)
file .png or .jpg true the image file

Uploading Fiat Deposit Proof

Request

curl "https://api.bitwyre.com/private/account/deposit/fiat/upload_proof" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\
    \"nonce\": 17081945,\
    \"checksum\": \"somechecksum\",\
    \"payload\": {\
      \"transaction_id\": \"7dfd94e9-e3a6-4d6a-b469-489bfe1ced73\",\
    }\
    \"file\": \"somefile.jpg\"
  }"

Response

{
  "error": [],
  "result": {
    "message": "Image uploaded"
  }
}

Endpoint for user to upload fiat transfer proof to be checked.

Endpoint

https://api.bitwyre.com/private/account/withdrawal/fiat/upload_proof

Request Fields/Parameters

JSON Field Value Required Description
transaction_id string true Transaction ID.
file .png or .jpg true the image file
curl "https://api.bitwyre.com/private/custodian/dana/oauth" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "redirect_url": "https://api.saas.dana.id/m/portal/oauth?clientId=2019072315035152397360&subMerchantID=216620000000286412172&scopes=DEFAULT_BASIC_PROFILE,AGREEMENT_PAY,QUERY_BALANCE,CASHIER&requestId=12345678&state=2345555&terminalType=APP&redirectUrl=https://api.bitwyre.com/private/custodian/dana/oauth/callback"
  }
}

Returns a link that redirect to DANA registration

Endpoint

https://api.bitwyre.com/private/custodian/dana/oauth

DANA Create Order Deposit

curl "https://api.bitwyre.com/private/custodian/dana/deposit" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -d "\"payload\": {\
          \"amount\" : 7000
      }\
  -X POST

Response

{
  "error": [],
  "result": {
    "checkout_url": "www.dana.com/?acquirementId=201704284455855447787545&amp;156632685433335",
    "acquirement_id": "201704284455855447787545"
  }
}

Create transaction order for DANA to be processed by DANA, returns a checkout URL and ID for the particular transaction that are given by DANA. Note that the checkout URL is modified by our system to be the original DANA checkout URL + user OTT given by the get OTT function.

Endpoint

https://api.bitwyre.com/private/custodian/dana/deposit

DANA Deposit Payload

Json Field Value Required Description
amount int true the transaction amount in IDR

DANA Get User Balance

curl "https://api.bitwyre.com/private/custodian/dana/balance" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "balance": "100000"
  }
}

Get DANA User balance in IDR

Endpoint

https://api.bitwyre.com/private/custodian/dana/balance

DANA Check If User Has Binded

curl "https://api.bitwyre.com/private/custodian/dana/checkbinding" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {
    "has_binded": true,
    "message": "The user has binded with dana. No need to bind Dana again"
  }
}

Check if already has binded with Dana.

Endpoint

https://api.bitwyre.com/private/custodian/dana/checkbinding

Search Favorites

Search ticker, trades, and depth data of pairs in one endpoint

Request

curl "https://api.bitwyre.id/private/favorites?instruments=['btc_usdt_spot']" -X GET

Response

{
  "error": [],
  "result": {
    "favorites": [
      {
        "btc_usdt_spot": {
          "askbook": [["400.0", "2.0"]],
          "best_ask": "11000",
          "best_bid": "10075",
          "bidbook": [["310.0", "5.0"]],
          "high": "11000",
          "last": "10100",
          "last_trade_price": "10000.0",
          "last_trade_side": 1,
          "last_trade_timestamp": 1571747594573320135,
          "last_trade_uuid": "752837c7-aec6-41f8-bb07-286f859f2718",
          "last_trade_value": "20000.0",
          "last_trade_volume": "2.0",
          "low": "10000",
          "percent_change": "110.0",
          "timestamp": 1571747594573320135,
          "volume_base": "34",
          "volume_quote": "267346.0"
        }
      }
    ]
  }
}

Endpoint

https://api.bitwyre.id/private/favorites

Request Fields/Parameters

Query Parameter Data Type Required Remark
"instruments" list false Instruments of interest (eg ['btc_usdt_spot','eth_usdt_spot'])

Notes: if no instrument is specified, endpoint will return all available instrument

Response Types (JSON Object)

Returns | JSON Field | Data Type | Remark | | ---------- | --------- | -------------------------- | | error | list | Error messages, if any | | result | dictionaries | contain list of dictionaries of the data, grouped by product, market, instrument |

Please check ticker, trades, and depth endpoint documentation for explanation of the dictionary members

Getting Referrals Info

Request

curl "https://api.bitwyre.com/private/referrals?nonce=17081945&checksum=<payload_checksum>&payload=" \
  -H "API-Key: someapikey" \
  -H "API-Sign: somesignature" \
  -X GET

Response

{
  "error": [],
  "result": {"total_invited": 1, "total_earned": {"btc": "0.001", "idr": "1000"}}

Retrieve referrals info.

Endpoint

https://api.bitwyre.com/private/referrals

Request Fields/Parameters

Because this is a GET endpoint, nonce & checksum are query parameters, also payload should be always an empty string. The SHA256 steps for this endpoint's payload:

  1. jsonify an empty string.
  2. then SHA256 from above result.

Please refer to Authentication.

Response Types (JSON Object as Key-Value Pair)

JSON Field Data Type Remark
total_invited int People you invite
total_earned int Total earned group by asset

Websocket Public API

WS Server Time

Connecting

websocat -E "wss://api.bitwyre.com/ws/public/time"

Streaming Responses (1 Hz)

{"unixtime":1571744594571020435}
{"unixtime":1571744595571648685}
{"unixtime":1571744596571345719}
{"unixtime":1571744597571387480}
...

Streams server's time every second.

This helps in approximating the time difference between the server and client.

WS Endpoint

wss://api.bitwyre.com/ws/public/time

WS Request Fields/Parameters

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"unixtime" big-number/i64 unix time in nanoseconds

Websocket Stream

Connecting

websocat -E "wss://api.bitwyre.com/ws/stream"

Bitwyre allows subscribing to real-time data. This access is not rate-limited once connected and is the best way to get the most up-to-date data to your programs.

To subscribe to topics, send them as a comma-separated list in your connection string. For example:

websocat -E wss://api.bitwyre.com/ws/stream

If you are already connected and wish to subscribe to a new topic, send a message with the following format:

{"op": "subscribe", "args": [<SubscriptionTopic1>, <SubscriptionTopic2>, ...]}

You may subscribe to multiple topics at a time by sending an array of subscription topics.

The following subscription topics are available without authentication:

Topic Subscription Data Description
announcement Site announcements
markets The markets supported by Bitwyre e.g crypto, equities, commodities, fixed_income
products The products supported by Bitwyre
assets The assets supported by Bitwyre
instruments:market_product_country The instrument supported by Bitwyre in the format ex. btc_usdt_spot for jurisdictions
contract The contract details for a derivative instrument/asset pair traded at Bitwyre
ticker:instrument The ticker stream supported for instruments at Bitwyre
trades:instrument The trades stream supported for instruments at Bitwyre
depthL2:instrument The L2 (full snapshot) depth stream supported for instruments at Bitwyre
depthL2_10:instrument The L2 (full snapshot) top 10 depth stream supported for instruments at Bitwyre
depthL2_25:instrument The L2 (full snapshot) top 25 depth stream supported for instruments at Bitwyre
depthL2_incr:instrument The L2 (incremental/changes) only stream supported for instruments at Bitwyre
depthL3:instrument The L3 market data stream supported for instruments at Bitwyre

If you wish to get real-time order book data, we recommend you use the depthL2_25 subscription. depth10 pushes the top 10 levels on every tick, but transmits much more data. depthL2 pushes the full L2 order book, but the payload can get very large. orderbookL2_25 provides a subset of the full L2 orderbook, but is throttled. In the future, depth10 may be throttled, so use depthL2 in any latency-sensitive application. For those curious, the id on an depthL2_25 or depthL2 entry is a composite of price and symbol, and is always unique for any given price level. It should be used to apply update and delete actions.

When applicable, subjects may be filtered to a given instrument by appending a colon and instrument name. For example, trade:btc_usdt_spot will subscribe you to messages only for the btc_usdt_spot instrument.

Example traffic data would be

> {"op": "subscribe", "args": ["depthL2:btc_usdt_spot"]}
    < {"success":true,"subscribe":"depthL2:btc_usdt_spot","request":{"op":"subscribe","args":["depthL2:btc_usdt_spot"]}}
    < {
          "table":"depthL2",
          "keys":["instrument", "sequence_number", "bids","asks", "is_frozen"],
          "types": {"str", "int", "list", "list", "bool"}
          "action": "snapshot",
          "data":{
            "instrument": "btc_usdt_spot", 
            "sequence_number": 100000,
            "bids": [["124112000", "0.18154050"], ["124110000", "0.47319750"]],
            "asks": [["124130000", "0.03701609"], ["124251000", "0.03223585"]],
            "is_frozen": false
          }
      }
    < {
          "table":"depthL2",
          "action":"update",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100001,
               "timestamp": 1591592172780386000,
               "price": 9000,
               "qty": 2,
               "is_bid": 1, # indicates that this is a bid 
          }
      }
    < {
          "table":"depthL2",
          "action":"insert",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100002,
               "timestamp": 1591592172780386000,
               "price": 9000,
               "qty": 2, # positive for addition of liquidity
               "is_bid": 0, # indicates that this is not a bid === an ask
          }
      }
    < {
          "table":"depthL2",
          "action": "delete",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100003,
               "timestamp": 1591592172780386000,
               "price": 9000,
               "qty": -2, # negative for removal of liquidity
               "is_bid": 1, # indicates that this is not a bid === an ask
          }
      } 
    ...

Upon subscription, you will receive an image of the existing data, so you can get started. This comes through as a snapshot action.

You may receive other messages before the snapshot comes through. In that case, drop any messages received until you have received the snapshot.

Some notes on this response:

You may unsubscribe using the 'unsubscribe' operation. The formatting is identical to 'subscribe'. Several stream channels are described below.

WS Instruments

Connecting and Query/Request

websocat -E "wss://api.bitwyre.com/stream?subscribe=instruments:crypto_spot_ID"

Query Response

> {"op": "subscribe", "args": ["instruments:crypto_spot_ID"]}
    < {"success":true,"subscribe":"instruments:crypto_spot_ID","request":{"op":"subscribe","args":["instruments:crypto_spot_ID"]}}
    < {
          "table":"instruments:crypto_spot_ID",
          "keys":["instrument", "symbol"],
          "types": {"str", "str"}
          "action": "snapshot",
          "data": [
            {"instrument": "btc_idr_spot", "symbol" : "BTC/IDR"},
            {"instrument": "bch_idr_spot", "symbol": "BCH/IDR"},
            {"instrument": "eth_idr_spot", "symbol": "ETH/IDR"},
            ...
          ]
      }
     ...

Returns an underscore _ delimited tradable asset instruments array.

A sample response for a futures market in crypto:

Request

websocat -E "wss://api.bitwyre.com/stream?subscribe=instruments:crypto_futures_PA"

Response

> {"op": "subscribe", "args": ["instruments:crypto_futures_PA"]}
    < {"success":true,"subscribe":"instruments:crypto_futures_PA","request":{"op":"subscribe","args":["instruments:crypto_futures_PA"]}}
    < {
          "table":"instruments:crypto_futures_PA",
          "keys":["instrument", "symbol"],
          "types": {"str", "str"}
          "action": "snapshot",
          "data": [
            {"instrument": "btcusdtx_usdt_200607F1000000", "symbol" : "BTCM0"}, # BTC USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 10000 USD
            {"instrument": "bchusdtx_usdt_200607F30000", "symbol": "BCHM0"}, # BCH USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 300 USD
            {"instrument": "ethusdtx_usdt_200607F50000", "symbol": "ETHM0"}, # ETH USD Index, futures contract, settled in USD, delivery on June 7th 2020, strike price of 300 USD
            ...
          ]
      }
     ...

We are using an _ (underscore) delimited convention to refer our futures and options product: underlying_settlementcurrency_productdetails.

  1. Underlying financial instrument price. btcusdtx here is the Bitcoin to USD index on Bitwyre's exchange; a weighted average of worldwide Bitcoin spot market index price.
  2. Settlement currency, USD.
  3. Product details:
    • Expiration date: 6 digits in the YYMMDD format.
    • Products:
      • F for Futures.
      • For Options, either P for put or C for call.
      • S for Swaps.
    • Strike price: settlement currency in cents (For this USD example, 10000 here means 100 dollars).

A sample response for an options market in crypto:

Request

websocat -E "wss://api.bitwyre.com/stream?subscribe=instruments:crypto_options_PA"

Response

> {"op": "subscribe", "args": ["instruments:crypto_futures_PA"]}
    < {"success":true,"subscribe":"instruments:crypto_futures_PA","request":{"op":"subscribe","args":["instruments:crypto_futures_PA"]}}
    < {
          "table":"instruments:crypto_futures_PA",
          "keys":["instrument", "symbol"],
          "types": {"str", "str"}
          "action": "snapshot",
          "data": [
            {"instrument": "btcusdtx_usdt_200607C1000000", "symbol" : "BTCM0"}, # BTC USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 10000 USD
            {"instrument": "bchusdtx_usdt_200607C30000", "symbol" : "BCHM0"}, # BCH USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 300 USD
            {"instrument": "ethusdtx_usdt_200607C50000", "symbol" : "ETHM0"}, # ETH USD Index, call options, settled in USD, delivery on June 7th 2020, strike price of 300 USD
            {"instrument": "btcusdtx_usdt_200607P500000", "symbol" : "BTCM0"}, # BTC USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 5000 USD
            {"instrument": "bchusdtx_usdt_200607P10000", "symbol" : "BCHM0"}, # BCH USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 100 USD
            {"instrument": "ethusdtx_usdt_200607P10000", "symbol" : "ETHM0"}, # ETH USD Index, put options, settled in USD, delivery on June 7th 2020, strike price of 100 USD
            ...
          ]
      }
     ...

The product btcusdtx_usdt_200607C1000000 means a call contract with delivery on June 7th, 2020, at the strike price of 10,000 of the underlying financial instrument BTCUSDX). btcusdtx_usdt_200607P200000 means a put contract with delivery on June 7th, 2020, at the strike price of 2,000 of the underlying financial instrument BTCUSDX).

Returns a comma delimited tradable asset instruments array.

WS Endpoint

wss://api.bitwyre.com/ws/public/instruments

WS Request Fields/Parameters

Query Parameter Data Type Required Remark
"market" string true crypto, equities, fixed_income, or commodities
"product" string true spot, futures, options, or swaps
"country" string true ISO 3166-2 Country Code. Only ID or PA for now

WS Response Types (JSON Array)

JSON Field Data Type Remark
JSON-array string base asset, quote asset, product filter, delimited with an _ (underscore).

WS Ticker

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=ticker:btc_usdt_spot"

Streaming Responses (on new ticker)

> {"op": "subscribe", "args": ["ticker:btc_usdt_spot"]}
    < {"success":true,"subscribe":"ticker:btc_usdt_spot","request":{"op":"subscribe","args":["ticker:btc_usdt_spot"]}}
    < {
          "table":"ticker:btc_usdt_spot",
          "keys":["instrument", "asset_base", "asset_quote", "high", "low", "percent_change", "vol_base", "vol_quote", "percent_change", "vol_base", "vol_quote", "last", "best_bid", "best_ask", "timestamp", "market", "product", "is_frozen"],
          "types": {"str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "bool"}
          "action": "insert",
          "data": {
              "instrument": "btc_usdt_spot",
              "asset_base": "btc",
              "asset_quote": "usdt",
              "high": "126989000",
              "low": "115201000",
              "percent_change": "-2.123",
              "vol_base": "611.66499447",
              "vol_quote": "7434324.9431",
              "last": "124783000",
              "best_bid": "124761000",
              "best_ask": "124777000",
              "timestamp": 1571744594571020435,
              "market": "crypto",
              "product": "spot",
              "is_frozen": false
          }
      }
     ...
...

Streams new ticker information for an asset pair, if no asset pair specified the websocket service will stream all instruments ticker.

WS Endpoint

wss://api.bitwyre.com/stream?subscribe=ticker:<instrument>

WS Request Fields/Parameters (during handshake)

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).

If the instrument paremeter is empty or omitted, will return the ticker data of all available asset instruments.

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"instrument" string base asset, quote asset, product filter, delimited with an _ (underscore).
"asset_base" string base asset in the trade pair
"asset_quote" string quote asset in the trade pair
"high" float-string highest market price in the last 24 hours
"low" float-string lowest market price in the last 24 hours
"percent_change" float-string market price change percentage in the last 24 hours (up to 8 precision).
"vol_base" float-string total market volume of the base asset in the last 24 hours
"vol_quote" float-string total market volume of the quote asset in the last 24 hours
"last" float-string last market price for the base asset
"best_bid" float-string current highest bid price
"best_ask" float-string current lowest ask price
"timestamp" big-integer ticker timestamp, unixtime in nanoseconds
"market" enum-string "spot", "futures", "perpetual_swap", "options"
"is_frozen" boolean market frozen status

WS Trades

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=trades:btc_usdt_options"

Streaming Responses (on new trade)

> {"op": "subscribe", "args": ["trades:btc_usdt_options"]}
    < {"success":true,"subscribe":"trades:btc_usdt_options","request":{"op":"subscribe","args":["trades:btc_usdt_options"]}}
    < {
          "table":"trades:btc_usdt_options",
          "keys":["instrument", "price", "volume", "value", "side". "id", "timestamp"],
          "types": {"str", "str", "str", "str", "str", "str", "int"}
          "action": "insert",
          "data": {
              "instrument": "btc_usdt_options",
              "price": "9000",
              "volume": "2",
              "value": "18000",
              "side": 1,
              "id": "a911b7c0-e431-424f-9f05-49a8ef0c7d93",
              "timestamp": 1571744594571020435
          }
      }
...

Streams new trade information for an asset pair, if no asset pair specified the websocket service will stream all instruments new trade.

WS Endpoint

wss://api.bitwyre.com/stream?subscribe=trades:<instrument>

WS Request Fields/Parameters (during handshake)

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).

WS Streaming Data Types (Array of JSON Object)

JSON Field Data Type Remark
"instrument" string base asset, quote asset, product filter, delimited with an _ (underscore).
"price" float-string price/quote asset of the traded base asset
"volume" float-string volume of the traded base asset
"value" float-string quote value (price x volume)
"side" enum-number trade type ( 1 - buy; 2 - sell )
"id" uuid-string universal unique id of the trade
"timestamp" big-integer trade timestamp, unixtime in nanoseconds

WS Depth L2

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=depthL2:btc_usdt_spot"

Streaming Responses (on orderbook change)

> {"op": "subscribe", "args": ["depthL2:btc_usdt_spot"]}
    < {"success":true,"subscribe":"depthL2:btc_usdt_spot","request":{"op":"subscribe","args":["depthL2:btc_usdt_spot"]}}
    < {
          "table":"depthL2",
          "keys":["instrument", "sequence_number", "bids","asks", "is_frozen"],
          "types": {"str", "int", "list", "list", "bool"}
          "action": "snapshot",
          "data":{
            "instrument": "btc_usdt_spot", 
            "sequence_number": 100000,
            "bids": [["124112000", "0.18154050"], ["124110000", "0.47319750"]],
            "asks": [["124130000", "0.03701609"], ["124251000", "0.03223585"]],
            "is_frozen": false
          }
      }
    < {
          "table":"depthL2",
          "action":"update",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100001,
               "timestamp": 1591592172780386000,
               "price": 9000,
               "qty": 2, 
          }
      }
    < {
          "table":"depthL2",
          "action":"insert",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100002,
               "timestamp": 1591592172780386000,
               "price": -9000, # could be negative for asks
               "qty": 2, # positive for insertion
          }
      }
    < {
          "table":"depthL2",
          "action": "delete",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100003,
               "timestamp": 1591592172780386000,
               "price": 9000, #  positive for bids
               "qty": -2, # negative for removal of liquidity
          }
      } 
    ...
...

Streams full L2 orderbook data.

WS Endpoint

wss://api.bitwyre.com/stream?subscribe=depthL2:<instrument>

WS Request Fields/Parameters (during handshake)

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"bids" array-of-float-string-tuple current bid orders in the orderbook
"asks" array-of-float-string-tuple current ask orders in the orderbook
"is_frozen" boolean market frozen status

WS Depth L2 Top 25 Snapshot

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=depthL2_25:btcusdtx_usdt_200607F1000000"

Streaming Responses

> {"op": "subscribe", "args": ["depthL2_25:btcusdtx_usdt_200607F1000000"]}
    < {"success":true,"subscribe":"depthL2_25:btcusdtx_usdt_200607F1000000","request":{"op":"subscribe","args":["depthL2_25:btcusdtx_usdt_200607F1000000"]}}
    < {
          "table":"depthL2_25",
          "keys":["instrument", "sequence_number", "bids", "asks", "is_frozen"],
          "types": {"str", "int", "list", "list", "bool"}
          "action": "snapshot",
          "data":{
            "instrument": "btcusdtx_usdt_200607F1000000", 
            "sequence_number": 100000,
            "bids": [["124112000", "0.18154050"], ["124110000", "0.47319750"]] ..., # length 25
            "asks": [["124130000", "0.03701609"], ["124251000", "0.03223585"]] ..., # length 25
            "is_frozen": false
          }
      }
    < {
          "table":"depthL2_25",
          "action":"update",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100001,
               "timestamp": 1591592172780386000,
               "price": 9000,
               "qty": 2, 
          }
      }
    < {
          "table":"depthL2_25",
          "action":"insert",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100002,
               "timestamp": 1591592172780386000,
               "price": -9000, # could be negative for asks
               "qty": 2, # positive for insertion
          }
      }
    < {
          "table":"depthL2_25",
          "action": "delete",
          "data":{
               "instrument": "btc_usdt_spot",
               "sequence_number": 100003,
               "timestamp": 1591592172780386000,
               "price": 9000, #  positive for bids
               "qty": -2, # negative for removal of liquidity
          }
      } 
    ...

Streams orderbook depthL2 top 25 levels for bids and asks.

WS Endpoint

wss://api.bitwyre.com/stream?=depthL2_25:<instrument>

WS Request Fields/Parameters (during handshake)

Query Parameter Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"bids" array-of-float-string-tuple current bid orders in the orderbook
"asks" array-of-float-string-tuple current ask orders in the orderbook
"is_frozen" boolean market frozen status

WS Announcement

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=announcement"

Streaming Responses (1 Hz)

> {"op": "subscribe", "args": ["announcement"]}
    < {"success":true,"subscribe":"announcement","request":{"op":"subscribe","args":["announcement"]}}
    < {
          "table":"announcement",
          "keys":["unixtime", "announcement"],
          "types": {"str", "str"}
          "action": "snapshot",
          "data":{
            {"unixtime":1571744594571020435, "announcement": "halting btc_usdt_spot trading"}, 
            {"unixtime":1571744594571020435, "announcement": "restoring btc_usdt_spot trading"}, 
          }
      }
    < {
          "table":"announcement",
          "keys":["unixtime", "announcement"],
          "types": {"str", "str"}
          "action": "incremental",
          "data":{
            {"unixtime":1571744594571020435, "announcement": "halting eth_usdt_spot trading"}, 
          }
      }

Streams server's time every second an announcement for at least 1 minute full for an announcement of event

WS Endpoint

wss://api.bitwyre.com/stream?subscribe=announcement

WS Request Fields/Parameters

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"unixtime" big-integer unix time in nanoseconds
"announcement" string announcement

WS Contract

Connecting

websocat -E "wss://api.bitwyre.com/stream?subscribe=contract:btcusdtx_usdt_200607F1000000"

Streaming Responses (1 Hz)

> {"op": "subscribe", "args": ["contract:btcusdtx_usdt_200607F1000000"]}
    < {"success":true,"subscribe":"contract:btcusdtx_usdt_200607F1000000","request":{"op":"subscribe","args":["contract:btcusdtx_usdt_200607F1000000"]}}
    < {
          "table":"contract:btcusdtx_usdt_200607F1000000",
          "keys":["instrument", "details", "pricing_source", "bitwyre_index_price", "bitwyre_index_price_currency", "24h_volume", "24h_volume_currency", "open_interest", "interest_rate", "contract_value", "contract_value", "initial_margin_base_value", "maintenance_margin_base_value"],
          "types": {"str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str", "str"}
          "action": "snapshot",
          "data":{}
            "instrument": "btcusdtx_usdt_200607F1000000",
            "details": "contract for cash delivery of BTC/USD index settled for July 6th, 2020 for the strike price of 10,000 USD",
            "pricing_source": "CME Bitcoin Real Time Index",
            "bitwyre_index_price": "11500.00",
            "bitwyre_index_price_currency": "USD",
            "24h_volume": "800,000,000.00",
            "24h_volume_currency": "USD",
            "open_interest": "600,000,000.00",
            "interest_rate": "0.001%",
            "contract_value": "1 USD",
            "initial_margin_base_value": "1%",
            "maintenance_margin_base_value": "0.5%"
          }
      }
...

Streams server's time every second the contract details for a derivative instrument/asset pair.

WS Endpoint

wss://api.bitwyre.com/stream?subscribe=contract

WS Request Fields/Parameters

Query Parameter Data Type Required Remark
"instrument" string true base asset, quote asset, product filter, delimited with an _ (underscore).

WS Streaming Data Types (JSON Object)

JSON Field Data Type Remark
"instrument" string base asset, quote asset, product filter, delimited with an _ (underscore).
"details" string detail of financial contract
"pricing_source" string source of index pricing
"bitwyre_index_price" float-string price of index
"bitwyre_index_price_currency" string currency of price index
"24h_volume" string 24 hour traded volume of instrument
"24h_volume_currency" string currency reference for 24 hour traded volume
"open_interest" string the number of contracts or commitments outstanding in futures and options that are trading on an official exchange at any one time.
"interest_rate" percentage-string interest rate reference for valuation reference
"contract_value" string 1 contract value equivalent in USD
"initial_margin_base_value" string initial margin percentage
"maintenance_margin_base_value" string maintenance margin percentage

Websocket Private API

WS Account Balance

Connecting and Query/Request (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/account/balance"
> {
      "command": "get",
      "nonce": 1571744594571020435,
      "checksum": "12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
      "api_key": "someapikey",
      "api_sign": "somesignature",
      "payload": ""
}

Query Response (on message event)

{
  "idr": "20190522",
  "btc": "227",
  "eth": "3.14",
  ... #and all other coin balances
}

Retrieve all user's fiat and crypto balance.

WS Endpoint

wss://api.bitwyre.com/ws/private/account/balance

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always get.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object/array true although required, the value must be "" (empty string).

WS Account Balance Response Types

Key-Value of asset name and it's balance.

JSON Field Data Type Remark
asset name float-string balance amount in float string.
asset name float-string balance amount in float string.
... ... ...

WS Account Statement

Connecting and Query/Request (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/account/statement"
> {
  "command": "get",
  "nonce": 1571744594571020435,
  "checksum": "12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": ""
}

Query Response (on message event)

{
"withdrawal": {
  "idr": [
    {
      "id": "26a13a32-2e11-472a-84cc-242d765a88de",
      "status": "pending",
      "type": "fiat",
      "provider": "duitku",
      "gross_amount": "2000000",
      "fee": "1500",
      "nett_amount": "1998500",
      "submit_time": 1571747594573320135,
      "success_time": null
    }
  ],
  "btc": [
    {
      "id": "073ba6e5-24d2-4532-8b02-58c1d7a104be",
      "status": "success",
      "type": "crypto",
      "provider": "hot",
      "gross_amount": "150.00",
      "fee": "0.1",
      "nett_amount": "149.9",
      "network_confirmation": 4,
      "submit_time": 1571747594573320135,
      "success_time": 1571747594573320135
    }
  ],
  ... #other coins
},
  "deposit": {
    "idr": [
      {
        "id": "f3086a0e-6d25-4590-b47e-a5917816281b",
        "status": "success",
        "type": "fiat",
        "provider": "dana",
        "gross_amount": "1000000",
        "fee": "1500",
        "nett_amount": "995000",
        "submit_time": 1571747594573320135,
        "success_time": 1571747594573320135
      }
    ],
    "btc": [
      {
        "id": "4b6dc35a-ab03-4f55-bb81-8efb5a8569e0",
        "status": "success",
        "type": "crypto",
        "provider": "warm",
        "gross_amount": "150.00",
        "fee": "0.1",
        "nett_amount": "149.9",
        "network_confirmation": 4,
        "submit_time": 1571747594573320135,
        "success_time": 1571747594573320135
      }
    ],
    ... #other coins
  }
}

Retrieve user's withdraw and deposit history.

WS Endpoint

wss://api.bitwyre.com/ws/private/account/statement

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always get.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object/array true although required, the value must be "" (empty string).

WS Response Base Structure

JSON Field Data Type Remark
"withdrawal" asset-statement-object historical withdrawal data for specific asset (array).
"deposit" asset-statement-object historical deposit data for specific asset (array).

WS Asset Statement Response Type

Asset, e.g "btc", statements, containing an array of json object:

JSON Field Data Type Remark
"id" uuid-string universal unique id of the transaction
"status" enum-string transaction status, "pending" for pending and "success" for settled.
"type" enum-string asset type, "fiat" for fiat and "crypto" for crypto.
"provider" enum-string transaction provider, see Deposit and Withdrawal.
"gross_amount" float-string gross amount of the transaction before the fee.
"fee" float-string transaction fee.
"nett_amount" float-string nett amount of the transaction after the fee.
"network_confirmation" number confirmation needed to settle the transaction (crypto only).
"submit_time" big-integer request accepted timestamp in unixtime nanoseconds.
"success_time" big-integer success timestamp in unixtime nanoseconds.

WS Orders Creation

Connecting and New Market Order request (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/orders/control"
> {
  "command": "create",
  "nonce": 1574236540319258051,
  "checksum": "ba83ec9451e68bd774795a3c2b02e332ce08fdf8f3b5c15797c49e2729f77664",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": {
    "instrument": "btc_usdt_spot",
    "ordtype": 1,
    "side": 2,
    "orderqty": "2.9301"
  }
}

Query Response (on message event)

{
  "orderid": "b648e250-04c4-41c3-9121-423a3a389af0",
  "origclid": "b648e250-04c4-41c3-9121-423a3a389af0",
  "execid": "c404d0a8-8d16-4e8f-ae78-9608f511e5e8",
  "exectype": 0,
  "ordstatus": 0,
  "account": "redacted",
  "instrument": "btc_usdt_spot",
  "side": 2,
  "transacttime": 1574236685489564902,
  "orderqty": "2.9301",
  "timestamp": 1574236685489564902,
  "ordtype": 1,
  "leavesqty": "2.9301",
  "cumqty": "0"
}

Create a new trade order.

WS Endpoint

wss://api.bitwyre.com/ws/private/orders/control

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always create.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object true see Create Order Payload.

WS Response Type

See Execution Report Response.

WS Orders Cancellation

Connecting and Cancelling an order (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/orders/control"
> {
  "command": "cancel",
  "nonce": 1574236540319258051,
  "checksum": "a260f0d1d9cb4d2d9dd1840857ded3bf78134191b875fc461c1d3bc26ba529fe",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": [
    "31911e87-b547-480f-b8d1-4515529ca2fd"
  ]
}

Query Response (on message event)

[
  {
    "orderid": "bae77ef8-5799-465f-8491-ec0eebc2d057",
    "origclid": "31911e87-b547-480f-b8d1-4515529ca2fd",
    "execid": "097b645d-6ff4-435a-a5a4-40c38115b6e9",
    "exectype": 6,
    "ordstatus": 6,
    "account": "redacted",
    "instrument": "btc_usdt_futures",
    "side": 2,
    "transacttime": 1574233086281019485,
    "orderqty": "2.9301",
    "timestamp": 1574174854272148294,
    "ordtype": 3,
    "stoppx": "9850.35",
    "leavesqty": "2.9301",
    "cumqty": "0"
  }
]

Cancels open orders by its ID, can be bulk.

WS Endpoint

wss://api.bitwyre.com/ws/private/orders/control

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always cancel.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-array true json array of open order's ID.

WS Response Type

An array of Execution Report Response stating the cancellation status of each order.

WS Orders Status

Connecting and Status Query of an order (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/orders/status"
> {
  "command": "get",
  "nonce": 1574236540319258051,
  "checksum": "041a8f4d1ea4b7202ce725192e16eb14cdf7e20e3ed231773f29ea097c1948fd",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": {
    "orderid": "732f066e-feed-baad-beef-e000ed83243a"
  }
}

Query Response (on message event)

{
  "orderid": "732f066e-feed-baad-beef-e000ed83243a",
  "origclid": "732f066e-feed-baad-beef-e000ed83243a",
  "execid": "71605de8-efa4-4e20-bcfb-5f23d90f26c2",
  "ordstatusReqID": "3064760e-a92d-4b60-bf9c-a241b36c134a",
  "exectype": 10,
  "ordstatus": 10,
  "account": "redacted",
  "instrument": "btc_usdt_spot",
  "side": 1,
  "transacttime": 1574232727730188710,
  "orderqty": "2.9301",
  "timestamp": 1574174854272003795,
  "ordtype": 2,
  "price": "9800.5",
  "leavesqty": "2.9301",
  "cumqty": "0"
}

Retrieves information on a specific order.

WS Endpoint

wss://api.bitwyre.com/ws/private/orders/status

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always get.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object true json object containing an orderid.

WS Response Type

See Execution Report Response.

WS Orders Events

Connecting and Subscribing to Orders Events (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/orders/events"
> {
  "command": "subscribe",
  "nonce": 1574236540319258051,
  "checksum": "a260f0d1d9cb4d2d9dd1840857ded3bf78134191b875fc461c1d3bc26ba529fe",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": {
    "instrument": "btc_usdt_options",
  }
}

Streaming Execution Report (on message event)

{
  "orderid": "97a2387d-5eed-4001-a5eb-67e0e0671645",
  "origclid": "97a2387d-5eed-4001-a5eb-67e0e0671645",
  "execid": "ef799ba7-755f-45fb-8a12-6812489869b3",
  "exectype": 15,
  "ordstatus": 1,
  "account": "redacted",
  "instrument": "btc_usdt_options",
  "side": 1,
  "transacttime": 1574230320958860499,
  "orderqty": "2.9301",
  "timestamp": 1574174854272296196,
  "ordtype": 4,
  "price": "9800.5",
  "stoppx": "9750",
  "leavesqty": "1.9301",
  "cumqty": "1",
  "lastliquidityind": "0.871",
  "lastpx": "9765",
  "lastqty": "1",
  "avgpx": "9765"
}

Subscribe to eventual broadcasts on order status changes, can only be filtered by instrument/Asset Pair symbol.

WS Endpoint

wss://api.bitwyre.com/ws/private/orders/events

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always subscribe.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object true "" for no filter, json object containing an instrument to filter.

WS Response Type

See Execution Report Response.

WS Trade History

Connecting and Historical Query (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/trades/history"
> {
  "command": "get",
  "nonce": 1573913429373103887,
  "checksum": "bf74db4854ecb160e104408d6beb6e81104917dcd2c0e0d61b8f83335c855687",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": {
    "instrument": "btc_usdt_spot",
    "from_time": 1537913405774945493
  }
}

Query Response (on message event)

{
  "btc_usdt_spot": [
    {
      "id": "f3086a0e-6d25-4590-b47e-a5917816281b",
      "time": 1571747594573320135,
      "type": "buy",
      "price": "10590",
      "volume": "0.45",
      "total": "4765.50",
      "fee_percentage": "0.1",
      "fee": "4.7655",
      "fee_currency": "usdt"
    }
  ]
}

Retrieves some or all latest buying/selling transaction histories.

WS Endpoint

wss://api.bitwyre.com/ws/private/trades/history

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always get.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object true "" means no filter, see WS Trades History Request.

WS Trades History Request

JSON Field Data Type Required Remark
"instrument" string false base asset, quote asset, product filter, delimited with an _ (underscore).
"count" number false limit the latest historical trade data.
"from_time" big-integer false inclusive historical time offset, unixtime in nanoseconds.
"to_time" big-integer false exclusive historical time limit, unixtime in nanoseconds.

WS Trades History Response Type

Key-Value of instrument and it's historical trades (array). The historical trade field data:

JSON Field Data Type Remark
"id" uuid-string universal unique id of the trade.
"time" big-integer trade timestamp, unixtime in nanoseconds.
"type" enum-string "buy" for buy, "sell" for sell.
"price" float-string quote price for the base asset of the trade.
"volume" float-string base asset amount of the trade.
"total" float-string total quote value of the trade.
"fee_percentage" float-string percentage of the fee.
"fee" float-string fee value.
"fee_currency" string asset of the fee, in most case is the quote asset

WS Get Chat

Connecting and Query/Request (Note: minify the json request for websocat)

websocat -E "wss://api.bitwyre.com/ws/private/chat/"
> {
      "command": "get",
      "nonce": 1571744594571020435,
      "checksum": "12ae32cb1ec02d01eda3581b127c1fee3b0dc53572ed6baf239721a03d82e126",
      "api_key": "someapikey",
      "api_sign": "somesignature",
      "payload": "/{/username: vitalik/}/" # stringified
}

Query Response (on message event)

{
    "username":  "satoshi":, # the owner of the chat
    "chats": [
            {
                "sender": "satoshi",
                "receiver": "vitalik",
                "timestamp": 1590654209219752000,
                "message": "Hi there how are you",
                "is_read": False,
            },
            {
                "sender": "vitalik",
                "receiver": "satoshi",
                "timestamp": 1590654209220763000,
                "message": "I'm good how are you",
                "is_read": False,
            },
    ],
}

Retrieve all user's chat message encrypted in Elliptic Curve Integrated Encryption Scheme (ECIES).

WS Endpoint

wss://api.bitwyre.com/ws/private/chat/

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always get.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object/array true although required, if the value is unspecified, the chat will return the stream of all new unread chats. If specified, it will return the chat associated with a specific username.

WS Get Chat Response Types

Key-Value of message

JSON Field Data Type Remark
username string username of chat owner
chats string balance amount in float string.
sender string chat sender
receiver string chat receiver
timestamp int nanosecond server timestamp
message string chat message
is_read bool that the chat has been downloaded
... ... ...

WS Send Chat

Connecting and send chats.

websocat -E "wss://api.bitwyre.com/ws/private/chats/"
> {
  "command": "create",
  "nonce": 1574236540319258051,
  "checksum": "ba83ec9451e68bd774795a3c2b02e332ce08fdf8f3b5c15797c49e2729f77664",
  "api_key": "someapikey",
  "api_sign": "somesignature",
  "payload": "I really like that painting"
}

Query Response (on message event)

{
    "timestamp": 1590654854095640000
    "message_id": "3e00e9f4-fe7a-45c9-9ed7-456d9e6518b3",
}

Create a new trade order.

WS Endpoint

wss://api.bitwyre.com/ws/private/chats/

WS Request Base Structure

JSON Field Data Type Required Remark
"command" string true always create.
"nonce" big-integer true see REST Private API Request Data.
"checksum" string true see REST Private API Request Data.
"api_key" string true see API Key.
"api_sign" string true see API Sign.
"payload" json-object true The message to be sent.

WS Response Type

Key-Value of message

JSON Field Data Type Remark
message_id string message UUID
timestamp int timestamp in nanoseconds

UDF API

Chart Config

Request

curl "https://api.bitwyre.com/udf/config" -X GET

Response

{
    "exchanges": [
        {
            "desc": "Bitwyre Exchange",
            "name": "Bitwyre",
            "value": "BITWYRE"
        }
    ],
    "supported_resolutions": ["1", "3", "5", "15", "30", "60", "120", "240", "360", "480", "720", "1D", "3D", "1W", "1M"],
    "supports_group_request": false,
    "supports_marks": false,
    "supports_search": true,
    "supports_time": true,
    "supports_timescale_marks": false,
    "symbols_types": [
        {
            "name": "Bitcoin",
            "value": "bitcoin"
        }
    ]
}

Returns chart configuration.

Endpoint

https://api.bitwyre.com/udf/config

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
exchanges array-of-json exchanges info
supported_resolutions array-of-string
supports_group_request boolean
supports_marks boolean
supports_search boolean
supports_time boolean
supports_timescale_marks boolean
symbols_types array-of-json

Symbols

Request

curl "https://api.bitwyre.com/udf/symbols?symbol=btc_usdt_spot" -X GET

Response

{
    "currency_code": "USD",
    "data_status": "streaming",
    "description": "BTC/USDT: Bitcoin / USD Tether spot",
    "exchange": "BITWYRE",
    "has_daily": true,
    "has_empty_bars": true,
    "has_intraday": true,
    "has_weekly_and_monthly": true,
    "intraday_multipliers": [
        "1",
        "5",
        "60"
    ],
    "listed_exchange": "BITWYRE",
    "minmov": 1,
    "name": "BTC/USDT",
    "pricescale": 100,
    "session": "24x7",
    "supported_resolutions": [
        "1",
        "3",
        "5",
        "15",
        "30",
        "60",
        "120",
        "240",
        "360",
        "480",
        "720",
        "1D",
        "3D",
        "1W",
        "1M"
    ],
    "symbol": "BTCUSDT",
    "ticker": "btc_usdt_spot",
    "timezone": "Etc/UTC",
    "type": "bitcoin",
    "volume_precision": 2
}

Returns udf info.

Endpoint

https://api.bitwyre.com/udf/symbol

Request Fields/Parameters

Query Parameter Data Type Required Remark
symbol string true base asset, quote asset, product filter, delimited with an _ (underscore).

Response Types (JSON Object)

JSON Field Data Type Remark
currency_code string
data_status string
description string
has_daily boolean
has_empty_bars boolean
has_intraday boolean
has_weekly_and_monthly boolean
intraday_multipliers array-of-string
listed_exchange string
minmov int
name string
pricescale int
session string
listed_exchange string
supported_resolutions array-of-string supported timeframe resolution
symbol string
ticker string
timezone string
type string
volume_precision int

Symbol Info

Request

curl "https://api.bitwyre.com/udf/symbols?symbol=btc_usdt_spot" -X GET

Response

{
    "currency_code": "USD",
    "data_status": "streaming",
    "description": "BTC/USDT: Bitcoin / USD Tether spot",
    "exchange": "BITWYRE",
    "has_daily": true,
    "has_empty_bars": true,
    "has_intraday": true,
    "has_weekly_and_monthly": true,
    "intraday_multipliers": [
        "1",
        "5",
        "60"
    ],
    "listed_exchange": "BITWYRE",
    "minmov": 1,
    "name": "BTC/USDT",
    "pricescale": 100,
    "session": "24x7",
    "supported_resolutions": [
        "1",
        "3",
        "5",
        "15",
        "30",
        "60",
        "120",
        "240",
        "360",
        "480",
        "720",
        "1D",
        "3D",
        "1W",
        "1M"
    ],
    "symbol": "BTCUSDT",
    "ticker": "btc_usdt_spot",
    "timezone": "Etc/UTC",
    "type": "bitcoin",
    "volume_precision": 2
}

Returns udf info.

Endpoint

https://api.bitwyre.com/udf/symbol_info

Request Fields/Parameters

Query Parameter Data Type Required Remark
"symbol" string true base asset, quote asset, product filter, delimited with an _ (underscore).

Response Types (JSON Object)

JSON Field Data Type Remark
currency_code string
data_status string
description string
has_daily boolean
has_empty_bars boolean
has_intraday boolean
has_weekly_and_monthly boolean
intraday_multipliers array-of-string
listed_exchange string
minmov int
name string
pricescale int
session string
listed_exchange string
supported_resolutions array-of-string
symbol string
ticker string
timezone string
type string
volume_precision int

Request

curl "https://api.bitwyre.id/udf/search?symbol=BTCUSDT&name=BTC/USDT&ticker=btc_usdt_spot&currency_type=bitcoin&currency_code=USD&exchange_traded=BITWYRE&exchange_listed=BITWYRE&limit=1" -X GET

Response

{
    "currency_code": "USD",
    "data_status": "streaming",
    "description": "BTC/USDT: Bitcoin / USD Tether spot",
    "exchange": "BITWYRE",
    "has_daily": true,
    "has_empty_bars": true,
    "has_intraday": true,
    "has_weekly_and_monthly": true,
    "intraday_multipliers": [
        "1",
        "5",
        "60"
    ],
    "listed_exchange": "BITWYRE",
    "minmov": 1,
    "name": "BTC/USDT",
    "pricescale": 100,
    "session": "24x7",
    "supported_resolutions": [
        "1",
        "3",
        "5",
        "15",
        "30",
        "60",
        "120",
        "240",
        "360",
        "480",
        "720",
        "1D",
        "3D",
        "1W",
        "1M"
    ],
    "symbol": "BTCUSDT",
    "ticker": "btc_usdt_spot",
    "timezone": "Etc/UTC",
    "type": "bitcoin",
    "volume_precision": 2
}

Returns udf info with specific parameters.

Endpoint

https://api.bitwyre.com/udf/search

Request Fields/Parameters

Query Parameter Data Type Required Remark
symbol string false base asset, quote asset, product filter, delimited with an _ (underscore).
name string false
ticker string false
currency_type string false
currency_code string false
exchange_traded string false
exchange_listed string false
limit int false

Response Types (JSON Object)

JSON Field Data Type Remark
currency_code string
data_status string
description string
has_daily boolean
has_empty_bars boolean
has_intraday boolean
has_weekly_and_monthly boolean
intraday_multipliers array-of-string
listed_exchange string
minmov int
name string
pricescale int
session string
listed_exchange string
supported_resolutions array-of-string
symbol string
ticker string
timezone string
type string
volume_precision int

History

Request

curl "https://api.bitwyre.id/udf/history?symbol=btc_usdt_spot&from=1606083060&to=1626083060&resolution=1" -X GET

Response

{
    "c": [
        33285.0,
        33287.0,
        33287.0,
        34838.0
    ],
    "h": [
        33285.0,
        33287.0,
        33287.0,
        34838.0
    ],
    "l": [
        33284.0,
        33285.0,
        33287.0,
        33292.0
    ],
    "o": [
        33284.0,
        33285.0,
        33287.0,
        33292.0
    ],
    "s": "ok",
    "t": [
        1626056880,
        1626056940,
        1626060120,
        1626080640
    ],
    "v": [
        9.0,
        18.0,
        0.1,
        2.54916871
    ]
}

Returns status, volume, open/close/high/low prices and timetamp data from timestamp from until to.

Endpoint

https://api.bitwyre.com/udf/history

Request Fields/Parameters

Query Parameter Data Type Required Remark
symbol string true base asset, quote asset, product filter, delimited with an _ (underscore).
from big-integer true unix time in seconds
to big-integer true unix time in seconds
resolution string true time frame resolution

Response Types (JSON Object)

JSON Field Data Type Remark
c array-of-float close price data
h array-of-float high price data
l array-of-float low price data
o array-of-float open price data
s str status data request
t array-of-bigint timestamp data
v array-of-float volume data

Time

Request

curl "https://api.bitwyre.com/udf/time" -X GET

Response

1626236213

Returns server's unix time in seconds.

Endpoint

https://api.bitwyre.com/udf/time

Request Fields/Parameters

Response Types (JSON Object)

JSON Field Data Type Remark
- big-integer unix time in seconds

FIX API

FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. Bitwyre's FIX API is based on FIX 4.4 and modeled after common forex FIX implementations. Users who are not familiar with FIX should first consider using the REST API.

Getting started

In order to interact with our FIX endpoints, you'll need to contact [email protected] for information regarding fix connectivity. Before an initial FIX connection, Bitwyre will reach out with information about setting up your account via email. It will also contain instructions on creating a staging account.

Connectivity

Before logging in to a FIX session, clients must establish a secure connection to the FIX gateway. We expect an SSL connection over TCP to the host and port you are assigned with.

Standard Header

Each administrative or application message is preceded by a standard header. The header identifies the message type, length, destination, sequence number, origination point and time.

Tag Field Name Required Description
6 BeginString true
9 BodyLength true Message length, in bytes, forward to the CheckSum field.
Always unencrypted, must be second field in message.
35 MsgType true Defines message type. Always the third tag in the message.
49 SenderCompID true Assigned value used to identify the firm sending the message.
56 TargetCompID true Assigned value used to identify the firm receiving the message.
34 MsgSeqNum true Integer message sequence number.
52 SendingTime true Time of message transmission (always expressed in UTC).
122 OrigSendingTime false* Original time of message transmission (always expressed in UTC) when transmitting orders as the result of a resend request.*Required for a re-transmitted message.
43 PossDupFlag false* Indicates possible retransmission of message with this sequence number.

Valid values:
- true = Possible duplicate
- false = Original transmission

*Required for a re-transmitted message.

Standard Trailer

Each message, administrative or application, is terminated by a standard trailer. The trailer is used to segregate messages and contains the three-digit character representation of the Checksum value.

Tag Field Name Required Description
10 CheckSum true Three byte, simple checksum. Always unencrypted, always last field in message.

Supported Symbols

The following symbols are valid values for a Symbol <55> field.

Symbols are formatted as ccy1_ccy2 where prices are in ccy1 (price currency) and quantities are in ccy2 (quantity currency), as this table makes explicit:

Symbol Price Currency Quantity Currency Min Order Size
btc_usdt_spot usdt btc < A_VALUE_HERE >
eth_usdt_spot usdt eth < A_VALUE_HERE >
eth_btc_spot btc eth < A_VALUE_HERE >
btc_idr_spot idr btc < A_VALUE_HERE >
bch_idr_spot idr bch < A_VALUE_HERE >
eth_btc_spot btc eth < A_VALUE_HERE >

On a market data channel, Bitwyre will respond to a Symbol List Request <x> with a Symbol List <y> containing all the supported symbols on the exchange.

FIX Order Entry

The following list of messages are supported for Administrative and Application level messages

Administrative or Session Level Messages

The following Administrative message types will be supported under MsgType (35)

Logon <A>

Logon request

    8=FIX.4.4|9=78|35=A|49=MYID|56=Bitwyre|34=1|52=20200114-15:14:22.487|369=0|98=0|108=30|141=Y|10=087|

Parsed message

    HEADER
    8               BeginString: FIX.4.4
    9               BodyLength: 78
    35              MsgType: LOGON (A)
    49              SenderCompID: MYID
    56              TargetCompID: Bitwyre
    34              MsgSeqNum: 1
    52              SendingTime: 20200114-15:14:22.487
    369             LastMsgSeqNumProcessed: 0

    BODY

    98              EncryptMethod: NONE (0)
    108             HeartBtInt: 30
    141             ResetSeqNumFlag: YES (Y)

    TRAILER

    10              CheckSum: 087

The Logon <A> message is used by a market participant to establish a FIX session with Bitwyre, and by Bitwyre as an acknowledgement. Only one session may exist per connection. If any validation fails during the process, the connection will be dropped without a Reject <2>.

Tag Field Name Required Description
Standard Header true
98 EncryptMethod true Must be 0 (None)
108 HeartBtInt true Must be 30 (Seconds) or less. Values greater than 30 will be capped at 30.
Server will send Test Request if no client messages received in
approximately (HeartBtInt x 1.5) seconds. Server will terminate session
if no client messages received in approximately (HeartBtInt x 2
seconds).
96 RawData true Client message signature
554 Password true Client API passphrase
49 SenderCompID true Assigned value used to identify the firm sending the message.
8013 CancelOrdersOnDisconnect true
S: Batch cancel all open orders placed during session;
Y: Batch cancel all open orders for the current profile.
The former is more performant and recommended.
Standard Trailer true

HeartBeat<0>

The Heartbeat <0> monitors the status of the communication link and identifies when the last of a string of messages was not received. The duration of the inactive period is determined by the field HeartBtInt <108> in Logon<A> message.

Tag Field Name Required Description
Standard Header true
58 TestReqID false*
Required if the heartbeat

message is generated in response to a TestRequest <1> message.
Standard Trailer true

TestRequest<1>

Heartbeat <0> and TestRequest <1> messages are used by Bitwyre to monitor the live status of a FIX Session. In the event of no response within the agreed upon heartbeat interval, HeartBtInt<108>, in Logon<A> message, a TestRequest <1> message will be sent. The client must respond immediately to the TestRequest <1> message.

If we do not receive a response to the TestRequest <1> message within the heartbeat interval, it will terminate the FIX session to the counterparty.

Tag Field Name Required Description
Standard Header true
58 TestReqID true
Identifier included in Test Request <1>

message to be returned in resulting Heartbeat <0>
Standard Trailer true

ResendRequest<2>

The resend request is sent by the receiving application to initiate the retransmission of messages. This function is utilized if a sequence number gap is detected, if the receiving application lost a message, or as a function of the initialization process. It can be used to request a single message, a range of messages or all messages subsequent to a particular message.

Tag Field Name Required Description
Standard Header true
7 BeginSeqNo true Message sequence number of first message in range to be resent.
Valid sequence number for session.
16 EndSeqNo true
Message sequence number of last message in range to be resent.

Specify 0 for all the messages subsequent to a particular message.
Standard Trailer true

Reject<3>

The Reject <3> message will be sent when a message is received but cannot be properly processed due to session-level rule violation

Tag Field Name Required Description
Standard Header true
45 RefSeqNum true MsgSeqNum <34> of the rejected message.
58 Text false The reason of the rejection
371 RefTagID false The tag number of the FIX field being referenced.
372 RefMsgType false The MsgType <35> of the rejected message.
373 SessionRejectReason false Code to identify the reason for the Reject <3> message.

Valid values:
* 0 = Invalid tag number
* 1 = Required tag missing
* 2 = Tag not defined for this message type
* 3 = Undefined Tag
* 4 = Tag specified without a value
* 5 = Value is incorrect (out of range) for this tag
* 6 = Incorrect data format for value
* 10 = SendingTime <52> accuracy problem
* 11 = Invalid MsgType <35>
Standard Trailer true

SequenceReset<4>

The Sequence Reset message is used in response to a Resend Request <2> message when one or more messages must be skipped over for the following reasons:

Tag Field Name Required Description
Standard Header true
36 NewSeqNo true New sequence number. The number cannot be lower than the expected sequence number of either side of the connection.
123 GapFillFlag true
Indicates that the sender is skipping messages rather than resending them.
Valid value:

Y = Gap Fill message
N = Sequence Reset, ignore MsgSeqNum <34>
Standard Trailer true

The Logout<5> message initiates or confirms the termination of a FIX session.

Tag Field Name Required Description
Standard Header true
58 Text false Logging out reason
Standard Trailer true

Application Level Messages

The following Applications message types are supported under MsgType (35):

Inbound Messages (From Client to Bitwyre)

NewOrderSingle request

8=FIX.4.4|9=132|35=D|34=2|49=USERNAME|52=20200125-17:56:41.000|56=Bitwyre|11=uuid-uuid|38=1|40=2|44=10000|54=1|55=btc_usdt|59=1|60=20200125-18:56:41|10=028|

Parsed message

HEADER

8               BeginString: FIX.4.4
9               BodyLength: 132
35              MsgType: ORDER_SINGLE (D)
34              MsgSeqNum: 2
49              SenderCompID: USERNAME
52              SendingTime: 20200125-17:56:41.000
56              TargetCompID: Bitwyre

BODY

11              ClOrdID: uuid-uuid
38              OrderQty: 1
40              OrdType: LIMIT (2)
44              Price: 10000
54              Side: BUY (1)
55              Symbol: btc_usdt
59              TimeInForce: GOOD_TILL_CANCEL (1)
60              TransactTime: 20200125-18:56:41

TRAILER

10              CheckSum: 028

To submit a new market order, send a New Order Single <D> message with OrdType Market. We will respond to a New Order Single <D> message with an Execution Report <8>.

Tag Field Name Required Description
Standard Header true
11 ClOrdID true
Unique identifier (UUID) of the order as assigned by the institution.
Uniqueness must be guaranteed by the institution for the duration of the

connection to the order entry channel.
38 OrderQty false* Required when Side is equals to SELL. Represents the quantity ordered.
40 OrdType true
Order type.
Supported values are :

1 = Market

2 = Limit
54 Side true
Side of the order.

Valid values are:
1 = Buy
2 = Sell
55 Symbol true Ticker symbol of the order
60 TransactTime true Time of the order creation expressed in UTC
152 CashOrderQty false*
* Required when Side is BUY. Amount in price currency to use in the

market order
Standard Trailer true

OrderCancelRequest

8=FIX.4.4|9=215|35=F|49=UUID-ORDER|56=Bitwyre|34=30|50=UUID-MMZZ7YAV|142=US,IL|57=SCXM|52=20201001-15:18:18.339|369=29|41=Order48988|37=319500000000000016|11=Cancel48989|1=UUID-1FBD|55=btc_usdt|54=1|60=20181001-15:18:18|528=A|582=1|10=059|

Parsed message

HEADER

8               BeginString: FIX.4.4
9               BodyLength: 215
35              MsgType: ORDER_CANCEL_REQUEST (F)
49              SenderCompID: UUID-ORDER
56              TargetCompID: Bitwyre
34              MsgSeqNum: 30
50              SenderSubID: UUID-MMZZ7YAV
142             SenderLocationID: US,IL
57              TargetSubID: SCXM
52              SendingTime: 20201001-15:18:18.339
369             LastMsgSeqNumProcessed: 29

BODY

41              OrigClOrdID: Order48988
37              OrderID: 319500000000000016
11              ClOrdID: Cancel48989
1               Account: UUID-1FBD
55              Symbol: btc_usdt
54              Side: BUY (1)
60              TransactTime: 20181001-15:18:18
528             OrderCapacity: AGENCY (A)
582             CustOrderCapacity: MEMBER_TRADING_FOR_THEIR_OWN_ACCOUNT (1)

TRAILER

10              CheckSum: 059

The Order Cancel Request <F> message requests the cancellation of all of the remaining quantity of an existing order. An order is cancelled on the basis of the value in the OrigClOrdID <41> field. All other fields are required in the FIX specs but are ignored.

Tag Field Name Required Description
Standard Header true
41 OrigClOrdID true ClOrdID <11> of the previous non-rejected order.
11 ClOrdID true Unique identifier of the cancel request as assigned by the institution.
Uniqueness must be guaranteed by the institution for the duration of the
connection to the order entry channel.
38 OrderQty true Quantity in the order referred to by OrigClOrdID <41>.
54 Side true Side of the order to cancel:
Valid values:
1 = Buy
2 = Sell
55 Symbol true Ticker symbol of the order.
60 TransactTime true Time of the order creation expressed in UTC.
Standard Trailer true

Outbound Messages (From Bitwyre to Client)

ExecutionReport <8>

The ExecutionReport<8> message is used to acknowledge/reject orders, cancel and amend requests. The message will also be used to relay trade information and end of day cancellations.

We use the Execution Report <8> message to:

Execution report for a Buy order

8=FIX.4.4|9=163|35=8|34=2|49=Bitwyre|52=20200120-10:50:51.943|56=DEVELOPER|6=0|11=uuid-uuid|14=0|17=43|37=42|39=0|54=1|55=btc_usdt|60=202020-10:50:52.042|150=0|151=500.0|152=500.0|10=138|

Parsed Message

HEADER

8               BeginString: FIX.4.4
9               BodyLength: 163
35              MsgType: EXECUTION_REPORT (8)
34              MsgSeqNum: 2
49              SenderCompID: Bitwyre
52              SendingTime: 20200120-10:50:51.943
56              TargetCompID: DEVELOPER

BODY

6               AvgPx: 0
11              ClOrdID: uuid-uuid
14              CumQty: 0
17              ExecID: 43
37              OrderID: 42
39              OrdStatus: NEW (0)
54              Side: BUY (1)
55              Symbol: btc_usdt
60              TransactTime: 202020-10:50:52.042
150             ExecType: NEW (0)
151             LeavesQty: 500.0
152             CashOrderQty: 500.0

TRAILER

10              CheckSum: 138

Tag Field Name Required Description
Standard Header true
37 OrderID true Unique order identifier assigned by Bitwyre
41 OrigClOrdID false*
ClOrdID <11> of the order to cancel.
Needs to correspond to a current outstanding order submitted during this trading session.

* Required for a response to an Order Cancel Request .
17 ExecID true Unique event ID
150 ExecType true Describes the purpose of the Execution Report
Valid values:
* 0 = New

* F = Trade
* 4 = Cancelled
* 8 = Rejected
18 ExecInst false Execution instructions.
39 OrdStatus true
Describes the current order status
Valid values:
* 0 = New
* 1 = Partially filled
* 2 = Filled
* 4 = Cancelled
* 8 = Rejected
55 Symbol true Ticker symbol of the order.
54 Side true
Side of the order.



Valid values:
* 1 = Buy
* 2 = Sell
44 Price false* Required for limit orders.
99 StopPx false* Stop price of the order.

* Required if ExecType <150> is not 8 = Rejected and responding

to a OrdType <40> is 4 = Stop Limit order entry.
6 AvgPx true Calculated average price of fills on this order. Zero for order with no fills.
31 LastPx false*
Price of the fill. This field is only present when the order

is updated due to a match on the exchange.

*Required if ExecType <150> is F = Trade.
14 CumQty true Total quantity of the order that is filled.
38 OrderQty false*
Decimal amount of BTC to purchase. The general rule is:


OrderQty <38> = CumQty <14> + LeavesQty <151>.
* Required if ExecType <150> is not 8 = Rejected.
151 LeavesQty true
Quantity <53> open for further execution.

If the OrdStatus <39> is 4 = Cancelled or 8 = Rejected (in which case the order is no longer active)

then LeavesQty <151> could be 0, otherwise LeavesQty <151> = OrderQty <38> - CumQty <14>.
32 LastQty false*
Quantity of the fill. This field is only present when the order

is updated due to a match on the exchange.

* Required if ExecType <150> is F = Trade.
12 Commission false* Fee charged for trade. Negative for rebates.
* Required if ExecType <150> is F = Trade.
479 CommCurrency false* Currency code of the currency that the fee is denominated in.
* Required if ExecType <150> is F = Trade.
13 CommType false* Commission type.
Valid value:

3 = absolute (total monetary amount)

* Required if ExecType <150> is F = Trade.
851 LastLiquidityInd false* Whether this order added liquidity ("maker") or removed liquidity ("taker").

Valid values:
1 = Added Liquidity
2 = Removed Liquidity

* Required if ExecType <150> is F = Trade.
103 OrdRejReason false*
Reason the order was rejected.


Valid values:
1 = Unknown symbol
2 = Exchange closed for scheduled maintenance
3 = Order exceeds limit
13 = Incorrect quantity
99 = Other
58 Text false* Reason the order was rejected or cancelled.

* Required if OrdRejReason <103> is 99 = Other,
or if OrdStatus <39> is 4 = Cancelled and ExecType <150> is 4 = Cancelled.
59 TimeInForce true* Specifies how long the order remains in effect. Absence of this
field would be interpreted as a day order, which we do not
currently support.

Valid value:
1 = Good Till Cancel (GTC)
3 = Immediate Or Cancel (IOC)
4 = Fill Or Kill (FOK)

7 = At the Close - Indicates this is an order for an upcoming Auction
60 TransactTime true Time the transaction represented by this ExecutionReport <8> occurred (expressed in UTC).
Standard Trailer true

OrderCancelReject <9>

We send an Order Cancel Reject <9> message when the exchange receives an Order Cancel Request <F> message which cannot be honored because:

Tag Field Name Required Description
Standard Header true
37 OrderID true Unique order identifier assigned by Bitwyre
11 ClOrdID false* Unique identifier for order as assigned by the institution.
39 OrdStatus true Identifies the current status of order. The status is 8 = Rejected if the order is unknown.

Valid values:
0 = New
1 = Partially filled
2 = Filled
4 = Canceled
8 = Rejected
150 ExecType true Describes the purpose of the Execution Report
Valid values:
* 0 = New

* F = Trade
* 4 = Cancelled
* 8 = Rejected
18 ExecInst false Execution instructions.
39 OrdStatus true
Describes the current order status
Valid values:
* 0 = New
* 1 = Partially filled
* 2 = Filled
* 4 = Cancelled
* 8 = Rejected
102 CxlRejReason true Code to identify reason for cancel rejection.

Valid values:
0 = Too late to cancel
1 = Unknown order
3 = Order already in Pending Cancel or Pending Replace status
4 = Unable to process Order Mass Cancel Request
6 = Duplicate ClOrdID <11> received
434 CxlRejResponseTo true Indicates the type of request that the message is in response to.

Valid values:
1 = Order Cancel Request
60 TransactTime true Time the transaction represented by this ExecutionReport <8> occurred (expressed in UTC).
Standard Trailer true

FIX Drop Copy

In the drop copy channel, Bitwyre only support the Trade Capture Report <AE>. We will send this message to user in the following cases:

Tag Field Name Description
Standard Header
571 TradeReportID The TradeID. This is compatible with the trade ids returned through the
REST API as well as the ExecID returned in the ExecutionReports in the
Order FIX channel.
570 PreviouslyReported Will always be "N".Client should use the MsgSeqNum, which will be globally unique.
75 TradeDate Required by the FIX spec; will be the date associated with the TransactTime below
60 TransactTime The time that the trade was executed
552 NoSides The number of sides, always 1
32 LastQty The quantity executed
31 LastPx The price of the execution
11 CliOrdID The client-assigned order ID.
37 OrderID The order ID assigned by Bitwyre to the order
54 Side
The side of the order

* 1 = Buy

* 2 = Sell
58 Text
Used to store the liquidity code. Will be the literal string
* MAKER = Added Liquidity
* TAKER = Removed Liquidity
* AUCTION = Auction Order
12 Commission Fee charged for trade. Negative for rebates.
13 CommType Type of commission. Allowed values:
3 = absolute (total monetary amount)
479 CommCurrency The currency of the fee
Standard Trailer

FIX Market Data

In the market data channel, Bitwyre support this set of messages:

From Client to Bitwyre

Symbol List Request <x>

Symbol List request

8=FIX.4.4|9=73|35=x|34=2|49=BITWYREUSER|52=20200120-14:51:20.000|56=Bitwyre|320=1|559=0|10=099|

Parsed message

HEADER

8               BeginString: FIX.4.4
9               BodyLength: 73
35              MsgType: SECURITY_LIST_REQUEST (x)
34              MsgSeqNum: 2
49              SenderCompID: BITWYREUSER
52              SendingTime: 20200120-14:51:20.000
56              TargetCompID: Bitwyre

BODY

320             SecurityReqID: 1
559             SecurityListRequestType: SYMBOL (0)

TRAILER

10              CheckSum: 099

A Symbol List Request <x> returns a Symbol List <y> response containing the symbols traded on the exchange.

Tag Field Name Required Description
Standard Header true
320 SecurityReqID true Unique identifier of the request
559 SecurityListRequestType true
The type/criteria of the request

Valid Value:

* 0 = Symbol
Standard Trailer true

Market Data Request <V>

Market Data Request

8=FIX.4.4|9=114|35=V|34=2|49=BITWYREUSER|52=20200120-11:51:40.000|56=Bitwyre|262=2|263=1|264=1|265=0|146=1|55=btc_usdt|267=1|269=0|10=052|

Parsed Message

HEADER

8               BeginString: FIX.4.4
9               BodyLength: 114
35              MsgType: MARKET_DATA_REQUEST (V)
34              MsgSeqNum: 2
49              SenderCompID: BITWYREUSER
52              SendingTime: 20200120-11:51:40.000
56              TargetCompID: Bitwyre

BODY

262             MDReqID: 2
263             SubscriptionRequestType: SNAPSHOT_PLUS_UPDATES (1)
264             MarketDepth: 1
265             MDUpdateType: FULL_REFRESH (0)
146             NoRelatedSym: 1
55              Symbol: btc_usdt
267             NoMDEntryTypes: 1
269             MDEntryType: BID (0)

TRAILER

10              CheckSum: 052

This will subscribe the session to Market Data Snapshot and Full Refresh <W>, as a response the sender will receive zero or more Market Data - Incremental Refresh <X> messages.

Tag Field Name Required Description
Standard Header true
262 MDReqID true
Unique identifier of the market
data request
263 SubscriptionRequestType true
Indicates what type of response is expected
Valid value:
* 1 = Snapshot and Updates (subscribe)
264 MarketDepth true
Depth of the book to receive snapshot and updates for.

Valid values:
* 0 = Full Book
* 1 = Top of Book
267 NoMDEntryTypes true Number of MDEntryType<269> fields requested
269 MDEntryType true
Type of market data entry to receive snapshots

and updates for.
Valid values include:
* 0 = Bid
* 1 = Offer
* 2 = Trade
146 NoRelatedSym true Number of Symbols Requested
55 Symbol true Market data symbol requested.
Standard Trailer true

From Bitwyre to Client

Symbol List <y>

Response to the previous Symbol List Request<x>

8=FIX.4.4|9=151|35=y|34=2|49=Bitwyre|52=20180425-17:51:27.544|56=BITWYREUSER|320=1|322=1|560=0|146=6|55=btc_usdt|55=eth_usdt|55=idr_usdt|55=btc_idr|55=idr_btc|55=bch_btc|10=225|

Parsed message

HEADER

9               BodyLength: 151
8               BeginString: FIX.4.4
35              MsgType: SECURITY_LIST (y)
34              MsgSeqNum: 2
49              SenderCompID: Bitwyre
52              SendingTime: 20180425-17:51:27.544
56              TargetCompID: BITWYREUSER

BODY

320             SecurityReqID: 1
322             SecurityResponseID: 1
560             SecurityRequestResult: VALID_REQUEST (0)
146             NoRelatedSym: 6
55              Symbol: btc_usdt
55              Symbol: eth_usdt
55              Symbol: idr_usdt
55              Symbol: btc_idr
55              Symbol: idr_btc
55              Symbol: bch_btc

TRAILER

10              CheckSum: 225

A Symbol List <y> is the response containing the list of symbols specified in a Symbol List Request <x>.

Tag Field Name Required Description
Standard Header Y
320 SecurityReqID Y
Unique identifier of the Symbol List Request

that solicited this response.
322 SecurityResponseID Y Identifier for this message.
560 SecurityRequestResult Y
The result of this request.

Valid values:* 0 = Valid Request
* 1 = Invalid Request
146 NoRelatedSym Y Specifies the number of returned symbols
55 Symbol Y Symbol of the exchange-traded order book pair
Standard Trailer Y

Market Data - Snapshot / Full Refresh <W>

This message is a response to a Market Data Request <V>. We first send snapshot of the current state followed by multiple Market Data - Incremental Refresh <X> messages.

Tag Field Name Required Description
Standard Header
262 MDReqID true Unique identifier of the Market Data Request this message is in response to.
55 Symbol true Symbol of market data entry.
268 NoMDEntries true Number of entries in this message
269 MDEntryType true Type of market data update.

Valid values:
* 0 = Bid
* 1 = Offer
* 2 = Trade
270 MDEntryPx true Price of market data entry.
271 MDEntrySize true Quantity of market data entry.
11 CliOrdID The client-assigned order ID.
37 OrderID The order ID assigned by Bitwyre to the order
54 Side
The side of the order
* 1 = Buy* 2 = Sell
58 Text
Used to store the liquidity code. Will be the literal string
* MAKER = Added Liquidity
* TAKER = Removed Liquidity
* AUCTION = Auction Order
12 Commission Fee charged for trade. Negative for rebates.
Standard Trailer

Market Data Request Reject <Y>

Tag Field Name Required Description
Standard Header
262 MDReqID true Unique identifier of the Market Data Request this message is in response to.
281 MDReqRejReason false Reason why Market Data Request was rejected.


Valid values:
* 0 = Unknown Symbol* 1 = Duplicate MDReqID <262>
* 4 = Unsupported SubscriptionRequestType <263>
* 5 = Unsupported MarketDepth <264>
* 8 = Unsupported MDEntryType <269>
Standard Trailer

Response Objects

Asset Statement

Asset, e.g "btc", statements, containing an array of json object:

JSON Field Data Type Remark
"id" uuid-string universal unique id of the transaction.
"tx_id" string crypto transaction id (crypto only). Can be checked using any block explorer.
"status" enum-string transaction status:
"waiting" for waiting for authorization,
pending" for pending and "success" for settled.
"type" enum-string asset type, "fiat" for fiat and "crypto" for crypto.
"provider" enum-string transaction provider.
"gross_amount" float-string gross amount of the transaction before the fee.
"fee" float-string transaction fee.
"nett_amount" float-string nett amount of the transaction after the fee.
"network_confirmation" number confirmation needed to settle the transaction (crypto only).
"submit_time" big-integer unix time in nanoseconds
"success_time" big-integer unix time in nanoseconds

Execution Report

This is a general response for all private/orders endpoint.

JSON Field Data Type Remark
"OrderID" uuid-string server generated order id.
"ClOrdID" uuid-string client generated order id, if supplied.
"OrigClID" uuid-string original order id, will be different when a order cancellation occured.
"OrdStatusReqID" uuid-string an echo of order status request/query id.
"ExecID" uuid-string this report id.
"ExecType" enum-number execution report type, see Execution Type.
"OrdStatus" enum-number order status of this report, see Order Status.
"OrdRejReason" enum-number order reject reason, see Order Reject Reason.
"Account" uuid-string account uniqute id of the current API Key.
"Instrument" string asset pair symbol.
"Side" enum-number order side, "buy" or "sell".
"TransactTime" big-integer execution report timestamp, unix time in nanoseconds
"OrderQty" float-string base asset quantity, in float string.
"Timestamp" big-integer order timestamp, when accepted by server, unix time in nanoseconds
"OrdType" enum-number market (1), limit (2), stop (3), and stop_limit (4).
"Price" float-string "limit" or "stop_limit" price of the order.
"StopPx" float-string stop price for "stop" and "stop_limit".
"TimeInForce" enum-number order lifetime enforcement, see Time In Force.
"ExpireTime" big-integer order expire time, mandatory for Good-Till-Date, unixtime in nanoseconds.
"ExecInst" string not yet supported.
"CancelOnDisconnect" bool cancel on disconnection, currently only supported by Websocket API.
"LastQty" float-string last executed quantity in a trade-match.
"LastPx" float-string last executed price in a trade-match.
"LastLiquidityInd" float-string last executed liquidity index.
"LeavesQty" float-string remaining quantity of the order.
"CumQty" float-string total executed quantity.
"AvgPx" float-string average price of executed order.

Execution Type

Enum Name (FIX 4.4) Representation
New 0
Trade 2
DoneForToday 3
Canceled 4
Replace 5
PendingCancel 6
Stopped 7
Rejected 8
Suspended 9
PendingNew 10
Calculated 11
Expired 12
Restated 13
PendingReplace 14
TradeCorrect 16
TradeCancel 17
OrderStatus 18

Order Status

Enum Name (FIX 4.4) Representation
New 0
PartiallyFilled 1
Filled 2
DoneForToday 3
Canceled 4
Replaced 5
PendingCancel 6
Stopped 7
Rejected 8
Suspended 9
PendingNew 10
Calculated 11
Expired 12
AcceptedForBidding 13
PendingReplace 14
PendingExpire 15
PartialCancel 16
PartialCancelTooBig 17
PendingPartialCancel 18
PendingSuspend 19

Order Reject Reason

Enum Name (FIX 4.4) Representation
BrokerExchangeOption 0
UnknownSymbol 1
ExchangeClosed 2
OrderExceedsLimit 3
TooLateToEnter 4
UnknownOrder 5
DuplicateOrder 6
DuplicateVerballyCommunicatedOrder 7
StaleOrder 8
TradeAlongRequired 9
InvalidInvestorID 10
UnsupportedOrderCharacteristic 11
SurveillanceOption 12
IncorrectQuantity 13
IncorrectAllocatedQuantity 14
UnknownAccounts 15
PriceExceedsCurrentPriceBand 16
InvalidPriceIncrement 18
ReferencePriceNotAvailable 19
NotionalValueExceedsThreshold 20
AlgorithmRiskThresholdBreached 21
ShortSellNotPermitted 22
ShortSellRejectedSecurityPreBorrowRestrictions 23
ShortSellRejectedAccountPreBorrowRestrictions 24
InsufficientCreditLimit 25
ExceededClipSizeLimit 26
ExceededMaxNotionalOrderAmount 27
ExceededDV01Limit 28
ExceededCS01Limit 29
SelfMatch 30
NegativeBalance 31
Mallicious 32
Other 99

Time In Force

Enum Name (FIX 4.4) Representation
Day 0
GoodTillCancel 1
AtTheOpening 2
ImmediateOrCancel 3
FillOrKill 4
GoodTillCrossing 5
GoodTillDate 6
AtTheClose 7

Banking Details

Fields Description
SWIFT Code specific banking institution code https://en.wikipedia.org/wiki/ISO_9362

HTTP Errors

The Bitwyre API uses the following HTTP error codes:

Code Meaning Description
400 Bad Request Your request is invalid.
401 Unauthorized Your API key is wrong.
403 Forbidden Oops. You're not allowed to access that.
404 Not Found Whatever you're looking for could not be found.
405 Method Not Allowed You tried to access stuffs with an invalid method.
406 Not Acceptable You requested a format that isn't processable.
410 Gone The things you requested has been removed from our servers.
418 I'm a teapot. We refuse to brew your coffee because you've been banned.
422 Unprocessable Entity Something (parameters, values, etc.) is missing from your request, hence we are unable to process it.
429 Too Many Requests You're calling in too fast! Slow down!
500 Internal Server Error We had a problem on our side. Try again later. Sorry!
503 Service Unavailable We're temporarily offline for maintenance. Please try again later.