Start accepting crypto payments
Accept crypto payments instantly on your website

Accept payments on your website

All API calls are implemented as HTTP Post. Requests must be made to our API endpoint located at https://sendbit.io/api/[METHOD]
Download our library below
sendbit.inc.php
1KB
Text
sendbit.inc.php
Once you have downloaded our library paste the following example into your development environment to generate an address to accept payments. your end-user can send any amount to the address and you will be notified - learn more about this in the next step below
1
include_once("sendbit.inc.php");
2
3
define("API_KEY", "YOUR_API_KEY");
4
define("API_SECRET", "YOUR_API_SECRET");
5
6
$amount = $_POST["amount"];
7
8
$callback_url = "https://site.com/IPN.php?user=2450";
9
$api_client = new SendBitApi(API_KEY, API_SECRET);
10
$api_client->setCoin("BTC"); // set coin (BTC, LTC, BCH, DASH) https://www.sendbit.io/page/coins_accepted
11
$api_client->setField("callback_url", $callback_url);
12
$api_client->setMethod("generate-address");
13
$response = $api_client->process();
14
15
if($response["response_code"] != 200) {
16
17
exit($response["response_message"]);
18
19
} else {
20
21
$address = $response["address"];
22
$qr_code_url = $response["qr_code"];
23
24
echo "Please send" .$amount. " to" .$address. "";
25
26
}
Copied!
Once your end-user sends a payment to the generated address you will get the following details sent back to your callback_url
Last modified 11mo ago
Copy link