include_once("sendbit.inc.php");
define("API_KEY", "YOUR_API_KEY");
define("API_SECRET", "YOUR_API_SECRET");
$amount = $_POST["amount"];
$callback_url = "https://site.com/IPN.php?user=2450";
$api_client = new SendBitApi(API_KEY, API_SECRET);
$api_client->setCoin("BTC"); // set coin (BTC, LTC, BCH, DASH) https://www.sendbit.io/page/coins_accepted
$api_client->setField("callback_url", $callback_url);
$api_client->setMethod("generate-address");
$response = $api_client->process();
if($response["response_code"] != 200) {
exit($response["response_message"]);
$address = $response["address"];
$qr_code_url = $response["qr_code"];
echo "Please send" .$amount. " to" .$address. "";