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

Overview

The Crypto Payment API is Litepay's crypto payment gateway API - the quickest way to accept automated cryptocurrency payments across our supported coins. 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, e.g. btc - see Supported Cryptocurrencies for the full list
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

This only applies if you include a callback parameter: its domain must be valid or the request will be denied. Omit callback entirely to skip this check - see Without a Callback below.


Without a Callback

For example, for Tor users, or anyone who'd rather not run a callback endpoint:

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 WALLET 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, e.g. BTC - see Supported Cryptocurrencies for the full list

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.

Security

Follow these practices to keep your integration safe:

  • Verify your callback secret. Include a custom secret parameter in your callback URL and check it in your callback script before processing - reject any callback with an invalid or missing secret.
  • Validate the destination address. Confirm destination_address in the callback matches your own wallet address before crediting the payment.
  • Whitelist our IPs. If you use Cloudflare or a firewall, make sure our GET requests are allowed: 185.66.143.156 and 185.66.142.132
  • Wait for confirmations before treating a payment as final, especially for high-value transactions - see the note on double spends under Rates.

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 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

FAQ

Do I need an account to use the Crypto Payment API?

No. Generate a receiving address and start accepting payments immediately - no signup required.

Is KYC required?

No. The Crypto Payment API doesn't require identity verification to get started.

What if a customer sends less than expected?

Transactions below the $1 minimum are treated as donations rather than forwarded (see Fair Usage). There's no fixed "expected amount" for this API - any payment of $1 or more is forwarded in full, minus the standard fee.

How long until I get paid out?

Payments are forwarded automatically as they arrive - see Payments & Fees for the exact schedule.