RaidoSpare API for Web Developers

Registration and verification

1) Sign up for an account with RaidoSpare https://secure.raidospare.com/site/signup

2) Log in to your account and proceed to the Merchant Activation page: https://secure.raidospare.com/merchant

3) Complete the necessary boxes on the left side of the screen and select the available payment methods for your Merchant on the right side. Website address should contain a protocol, example: https://my-merchant-site.com .
Thereafter click on the "Send request" button. The added website will appear in the bottom of the page. To view the merchant parameters simply click on the website link.

4) Complete website verification: https://secure.raidospare.com/verification/merchant .
Select the website and click on the "Confirm" button. An automatic support request regarding your website verification will be created. Save the generated text file and upload it to the root folder of your website. Do NOT rename the file.

The file should be accessible by the link like this:
https://my-merchant-site.com/6023275085114c5c1b7c4ddc1998d447.txt

Integration v1

1) Select the added website from the list in the bottom of the page: https://secure.raidospare.com /merchant

You will need the following parameters:

  • Merchant ID
  • Secret
  • Payment Methods ID

2) Create a payment.

Payment parameters are specified in the form of an associative array. Then they are coded and the signature is created from their hash.

Parameter Key Description
Merchant merchant Your Merchant ID
Order order Order number in your system
Price amount The amount you wish to receive from the buyer
Currency currency The currency of the price amount
Description desc The description of the payment (Not requered)
Payment method method Payment Method ID (Not requered)
Show payment method selection button allowchoice In case the parameter allowchoice = true, the special button will redirect a customer on the page with list of others payment methods. In case the parameter do not specify, a customer will not see others payment options. (Not requered)
$params = [
	'merchant'  => 235,
	'order'     => '12345ABC',
	'amount'    => 51.3,
	'currency'  => 'EUR',
	'desc'     => 'purchase #43968',
];
$secret = 'Your_Secret';
$data = base64_encode(json_encode($params));
$sign = hash_hmac('sha256', $data, $secret);
                

If you set the "method" in parameters, example:
$params['method'] => 123,
then the client will be automatically transferred to the approrpiate payment method checkout page upon clicking on the payment button.

Available methods:

Method Payment Methods ID
Bitcoin 2
Etherium 3
RDO 21
USDT 22
TRX 23

If the 'method' is set blank:
$params['method'] => '',
then the client will be automatically transferred to the RaidoSpare checkout page upon clicking on the payment button.

3) Create the payment form.

It is required to specify the $data and $sign obtained values. As the result, payment form will look like this:

<form action="https://secure.raidospare.com/api/merchant" method="post">
	<input type="hidden" name="data"
           value="eyJtZXJjaGFudCI6IjQiLCJvcmRlciI6IjIzNTMyNjIzMyIsImN1cnJlbmN5IjoiVVNEIiwiYW1vdW50IjoiNTEuNDAiLCJ==">
	<input type="hidden" name="sign" value="b657953b504975057c7a466b0131583daea940b12fdb26fbba84a36ec83518b2">
	<button type="submit">Pay</button>
</form>

RaidoSpare supports several languages. To set the specific language of checkout page, you should send the form with a language prefix: https://secure.raidospare.com/ru/api/merchant

4) Set the payment handler.

After the payment is made, the details will be sent to the Process URL of your merchant.
Please contact the RaidoSpare support in order to set the Process URL:
https://secure.raidospare.com/support

Data in the form of an associative array is transferred to the payment processor using the POST request.
Data has the following structure:

$_POST = [
	'order' => string,
	'data' => array,
	'sign' => string,
];
                    

The information contained under the key 'data', also has the structure of an associative array:

Parameter Key Description
Invoice date date The date the ionvoice has been issued
Payment date payDate The date the payment has been made
Invoice amount amount The amount of the issued invoice
Invoice currency currency The currency of the issued invoice
Payment method method Payment method name used to pay for the invoice
Payment currency methodCurrency The currency used to pay for the invoice
Payment amount methodAmount Invoice amount converted to the actual payment currency
Total amount methodAmount Total invoice amount in the payment currency including fee
Raido transaction transaction RaidoSpare transaction number
Transaction in the network transactionNetwork Transaction number in the Blockchain
Enrollment currency transactionCurrency The currency in which the merchant receives the funds on the RaidoSpare account balance
Enrollment amount transactionAmount The amount of funds, merchant receives on the RaidoSpare account balance
Total amount transactionTotal Total amount of the transaction including fees in RaidoSpare system.
Description desc The description of the payment
Payment delay cautionPaymentDelay Payment delay in seconds. Used in case buyer paid the invoice amount but for some reasons the transaction delayed in the RaidoSpare system.
Partial payment cautionPartialPayment The partial payment amount in the RaidoSpare enrollment currency. Specified in case buyer did not pay the full amount (in case of cryptocurrency).

In response to the transmitted parameters, our service will wait for your response.
The response MUST be as follows:

  • Start with the words 'success' or 'error'.
  • The through the '|' character can contain a URL for the buyer's redirect.
  • Be no longer than 255 characters.

An example of a simple handler:

$post = $_POST;
$secret = 'Your_Secret';
if (isset($post['order'], $post['data'], $post['sign'])) {
	$data = base64_encode(json_encode($post['data']));
	$sign = hash_hmac('sha256', $data, $secret);
	if ($sign == $post['sign']) {
		if (isset($post['data']['cautionPartialPayment'])) {
			exit("error|https://my-merchant-site.com/payment/error/?order={$post['order']}");
		}
		exit("success|https://my-merchant-site.com/payment/complete/?order={$post['order']}");
	}
}
                

Transfers in Bitcoins will be credited to your merchant account only after 3 confirmations, while process URL notifications are sent after 2 confirmations.

Payment in the RaidoSpare system will not be completed until the payment is processed by your website and we do not receive the correct response.

After receiving a correct response from your payment processor, the buyer will be notified of the successful / unsuccessful payment, and also suggested to go to the specified URL, if it's transferred.

Integration v2

1) Select the added website from the list in the bottom of the page: https://secure.raidospare.com/api/deposit/request

You will need the following parameters:

  • Merchant ID
  • Secret
  • Payment Methods ID

2) Create a payment.

Payment parameters are specified in the form of an associative array. Then they are coded and the signature is created from their hash.

Parameter Key Description
Merchant merchant Your Merchant ID
Order order Order number in your system
Price amount The amount you wish to receive from the buyer
Currency currency The currency of the price amount
Description desc The description of the payment (Not requered)
Payment method method Payment Method ID

Available methods:

Method Payment Methods ID
Bitcoin 2
Etherium 3
RDO 21
USDT 22
TRX 23
$params = [
	'merchant'  => 235,
	'order'     => '12345ABC',
	'amount'    => 51.3,
	'currency'  => 'USD',
	'desc'     => 'purchase #43968',
    'method'     => '2',
];
$secret = 'Your_Secret';

data = base64_encode(json_encode($params));
$sign = hash_hmac('sha256', $data, $secret);
$postData = array (
    'data' => $data,
    'sign' => $sign,
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/deposit/request');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

The response is returned in JSON format.:

Parameter Key Description
Invoice amount amount The amount of the issued invoice
Invoice currency currency The currency of the issued invoice
Payment method method Payment method name used to pay for the invoice
Description desc The description of the payment
Total amount priceTotal Total invoice amount in the payment currency including fee
Комиссия feeRaido raidospare.com commission in payment method currency
Method name methodTitle Name of the payment method
Payment method methodPayment Payment Method ID
Payment currency methodCurrency The currency used to pay for the invoice
Crypto Address cryptoAddress Crypto Address for payment
Order orderID Order number in your system

3) Set the payment handler.

After the payment is made, the details will be sent to the Process URL of your merchant.
Please contact the RaidoSpare support in order to set the Process URL:
https://secure.raidospare.com/support

Data in the form of an associative array is transferred to the payment processor using the POST request.
Data has the following structure:

$_POST = [
	'order' => string,
	'data' => array,
	'sign' => string,
];
                    

The information contained under the key 'data', also has the structure of an associative array:

Parameter Key Description
Invoice date date The date the ionvoice has been issued
Payment date payDate The date the payment has been made
Invoice amount amount The amount of the issued invoice
Invoice currency currency The currency of the issued invoice
Payment method method Payment method name used to pay for the invoice
Payment currency methodCurrency The currency used to pay for the invoice
Payment amount methodAmount Invoice amount converted to the actual payment currency
Total amount methodAmount Total invoice amount in the payment currency including fee
Raido transaction transaction RaidoSpare transaction number
Transaction in the network transactionNetwork Transaction number in the Blockchain
Enrollment currency transactionCurrency The currency in which the merchant receives the funds on the RaidoSpare account balance
Enrollment amount transactionAmount The amount of funds, merchant receives on the RaidoSpare account balance
Total amount transactionTotal Total amount of the transaction including fees in RaidoSpare system.
Description desc The description of the payment
Payment delay cautionPaymentDelay Payment delay in seconds. Used in case buyer paid the invoice amount but for some reasons the transaction delayed in the RaidoSpare system.
Partial payment cautionPartialPayment The partial payment amount in the RaidoSpare enrollment currency. Specified in case buyer did not pay the full amount (in case of cryptocurrency).

In response to the transmitted parameters, our service will wait for your response.
The response MUST be as follows:

  • Start with the words 'success' or 'error'.
  • The through the '|' character can contain a URL for the buyer's redirect.
  • Be no longer than 255 characters.

An example of a simple handler:

$post = $_POST;
$secret = 'Your_Secret';
if (isset($post['order'], $post['data'], $post['sign'])) {
	$data = base64_encode(json_encode($post['data']));
	$sign = hash_hmac('sha256', $data, $secret);
	if ($sign == $post['sign']) {
		if (isset($post['data']['cautionPartialPayment'])) {
			exit("error|https://my-merchant-site.com/payment/error/?order={$post['order']}");
		}
		exit("success|https://my-merchant-site.com/payment/complete/?order={$post['order']}");
	}
}
                

Transfers in Bitcoins will be credited to your merchant account only after 3 confirmations, while process URL notifications are sent after 2 confirmations.

Payment in the RaidoSpare system will not be completed until the payment is processed by your website and we do not receive the correct response.

After receiving a correct response from your payment processor, the buyer will be notified of the successful / unsuccessful payment, and also suggested to go to the specified URL, if it's transferred.

Authentication

Authentication is performed via Http Bearer Token. The token is issued after receiving the application. The answer from the server in JSON format .

Information on the authorized user

https://secure.raidospare.com/api/

curl -X GET "https://secure.raidospare.com/api/" -H "accept: application/json" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Example for to PHP:

if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$out = curl_exec($curl);
curl_close($curl);
}
                    

Transactions History

https://secure.raidospare.com/api/history

account - the wallet number you would like to see the history for

curl -X POST "https://secure.raidospare.com/api/history " -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Example for to PHP:

$postData = array (
'account' => 'RD1234567',
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/history');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

Balance Information

https://secure.raidospare.com/api/balance

account - the wallet number you want to receive a balance for

currency - currency

curl -X POST "https://secure.raidospare.com/api/balance " -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Example for to PHP:

$postData = array (
'currency' => 'USD',
'account' => 'RD1234567',
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/balance');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

Payouts \ Mass Payments

https://secure.raidospare.com/api/payout

merchant - Merchant ID in the RAIDOSPARE system

to - account number, email, phone number or crypto address of the recipient in the RAIDOSpare system

amount - the amount of payment

currency - payment currency

fee - How to understand, who will pay fee:in case without params, the fee will take from the merchant, in case with params and if the word true, or number 1, the fee will take from the customer

curl -X POST "https://secure.raidospare.com/api/payout" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "merchant=123456&to=RD1234567&amount=10¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Returns the JSON string with the transaction number when the operation succeeded.

Example for to PHP:

$postData = array (
'amount' => 10,
'currency' => 'USD',
'to' => 'client@gmail.com',
'merchant' => 12345678,
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/payout');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

Send money

https://secure.raidospare.com/api/transfer

from - Your wallet number, from which the payment will be made

to - account number, email, phone number or crypto address of the recipient in the RAIDOSpare system

the amount of payment

payment currency

curl -X POST "https://secure.raidospare.com/api/transfer" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "from=RD1234567&to=RD1234568&amount=10¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Returns the JSON string with the transaction number when the operation succeeded.

Example for to PHP:

$postData = array (
'from' => 'RD1234567',
'to' => 'RD1234568',
'amount' => 10,
'currency' => 'USD',
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/transfer');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

Checking of availability of wallet

https://secure.raidospare.com/api/check-account

the wallet number that should be checked

curl -X POST "https://secure.raidospare.com/api/check-account" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"

Returns a JSON string true or false

{"success":true}

Example for to PHP:

$postData = array (
'account' => 'RD1234567',
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://secure.raidospare.com/api/check-account');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
$out = curl_exec($curl);
curl_close($curl);
}
                

Customers payouts

Payout API requests require a header for authentication

Headers 
Authorization: Bearer {{access_token}}

The first step is requesting the offer

https://secure.raidospare.com/api/withdrawal/request

POST:

Required parameters
Parameter Description
amount The requested withdrawal amount
currency Currency of the requested withdrawal amount
currency_in Transaction currency
account_in Account for transfer (you can specify email, wallets, crypto addresses, etc.)
order Merchant order ID
merchant Merchant ID in the RAIDOSPARE system
Additional parameters
client_id Merchant customer ID
desc Custom transaction description

The second step is confirmation of the request

https://secure.raidospare.com/api/withdrawal/confirm

POST:

Parameter Description
offer_id The offer ID in the RaidoSpare system
merchant Merchant ID in the RAIDOSPARE system
sign Sign

The sign is formed as follows:

$sign = hash_hmac('sha256', $offer_id . $merchant, {{secret}});
                    

The response is returned in JSON format.:

Example of a good answer:

{"status":"success","tx":"5B89B69E5533B2A9F2CAC64B6"}

tx - hash transaction in the RaidoSpare system

Example of an answer with an error:

{"name":"Bad Request","message":"Amount cannot be blank.","code":0,"status":400}
{"name":"Bad Request","message":"Offer already paid","code":100,"status":400}