Download OpenAPI specification:Download
API for Anycoin.cz opened only to verified partners.
Host (production): https://www.anycoin.cz
Host (staging): https://staging.anycoin.cz
Staging requires IP whitelisting. Contact your representative for access.
Signing API requests:
There are two sets of keys: app key and user api key. App key is used to identify your app and user api key is used to identify the user.
When signing with the app key, headers x-app-key and x-app-sgn must be added.
When signing with the api key, headers x-api-key and x-api-sgn must be added.
Both x-app-sgn and x-api-sgn headers are calculated using the same algorithm, but with different secret keys.
Header x-timestamp must be added and contain current UTC timestamp in milliseconds. Call must then be made within
+- 5 minutes, otherwise it will fail.
Pseudo algorithm:
import crypto from 'crypto';
import qs from 'qs';
export function calculateApiSignature(
path: string,
params: Object,
timestamp: number,
apiSecret: string,
) {
const secret = Buffer.from(apiSecret, 'base64');
const signatureInput =
path + qs.stringify(params, {sort: alphabeticalSort}) + `${timestamp}`;
const signature = crypto
.createHmac('sha512', secret)
.update(signatureInput)
.digest()
.toString('base64');
return signature;
}
With this function, set these headers to correctly sign the api call:
x-timestamp: (timestamp)
x-api-key: (your api key)
x-api-sgn: getSignature(path, body, timestamp, apiKeySecret)
x-app-key: (your app key)
x-app-sgn: getSignature(path, body, timestamp, appKeySecret)
Get detailed exchange rates (buy, sell, mid) for a specific pair.
| base | string Example: base=BTC Base currency (coin) |
| quote | string Example: quote=CZK Quote currency (fiat) |
{- "buy": 9950,
- "sell": 10050,
- "mid": 10000
}Returns a list of user's accounts with current balance.
| currencies | string[] Array of currencies to return. If not specified, all currencies are returned. |
{- "accounts": [
- {
- "currency": "CZK",
- "amount": 1000,
- "blockedAmount": 500
}
]
}Create a new order.
| coin_code | string Example: coin_code=BTCCZK |
| coin_value | number Example: coin_value=0.1 Amount of cryptocurrency to be bought/sold |
| fiat_value | number Example: fiat_value=1000 Price to pay for the cryptocurrency |
| rate_value | number Example: rate_value=10000 Rate to be used (must be equal to fiat_value / coin_value) |
| rate_type | string Example: rate_type=CUSTOM CUSTOM (for limit order) or MARKET (for market order) |
| sell | boolean Example: sell=true
|
| payment_type | string Example: payment_type=VIRTUAL always use VIRTUAL |
| payout_type | string Example: payout_type=KEEP always use KEEP |
{- "orderId": 0
}Retrieve detailed information about a specific user transaction by its public id.
| publicId required | string The public ID of the transaction to retrieve details for |
{- "amount": 0,
- "currency": null,
- "orderId": 0,
- "txnType": null,
- "fundingStatus": null,
- "fundingAddress": null,
- "fundingUpdatedAt": "2019-08-24T14:15:22Z",
- "withdrawalFee": 0,
- "withdrawalTxId": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}{- "id": null,
- "amount": 0,
- "currency": null,
- "orderId": 0,
- "txnType": null,
- "fundingStatus": null,
- "fundingAddress": null,
- "fundingUpdatedAt": "2019-08-24T14:15:22Z",
- "withdrawalFee": 0,
- "withdrawalTxId": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}