apiKey and secretKey from the Bitycle Pay support team.withdrawUniqueId. This ID is used to prevent duplicate withdrawals and protect your users' funds.withdrawUniqueId. Bitycle Pay will recognize that the request has already been submitted and prevent it from being processed twice.import axios from 'axios';
import crypto from "crypto"
const apiKey = 'b20c...b54a';
const secreteKey = 'c81a8...344ed';
const timestamp = Date.now();
const merchantCode = 'e3aa...ba9a';
const amount = '1200'
const token = 'USDT';
const walletAddress = '0xFB0F...2cAc';
const chain='BSC';
const withdrawUniqueId='4789290084';
const signature = crypto.createHmac("sha256",secreteKey).update(`${apiKey}${merchantCode}${timestamp}${withdrawUniqueId}${amount}${chain}${token}${walletAddress}`).digest("hex");
const response = await axios.post('https://chainhub.bitycle.com/v1/webservice/withdraw',{
amount: amount,
token: token,
walletAddress: walletAddress,
chain:chain,
withdrawUniqueId:withdrawUniqueId,
description:"Widthraw 1200 USDT for user 56739"
},{
headers:{
'x-api-key': apiKey,
'x-timestamp': timestamp,
'x-signature': signature
}
});
console.log("response: ",response);import requests
import hmac
import hashlib
import time
# API credentials
api_key = 'b20c...0fb54a'
secret_key = 'c81a...44ed'
# Request parameters
timestamp = str(int(time.time() * 1000)) # Convert current time to milliseconds
merchant_code = 'e3aa...14dba9a'
amount = '1200'
token = 'USDT'
wallet_address = '0xFB0...22cAc'
chain='BSC'
withdrawUniqueId='4789290084'
# Creating the signature
message = f"{api_key}{merchant_code}{timestamp}{withdrawUniqueId}{amount}{chain}{token}{wallet_address}"
signature = hmac.new(secret_key.encode(), message.encode(), hashlib.sha256).hexdigest()
# Sending the POST request
response = requests.post('https://chainhub.bitycle.com/v1/webservice/withdraw', json={
'amount': amount,
'token': token,
'walletAddress': wallet_address,
'chain': chain,
'withdrawUniqueId':withdrawUniqueId
'description': "Widthraw 1200 USDT for user 56739",
}, headers={
'x-api-key': api_key,
'x-timestamp': timestamp,
'x-signature': signature
})
print("Response: ", response.json())curl --location 'https://chainhub.bitycle.com/v1/webservice/withdraw' \
--header 'x-api-key: apiKey' \
--header 'x-timestamp: timestamp' \
--header 'x-signature: signature' \
--header 'Content-Type: application/json' \
--data '{
amount: "1200",
token: "USDT",
walletAddress: "0x0ad32...45a6",
chain: "BSC",
withdrawUniqueId: "4789290084",
description: "Widthraw 1200 USDT for user 56739"
}'{
message: "Withdraw request registered successfully",
data: {
withdrawId: 293670
}
}