Litecoin API

Introduction

The Coins.ac receive payments API is the quickest and easiest way to begin accepting automated litecoin payments. Consisting of just two simple http GET requests. One of the difficulties involved with receiving litecoin payments is the need to generate a unique address for each new user or invoice. These addresses need to monitored and stored securely. The Coins.ac receive payments API takes care of the generation and monitoring of addresses.

You provide a GUID we generate unique addresses that forwards payments to that address instantly.

Generating Receiving Addresses
[API call to generate a new litecoin address ready to receive payments.]

This method creates a unique address which should be presented to the customer. Any payments sent to this address will will be forwarded to your own litecoin address.

The minimum supported transaction size is 0.00005 LTC. Forwarding transactions will include a network fee paid by Coins.ac.

https://coins.ac/api/receive?method=create&guid=$guid&currency=ltc

  • $guid Your account GUID (Sign up on the Coins.ac for get your GUID)
{
    "fee_percent":0,
    "guid":"abcd00-0000-0000-abcd",
    "currency":"ltc",
    "input_address":"LKdW1jB2wLeBXAP3CKhvkZVhbdvUSvVpyX"
}
PHP Example
$guid = 'abcd00-0000-0000-abcd';
$response = file_get_contents('https://coins.ac/api/receive?method=create&guid=' . $guid .'&currency=ltc');
$object = json_decode($response);
echo 'Send Payment To : ' . $object->input_address;

Get Balance Receiving Addresses
[API call to get a balance receive payments address.]

https://coins.ac/merchant/address_balance?address=$address&confirmations=$confirmations&currency=ltc

  • $address Your input generated receiving address.
  • $confirmations The count confirmations
{
"currency" : "ltc",
"address" : "LKdW1jB2wLeBXAP3CKhvkZVhbdvUSvVpyX",
"total_received" : 100000000
}

total_received - The value of the payment received (in litoshi, so divide by 100,000,000 to get the value in LTC).

PHP Example
$address = 'LKdW1jB2wLeBXAP3CKhvkZVhbdvUSvVpyX'
$confirmations = 6;
$response = file_get_contents('https://coins.ac/merchant/address_balance?address=' . $address .'&confirmations=' . $confirmations. '&currency=ltc');
$object = json_decode($response);
$total_received = $object->total_received / 100000000;
echo 'Total received : ' . $total_received . ' LTC';

Currency Conversion

Use the Exchange Rates to convert value in USD to LTC.
This API show rate cryptocurrency for 1 USD

{
"btc":"0.00003093",
"ltc":"0.00731582",
"eth":"0.00232829",
"xmr":"0.000817"
}

Double Spends & Chargebacks

A double spend occurs when a malicious user spends the same LTC 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.

Validate the transaction confirmations in the script by checking confirmations parameter. It is recommended you acknowledge the transaction at zero confirmations but only trust the transaction after one confirmed. For example if purchasing a product we would show the order as successful at zero confirmations but only ship the product when 6 or more confirmations are reached.

Address Expiration

Normal addresses never expire and will continue to be monitored forever.

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 0.00005 LTC. There is no maximum payment or any other limitations.