Contents
- API Version
- How does it work?
- Error processing
- List of available wallet cryptocurrencies
- List of wallets
- Creating a new wallet
- Updating (renaming) a wallet
- Deleting a wallet
- Receiving current wallet balance
- Receiving a list of unconfirmed incoming transactions
- Receiving a list of pending outgoing transactions (withdrawal requests)
- Receiving history (confirmed entries about deposit and withdrawal of funds)
- Receiving overall number of entries in history
- Receiving a list of wallet addresses
- Receiving overall number of wallet addresses
- Transferring money (creating a request for money withdrawal)
- Checking request status for money withdrawal
API Version
Current API version: 1.1. Documentation on previous versions can be found here: 1.0
How does it work?
All API methods:
- are called using HTTP-method POST
- must be authorized with the API-key (it can be found in the "Settings" section of your wallet), which is passed as the value of the required string parameter api_key
- use JSON for a request and response
Amount values are given out and taken in as big integer numbers. For example, for BTC (Bitcoin) all amounts are represented in satoshi: 1 satoshi = 0.00000001 BTC or 100000000 satoshi = 1 BTC.
Error processing
All commands may return a list of errors that occurred during execution as a response. In the overwhelming majority of cases, they are validation errors of input values.
А list of errors is returned as the object with a single parameter 'errors', which contains an enumeration of parameters with which a particular error is associated.
Each parameter, in its turn, contains an array of string errors.
Example of an error in JSON format:
{"errors":{"wallet":["Incorrect parameter"]}}
It is guaranteed that no other returned response contains an object with the 'errors' parameter.
List of available wallet cryptocurrencies
URL
http://rahakott.io/api/v1.1/currencies
Request parameters
None.
Response
The list of available cryptocurrencies is returned as a response.
Request and response example
<<< POST http://rahakott.io/api/v1.1/currencies
{"api_key":"1234567890abcdef1234567890abcdef"}
>>>
["BTC","BCH"]
List of wallets
URL
http://rahakott.io/api/v1.1/wallets
Request parameters
- currency (string, required) - currency of the wallets
Response
The array of objects is returned as a response and it has the descriptions of the following parameters of the wallets:
- oid (string) - unique wallet identifier
- currency (string) - wallet currency
- name (string) - wallet name; in case null is specified, this is the default wallet (main wallet)
- current_address (string) - current wallet address
- created_at (date) - date of wallet creation
- updated_at (date) - date of wallet update (currently the update is associated with renaming the wallet)
Request and response example
<<< POST http://rahakott.io/api/v1.1/wallets
{"api_key":"1234567890abcdef1234567890abcdef"}
>>>
[
{"currency":"BTC","name":null,"created_at":"2017-11-23 13:34:48","updated_at":"2017-11-23 13:34:48","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","current_address":"mtQRpiBCd4JpQ4ATfUyVgQyW8kSQQViTuZ"},
{"currency":"BTC","name":"Additional","created_at":"2017-11-23 13:43:57","updated_at":"2017-11-23 13:43:57","oid":"efecc1468fe33d06c510658eaca75297","current_address":"mtaHjMjdbRDb9y6977aRT3zS6QfVYnXp7k"}
]
Creating a new wallet
URL
http://rahakott.io/api/v1.1/wallets/new
Request parameters
- name (string, required) - wallet name, it must be unique within the account
- currency (string, required) - wallet currency
Response
The object with the following parameters of the created wallet is returned as a response:
- oid (string) - unique wallet identifier
- currency (string) - wallet currency
- name (string) - wallet name; in case null is specified, this is the default wallet (main wallet)
- current_address (string) - current wallet address
- created_at (date) - date of wallet creation
- updated_at (date) - date of wallet update (currently the update is associated with renaming the wallet)
Request and response example
<<< POST http://rahakott.io/api/v1.1/wallets/new
{"api_key":"1234567890abcdef1234567890abcdef","name":"New wallet","currency":"BTC"}
>>>
{"currency":"BTC","name":"New wallet","created_at":"2017-11-23 13:34:48","updated_at":"2017-11-23 13:34:48","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","current_address":"mtQRpiBCd4JpQ4ATfUyVgQyW8kSQQViTuZ"}
Updating (renaming) a wallet
URL
http://rahakott.io/api/v1.1/wallets/update
Request parameters
- oid (string, required) - unique wallet identifier received via a list of wallets or creating a new wallet requests
- name (string, required) - wallet name, it must be unique within the account
Response
The object with the description of the following parameters is returned as a response:
- oid (string) - unique wallet identifier
- currency (string) - wallet currency
- name (string) - wallet name; in case null is specified, this is the default wallet (main wallet)
- current_address (string) - current wallet address
- created_at (string) - date of wallet creation
- updated_at (string) - date of wallet update (currently the update is associated with renaming the wallet)
Request and response example
<<< POST http://rahakott.io/api/v1.1/wallets/update
{"api_key":"1234567890abcdef1234567890abcdef","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","name":"Updated wallet"}
>>>
{"currency":"BTC","name":"Updated wallet","created_at":"2017-11-23 13:34:48","updated_at":"2017-11-23 13:34:48","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","current_address":"mtQRpiBCd4JpQ4ATfUyVgQyW8kSQQViTuZ"}
Deleting a wallet
URL
http://rahakott.io/api/v1.1/wallets/delete
Request parameters
- oid (string, required) - unique wallet identifier received via a list of wallets or creating a new wallet requests
Response
The following parameters are returned as a response:
- wallet_oid (string) - unique wallet identifier
- deleted (boolean) - boolean, which always equals true
Request and response example
<<< POST http://rahakott.io/api/v1.1/wallets/delete
{"api_key":"1234567890abcdef1234567890abcdef","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet_oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","deleted":true}
Receiving current wallet balance
URL
http://rahakott.io/api/v1.1/wallets/balance
Request parameters
- oid (string, required) - unique wallet identifier received via a list of wallets or creating a new wallet requests
Response
The following parameters are returned as a response:
- wallet_oid (string) - unique wallet identifier
- confirmed (number) - confirmed wallet balance
- unconfirmed (number) - unconfirmed wallet balance, i.e. the sum of unconfirmed incoming transactions
Request and response example
<<< POST http://rahakott.io/api/v1.1/wallets/balance
{"api_key":"1234567890abcdef1234567890abcdef","oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet_oid":"2bb027c2ca0143bcaf0b9e2460f6bfd1","confirmed":100000000,"unconfirmed":0}
Receiving a list of unconfirmed incoming transactions
URL
http://rahakott.io/api/v1.1/transactions/incoming
Request parameters
- wallet (string, required) - unique wallet identifier
Response
The wallet identifier and connected with it array of objects are sent as a response. The objects have the following transaction parameters:
- txid (string) - transaction unique identifier
- amount (number) - amount of transfered funds
- confirmations (number) - number of transaction confirmations
- created_at (date) - date of transaction receipt of the wallet
- updated_at (date) - date of transaction update (corresponds to the time of the last transaction number confirmation update)
- address (string) - address to which the transaction was received
Request and response example
<<< POST http://rahakott.io/api/v1.1/transactions/incoming
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee",
"incoming":[
{"txid":"3c084f02968b48c175c176a64a8aaf49a60e5716e8dd5ade8f97d773dbdaf458","amount":1000000,"confirmations":1,"created_at":"2017-11-24 11:26:21","updated_at":"2017-11-24 11:26:21","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc"}
{"txid":"2f46615cbaa76b786b344e603d6adbec2890a3b3bfa676c8b8a6b87b9792ff1a","amount":2000000,"confirmations":0,"created_at":"2017-11-24 11:27:39","updated_at":"2017-11-24 11:27:39","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc"}
]}
Receiving a list of pending outgoing transactions (withdrawal requests)
URL
http://rahakott.io/api/v1.1/transactions/outgoing
Request parameters
- wallet (string, required) - unique wallet identifier
Response
The wallet identifier and connected with it array of objects are sent as a response. The objects have the following transaction parameters:
- request (string) - unique identifier of the withdrawal request
- address (string) - recipient's address
- amount (number) - amount of transferred funds
- external_only (boolean) - boolean signifying using external transfer (via the blockchain) for funds sending
- subtract_fees (boolean) - boolean signifying subtracting all fees from the transfer amount (is usually used for the withdrawal of all funds from the account)
- executed (boolean) - if true, the request is completed; if false, the request is waiting to be executed; on completion, the parameter 'error' should be checked
- error (string) - if not null, an error occurred during the request execution
- created_at (date) - date of request creation for the withdrawal
- updated_at (date) - date of request update
Request and response example
<<< POST http://rahakott.io/api/v1.1/transactions/outgoing
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee",
"outgoing":[
{"created_at":"2017-11-24 12:02:21","updated_at":"2017-11-24 12:02:21","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","amount":2000000,"external_only":false,"subtract_fees":false,"error":null,"request":"62c7cbfb0eb039e68c9691d7f31ece19","executed":false},
{"created_at":"2017-11-24 12:02:14","updated_at":"2017-11-24 12:02:14","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","amount":1000000,"external_only":false,"subtract_fees":false,"error":null,"request":"abadf547c544f067661604db8ab522ee","executed":false}
]}
Receiving history (confirmed entries about deposit and withdrawal of funds)
URL
http://rahakott.io/api/v1.1/history
Request parameters
- wallet (string, required) - unique wallet identifier
- offset (number, optional) - offset from the beginning of entries, similar to OFFSET parameter in SQL-request
- limit (number, optional) - maximum number of entries in output, similar to LIMIT parameter in SQL-request
Response
The wallet identifier and connected with it array of objects are sent as a response. The objects have the following historic entry parameters:
- txid (string) - unique transaction number with which this entry is associated
- request_id (string) - unique identifier of the request for the withdrawal according to which this entry in history was created; in case of receiving funds entry, this parameter value equals null
- address (string) - address of the sender or recipient.
- amount (number) - amount of transferred funds
- failed (boolean) - boolean signifying the success of the operation
- created_at (date) - entry date
Request and response example
<<< POST http://rahakott.io/api/v1.1/history
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1","offset":0,"limit":50}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee",
"history":[
{"amount":2000000,"txid":"2f46615cbaa76b786b344e603d6adbec2890a3b3bfa676c8b8a6b87b9792ff1a","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","failed":false,"created_at":"2017-11-24 11:48:44","request_id":null},{"amount":1000000,"txid":"3c084f02968b48c175c176a64a8aaf49a60e5716e8dd5ade8f97d773dbdaf458","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","failed":false,"created_at":"2017-11-24 11:48:44","request_id":null}
]}
Receiving overall number of entries in history
URL
http://rahakott.io/api/v1.1/history/count
Request parameters
- wallet (string, required) - unique wallet identifier
Response
The following parameters are sent as a response:
- wallet (string) - unique wallet identifier
- history_count (number) - number of entries in history
Request and response example
<<< POST http://rahakott.io/api/v1.1/history/count
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee","history_count":2}
Receiving a list of wallet addresses
URL
http://rahakott.io/api/v1.1/addresses
Request parameters
- wallet (string, required) - unique wallet identifier
- offset (number, optional) - offset from the beginning of addresses, similar to OFFSET parameter in SQL-request
- limit (number, optional) - maximum number of addresses in output, similar to LIMIT parameter in SQL-request
Response
The wallet identifier and connected with it array of objects are sent as a response. The objects have the following address parameters:
- address (string) - unique address
- current (boolean) - boolean signifying current wallet address. There may be only one current address in the wallet.
- created_at (date) - date of address creation
Request and response example
<<< POST http://rahakott.io/api/v1.1/addresses
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1","offset":0,"limit":50}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee",
"addresses":[
{"address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","current":false,"created_at":"2017-11-24 11:25:38"},
{"address":"mn18nUWGL8sHsxKXCbBJ8G7nAbmA8XB7Vb","current":true,"created_at":"2017-11-24 12:58:00"}
]}
Receiving overall number of wallet addresses
URL
http://rahakott.io/api/v1.1/addresses/count
Request parameters
- wallet (string, required) - unique wallet identifier
Response
The following parameters are sent as a response:
- wallet (string) - unique wallet identifier
- addresses_count (number) - number of wallet addresses
Request and response example
<<< POST http://rahakott.io/api/v1.1/addresses/count
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1"}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee","addresses_count":2}
Transferring money (creating a request for money withdrawal)
URL
http://rahakott.io/api/v1.1/send
Request parameters
- wallet (string, required) - unique wallet identifier
- recipient (string, required) - recipient's address
- amount (number, required) - amount of transfered funds
- external_only (boolean, optional) - boolean signifying using external transfer (via the blockchain), false by default
- subtract_fees (boolean, optional) - boolean signifying subtracting all fees from the transfer amount (is usually used for the withdrawal of all funds from the account), false by default
Response
As a response the following parameters are sent:
- wallet (string) - unique wallet identifier
- request (string) - unique request identifier for the withdrawal, can be used for status check
Request and response example
<<< POST http://rahakott.io/api/v1.1/send
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"abadf547c544f067661604db8ab522ee","recipient":"mn18nUWGL8sHsxKXCbBJ8G7nAbmA8XB7Vb","amount":1000000,"external_only":true,"subtract_fees":true}
>>>
{"wallet":"abadf547c544f067661604db8ab522ee","request":"4c33a83b399a3df263beca3601ad1bf1"}
Checking request status for money withdrawal
URL
http://rahakott.io/api/v1.1/send/check
Request parameters
- wallet (string, required) - unique wallet identifier
- request (string, required) - unique request identifier for the withdrawal
Response
An object with the description of the following request parameters is sent:
- request (string) - unique identifier of the withdrawal request
- address (string) - recipient's address
- amount (number) - amount of transferred funds
- external_only (boolean) - boolean signifying using external transfer (via the blockchain) for money sending
- subtract_fees (boolean) - boolean signifying subtracting all fees from the transfer amount (is usually used for the withdrawal of all funds from the account)
- executed (boolean) - if true, then the request has been executed; if false, the request is waiting for execution; on completion, the parameter 'error' should be checked
- error (string) - if not null, then an error occurred during request execution
- created_at (date) - date of withdrawal request creation
- updated_at (date) - date of request update
Request and response example
<<< POST http://rahakott.io/api/v1.1/send/check
{"api_key":"1234567890abcdef1234567890abcdef","wallet":"2bb027c2ca0143bcaf0b9e2460f6bfd1", "request":"abadf547c544f067661604db8ab522ee"}
>>>
{"created_at":"2017-11-24 12:02:14","updated_at":"2017-11-24 12:02:14","address":"mviz3utBwH8PCTS5XZhj3YCKCkWH1mZUvc","amount":1000000,"external_only":false,"subtract_fees":false,"error":null,"request":"abadf547c544f067661604db8ab522ee","executed":false}