Accept Bitcoin payments in your #App or #Website using BitcoinToBankAccount.com #API
BITCOIN TO BANK ACCOUNT API
An API to automate Bitcoin to BACS / SWIFT transfers.
BitcoinToBankAccount.com offers a service where a payment made in bitcoin can be paid back out via BACS / SWIFT (Electronic bank transfer) for a low fixed fee, and within 24 hours. It uses Stripe as a payment processor.
This API allows your website or software accept bitcoin payments, by allowing the customer make a payment to a specified Bitcoin Wallet. Then once the payment has been verified, make the bank transfer back to your account, and then provide the service to the customer.
Since payments are asynchronous, you need to poll on the wallet, to wait for the transaction to appear from the consumer. We recommend polling every 1 second for a maximum of 10 minutes.
The API endpoint is located at the following URL:
Ensure to use the “https” version of the API, since this ensures a level of security in the data being sent.
The steps involved are:
- Call MakeTransfer with the amount of Bitcoin being paid, you will receive a Wallet and SessionID in return. You should ask the consumer to make a payment to the Bitcoin Wallet.
- Call PollOnTransfer every second for up to 10 minutes, passing the SessionID returned from MakeTransfer, until a status of true is returned
- Finally call MakeBankTransfer passing your Account number, Sort code, IBAN, and SWIFT/BIC code, and the SessionID as before. This will return true if the data is valid, the bank transfer will appear within 24 hours.
Create a new console application in Visual Studio
Make a service reference to https://www.bitcointobankaccount.com/api/api.asmx call the reference “Bitcoin”
- Add the following code
static void Main(string args)
var client = new apiSoapClient(“apiSoap”);
var tx = client.MakeTransfer(0.1);
Console.WriteLine(“Waiting for Bitcoin payment to wallet: ” + tx.Wallet);
var isReady = false;
for (var i = 0; i<600; i ++)
isReady = client.PollOnTransfer(tx.Session);
if (isReady) break;
Console.WriteLine(“Bitcoin Payment not received”);
Console.WriteLine(“Bitcoin Payment received and verified”);
var isOK = client.MakeBankTransfer(“82982675”, “904974”, “IE4482982675904974”, “BOFII2D”, tx.Session);
Console.WriteLine(“Bank Transfer Made”);
Console.WriteLine(“Bank transfer failed, please check account details”);
There is a fixed fee per transaction, which is deducted before the bank transfer is made, the currency is deduced from the destination bank account.