Getting Started on API Guide

Overview

This is a simple API built to encourage and collaborate between project stakeholders, developers, and customers at any point in the project.

Note

If Unique Identifire for all coins are same then its consider the one user.

Coin / Digital Currency Support

Identifier Digital Currency
BTC Bitcoin
BCH Bitcoin Cash
LTC Litecoin
XRP XRP (formerly known as Ripple)
ETH Ethereum
Token ERC-20 Token

User Authentication

If you want to set with this API, you will need to generate an API key. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API key in publicly. To generate an API key use below URL.

https://keypay.io/index.php/home/exchange_user_registration

api_key must be sent with all client requests. The api_key helps the server to validate the request source.

Example JSON Response:

                
  {
    "Error":"Missing API Key"
  }
  {
    "Error":"Invalid API key."
  }
                
              

Coin-Specific Implementation

The API operates at a wallet level and handles different transactional implementation without getting in the user’s way. This section explains how this API handles wallet operations.

  • Bitcoin
  • Bitcoin Cash
  • Litecoin
  • Ethereum
  • XRP (formerly known as Ripple)
  • XLM (formerly known as Steller)
  • USDT

Bitcoin

Bitcoin can be accessed with the BTC as coin id (coin_id = "BTC").

Get Balance

The get balance API gets the balance in decimal bitcoin across all counts or for a particular account.

URL: /getCoinBalance

Parameters

api_key: String(Required)

coin_id: String like (BTC) (Required)

Example JSON Response:

                
  {
    "Response":0.00385000 
  }
                
                

Master List Transactions

Client side url to get transaction list for bitcoin.

URL: https://beathebit.com/api.php/?method=masterlistTransactions&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Subuser List Transactions

Client side url to get transaction list for bitcoin.

https://beathebit.com/api/index.php/welcome/subuserlistTransactions?api_key=PJeISV64LcqBgkqj2F8UTbmsxQWlhm3DGuOa9glUcyZoEXVhyfAT1CMNIfn5oJ2KpR1&unique_identifier=subuser001&coin_id=BTC

Here,

api_key = PJeISV64LcqBgkqj2F8UTbmsxQWlhm3DGuOa9glUcyZoEXVhyfAT1CMNIfn5oJ2KpR1

unique_identifier = subuser001 (Unique ID)

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  { "Response":
   [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
   ]
  }
                
                

Send From

Will send the given amount to the given address, ensuring the account has a valid balance. Returns the transaction ID if successful.

URL: /sendFrom

Parameters

api_key: String(Required)

coin_id: String like (BTC) (Required)

amount: Number(Required)

toaddress : String(Required)

where

amount is amount to be send.

toaddress is address of receiver.

Example JSON Response:

                
  {
    "Response": "8420dc73244dadef17820e318b70bc259c5a570df2665513d103b362cc12de8d"
  }
                
                

Get Address

It returns an address for receiving payments.

URL: /getAddress

Parameters

api_key: String(Required)

coin_id: String like (BTC) (Required)

Example JSON Response:

                
  {
    "Response": "mjhcjMFGESEqt9grokciroNMb6AnjFiiHv"
  }
                
                

Bitcoin Cash

Bitcoin cash can be accessed with the BCH as coin id (coin_id = "BCH").

Get Balance

The get balance API gets the balance in decimal bitcoin cash across all counts or for a particular account.

URL: /getCoinBalance

Parameters

api_key: String(Required)

coin_id: String like (BCH) (Required)

Example JSON Response:

                
  {
    "Response":0.00385000 
  }
                
                

Master List Transactions

It returns the most recent transactions.

URL: /masterlistTransactions

Parameters

api_key: String(Required)

coin_id: String like (BCH) (Required)

Subuser List Transactions

It returns the most recent transactions.

URL: /subuserlistTransactions

Parameters

unique_identifier: Unique Id(Required)

coin_id: String like (BCH) (Required)

Example JSON Response:

                
 {
    "Response":
  [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
  ]
 }
                
                

Send From

Will send the given amount to the given address, ensuring the account has a valid balance. Returns the transaction ID if successful.

URL: /sendFrom

Parameters

api_key: String(Required)

coin_id: String like (BCH) (Required)

amount: Number(Required)

toaddress : String(Required)

where

amount is amount to be send.

toaddress is address of receiver.

Example JSON Response:

                
  {
    "Response": "8420dc73244dadef17820e318b70bc259c5a570df2665513d103b362cc12de8d"
  }
                
                

Get Address

It returns an address for receiving payments.

URL: /getAddress

Parameters

api_key: String(Required)

coin_id: String like (BCH) (Required)

Example JSON Response:

                
  {
    "Response": "mjhcjMFGESEqt9grokciroNMb6AnjFiiHv"
  }
                
                

Litecoin

Litecoin can be accessed with the LTC as coin id (coin_id = "LTC").

Get Balance

The get balance API gets the balance in decimal format across all counts or for a particular account.

URL: /getCoinBalance

Parameters

api_key: String(Required)

coin_id: String like (LTC) (Required)

Example JSON Response:

                
  {
    "Response":0.00385000 
  }
                
                

Master List Transactions

It returns the most recent transactions.

URL: /masterlistTransactions

Parameters

api_key: String(Required)

coin_id: String like (LTC) (Required)

Subuser List Transactions

It returns the most recent transactions.

URL: /subuserlistTransactions

Parameters

unique_identifier: Unique ID(Required)

coin_id: String like (LTC) (Required)

Example JSON Response:

                
 {
    "Response":
  [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
  ]
 }
                
                

Send From

Will send the given amount to the given address, ensuring the account has a valid balance. Returns the transaction ID if successful.

URL: /sendFrom

Parameters

api_key: String(Required)

coin_id: String like (LTC) (Required)

amount: Number(Required)

toaddress : String(Required)

where

amount is amount to be send.

toaddress is address of receiver.

Example JSON Response:

                
  {
    "Response": "8420dc73244dadef17820e318b70bc259c5a570df2665513d103b362cc12de8d"
  }
                
                

Get Address

Client side url to get address.

URL: /getAddress

Parameters

api_key: String(Required)

coin_id: String like (LTC) (Required)

Example JSON Response:

                
  {
    "Response": "mjhcjMFGESEqt9grokciroNMb6AnjFiiHv"
  }
                
                

XRP (formerly known as Ripple)

XRP can be accessed with the XRP as coin id (coin_id = "XRP").

Get Balance

The get balance API gets the balance in decimal format across all counts or for a particular account.

URL: /getCoinBalance

Parameters

api_key: String(Required)

coin_id: String like (XRP) (Required)

Example JSON Response:

                
  {
    "Response":"10003.0012"
  }
                
                

Master List Transactions

It returns the most recent transactions.

URL: /masterlistTransactions

Parameters

api_key: String(Required)

coin_id: String like (XRP) (Required)

Subuser List Transactions

It returns the most recent transactions.

URL: /subuserlistTransactions

Parameters

unique_identifier: Unique Id(Required)

coin_id: String like (XRP) (Required)

Example JSON Response:

                
 {
    "Response":
   [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
  ]
}
                
                

Send From

Will send the given amount to the given address, ensuring the account has a valid balance. Returns the transaction ID if successful.

URL: /sendFrom

Parameters

api_key: String(Required)

coin_id: String like (XRP) (Required)

amount: Number(Required)

toaddress : String(Required)

where

amount is amount to be send.

toaddress is address of receiver.

Example JSON Response:

                
  {
    "Response": "0FF3F1250B2E4F6B82D710BBE4A64FD8C149767E5273B57C8333746C18230292"
  }
                
                

Get Address

It returns an address for receiving payments.

URL: /getAddress

Parameters

api_key: String(Required)

coin_id: String like (XRP) (Required)

Example JSON Response:

                
  {
    "Response":"rfs4CGsTQwM9j3es112sSTDX2KAUpm8JZb"
  }
                
                

Ethereum

Ethereum can be accessed with the ETH as coin id (coin_id = "ETH").

Get Balance

The get balance API gets the balance in decimal format across all counts or for a particular account.

URL: /getCoinBalance

Parameters

api_key: String(Required)

coin_id: String like (ETH) (Required)

Example JSON Response:

                
              {"Response":"2.0109456010416675"}
                
                

Master List Transactions

Client side url to get transaction list for etherium.

URL: https://beathebit.com/api.php/?method=masterlistTransactions&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=ETH

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = ETH

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Subuser List Transactions

Client side url to get transaction list for etherium.

URL: https://beathebit.com/api.php/?method=subuserlistTransactions&unique_identifier=sample001&coin_id=ETH

Here,

unique_identifier = sample001 (unique Id)

coin_id = ETH

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  {
    "Response":
    {
      "txid":"0x21c0f6afe0c7372ad023e13aacc5aa3ab87ca1804cc644517bf3a4689428a073","toaddress":"0x35Dd44B4214e80B9a7b961F70C8d3cE02c5273c5",
      "amount":"0.00010000"
    }
  }

                
                

Get Address

It returns an address for receiving payments.

URL: /getAddress

Parameters

api_key: String(Required)

coin_id: String like (ETH) (Required)

Example JSON Response:

                
  {
    "Response":"0xe26b5404224cbE870013eB62459894eBa617cEed"
  }
                
                

Send From

Client side url to transfer amount to the given address for bitcoin.

URL: https://beathebit.com/api.php/?method=sendFrom&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=ETH&amount=0.13191495&toaddress=2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = ETH

amount = 0.13191495

toaddress = 2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

where

amount is amount to be send.

toaddress is address of receiver.

gaslimit (default:36553)is gaslimit to be send.

gasprice (default:41)is gasprice to be send.

Example JSON Response:

                
  {
    "Response": "0xd36f341c6e3cf07a4859244feff5c1544917e1db0b5076364d2a4465b54305eb"
  }
                
                

Token

Token can be accessed with the Symbol as token id (token_id = "ALTARTEC").

Get Balance

The get balance API gets the balance in decimal format across all counts or for a particular account.

URL: /getTokenBalance

Parameters

api_key: String(Required)

token_id: String like (ALTARTEC) (Required)

Example JSON Response:

                
             {
               "Response":"3143.7732401174753"
             }
                
                

Master List Transactions

Client side url to get transaction list for token.

URL: https://beathebit.com/api.php/?method=listTokenTransactions&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&token_id=ALTARTEC

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

token_id = ALTARTEC

Example JSON Response:

                
  {
    "Response":
    {
      "txid":"0x1be5d95fe325876e7c5570eca6ff0a28b578bf48c200d72230cf67bf4ebe6832",
      "toaddress":"0x35Dd44B4214e80B9a7b961F70C8d3cE02c5273c5",
      "amount":"0.00001000","contract_address":"0xB5658E6337A862c2b179236bf21bFE4e2909005B",
      "symbol":"ALTARTEC"
    }
  }

                
                

Get Address

It returns an address for receiving payments.

URL: /getTokenAddress

Parameters

api_key: String(Required)

token_id: String like (ALTARTEC) (Required)

Example JSON Response:

                
  {
    "Response":"0xe26b5404224cbE870013eB62459894eBa617cEed"
  }
                
                

Send From

Client side url to transfer amount to the given address for bitcoin.

URL: https://beathebit.com/api.php/?method=sendTokenfrom/v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&token_id=ALTARTEC&amount=0.13191495&toaddress=2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

token_id = ALTARTEC

amount = 0.13191495

toaddress = 2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

where

amount is amount to be send.

toaddress is address of receiver.

gaslimit (default:36553)is gaslimit to be send.

gasprice (default:41)is gasprice to be send.

Example JSON Response:

                
  {
    "Response":"0x0a71db12c31e5727eec9b158db0141d03fd078b79dfe179d1ec38cdc2004981d"
  }
                
                

Error Handling

All errors follow general REST principles.

Error Code Meaning
-1 std::exception thrown in command handling
-2 Server is in safe mode and command is not allowed in safe mode
-3 Unexpected type was passed as parameter
-5 Invalid address or key
-7 Run out of memory during operation
-8 Invalid, missing or duplicate operator
-20 Database error
-22 Error parsing or validating structure in raw format
-25 General error during transaction or block submission
-26 Transaction or block was rejected by network rules
-27 Transaction already in chain
-28 Client still warming up
-32600 Invalid request
-32601 Method not found
-32602 Invalid params
-32603 Internal error
-32700 Parse error

Convensions

  • All possible responses are listed under ‘Responses’ for each method.
  • All Responses are in JSON format.

Examples

This section describes the all methods for bitcoin, bitcoin cash, litecoin, etherium, XRP etc

Generate API Key

To generate an API key user need to register on below URL. For registration user has to enter username and Email Id. After registration user have to select Subscription plan.After login user have to click on "create API key" button in exchange menu to get an API key.

URL: https://keypay.io/index.php/home/exchange_user_registration

Example

username = test

email id = [email protected]

Example JSON Response:

                
  {
    "Response":0.00385000 
  }
                
                

Get Balance

Client side URL to get balance for bitcoin.

URL: https://beathebit.com/api.php/?method=getCoinBalance&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin,XRP

Example JSON Response:

                
  {
    "Response":0.00385000 
  }
                
                

Get Identifier

Client side URL to get Identifier for particular coin.

URL: https://beathebit.com/api.php/?method=getIdentifier&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&address=3MSDoFaZ9MetG65geE3W9EQ1dWp42eTmxYP

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

address = 3MSDoFaZ9MetG65geE3W9EQ1dWp42eTmxYP

Example JSON Response:

                
  {
    "Response":"subuser001"
  }
            
                

Master List Transactions

Client side url to get transaction list for bitcoin.

URL: https://beathebit.com/api.php/?method=masterlistTransactions&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
  ]
                
                

Subuser List Transactions

If Unique Identifire for all coins are same then its consider the one user

Client side url to get transaction list for bitcoin.

URL: https://beathebit.com/api.php/?method=subuserlistTransactions&unique_identifier=Sample001&coin_id=BTC

Here,

unique_identifier = Sample001 (Unique Id)

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  [
    {
      "address":"2Mz8yZSb7mbVWQJh9wpqWJtDubNrWfDJp7S",
      "category":"receive",
      "amount":0.00010000,
      "blockhash":"0000000000000173c6fa7a453ccf540c0726c2117eb39e7b115e9f5df9c24210",
      "txid":"d5179f9a2dd64020c6fd2e364374c50a53b1bb96dd8acb58ad0c75a3f804055a",
      "time":2018-12-08 09:43:35,
      "timereceived":2018-12-08 09:43:35
    }
  ]
                
                

Send From

Client side url to transfer amount to the given address for bitcoin.

URL: https://beathebit.com/api.php/?method=sendFrom&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC&amount=0.13191495&toaddress=2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

amount = 0.13191495

toaddress = 2N1zJ178p97NajkVQ8z8SEzniQ4FwwzyCD3

where

amount is amount to be send.

toaddress is address of receiver.

The same URI would be used for bitcoin cash, litecoin,XRP

Example JSON Response:

                
  {
    "Response": "8420dc73244dadef17820e318b70bc259c5a570df2665513d103b362cc12de8d"
  }
                
                

Get Address

It returns an address for receiving payments for bitcoin.

URL: https://beathebit.com/api.php/?method=getAddress&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  {
    "Response": "mjhcjMFGESEqt9grokciroNMb6AnjFiiHv"
  }
                
                

Create New Wallet

It returns an address for receiving payments for BTC.

URL: https://beathebit.com/api.php/?method=createNewWallet&api_key=v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj&coin_id=BTC&unique_identifier=0001#

Here,

api_key = v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj

coin_id = BTC

unique_identifier = 0001# (Unique Id)

The same URI would be used for bitcoin cash, litecoin, etherium, XRP

Example JSON Response:

                
  {
    "Response": "mjhcjMFGESEqt9grokciroNMb6AnjFiiHv"
  }
                
                

Sample Code

Sample Curl code For Coins

Parameters to be pass to API:

$user_array['api_key'] = "v52ngLk9R02SPxqVwPAKuGTYorlbHeEzz7d3u3gihfsylcGCOV8pUIaX0AN4oy8vxZj";
$user_array['coin_id'] = "BTC";

URL:

$url = 'https://beathebit.com/api.php/getCoinBalance';

Please follow this pattern to pass your parameters.

CURLOPT_POSTFIELDS => array(json_encode($user_array)),

Sample Curl code:

                
               $curl = curl_init();
                  curl_setopt_array ( $curl, array (
                    CURLOPT_URL => $url,  
                    CURLOPT_RETURNTRANSFER => true,
                    CURLOPT_ENCODING => "",
                    CURLOPT_MAXREDIRS => 10,
                    CURLOPT_TIMEOUT => 30,
                    CURLOPT_SSL_VERIFYPEER  => false,
                    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                    CURLOPT_VERBOSE => true,
                    CURLOPT_POST => count($user_array),  
                    CURLOPT_POSTFIELDS => array(json_encode($user_array)),
                    CURLOPT_HTTPHEADER => array (
                            "cache-control: no-cache",
                            "postman-token: fd5bcc0b-f46d-0cf8-a5cf-dc83bfe7dbec",
                            "zpm_hello: 1"
                    ) 
                ) );
                  $response   = curl_exec($curl);
                  $err    = curl_error($curl);
                  curl_close($curl);