Instant payment notification (IPN)

The following information is an overview of basic payment form. You must create a form using the POST method and pointing to https://www.coin2send.com/sci

<form method="POST" action="https://www.coin2send.com/sci"> 
<input type="hidden" name="account" value="MY_USERNAME"> 
<input type="hidden" name="store" value="MY STORE NAME">
 <input type="hidden" name="amount" value="0.00025675"> 
<input type="hidden" name="currency" value="BTC"> 
<input type="hidden" name="memo" value="Invoice #123"> 
<input type="hidden" name="custom_1" value="CUSTOM DATA 1"> 
<input type="hidden" name="custom_2" value="CUSTOM DATA 2"> 
<input type="hidden" name="custom_3" value="CUSTOM DATA 3"> 
<input type="hidden" name="custom_4" value="CUSTOM DATA 4"> 
<input type="hidden" name="success_url" value="http://www.yoursite.com/success.php"> 
<input type="hidden" name="fail_url" value="http://www.yoursite.com/cancel.php">
<input type="hidden" name="status_url" value="http://www.yoursite.com/status.php"> 
<button>Pay now!</button>
</form> 



Table of parameters

Parameter name Required? Details
account Yes Your Coin2Send username.
store Yes The name of your store or website (50 chars max.)
amount Yes The price of item, up to 8 decimals for cryptocurrencies.
Example: 0.00000531
currency Yes The currency that you would like to use in.
Example: BTC, USDT, ETH, DASH
memo Yes Description of item to purchase (50 max characaters).
Example: Golden membership
custom_1, custom_2... custom_4 No These are custom parameters that will be sent back to your status_url.
success_url No The URL where the user will be redirected after the payment has been completed.
fail_url No The URL where the user will be redirected after the payment has been failed or cancelled by customer.
status_url No The URL where the result details will be POSTed back.

Table of Result Parameters

Parameter name Sent back Details
account Always The receiver of the payment. Your Coin2Send username.
amount Always The price of the item. This amount will be transerred to your account.
currency Always The currency used to pay the item.
Example: BTC, ETH, LTC, USDT
memo Always Description or note about the item purchased.
custom_1, custom_2... custom_4 When set in payment form If you have set any custom parameter, they will be sent back unchanged.
customer Always Username of member who made the payment.
transaction_id Always The unique ID for each transaction. You will see this ID in your transaction history.
hash Always 128 bit MD5 message digest value to verify the authenticity of the payment.

When a payment is completed, you will receive a security hash which is generated using the following formula:

MD5(transaction_id.':'.account.':'.customer.':'.amount.':'.currency.':'.sci_password)
Note: you can set your sci_password in your account panel.

In your status script, you can generate this hash and check if the payment is valid. Below you can find an example in PHP:

$sci_password = "Your SCI Password Here";

$hash = md5($_POST['transaction_id'].':'.$_POST['account'].':'.$_POST['customer'].':'.$_POST['amount'].':'.$_POST['currency'].':'.$sci_password);

if($hash == $_POST['hash']){

//Payment is valid

}else{

//Payment is invalid

}


Currencies supported

Currency Code Name
BTC Bitcoin
USD United State Dollar

Our buttons

 

API Guide

The Coin2Send API provides a simple interface where merchants can use to programmatically interact with their account.

Transfer

The transfer method can be used to transfer funds to other user account.

URL: https://www.coin2send.com/api/v1/transfer
Method: POST

  • $api_id The API ID of your merchant account.
  • $api_key The API Key of your merchant account.
  • $amount The amount to transfer
  • $currency The currency of transaction (BTC or USD, in case your use USD, the amount will be converted from your BTC wallet)
  • $wallet The coin code of your wallet, ex: BTC
  • $to_account The username of receiver account
  • $memo Comment about this transacction

Response: 200 OK, application/json

{
"status": "success",
"transaction_id": "SJDCIXYSJSCMNXS"
}

PHP Example

<?php

$post_data = array(
    'api_id' => 'SDJ324HJJCKSDBJKBDSJXC',
    'api_key' => 'SDOJ3RK3JRS8CUS98CYSX89CHURHJKSCBKXCBKSBDFJKSBC',
    'amount' => '0.0005',
    'currency' => 'BTC',
    'wallet' => 'BTC',
    'to_account' => 'demo',
    'memo' => 'Withdrawal request #152'
);

$handle = curl_init();
curl_setopt_array($handle, array(
CURLOPT_URL => 'https://www.coin2send.com/api/v1/transfer',
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($handle);
curl_close($handle);

 

Get Balance

The Get Balance method can be used to get your balance amount of your selected wallet.

URL: https://www.coin2send.com/api/v1/balance
Method: POST

  • $api_id The API ID of your merchant account.
  • $api_key The API Key of your merchant account
  • $wallet The coin code of your wallet, ex: BTC

Response: 200 OK, application/json

{
"status": "success",
"balance": "0.018521000"
}

PHP Example

<?php

$post_data = array(
    'api_id' => 'SDJ324HJJCKSDBJKBDSJXC',
    'api_key' => 'SDOJ3RK3JRS8CUS98CYSX89CHURHJKSCBKXCBKSBDFJKSBC',
    'wallet' => 'BTC',
);

$handle = curl_init();
curl_setopt_array($handle, array(
CURLOPT_URL => 'https://www.coin2send.com/api/v1/balance',
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($handle);
curl_close($handle);

 

Create Deposit

The Create Deposit method is for making your own custom checkout page, so buyers don't have to leave your page.

URL: https://www.coin2send.com/api/v1/deposit
Method: POST

  • $api_id The API ID of your merchant account.
  • $api_key The API Key of your merchant account
  • $amount The amount to deposit
  • $currency The currency of deposit (BTC or USD, in case your use USD, the amount will be converted to the currency wallet)
  • $wallet The coin code of your wallet where you will receive the deposit, ex: BTC
  • $comment Any comment about this deposit, it will displayed in your deposit history.
  • $status_url (optional) URL to notify when deposit is completed.

Response: 200 OK, application/json

{
"status": "success",
"transaction_id": "35CBA167617AF7",
"address": "35tXX7q1Awp1rLx6YN7a2CiYVhRqzUWjg9",
"amount": "0.01884429",
"timeout":"1555710118"
}

PHP Example

<?php

$post_data = array(
    'api_id' => 'SDJ324HJJCKSDBJKBDSJXC',
    'api_key' => 'SDOJ3RK3JRS8CUS98CYSX89CHURHJKSCBKXCBKSBDFJKSBC',
    'currency' => 'USD',
    'amount' => '100',
    'wallet' => 'BTC',
    'comment' => 'Deposit by user demo',
    'status_url' => 'http://www.mysite.com/notify.php?invoice=54'
);

$handle = curl_init();
curl_setopt_array($handle, array(
CURLOPT_URL => 'https://www.coin2send.com/api/v1/deposit',
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($handle);
curl_close($handle);

 

Example of callback (notify.php)

You will receive the notification of payment when deposit is credited to your account, it means with 3 or more confirmations.

<?php
$username = 'coin2send'; //Your Coin2Send username
$api_id = 'SDJ324HJJCKSDBJKBDSJXC'; //Your API ID
$api_key = 'SDOJ3RK3JRS8CUS98CYSX89CHURHJKSCBKXCBKSBDFJKSBC'; //Your API Key

$merchant = $_POST['merchant']; //Your Coin2Send username
$transaction_id = $_POST['transaction_id']; //Unique ID of Coin2Send deposit
$currency = $_POST['currency']; //The original currency of the transaction.
$amount = $_POST['amount'];  //Amount of the original transaction
$wallet = $_POST['wallet']; //The currency of merchant wallet.
$amount2 = $_POST['amount2']; //Amount added in merchant wallet without fees
$address = $_POST['address']; //Currency address where deposit was made
$txid = $_POST['txid']; //The TX ID of the payment to the merchant.
$hash = $_POST['hash']; //Data required to validate the deposit


if($hash  == md5($username.':'.$transaction_id.':'.$amount.':'.$currency.':'.$wallet.':'.$api_id.':'.$api_key)){
  //Deposit is valid
}else{
  //Deposit is invalid
}

 

Withdrawal

Send bitcoin from your wallet to another bitcoin address. All transactions include a 0.00005 BTC miners fee.

URL: https://www.coin2send.com/api/v1/withdraw
Method: POST

  • $api_id The API ID of your merchant account.
  • $api_key The API Key of your merchant account
  • $address Recipient Bitcoin address
  • $currency The currency of your withdrawal request (BTC or USD, in case your use USD, the amount will be converted to the currency wallet)
  • $amount The amount to send
  • $wallet The coin code of your wallet where the funds will be taken. Ex: BTC
  • $comment Any comment about this request.

Response: 200 OK, application/json

{
"status": "success",
"transaction_id": "SJKSEH44578CV734"
}

PHP Example

<?php

$post_data = array(
    'api_id' => 'SDJ324HJJCKSDBJKBDSJXC',
    'api_key' => 'SDOJ3RK3JRS8CUS98CYSX89CHURHJKSCBKXCBKSBDFJKSBC',
    'address' => '1B76fnreixsdOSDhsjcsgsrfgxgfxkZ8Q'
    'currency' => 'USD',
    'amount' => '50',
    'wallet' => 'BTC',
    'comment' => 'Payment to user demo'
);

$handle = curl_init();
curl_setopt_array($handle, array(
CURLOPT_URL => 'https://www.coin2send.com/api/v1/withdraw',
CURLOPT_POSTFIELDS => $post_data,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
));
$response = curl_exec($handle);
curl_close($handle);