To give you a good overview of how to use the APIs, we have compiled a list of example usages.
You can signup for a sandbox environment at https://sandbox.bips.me
curl https://bips.me/api/v1/invoice \ -u INVOICE_API_KEY \ -d price=100 \ -d currency=USD \ -d item=Demo
$fields = array( 'price' => 100, 'currency' => 'USD', 'item' => 'Demo', 'custom' => json_encode(array( 'order_id' => '1', 'other' => '123' )) ); $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => 'https://bips.me/api/v1/invoice', CURLOPT_USERPWD => 'INVOICE_API_KEY', CURLOPT_POSTFIELDS => http_build_query($fields), CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 10, CURLOPT_HTTPAUTH => CURLAUTH_BASIC)); $url = curl_exec($ch); curl_close($ch); header('Location: ' . $url);
Invoice API Key The invoice api key from the account where you want to receive payment.
Price The price of your product or service.
Currency The currency of your price.
Item A description of the service or product.
“custom” A JSON-encoded string of any custom entries you wish to include in the Instant Payment Notification. “returnurl”, “callbackurl” and “secret” are protected parameters. “returnurl” URL for redirecting customer to receipt page. “cancelurl” URL for redirecting customer to cancel page. ”callbackurl” URL for sending Instant Payment Notification to your system. ”secret” Validate the transaction. (Length has to be above 16 characters)
Authorize and capture payments automatically in one request.
Visit our GitHub for more open-sourced examples.
curl https://bips.me/api/v1/json -u EXPORT_API_KEY
$ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => 'https://bips.me/api/v1/json', CURLOPT_USERPWD => 'EXPORT_API_KEY', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPAUTH => CURLAUTH_BASIC)); $json = curl_exec($ch); curl_close($ch);
Request can be pointed to endpoint json, html or excel
curl https://bips.me/api/v1/void \ -u VOID_API_KEY \ -d id=1001 \ -d address=1UpE17cik2edTr8TjSVskcgJodTeCijoi
$fields = array( 'id' => 1001, 'address' => '1UpE17cik2edTr8TjSVskcgJodTeCijoi' ); $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => 'https://bips.me/api/v1/void', CURLOPT_USERPWD => 'VOID_API_KEY', CURLOPT_POSTFIELDS => http_build_query($fields), CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPAUTH => CURLAUTH_BASIC)); $response = json_decode(curl_exec($ch)); curl_close($ch);
Void API Key The void api key from the merchant account containing the invoice deposit to cancel. BIPS Support can grant request for void api key for merchant accounts.
Id Invoice Identification Number
Address Customers bitcoin wallet address.
In case orders needs to be cancelled when out of stock, too busy to make fulfillment or payments to expired invoices.
Invoice bitcoin deposits can only be cancelled up until they are included in a block (approximately 1-10 minutes depending on the current bitcoin network block propagation).
Payments to expired invoices where no settlement has been made to a merchants bitcoin wallet address, can also be cancelled and the bitcoin amount refunded to the customer. There are no time limits on this.
For customer bitcoin wallets not supporting BIP70 Payment Requests, the merchant can opt in for BIPS Void Invoice API.
In order to ensure easier and faster integration between your online store and bitcoin payments, choose between a wide range of payment plugins for the most solutions in e-commerce.
This section was last updated on May 20, 2014 and replaces all previous versions of this document.