Accept Bitcoin, Litecoin, Zcash, Bitcoin Cash & Dogecoin payments with a simple API call. No account required.

Overview

The Crypto Payment API is the quickest way to accept automated Bitcoin, Litecoin, Zcash, Bitcoin Cash and Dogecoin payments. No account needed - just make an API call, present the generated address to your customer, and payments are forwarded to your wallet automatically.

A small fee is deducted before forwarding. Need help integrating? Contact us and we'll set it up for you.

Generating Receiving Addresses

This method creates a unique address to present to your customer. Payments sent to this address are forwarded to your own wallet. Each time a payment is forwarded, the callback URL is called.

  • Minimum transaction size: $1 in crypto
  • Network fees are paid from the forwarded amount

API Request

https://litepay.ch/api/receive?method=$method&address=$receiving_address&callback=$callback_url

Parameter Description
method Cryptocurrency to use: btc, ltc, zec, bch or doge
receiving_address Your wallet address where payments will be forwarded
callback_url URL to notify when a payment is received (must be URL-encoded)

Domain validation

The callback URL domain must be valid or the request will be denied.


Without callback (e.g. for Tor users):

https://litepay.ch/api/receive?method=$method&address=$receiving_address

The callback URL is not mandatory. You can use our PHP class to check the payment status directly, or poll this endpoint:

https://litepay.ch/api/check?method=$method&address=$receiving_address

API Response

Success: 200 OK, application/json

{
   "status": "success",
   "address": "35zvWWHZHvASAJo1XkZwGRUWuNYheFhKji",
   "destination": "1EMnFbKfoCNptj9dQX3bpyunNhC6mfj7sa",
   "callback_url": "http://yourwebsite.com/callback",
   "fee": "0.01"
}

If you do not receive the callback, double check the callback_url in the response is correct.

Error: 200 OK, application/json

{
    "status": "error",
    "message": "Invalid Destination Address"
}

Example

$secret = 'NTIzMzUxN2E4Yjc2YWEzNDI0M2NlMjZh';
$my_address = '{YOUR BTC/LTC/ZEC/BCH/DOGE ADDRESS}';
$my_callback_url = 'http://yourwebsite.com/callbackurl.php?call=123&secret='.$secret;
$method = 'btc';
$parameters = 'address=' . $my_address . '&method=' . $method . '&callback=' . urlencode($my_callback_url);
$response = file_get_contents('https://litepay.ch/api/receive?' . $parameters);
$object = json_decode($response);
echo 'Send Payment To : ' . $object->address;
curl -G "https://litepay.ch/api/receive" \
  --data-urlencode "method=btc" \
  --data-urlencode "address={YOUR BTC ADDRESS}" \
  --data-urlencode "callback=http://yourwebsite.com/callbackurl.php?call=123&secret=NTIzMzUxN2E4Yjc2YWEzNDI0M2NlMjZh"
import requests

params = {
    "method": "btc",
    "address": "{YOUR BTC ADDRESS}",
    "callback": "http://yourwebsite.com/callbackurl.php?call=123&secret=NTIzMzUxN2E4Yjc2YWEzNDI0M2NlMjZh"
}
response = requests.get("https://litepay.ch/api/receive", params=params)
data = response.json()
print(f"Send Payment To: {data['address']}")

Callback

When a payment is received, our API sends a GET request to the callback URL you provided. The callback URL is limited to 255 characters.

Callback Parameters

Parameter Description
{Custom Parameters} Any parameters you included in the callback URL are passed back
value Payment amount in satoshi (divide by 100000000 for crypto value)
address The address that received the transaction
transaction_hash The transaction hash
destination_address Your destination address - verify this matches yours
coin The coin used: BTC, LTC, ZEC, BCH or DOGE

Example callback:

http://yourwebsite.com/callbackurl.php
  ?call=123
  &secret=NTIzMzUxN2E4Yjc2YWEzNDI0M2NlMjZh
  &orderid=103
  &destination_address=bc1qyrvghycrnywwxxzgs0hyckalkumwwp4ec9hnzy
  &input_address=37DZH956CuSbim6RGvSrVYvsiSJBZ6sLRG
  &value=74801
  &confirmations=26
  &transaction_hash=b5843346ce8c7d3af08a713cb6d6f05bd30673781ee349ab84211fec2a414bb4
  &coin=BTC

Expected Response

Your server must respond with *ok* to acknowledge the callback. Any other response causes the callback to be resent every new block (~10 minutes) up to 100 confirmations.

A callback is never sent twice for the same transaction once acknowledged. Record the transaction_hash to detect duplicates.

Cloudflare & Firewall

If you use Cloudflare or a firewall, make sure our GET requests are allowed. Whitelist our IPs: 185.66.143.156 and 185.66.142.132

Security

Include a custom secret parameter in your callback URL. Verify the secret in your callback script before processing - reject any callback with an invalid secret.

Rates

Crypto Rates

Get the current price of 1 fiat unit in crypto for each supported coin:

https://litepay.ch/api/rates

Example response
{
  "BTC": {
    "USD": "0.0000152671",
    "EUR": "0.0000179900",
    "GBP": "0.0000207125",
    "CHF": "0.0000195866",
    "CAD": "0.0000111485",
    "AUD": "0.0000106239",
    "RON": "0.0000026157",
    "PLN": "0.0000042531",
    "RUB": "0.0000001191",
    "INR": "0.0000001831"
  },
  "LTC": {
    "USD": "0.0195045836",
    "EUR": "0.0229885057",
    "GBP": "0.0264690312",
    "CHF": "0.0250501002",
    "CAD": "0.0142369021",
    "AUD": "0.0135851107",
    "RON": "0.0033402365",
    "PLN": "0.0054309455",
    "RUB": "0.0001520524",
    "INR": "0.0002339116"
  },
  "ZEC": { ... },
  "BCH": { ... },
  "XMR": { ... }
}

This tells you how much crypto equals 1 unit of fiat. For example, 1 USD = 0.0000152671 BTC.

Fiat Rates

Get the current price of 1 crypto in fiat for each supported currency:

https://litepay.ch/api/fiat_rates

Example response
{
  "BTC": {
    "USD": 65500.29,
    "EUR": 55586.47,
    "GBP": 48280.06,
    "CHF": 51055.30,
    "CAD": 89697.81,
    "AUD": 94127.18,
    "RON": 382301.00,
    "PLN": 235124.56,
    "RUB": 8398290.10,
    "INR": 5461258.75
  },
  "LTC": {
    "USD": 51.27,
    "EUR": 43.50,
    "GBP": 37.78,
    "CHF": 39.92,
    "CAD": 70.24,
    "AUD": 73.61,
    "RON": 299.38,
    "PLN": 184.13,
    "RUB": 6576.68,
    "INR": 4275.12
  },
  "ZEC": { ... },
  "BCH": { ... },
  "XMR": { ... }
}

This tells you how much fiat equals 1 crypto. For example, 1 BTC = 65500.29 USD.

Both endpoints return rates for all supported coins (BTC, LTC, ZEC, BCH, XMR) across multiple fiat currencies. Rates are updated regularly.

Double Spends & Chargebacks

A double spend occurs when the same transaction is spent twice. A payment that initially appears successful could be reversed. Wait for the transaction to be included in the blockchain and reach a sufficient number of confirmations. 6 confirmations is generally considered safe for high-value transactions.

Address Expiration

Generated addresses expire after 15 days of inactivity. Always generate a new address for each payment.

Fair Usage

  • No limit on the number of receiving addresses generated - the service handles millions of addresses
  • Minimum transaction: $1 in crypto. No maximum
  • Transactions below the minimum are considered donations
  • Transactions not claimed within 30 days are considered donations
  • Callback domains that appear dead or never return *ok* may be blocked