Price API

Price API allows you to get current cryprocurrency exchanging rates

Get Buy Rates

Get cryptocurrency buy rates

Get cryptocurrency buy rates
[GET] https://www.bitlio.com/api/v1/stats/buy
Response
{
  "usd": {
    "current_rate": "2527.68",
    "daily_change": {
      "percentage": "0.0",
      "value": "0.0"
    },
    "highest_today": "2527.68",
    "lowest_today": "2483.03",
    "todays_open": "2483.03"
  },
  "gbp": {
    "current_rate": "1941.51",
    "daily_change": {
      "percentage": "0.0",
      "value": "0.0"
    },
    "highest_today": "1941.51",
    "lowest_today": "1907.96",
    "todays_open": "1907.96"
  },
  ...
}
                        

Get Sell Rates

Get cryptocurrency sell rates

Get cryptocurrency sell rates
[GET] https://www.bitlio.com/api/v1/stats/sell
Response
{
  "usd": {
    "current_rate": "2524.82",
    "daily_change": {
      "percentage": "0.0",
      "value": "0.0"
    },
    "highest_today": "2527.68",
    "lowest_today": "2483.03",
    "todays_open": "2483.03"
  },
  "gbp": {
    "current_rate": "1939.63",
    "daily_change": {
      "percentage": "-0.02",
      "value": "-0.32"
    },
    "highest_today": "1941.51",
    "lowest_today": "1907.96",
    "todays_open": "1907.96"
  },
  ...
}
                        

Trading API

Trading API allows you to automate cryptocurrency trading tasks

User Registration

New user registration with single API call
[POST] https://www.bitlio.com/api/v1/sign_up
Params
  • name: User Name
  • email: Email
  • inviter_code: Referral code(optional)
  • time_zone: time zone string ('Europe/Kiev', 'UTC'...)
  • country_code: country code ('usa', 'uk', ...)
  • password: min 8 symbols
Response
{
  "result": "success"
}
                        

API Keys

You can use user-defined API keys to get access to the API

Getting Access Token

Access token is needed to access API's endpoints. API token should stay valid for 15 minutes, you're free to get new access token at any time. You can't use old API token once you receive new token.

Token request
[GET] https://www.bitlio.com/api/v1/get_token
Parameters: api_key = { Your API key }
Response
{
  "token": "your_token"
}
                      
BAD Response if api key is wrong or disabled
HTTP status 401

Using access token

Access token is needed to access API's endpoints. API token should stay valid for 15 minutes, you're free to get new access token at any time. You can't use old API token once you receive new token.

To use token you should put it into http header 'X-Api-Token'
If token is expired, regenerated or api key is disabled, you should expect bad reponse
HTTP status 401

OAuth

Also You can use OAuth to authorize in the API

Getting OAuth Token

OAuth token is needed to access API's endpoints.

Token request
[POST] https://www.bitlio.com/oauth/token
Params
  • grant_type: "password"
  • email: your email
  • password: your password
Response
{
    "access_token": "your_token",
    "token_type": "bearer",
    "expires_in": "7200",
    "created_at": "1501774832"
}
                      
BAD Response if credentials are wrong
HTTP Status 401
{
  "error": "invalid_grant",
  "error_description": "The provided authorization grant is invalid..."
}
                          

Using OAuth token

OAuth token is needed to access API's endpoints. To use token you should put it into http header 'Authorization' with Bearer prefix

Authorization: Bearer your_oauth_token
If token is expired you should expect bad reponse
HTTP status 401

Revoke OAuth Token

You can end your session with oauth token revocation

Token revokation. Do not forget to include Authorization header with valid token.
[POST] https://www.bitlio.com/oauth/revoke
Form Data (x-www-form-urlencoded)
  • token: "your_token"
Response
200 OK

Trading API Methods

Get Currencies

Get currency codes list, currency codes is needed for some operations.

Get currencies
[GET] https://www.bitlio.com/api/v1/currencies
Params
  • type: [ crypto | fiat | internal ] *optional
Response
{
  "info": {
    "currencies": [
      {
        "name": "Currency Name",
        "code": "Currency Code"
      },
      ...
    ]
  }
}
                        

Get Regions

Get regions list, region information is needed for some operations.

GET regions
[GET] https://www.bitlio.com/api/v1/regions
Response
                          
{
  "info": {
    "regions": [
      {
        "name": "International",
        "countries": []
      },
      {
        "name": "India",
        "countries": [
          {
            "country_code": "in",
            "currency_name": "INR"
          },
          ...
        ]
      },
      {
        "name": "European Union",
        "countries": [
          {
            "country_code": "be",
            "currency_name": "EUR"
          },
          ...
        ]
      },
      ...
    ]
  }
}
                      
                    

Get Bank Accounts

Get User's accounts list, that is needed for some operations

GET Bank Accounts
[GET] https://www.bitlio.com/api/v1/my_bank_accounts
Response
{
  "account": {
    "bank_accounts": [
      {
        "account_id": "24",
        "account_name": "testing account",
        "bank_name": "Test Bank",
        "account_number": "12345678",
        "region": "International",
        "verified": "false"
      },
      ...
    ]
  }
}
                    

Get Bitcoin Addresses

Get User's bitconin addresses, that is needed for some operations

GET Bitcoin Addresses
[GET] https://www.bitlio.com/api/v1/btc/addresses
Response
{
  "account": {
    "bitcoin_addresses": [
      {
        "address": "2NFLcrrYj12X9ME5p63hbxSp42cz1FH9icb",
        "label": "test address"
      },
      ...
    ]
  }
}
                    

Get Account Balances

Check account balances

GET Account Balances
[GET] https://www.bitlio.com/api/v1/balances
Response
{
  "account": {
    "balances": [
      {
        "currency": "BTC",
        "amount": "0.45740847"
      },
      {
        "currency": "USD",
        "amount": "22.34"
      },
      ...
    ]
  }
}
                    

Get Wire Transfer Deposit Requests

Get Wire Transfer Deposit Requests

Get Wire Transfer Deposit Requests
[GET] https://www.bitlio.com/api/v1/wire/deposits
Response
{
  "account": {
    "wire_transfer_deposit_requests": [
      {
        "created_at": "2017-07-17T15:28:32.489Z",
        "amount": "1,000.00 USD",
        "bank_type": "International",
        "status": "Confirmed",
        "operation_uuid": "2c311c69-9e2d-4ac9-b295-1613fd4be7ad"
      },
      ...
    ]
  }
}
                    

Get Wire Transfer Withdrawal Requests

Get Wire Transfer Withdrawal Requests

Get Wire Transfer Withdrawal Requests
[GET] https://www.bitlio.com/api/v1/wire/withdrawals
Response
{
  "account": {
    "wire_transfer_withdrawal_requests": [
      {
        "created_at": "2017-07-17T15:30:12.305Z",
        "amount": "100.00 USD",
        "bank_type": "International Bank",
        "description": "Wire Transfer",
        "status": "Pending",
        "operation_uuid": "96ad1ec5-8a79-47dd-b6ee-bbf6ca8efc5c"
      },
      ...
    ]
  }
}
                    

Get Bitcoin deposit transactions

Get Bitcoin deposit transactions

Get Bitcoin deposit transactions
[GET] https://www.bitlio.com/api/v1/btc/deposits
Response
{
  "account": {
    "bitcoin_deposit_transactions": [
      {
        "created_at": "2017-06-08T15:21:26.875Z",
        "amount": "2,228.37120000 BTC",
        "status": "Completed",
        "sender_address": "d5a52f93788f3658822166ac8245b7854732304d",
        "operation_uuid": "29cb4e69-3254-4097-94fa-dcb197c80c6e"
      },
      ...
    ]
  }
}
                    

Get Bitcoin withdrawal transactions

Get Bitcoin withdrawal transactions

Get Bitcoin withdrawal transactions
[GET] https://www.bitlio.com/api/v1/btc/withdrawals
Response
{
  "account": {
    "bitcoin_withdrawal_transactions": [
      {
        "created_at": "2017-06-08T15:21:26.783Z",
        "destination_address": "61164a4a659f2cbd4f837a693a7c3cd1fc108837",
        "amount": "1.50880000 BTC",
        "fee": "0.000108800 BTC",
        "status": "Completed",
        "operation_uuid": "29cb4e69-3254-4097-94fa-dcb197c80c6e"
      },
      ...
    ]
  }
}
                    

Get All Transactions

Get All Account Transactions

Get All Account Transactions
[GET] https://www.bitlio.com/api/v1/transactions
Response
{
  "account": {
    "transactions": [
      {
        "amount": "1.0",
        "fee": "0.00088",
        "created_at": "2017-06-08T15:21:26.783Z",
        "type": "withdraw",
        "status": "Completed",
        "network": "Buy/Sell",
        "bitcoin_buy_price": "null",
        "bitcoin_sell_price": "2250.88",
        "sent_from": "null",
        "btc_info": "null",
        "operation_uuid": "9aa89f97-01bf-401f-b35e-a96c9cd7d4e7"
      },
      ...
    ]
  }
}
                    

Place One-Click Buy Order

Buy cryptocurrency though one simple operation

Create new one-click order
[POST] https://www.bitlio.com/api/v1/one_click/buy
Params
  • currency: currency code(you can get it through info/currencies call)
  • amount: amount of currency you want to buy
Response
{
  "operation_uuid": "fb6bf7cb-5068-4601-a395-712d9ec64cbc"
}
                    
You may expect some of next listed errors if user doesn't finished his account setup.
{
  "errors": {
    "user_action_needed": [
      "One-click operations are disabled",
      "User should pass level 2 verification to proceed"
    ]
  }
}
                    
More info is available on api section inside account settings.

Place One-Click Sell Order

Sell cryptocurrency though one simple operation

Create new one-click order
[POST] https://www.bitlio.com/api/v1/one_click/sell
Params
  • currency: currency code(you can get it through info/currencies call)
  • amount: amount of currency you want to sell
Response
{
  "operation_uuid": "fb6bf7cb-5068-4601-a395-712d9ec64cbc"
}
                    
You may expect some of next listed errors if user doesn't finished his account setup.
{
  "errors": {
    "user_action_needed": [
      "One-click operations are disabled",
      "User should pass level 2 verification to proceed"
    ]
  }
}
                    
More info is available on api section inside account settings.

Place Instant Buy Order

Buy cryptocurrency

Create new instant buy order
[POST] https://www.bitlio.com/api/v1/instant/buy
Params
  • currency: currency code(you can get it through info/currencies call)
  • amount: amount of currency you want to buy
Response
{
  "operation_uuid": "fb6bf7cb-5068-4601-a395-712d9ec64cbc"
}
                    
Expedite method can force instant operation processing time
Expedite Info method can give you additional info about expedite method for this operation

Expedite Info

Expedite Info provides information of what options do you have to complete your order in shrorter amount of time, and shows what it will cost you

Expedite Info
[GET] https://www.bitlio.com/api/v1/instant/expedite_info
Params
  • operation_uuid: uuid of operation which you are intrested in. Only pending operations are allowed
Response
{
  "expedite_info": {
    "immediately_expedite": {
      "currency_name": "USD",
      "price": "100500"
    },
    "standard_expedite": {
      "currency_name": "USD",
      "price": "100",
      "confirmation_seconds_remaining": "5200",
      "available_on": "Mon 18, 2017"
    }
  }
}
                    
You can use Expedite method to force expedition on your instant operation

Expedite

Expedite allows you to complete your order fastly.

Expedite
This is paid opreation
[POST] https://www.bitlio.com/api/v1/instant/expedite
Params
  • operation_uuid: uuid of operation which you are intrested in. Only pending operations are allowed
  • expedite_type: {0|1} (0 - standrd expedite, 1 - immidiately expedite)
Response
{
  "transaction_expediton_result": {
    "id": ,
    "status": ,
    "direction": ,
    "created_at": ,
    "sent_money": ,
    "received_money": ,
    "amount_class": ,
    "available_on": ,
    "rate": ,
    "rate_class": ,
    "fee": ,
    "fee_class": ,
  }
}
                    

Place Instant Sell Order

Sell BTC

Create new instant sell order
[POST] https://www.bitlio.com/api/v1/instant/sell
Params
  • currency: currency code(you can get it through info/currencies call) to conver to
  • amount_btc: amount of BTC you want to sell
Response
{
  "operation_uuid": "fb6bf7cb-5068-4601-a395-712d9ec64cbc"
}
                    

Wire Transfer Deposit Methods

You must have and should choose Deposit Method if you want to place Wire Transfer Request

Wire Transfer Deposit Methods
[GET] https://www.bitlio.com/api/v1/wire/deposit_methods
Params
  • country_code: code of country where you want to process money transfer operation, you can get list of codes from info/regions method
Response
{
  "account": {
    "wired_transfers_deposit_methods": [
      {
        "bank_id": "190",
        "bank_name": "Test Bank",
        "account_number": "12345678",
        "account_name": "Personal Banking Account",
        "city": "Cincinnati",
        "swift_code": "GEBABEBB",
        "bank_address": "2596 Rogers Street",
        "iban": "null",
        "usd_account_number": "12345678",
        "kes_account_number": "12345678",
        "bank_code": "99-11-22",
        "branch_code": "081"
      },
      ...
    ]
  }
}
                    
Error you may expect if user is not reached level 2 verification
{
  "errors": {
    "user_action_needed": [
      "User should pass level 2 verification to proceed"
    ]
  }
}
                    

Wire Transfer Deposit Request

Wire Transfer Deposit Request allows you to transfer money into your Bitlio account

Wire Transfer Deposit Request
[POST] https://www.bitlio.com/api/v1/wire/deposit
Params
  • first_name: First Name of sender
  • last_name: Last Name of sender
  • currency: currency code, you can get codes list from info/currencies
  • amount: amount to expect
  • comment: your comment(optional)
  • country_code: country code, you can country codes from info/regions
  • bank_id: bank id, you can get one from wire transfer deposit methods
Response
{
  "result": "success",
  "operation_uuid": "29cb4e69-3254-4097-94fa-dcb197c80c6e"
}
                    
Errors you may expect if user is not completed his account setup
{
  "errors": {
    "user_action_needed": [
      "Your ability to deposit are restricted at the moment. Please open a support ticket.",
      "Your ability to deposit are restricted at the moment. Please complete all steps from verify account."
    ]
  }
}
                    

Get Wire Transfer Deposit Transaction Status

Get wire transfer deposit transaction status

Get wire transfer deposit transaction status
[GET] https://www.bitlio.com/api/v1/wire/get_deposit
Params
  • operation_uuid: uuid of operation
Response
{
  "user_deposit_transaction": {
    "amount": "0.75292869",
    "created_at": "2017-07-14T16:15:50.954Z",
    "status": "Pending",
    "operation_uuid": "fb6bf7cb-5068-4601-a395-712d9ec64cbc"
  }
}
                    

Wire Transfer Withdrawal Request

Wire Transfer Withdrawal Request allows you to transfer money into your bank account

Wire Transfer Withdrawal Request
[POST] https://www.bitlio.com/api/v1/wire/withdraw
Params
  • currency: currency code, you can get codes list from info/currencies
  • amount: amount to withdraw
  • comment: your comment(optional)
  • bank_account_id: bank id, you can get list of your bank accounts via account/bank_accounts
  • verification_code: verification code from google authenticator
Response
{
  "result": "success",
  "operation_uuid": "29cb4e69-3254-4097-94fa-dcb197c80c6e"
}
                    

Get Wire Transfer Withdrawal Transaction Status

Get wire transfer withdrawal transaction status

Get wire transfer withdrawal transaction status
[GET] https://www.bitlio.com/api/v1/wire/get_withdrawal
Params
  • operation_uuid: uuid of operation
Response
{
  "user_withdrawal_transaction": {
    "amount": "100.0",
    "created_at": "2017-07-03T10:18:54.744Z",
    "status": "Pending",
    "operation_uuid": "b6780afe-ab20-4d45-b00e-1226e03ab503"
  }
}
                    

BTC Withdrawal Request

BTC Request allows you to transfer money into another address

BTC Withdrawal Request
[POST] https://www.bitlio.com/api/v1/btc/withdraw
Params
  • address: address to transfer BTC
  • amount: amount to transfer
  • verification_code: verification code from google authenticator
Response
{
  "result": "success",
  "operation_uuid": "29cb4e69-3254-4097-94fa-dcb197c80c6e"
}
                    

Get Bitcoin Withdrawal Transaction Status

Get Bitcoin withdrawal transaction status

Get Bitcoin withdrawal transaction status
[GET] https://www.bitlio.com/api/v1/btc/get_withdrawal
Params
  • operation_uuid: uuid of operation
Response
{
  "user_withdrawal_transaction": {
    "amount": "1.02",
    "created_at": "2017-07-03T12:07:24.907Z",
    "status": "Pending",
    "recipient_address": "address",
    "operation_uuid": "5a150f1d-ccb7-4402-b850-8180ed8c66ba"
  }
}
                    

Error Handling

Sometimes you'll meet conditions where something prevents normal API call. To minimize efforts, we provide simple way to handle API errors on client's side. There are three typical situations you can meet.

Q: You get status 401 on any api call.
A: Probably you are trying to use expired API token. Try to get a new one.
Q: You get status 422 on some of API calls.
A: You should get error response with explanation, like this:
{
  "errors": {
    "user_action_needed": [
      "One-click operations are disabled",
      "User should pass level 2 verification to proceed"
    ]
  }
}
                
© 2017 Bitlio. All Rights Reserved