Make your first request
Confirm API access with a read-only account balance request.
1. Prepare your account and key#
Arrange API access, generate a secp256k1 key pair, and have Coinhako register your public key against the account and environment you will use. Keep the matching private key locally. The authentication guide covers key generation, permissions, and request signing.
2. Choose your environment#
Production requests use:
https://api.coinhako.com/v1
For testing, use the base URL and account supplied by your Coinhako representative. Keys, balances, saved addresses, and IDs belong to their environment; do not mix values between environments.
3. Request your BTC balance#
Sign this method and full URL with an empty body:
curl --request GET \
--url 'https://api.coinhako.com/v1/accounts/balances?currency=BTC' \
--header 'X-API-KEY: <REGISTERED_PUBLIC_KEY_HEX>' \
--header 'X-API-Algorithm: ecdsa-secp256k1-sha256' \
--header 'X-API-Timestamp: <CURRENT_TIMESTAMP_MILLISECONDS>' \
--header 'X-API-Signature: <DER_SIGNATURE_HEX>'
The header placeholders must come from your signing code. Copying this command with placeholder values will not authenticate. The Ruby example generates the headers and sends the request.
4. Read the response#
A successful response contains an array of balances. The following values are illustrative:
[
{
"currency": "BTC",
"regular": "0.001",
"locked": "0",
"locked_balance": {
"orders": "0",
"alternative_products": "0"
}
}
]
regular is the available balance. locked is the total reserved balance, and
locked_balance breaks it down by open orders and Alternative Products. The total balance is
regular + locked. The locked field is deprecated but still returned; use the
locked_balance breakdown for new integrations. Only assets with a non-zero total balance are returned, so
an empty array can be valid. Treat decimal values as decimal strings to preserve precision.
Use a recognized uppercase asset symbol for currency. An unrecognized symbol currently falls back to an
unfiltered balance list; check the returned currency values rather than assuming the filter was applied.
If the response is 401, check the key registration, timestamp, full URL, and body digest in
authentication errors
. A successful balance request confirms authentication; it does not confirm permission or account readiness to trade
or withdraw.
Next steps#
- Trade with a quote : create a quote, submit an RFQ order, and check its status.
- Withdraw crypto : choose a network and saved address, submit a withdrawal, and track it.
- API reference : inspect the complete balance response schema.