Skip to content

Introduction

Accept crypto payments using our crypto payments API. Easy, secure, anonymous, fast. We provide an easy way to integrate cryptocurrency payments into your website or app.

Our crypto payments API is the quickest and easiest way to begin accepting automated Bitcoin, Litecoin, Zcash , Bitcoin Cash or Monero payments, system only requires one confirmation to forward the payment.

Payments are sent as they come or every hour, depending on the coin.

A small fee is taken automatically before system forwards the payment, we use those fees to keep the services up and running.

If you need help implementing the crypto payment API, you can contact us and we'll do that for you for a small fee.

Generating Receiving Addresses

This method creates a unique address which should be presented to the customer. Any payments sent to this address will be forwarded to your own BTC/LTC/ZEC/BCH/XMR address. Each time a payment is forwarded the callback URL will be called.

The minimum supported transaction size is pegged at $1 in the crypto currency you are sending/receiving. Forwarding transactions will include a network fee paid from the amount you are sending. Currently locked at minimum required for the transaction to be sent.

NOTE - Bitcoin, Litecoin, Monero payments are sent at 30/60 minutes interval. All other coins are sent as they come, but in the future they will be batched as well and sent once per hr

REQUESTING

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

$method - Use 'btc' / 'ltc' / 'zec' / 'bch' / 'xmr' as a value for parameter method, based on entered value a Bitcoin, Litecoin, Zcash, Bitcoin Cash, Monero address will be generated
$receiving_address - Your Receiving Bitcoin/ Litecoin / Zcash / Bitcoin Cash / Monero Address (Where you would like the payment to be forwarded)
$callback_url - The callback URL to be notified when a payment is received.

Remember to URL Encode the callback URL when calling the create method. The domain must be valid, or else your request will be denied.

TOR USERS:

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

NOTE - callback URL is not mandatory, you can use our class on github to check the payment on the spot.
NOTE - if you are not using a callback, you can check the address for incoming payments here

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

RESPONSE

Success: 200 OK, APPLICATION/JSON

{
   "callback_url":"http://yourwebsite.com/callback_page?id=123&secret=random_secret",
   "address":"35zvWWHZHvASAJo1XkZwGRUWuNYheFhKji",
   "destination":"1EMnFbKfoCNptj9dQX3bpyunNhC6mfj7sa",
   "fee":"0.01",
   "status":"success"
}

If you do not receive the callback, double check the callback_url provided 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 ADDRESS}';
$my_callback_url = 'http://yourwebsite.com/callbackurl.php?call=123&secret='.$secret;
$method = '{YOUR METHOD}';
$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;

Implementing The Callback

When a payment is received our API will notify the callback URL passed using the create method. The parameters will be supplied in a http GET request. The callback url is limited to 255 characters in length.

Parameters

{Custom Parameters} - Any parameters included in the callback URL will be passed back to the callback URL in the notification.
value - The value of the payment received in satoshi. Divide by 100000000 to get the value in crypto.
address - The Bitcoin/Litecoin/Zcash/Bitcoin Cash/Monero address that received the transaction.
transaction_hash - The transaction hash.
destination_address - The destination Bitcoin/Litecoin/Zcash/Bitcoin Cash/Monero address. Check this matches your address.
coin - The coin used in the transaction BTC/LTC/ZEC/BCH/XMR

Example of a callback returning to your website
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

NOTE: We are working continuously to upgrade our service, above data may change.

Expected Response

In order to acknowledge successful processing of the callback the server should respond with the text *ok*. If the server responds with anything else the callback will be resent again every new block (approximately every 10 minutes) up to 100 confirmations.

A notification will never be sent for the same transaction twice once acknowledged with *ok*. It is a good idea to record the transaction hash even if its not needed to detect duplicates.

If you are using Cloudflare service, make sure you are allowing our GET request, if you do not receive callbacks from us, check your cloudflare rules first.

Whitelist

Make sure our ip 185.66.143.156 is whitelisted

Security
A custom secret parameter should be included in the callback URL. The secret will be passed back to the callback script when the callback is fired and will be checked for validity. If the secret is invalid, callback should not execute.

Double Spends & Chargebacks

A double spend occurs when a malicious user spends the same crypto transaction twice. A payment that initial appears successful could be reversed at a later date. This is counteracted by waiting for the transaction to be included in the blockchain and reaching a number of confirmations. 6 confirmations is generally considered safe for high value transactions.

Address Expiration

Normal addresses expire after 30 days of idle. Don't use the same address for multiple payments, generate a new one each time.

Fair Usage

There is no limit to the number of receiving address which can be generated, the service is designed to monitor millions of addresses.
The minimum transaction size is $1 in crypto. There is no maximum payment or any other limitations.
Transactions lower than the minimum transaction amount specified earlier are considered donations.
Callback domains which appear dead or never return the *ok* response may be blocked from the service.