Create an Invoice to receive a fixed amount of payment. Invoices can be used as a white-label solution or to redirect the customer to a hosted page on our system.

📘

Forward Address

When using a forwarded address, the blockchain fees required for the transaction to be signed in the blockchain are deducted from the received amount.

Endpoint
https://anonwallet.net/api/v1/create_invoice

POST Body Parameters

ParametertypeExampleIs Required?
amountdouble0.01000000Yes
currencystringBTCNo (default is BTC)
forward_addressstring1BthisisandummybitcoinaddressNo (Used to forward received amount to your specific address after is confirmed in the system)
ipn_urlstringhttps://domain.com/ipn_handlerNo (Used to notify you on incoming payments on callback address)

Your domain must have SSL Certificate
invoice_idstring12No (Used in case of identification in your system)
hosted_invoicebooleantrue or 1No
product_titlestringMy Product TitleNo (Recommended to be used in case of using the hosted invoice page feature)
product_descriptionstringMy Product DescriptionNo (Recommended to be used in case of using the hosted invoice page feature)
cancel_urlstringhttps://domain.com/cancel_urlNo (Recommended to be used in case of using the hosted invoice page feature)

Cancel button will link the buyer to your website
success_urlstringhttps://domain.com/success_urlNo (Recommended to be used in case of using the hosted invoice page feature)

Success button will link the buyer to your website success page after a successful payment
buyer_emailstring[email protected]No

Code Example

/**
 * Requires libcurl
 */

$curl = curl_init();

$payload = array(
  "amount" => "0.01000000",
  "currency" => "BTC",
  "forward_address" => "1Bthisisandummybitcoinaddress",
  "ipn_url" => "https://domain.com/ipn_handler",
  "invoice_id" => "12",
  "hosted_invoice" => true,
);

curl_setopt_array($curl, [
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "Authorization: Bearer YOUR_API_KEY_HERE"
  ],
  CURLOPT_POSTFIELDS => json_encode($payload),
  CURLOPT_URL => "https://anonwallet.net/api/v1/create_invoice",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$error = curl_error($curl);

curl_close($curl);

if ($error) {
  echo "cURL Error #:" . $error;
} else {
  echo $response;
}

API Response

{
    "status": 200,
    "message": "OK",
    "amount": "0.10000000",
    "usd_amount":"100",
    "address": "1qs2qsyzh6f64srzenpw4c2xl0twr0lc6h06tsrtzc",
    "forward_address": "1Bthisisandummybitcoinaddress",
    "invoice_id": 12,
    "invoice_internal_id": 2722548,
    "ipn_url": "domain.com/ipn_handler",
    "hosted_invoice": true,
    "cancel_url":"https://domain.com/cancel_url",
    "success_url":"https://domain.com/success_url",
    "buyer_email":"[email protected]",
    "invoice_url":"https://anonwallet.net/invoice/2722548",
}