Frequently Asked Questions
To create an account, you need to make a POST request to the URL:
In the header of the request, you need to pass your API key:
in the body of the request, you must provide:
{
"payment_currencies": ["BTC"], // list of cryptocurrencies in which payments can be accepted, possible values: BTC, ETH, ATOM, USDC, USDT, TRX, AVAX
"currency": "USDT", // account currency, possible values: BTC, ETH, USDT, USDC, TRX, ATOM, AVAX
"amount": 100, // invoice amount
"description": "buying a laptop model ACer..", // invoice description
"language": "en" // the language of the invoice your client will receive.
"header": "Company", // invoice header (name of the organization that issued the invoice)
"payer": "John Doe", // who is billed
"is_convert_payments": false, // convert received funds into Rubles or leave them in crypto
"data": {}, // any data in json format (they will later be sent as a response in a webhook request)
"sign": "requestsign", // request signature is calculated as (hmac(currency + amount + header + description, api_key, sha256))
}
Upon successful creation, we will send you a response:
{
"result": "success",
"id": "1izt8r3YNoZ6kgwewB3xCB",
"link": "https://app.bitbanker.org/external/invoice/1izt8r3YNoZ6kgwewB3xCB",
"addresses": {
"BTC": "1JxiDZYqFReWStvRy8tAm3LLFY9BaGrHZp"
}
}
You can also set up a webhook for your API so that you know when the payment was successful. This requires that you send us a URL to which we can make a POST request in the following format:
{
"paid": true,
"id": "123456qwerty",
"amount": 50,
"currency": "USDT",
"paid_amount": 50,
"transactions": [
{
"tx_id": "sfsertert23425345342345345",
"amount": 0.00015,
"fee": 0.0000000025,
"currency": "BTC"
}
],
"data": {},
"sign": "requestsign", // request signature is calculated as (hmac(currency + amount + header + description, api_key, sha256))
"sign_2": "webhooksign"// request signature is computed as (hmac(currency + amount + header + description, api_secret, sha256))
}
To retrieve account information, perform a GET request to the following URL:
Include the following headers:
X-API-KEY:"eGvBwIyn-Lwm6Yr4r-08UYI8DazyaR9t", // your API-KEY
Include the following parameters:
id:"1YvVWI08GbDUb4D27LRp4n", // where id is the identifier of the account for which you wish to retrieve information
You can issue invoices for specific networks if these networks are enabled for account deposits on Bitbanker. You can check the currently available networks in the "Deposit and Withdrawal" section.
Key:
"payment_chains": ["bsc", "tron", "eth", "avax", "ton"]
For example
Python
import requests
import hmac
import hashlib
def main():
url = "https://api.aws.bitbanker.org/latest/api/v1/invoices"
api_key = "<your_api_key>"
# Invoice data
currency = "USDT"
amount = 100
header = "Company"
description = "Buying a laptop model Acer..."
sign_data = f"{currency}{amount}{header}{description}"
# Generate request signature
signature = hmac.new(api_key.encode(), sign_data.encode(), hashlib.sha256).hexdigest()
payload = {
"payment_currencies": ["BTC"],
"currency": currency,
"amount": amount,
"description": description,
"language": "en",
"header": header,
"payer": "John Doe",
"is_convert_payments": False,
"data": {"order_id": 12345},
"sign": signature
}
# Headers
headers = {
"X-API-KEY": api_key,
"Content-Type": "application/json"
}
# Send POST request
response = requests.post(url, json=payload, headers=headers)
# Print the response
print("Status Code:", response.status_code)
print("Response JSON:", response.json())
if __name__=='__main__':
main()
Bash
api_key="<your_api_key>"
currency="USDT"
amount=100
header="Company"
description="Buying a laptop model Acer..."
sign=$(echo -n "$currency$amount$header$description" | openssl dgst -sha256 -hmac "$api_key" | awk '{print $2}')
curl -X POST "https://api.aws.bitbanker.org/latest/api/v1/invoices" \
-H "X-API-KEY: $api_key" \
-H "Content-Type: application/json" \
-d '{
"payment_currencies": ["BTC"],
"currency": "'"$currency"'",
"amount": '"$amount"',
"description": "'"$description"'",
"language": "en",
"header": "'"$header"'",
"payer": "John Doe",
"is_convert_payments": false,
"data": {
"order_id": 12345
},
"sign": "'"$sign"'"
}'
JavaScript
const crypto = require("crypto");
async function createInvoice() {
const url = "https://api.aws.bitbanker.org/latest/api/v1/invoices";
const apiKey = "<your_api_key>";
// Invoice data
const currency = "USDT";
const amount = 100;
const header = "Company";
const description = "Buying a laptop model Acer...";
const signData = `${currency}${amount}${header}${description}`;
// Generate request signature
const signature = crypto
.createHmac("sha256", apiKey)
.update(signData)
.digest("hex");
const payload = {
payment_currencies: ["BTC"],
currency: currency,
amount: amount,
description: description,
language: "en",
header: header,
payer: "John Doe",
is_convert_payments: false,
data: { order_id: 12345 },
sign: signature,
};
const headers = {
"X-API-KEY": apiKey,
"Content-Type": "application/json",
};
try {
const response = await fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
});
const responseData = await response.json();
console.log("Status Code:", response.status);
console.log("Response JSON:", responseData);
} catch (error) {
console.error("Error:", error);
}
}
createInvoice();