Developers' API

Table of Contents


1.0 Introduction


This document describes how to programatically transfer funds, and/or receive payments on your website, using UnifiedPurse (You must have created a UnifiedPurse account before using this tool. .

2.0 Shopping Cart Interface


To accept online payments on you website, online-stores, mobile/desktop app or phisically for your products and services using UnifiedPurse, Click here to generate your payment url or snippet/script to be shared or included in your applications and start recieving payments worldwide.

3.0 Transaction Confirmation


After a successful payment transaction, the following parameters will be posted back to your supplied notification_url via HTTP POST request .
	ref :the transaction reference 
	unifiedpurse_transaction_reference :the internal transaction reference on UnifiedPurse
This section describes how to programatically validate/check a transaction status on UnifiedPurse server, using the transaction information posted to your notification URL

3.1 Getting transaction information

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1

Input Field Name Description Example Value
action The value for this key must be get_transaction get_transaction
receiver The receiver's username or email sample@gmail.com
ref Transaction reference User:123-Product:ABC
Optional Fields
amount If supplied, the value will be checked against the original transaction amount supplied on the payment request, and an error will be returned if the values does not match 0.053
currency If supplied, the value will be checked against the original transaction currency supplied on the payment request, and an error will be returned if the values does not match BTC
trade_id Since it is possible to also specify a ref during trades, this value is important to check and ensure that a user isn't trying to use ref from a trade transaction to validate a payment transaction. In short, for a payment transaction, this value will be zero. 0
Sample Codes for getting transaction information
https://unifiedpurse.com/api_v1?action=get_transaction&receiver=sample%40gmail.com&ref=User%3A123-Product%3AABC&trade_id=0
<?php

	$my_username='sample@gmail.com'; //this should be replaced with your UnifiedPurse username or email

	if(empty($_POST['ref']))$msg="Transaction reference not supplied.";
	else
	{
		$ref=$_POST['ref'];
		//$ext_txn_ref=$_POST['unifiedpurse_transaction_reference'];
	
		$post_data=array(
			'action'=>'get_transaction',
			'receiver'=>$my_username,
			'ref'=>$ref,
			'trade_id'=>0,
			//'amount'=>'0.1',  //the amount that you are expecting (this is optional)
			//'currency'=>'BTC',  //the currency that you are expecting (this is optional)
		);
		
		$api_url='https://unifiedpurse.com/api_v1';

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $api_url);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended
		
		$response = curl_exec($ch);
		$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
		if($response_code != 200)$response=curl_error($ch);
		curl_close($ch);

		if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
		else
		{
			$json=@json_decode($response,true);
			
			if($json===null)$msg="INVALID RESPONSE: $response"; 
			elseif(!empty($json['error']))$msg=$json['error'];
			elseif($json['status_msg']!='COMPLETED')$msg="Transaction Not Completed. STATUS: ".$json['status_msg'];
			else
			{
				//Transaction successfully validated, further processing can proceed here
				$msg="Transaction Completed, amount: ".$json['amount'];			
			}
		}
	}
	
	echo $msg;
?>
Below is a sample successful process's response (NOTE: This does not mean a succesful transaction, check the transaction status)
{
    "username": "sample@gmail.com",
    "email": "sample@gmail.com",
    "ref": "User:123-Product:ABC",
    "trade_id": 0,
    "currency_code": "BTC",
    "amount": 0.00106,
    "commission_for_receiver": 0,
    "total_received": 0.00106,
    "memo": "Buying Product ABC With 2000.00 NGN",
    "date_time": "2018-04-12T13:17:10 BST",
    "status": 1,
    "status_msg": "COMPLETED",
    "type": "TRANSFER",
    "payment_method": "unifiedpurse",
    "blockchain_txid": "",
    "original_amount": 2000,
    "original_currency_code": "NGN",
    "info": ""
}
Below is a sample response to a failed process, a JSON Object
{"error":"Transaction record not found"}

3.2 Balance Enquiry

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1

Input Field Name Description Example Value
action The value for this key must be get_balance get_balance
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
Optional Fields
currency If supplied, the only the ballance of the supplied currency will be returned. Currency can be any of BTC, LTC, ETH ETH
Sample Codes for getting your account balance
https://unifiedpurse.com/api_v1?action=get_balance&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);

	$post_data=array(
		'action'=>'get_transaction',
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended	
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		else
		{
			//Balance for each currency is now available under corresponding currency code
			$msg="Bitcoin balance: ".$json['BTC'];			
		}
	}
	
	echo $msg;
?>
Below is a sample successful process's response.
{"BTC":0,"LTC":0,"ETH":0}
Below is a sample response to a failed process, a JSON Object
{"error":"Invalid token"}

3.3 Releasing Escrow Transaction

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1

Input Field Name Description Example Value
action The value for this key must be release_escrow release_escrow
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
ref The transaction reference 15349519661068
Sample Codes for getting your account balance
https://unifiedpurse.com/api_v1?action=release_escrow&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&ref=15349519661068
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);

	$post_data=array(
		'action'=>'get_transaction',
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
		'ref'=>'15349519661068'
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended	
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		elseif(!empty($json['success']))
		{
			//Escrow succesfully released
			$msg=$json['success']['msg'];			
		}
	}
	
	echo $msg;
?>
Below is a sample successful process's response.
{"BTC":0,"LTC":0,"ETH":0}
Below is a sample response to a failed process, a JSON Object
{"error":"Invalid token"}

4.0 Transfer funds


The four types of funds sending actions basically follow the same pattern, they only differs in some request parameters and the extra details in the response


4.1 Transfer Funds

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1 in order to intiate a fund-transfer transaction

Input Field Name Description Example Value
action The value for this key must be transfer transfer
proceed The value for this key should be confirm. If otherwise, the transaction will not actually be commited, you will only see the preview information and be sure that this transaction would have gone through sucessfully confirm
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
transaction_pin_hash A md5 hashing of md5 hash generated from your account's transaction pin, email, and token key in this pattern
md5(md5(transaction_pin+email)+token_key)
+ here means concatenation of of values, not to include the + sign
42edb714dd02540466591fe6edf154fd
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
payment_currency The wallet to transfer this fund from; as long as you have sufficient balance in that wallet. Presently the value can be any of BTC, LTC, ETH BTC
amount The numerical amount to be transferred, depending on the specified wallet's currency 1000
recipient This can either be the registered email or username of the receiver at UnifiedPurse
CAUTION: Double-check to make sure to avoid transferring into a wrong account
a@b.com
Optional Fields
escrow 0 and 1 are the values that are allowed here;
If you supply '1', then the fund will not be released to the receiver until you approve.
Supplying '0' has no effect, it's the default, and means that the fund should be released immediately
0
receiver_bear_charges 0 and 1 are the values that are allowed here;
If you supply '1', then the transfer fee will be deducted from the amount that you supplied.
0
auto_approval_date A valid date (such as 2017-04-01 14:30) UIf supplied, the fund will only be realeased to the receiver on or after the date. 0
ref Your custom transaction reference Invoice:123-Product:ABC
Sample Codes for transferring funds to another user's account
https://unifiedpurse.com/api_v1?action=transfer&proceed=confirm&payment_currency=USD&recipient=b%40c.com&amount=1000&escrow=0&ref=User%3A123-Product%3AABC&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&transaction_pin_hash=42edb714dd02540466591fe6edf154fd
<?php

	$recipient_email=$_POST['recipient'];
	
	$account_email='sample@gmail.com';
	$account_pass='password';
	$transaction_pin='123456';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);
	$transaction_pin_hash=md5(md5($transaction_pin.$account_email).$token_key);
	

	$post_data=array(
		'action'=>'transfer',
		'proceed'=>'confirm',
		'payment_currency'=>'USD',
		'recipient'=>$recipient_email,
		'amount'=>'1000',
		'escrow'=>0,
		'ref'=>$ref,
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
		'transaction_pin_hash'=>$transaction_pin_hash,
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended	
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		else
		{
			//Transaction successfully processed, further processing can proceed here
			$msg=$json['success'];
			$temp=print_r($json['transaction'],true);
		}
	}
	
	echo $msg;
?>
Below is a sample successful process's response.
{"success":"Transaction Successful Reference: 1492486939","transaction":{"transaction_id":"24","date_time":"2017-04-18 04:42:19","user_id":"1","related":"0","amount":"0.1","site_charges":"5.01","type":"2","currency_code":"BTC","original_currency_code":"BTC","status":"1","payment_method":"transfer","transaction_reference":"1492486939","batch_used":"","details":"Transferring 0.1 BTC","json_details":{"percentage_commission":0.5,"fixed_commission":5,"percentage_commission_amount":0.0005,"preview_info":{"Sender's Details":{"Sender's Name":"firstname lastname","Sender's Email":"sampl@mail.com","Sender's Phone":"+2348000000000","Sender's Country":"Nigeria"},"Receiver's Details":{"Name":"firstname lastname","Country":"Nigeria","Escrow Transaction":"NO"},"Summary":{"Amount":"0.1 BTC","Fixed Charges":"5 BTC","Transfer Commission":"0.0005 BTC (0.5 %)","Total Amount":"5.11 BTC"}}},"json_info":null,"time":"1492486939","escrow_status":"0","related_user_id":"2","ref":"","to_amount":"0.1","to_currency_code":"BTC","firstname":"firstname","lastname":"lastname","email":"sample@mail.com","phone":"+3311111111"}}
Below is a sample response to a failed process, a JSON Object
{"error":"Invalid account credentials"}

4.2 Withdraw Funds

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1 in order to intiate a fund withdrawal transaction

Input Field Name Description Example Value
action The value for this key must be withdraw withdraw
proceed The value for this key should be confirm. If otherwise, the transaction will not actually be commited, you will only see the preview information and be sure that this transaction would have gone through sucessfully confirm
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
transaction_pin_hash A md5 hashing of md5 hash generated from your account's transaction pin, email, and token key in this pattern
md5(md5(transaction_pin+email)+token_key)
+ here means concatenation of of values, not to include the + sign
42edb714dd02540466591fe6edf154fd
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
payment_currency The wallet to transfer this fund from; as long as you have sufficient balance in that wallet. Presently the value can be any of BTC, LTC, ETH BTC
amount The numerical amount to be transferred, depending on the specified wallet's currency 1000
Optional Fields
Your specified payment currency will determine if you should supply 'destination_account' or bank details. If you are withdrawing e-currencies, you will need to rather supply 'destination_account'
destination_account e.g If the payment_currency is BTC, the destination_account should be the bitcoin address 1PyTX2UzWuxNu3dywPdrJa1SE2dTcUKfqf
ref Your custom transaction reference Invoice:123-Product:ABC
notification_url When a transaction has been succesfuly completed, the transaction reference (under an HTTP POST key 'ref') will be posted to this url http://example.com/payment/withdrawal_completed_notification
Sample Codes for withdrawing funds easily
https://unifiedpurse.com/api_v1?action=withdraw&proceed=confirm&payment_currency=BTC&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&transaction_pin_hash=42edb714dd02540466591fe6edf154fd&amount=1000&destination_account=1PyTX2UzWuxNu3dywPdrJa1SE2dTcUKfqf&ref=User%3A123-Product%3AABC
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$transaction_pin='123456';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);
	$transaction_pin_hash=md5(md5($transaction_pin.$account_email).$token_key);

	$post_data=array(
		'action'=>'withdraw',
		'proceed'=>'confirm',
		'payment_currency'=>'USD',
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
		'transaction_pin_hash'=>$transaction_pin_hash,
		'amount'=>'1000',
		'destination_account'=>'1PyTX2UzWuxNu3dywPdrJa1SE2dTcUKfqf',
		'ref'=>$ref,
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended	
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		else
		{
			//Transaction successfully processed, further processing can proceed here
			$msg=$json['success'];
			$temp=print_r($json['transaction'],true);
		}
	}

	echo $msg;
?>

4.3 Exchange Funds

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1 in order to exchange your funds from one currency to another

Input Field Name Description Example Value
action The value for this key must be exchange exchange
proceed The value for this key should be confirm. If otherwise, the transaction will not actually be commited, you will only see the preview information and be sure that this transaction would have gone through sucessfully confirm
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
transaction_pin_hash A md5 hashing of md5 hash generated from your account's transaction pin, email, and token key in this pattern
md5(md5(transaction_pin+email)+token_key)
+ here means concatenation of of values, not to include the + sign
42edb714dd02540466591fe6edf154fd
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
payment_currency The wallet to transfer this fund from; as long as you have sufficient balance in that wallet. Presently the value can be any of BTC, LTC, ETH BTC
amount The numerical amount to be transferred, depending on the specified wallet's currency 1000
destination_currency The wallet to be credited from this exchange BTC, LTC, ETH USD
Optional Fields
Your specified payment currency will determine if you should supply 'destination_account' or bank details. If you are withdrawing e-currencies, you will need to rather supply 'destination_account'
ref Your custom transaction reference Invoice:123-Product:ABC
Sample Codes for exchanging funds between currencies
https://unifiedpurse.com/api_v1?action=exchange&proceed=confirm&payment_currency=USD&destination_currency=BTC&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&transaction_pin_hash=42edb714dd02540466591fe6edf154fd&amount=1000&ref=User%3A123-Product%3AABC
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);

	$post_data=array(
		'action'=>'transfer',
		'proceed'=>'confirm',
		'payment_currency'=>'USD',
		'destination_currency'=>'BTC',
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
		'transaction_pin_hash'=>$transaction_pin_hash,
		'amount'=>'1000',
		'escrow'=>0,
		'ref'=>$ref,
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		else
		{
			//Transaction successfully processed, further processing can proceed here
			$msg=$json['success'];
			$temp=print_r($json['transaction'],true);
		}
	}
	
	echo $msg;
?>

4.4 Escrow Bureau-de-change

The following parameters can be sent, through HTTP GET or POST request to the URL: https://unifiedpurse.com/api_v1 in order to make use of bureau_de_change services

Input Field Name Description Example Value
action The value for this key must be bureau_de_change bureau_de_change
proceed The value for this key may at first be list_exchangers; Where: based on your request parameters, this will return a list of available exchangers and their exchanger_rate_id which can then me used in a subsequent call.
If value for this key be set to confirm (of course the exchanger_rate_id must be supplied) and the transaction will be commited.
If otherwise (not set to list_exchangers nor confirm), the transaction will not actually be commited, you will only see the preview information and be sure that this transaction would have gone through sucessfully
list_exchangers
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
transaction_pin_hash A md5 hashing of md5 hash generated from your account's transaction pin, email, and token key in this pattern
md5(md5(transaction_pin+email)+token_key)
+ here means concatenation of of values, not to include the + sign
42edb714dd02540466591fe6edf154fd
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
payment_currency The wallet to transfer this fund from; as long as you have sufficient balance in that wallet. Presently the value can be any of BTC, LTC, ETH BTC
amount The numerical amount to be transferred, depending on the specified wallet's currency 1000
country The country_code of your bank's location (e.g NG is the country_code of Nigeria)
This value can be any of the valid countries list below
NG
bank_name Name of the bank Guaranty Trust Bank
bank_account_name Receiver's bank account name John Doe
bank_account_no Receiver's bank account number 00000000
destination_currency The wallet to be credited from this exchange BTC, LTC, ETH USD
Optional Fields
auto_approval_date A valid date (such as 2017-04-01 14:30) UIf supplied, the fund will only be realeased to the receiver on or after the date. 0
ref Your custom transaction reference Invoice:123-Product:ABC
exchanger_rate_id This should be any of the exchanger_rate_id from the list of exchangers returned when the request was made with proceed = list_exchangers
The value is required for this request, unless the value for the key proceed is list_exchangers
121
Sample Codes for using bureau_de_change services
https://unifiedpurse.com/api_v1?action=bureau_de_change&proceed=list_exchangers&payment_currency=BTC&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&transaction_pin_hash=42edb714dd02540466591fe6edf154fd&amount=0.1&country=37&bank_name=Guaranty+Trust+Bank&bank_account_name=John+Doe&bank_account_no=0000000000&exchanger_rate_id=0&ref=User%3A123-Product%3AABC
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);
	
	$post_data=array(
		'action'=>'bureau_de_change',
		'proceed'=>'list_exchangers',
		'payment_currency'=>'BTC',
		'amount'=>'0.1',
		'country'=>'37',
		'bank_name'=>'Guaranty Trust Bank',
		'bank_account_name'=>'John Doe',
		'bank_account_no'=>'0000000000',
		'exchanger_rate_id'=>'0',
		'ref'=>$ref,
		'email'=>$account_email,
		'token_key'=>$token_key,
		'token'=>$token,
		'transaction_pin_hash'=>$transaction_pin_hash
	);
	
	$api_url='https://unifiedpurse.com/api_v1';

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $api_url);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended	
	
	$response = curl_exec($ch);
	$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	if($response_code != 200)$response=curl_error($ch);
	curl_close($ch);

	if($response_code != 200)$msg="HTTP ERROR $response_code: $response";
	else
	{
		$json=@json_decode($response,true);
		
		if($json===null)$msg="INVALID RESPONSE: $response"; 
		elseif(!empty($json['error']))$msg=$json['error'];
		else
		{
			//Transaction successfully processed, further processing can proceed here
			$msg=$json['success'];
			$temp=print_r($json['transaction'],true);
		}
	}
	
	echo $msg;
?>

Available Payment Systems, With Their ID

Risk level is an approximated measure of the tendency for charge-back. ( i.e how easy it is for the buyer to reverse the payment )
In which, reversals can occur weeks or months after the trade. In fact the payment provider may lock your account without a refund after receiving payments for crypto-currency if related to fraud-case.
NOTE Risk-level only applies when you are selling crypto-currencies online. You don't have any concern with risk-level if you are buying digital currencies

ID Payment System Risk Level Description
1 national-bank-transfer LOW Wire transfer within a specific country. Or Go to a bank / ATM and deposit cash directly to the bank account
2 transfers-with-specific-bank LOW Transfers to and from other customers with the same bank as you.
3 altcoin-alternative-cryptocurrencies LOW Any other cryptocurrencies than Bitcoin, Litecoin, Ethereum.
4 sepa-eu-bank-transfer LOW Single Euro Payments Area (SEPA) wire transfers. Usually recallable up to 10 days.
5 okpay HIGH OKPAY allows you to accept bank wire and cash money transfers and all e-currencies quickly and affordably. Currently OKPay offers as irreversible payment.
6 paypal HIGH Transfer money to anybody with an email address.
7 webmoney HIGH Secure and immediate transactions online.
8 moneybookers-skrill HIGH The simple and secure way to send and receive money.
9 neteller HIGH Instant deposits, withdrawals and payouts online.
10 cashiers-check HIGH Checks signed by cashiers.
11 venmo HIGH Send money to friends using a mobile app in US. Can be funded using a credit card.
12 dwolla HIGH Send money online using Dwolla.
13 perfect-money HIGH Instant payments and confidential money transfers online.
14 cashu HIGH Pay online securely without bank account or credit card and fund your account using variety of methods.
15 paysafecard HIGH Pay online securely without bank account or credit card in Europe. Fund your account with redeemable coupons.
16 payza HIGH Send and receive money online. Fund your account with wire transfer or credit card.
17 hal-cash HIGH Hal-Cash is a bank service that allows you to send money to any mobile phone, and be withdrawn instantly at an ATM of any of the financial institutions associated with the worldwide system, anytime and anywhere without needing a credit card.
18 western-union MEDIUM Send and receive money internationally. The receiver can redeem the transfer as cash.
19 postepay MEDIUM Italian online payments.
20 moneygram MEDIUM Send and receive money internationally. The receiver can redeem the transfer as cash.
21 postal-order MEDIUM Sending money through the mail in UK and US.
22 ria-money-transfer MEDIUM Send and receive money internationally. The receiver can redeem the transfer as cash.
23 m-pesa-tanzania-vodacom UNKNOWN Send and receive money with mobile phone in Africa.
24 bpay-bill-payment UNKNOWN Bpay allows Australians different ways to pay their bills.
25 transferwise UNKNOWN Transfer money online internationally
26 telegramatic-order UNKNOWN Payment method in Croatia
27 payeer UNKNOWN Send money anywhere in the world, receiver does not need be registered.
28 vipps HIGH Send money to anyone who has a Norwegian phone number.
29 cash-by-mail HIGH Send cash to the receiver via mail.
30 chase-quickpay HIGH Person-to-person payments through Chase's quickpay system.
31 gift-card-code HIGH A gift card code.
32 gift-card-code-global HIGH A gift card code.
33 google-wallet HIGH Online payment method to transfer funds between two Google Wallet users.
34 amazon-gift-card-code HIGH A gift card code.
35 vanilla HIGH Redeemable coupons and debit cards.
36 paypal-my-cash HIGH Coupons which can be used to load your PayPal account.
37 solidtrustpay HIGH International instant payment processor. Multiple funding options.
38 apple-store-gift-card-code HIGH A gift card code.
39 steam-gift-card-code HIGH A gift card code.
40 itunes-gift-card-code HIGH A gift card code.
41 square-cash HIGH Send money to friends using a mobile app in US. Can be funded with debit cards.
42 credit-card HIGH Buy Bitcoins using your credit card.
43 reloadit HIGH Redeemable coupons and debit cards.
44 walmart-gift-card-code HIGH A gift card code.
45 ebay-gift-card-code HIGH A gift card code.
46 starbucks-gift-card-code HIGH A gift card code.
47 swish LOW Send and receive Swedish Kroner to and from mobile phone numbers.
48 qiwi LOW Send money to anyone with a Qiwi account. All you need to know is their phone number, simple easy and fast.
49 m-pesa-kenya-safaricom LOW Send and receive money with your mobile phone in Africa.
50 international-wire-swift MEDIUM International wire transfer with SWIFT code
51 mobilepay-fi MEDIUM Easy way to send money with phone numbers, works with all Finnish banks.
52 imps-bank-transfer-india MEDIUM IMPS bank transfers in India.
53 interac-e-transfer MEDIUM Canadian online transfers
54 pingit MEDIUM Barclays mobile payments in UK.
55 paym MEDIUM Pay your friends and family using just their mobile number.
56 pyc MEDIUM Pay your contacts - mobile payments by Natwest / Royal Bank of Scotland
57 xoom MEDIUM Xoom Corporation is a digital money transfer company based in San Francisco. It provides consumer remittance services to Europe, Canada, Australia, Latin America, the Philippines and India.
58 mobilepay MEDIUM Easy way to send money with phone numbers, works with all Danish banks.
59 netspend-reload-pack MEDIUM Redeemable coupon for NetSpend card
60 mobilepay-no MEDIUM Easy way to send money with phone numbers, works with all Norwegian banks.
61 walmart-2-walmart MEDIUM Send and receive money between two Walmart locations. The receiver can redeem the transfer as cash.
62 serve2serve MEDIUM Reloadable debit cards and transfers between them.
63 yandex-money MEDIUM Mobile payment solution.
64 paytm UNKNOWN Indian mobile payment method (Pay Through Mobile).
65 lydia UNKNOWN French mobile payment method.
66 alipay UNKNOWN Alipay is a major Chinese online payment system.
67 superflash UNKNOWN Italian debit card with an IBAN number.
68 astropay UNKNOWN AstroPay Card is an easy and safe way to make payments online in latin american countries.
69 advcash UNKNOWN Advanced cash is an online wallet service that lets you send and receive money.
70 hyperwallet UNKNOWN hyperWALLET is online payment solution which offers instant bank transfer funding in Canada.
71 tigo-pesa-tanzania UNKNOWN Send and receive money with mobile phone in Africa.
72 payoneer UNKNOWN Payoneer is a financial services business that provides online money transfer and e-commerce payment services.
73 onecard UNKNOWN Prepaid card sold in Saudi Arabia, Egypt and Kuwait.
74 paxum UNKNOWN Send money anywhere in the world with just an email address.
75 cash-at-atm UNKNOWN Cash at ATM is a service some banks that lets you withdraw or deposit money from/to ATMs with a PIN code.
76 wechat UNKNOWN WeChat Pay is a digital wallet service incorporated into WeChat, which allows users to perform mobile payments and send money between contacts.
77 easypaisa UNKNOWN Send money to other people in Pakistan using your mobile phone.
78 worldremit UNKNOWN Send money anywhere in the world.
79 other-online-payment HIGH The exchanger gives payment details in the offer message
80 other-online-wallet HIGH Other online wallets that do not have their own category. The exchanger gives payment details in the offer description.
81 other-online-wallet-global HIGH International online wallets that do not have their own category.. The exchanger gives payment details in the offer descirption
82 other-remittance HIGH Remittance vendors not already on the list. The exchanger gives payment details in the offer message
83 other-pre-paid-debit-card HIGH National pre-paid debit cards that do not have their own category. The exchanger gives payment details in the offer descirption

Available Countries with their ID & Currencies

All Supported Fiat(Local) Currencies

Nigerian naira

Currency Code: NGN

United States dollar

Currency Code: USD

European euro

Currency Code: EUR

Pound sterling

Currency Code: GBP

UAE dirham

Currency Code: AED

Afghan afghani

Currency Code: AFN

Albanian lek

Currency Code: ALL

Armenian dram

Currency Code: AMD

Netherlands Antillean guilder

Currency Code: ANG

Angolan kwanza

Currency Code: AOA

Argentine peso

Currency Code: ARS

Australian dollar

Currency Code: AUD

Aruban florin

Currency Code: AWG

Azerbaijan manat

Currency Code: AZN

Bosnia and Herzegovina convertible mark

Currency Code: BAM

Barbadian dollar

Currency Code: BBD

Bangladeshi taka

Currency Code: BDT

Bulgarian lev

Currency Code: BGN

Bahraini dinar

Currency Code: BHD

Burundi franc

Currency Code: BIF

Bermudian dollar

Currency Code: BMD

Brunei dollar

Currency Code: BND

Bolivian boliviano

Currency Code: BOB

Brazilian real

Currency Code: BRL

Bahamian dollar

Currency Code: BSD

Bhutanese ngultrum

Currency Code: BTN

Botswana pula

Currency Code: BWP

Belarusian ruble

Currency Code: BYN

Belize dollar

Currency Code: BZD

Canadian dollar

Currency Code: CAD

Congolese franc

Currency Code: CDF

Swiss franc

Currency Code: CHF

Chilean peso

Currency Code: CLP

Chinese Yuan Renminbi

Currency Code: CNY

Colombian peso

Currency Code: COP

Costa Rican colon

Currency Code: CRC

Cuban peso

Currency Code: CUP

Cape Verdean escudo

Currency Code: CVE

Czech koruna

Currency Code: CZK

Djiboutian franc

Currency Code: DJF

Danish krone

Currency Code: DKK

Dominican peso

Currency Code: DOP

Algerian dinar

Currency Code: DZD

Egyptian pound

Currency Code: EGP

Eritrean nakfa

Currency Code: ERN

Ethiopian birr

Currency Code: ETB

Fijian dollar

Currency Code: FJD

Georgian lari

Currency Code: GEL

Ghanaian cedi

Currency Code: GHS

Gambian dalasi

Currency Code: GMD

Guinean franc

Currency Code: GNF

Guatemalan quetzal

Currency Code: GTQ

Guyanese dollar

Currency Code: GYD

Honduran lempira

Currency Code: HNL

Croatian kuna

Currency Code: HRK

Haitian gourde

Currency Code: HTG

Hungarian forint

Currency Code: HUF

Indonesian rupiah

Currency Code: IDR

Israeli new shekel

Currency Code: ILS

Indian rupee

Currency Code: INR

Iraqi dinar

Currency Code: IQD

Iranian rial

Currency Code: IRR

Icelandic krona

Currency Code: ISK

Jamaican dollar

Currency Code: JMD

Jordanian dinar

Currency Code: JOD

Japanese yen

Currency Code: JPY

Kenyan shilling

Currency Code: KES

Kyrgyzstani som

Currency Code: KGS

Cambodian riel

Currency Code: KHR

Comorian franc

Currency Code: KMF

North Korean won

Currency Code: KPW

South Korean won

Currency Code: KRW

Kuwaiti dinar

Currency Code: KWD

Kazakhstani tenge

Currency Code: KZT

Lao kip

Currency Code: LAK

Lebanese pound

Currency Code: LBP

Sri Lankan rupee

Currency Code: LKR

Liberian dollar

Currency Code: LRD

Lesotho loti

Currency Code: LSL

Lithuanian Litas

Currency Code: LTL

Latvians Lats

Currency Code: LVL

Libyan dinar

Currency Code: LYD

Moroccan dirham

Currency Code: MAD

Moldovan leu

Currency Code: MDL

Malagasy Ariary

Currency Code: MGA

Macedonian denar

Currency Code: MKD

Myanmar kyat

Currency Code: MMK

Mongolian tugrik

Currency Code: MNT

Mauritanian ouguiya

Currency Code: MRO

Mauritian rupee

Currency Code: MUR

Maldivian rufiyaa

Currency Code: MVR

Malawian kwacha

Currency Code: MWK

Mexican peso

Currency Code: MXN

Malaysian ringgit

Currency Code: MYR

Mozambican metical

Currency Code: MZN

Namibian dollar

Currency Code: NAD

Nicaraguan cordoba

Currency Code: NIO

Norwegian krone

Currency Code: NOK

Nepalese rupee

Currency Code: NPR

New Zealand dollar

Currency Code: NZD

Omani rial

Currency Code: OMR

Panamanian balboa

Currency Code: PAB

Peruvian sol

Currency Code: PEN

Papua New Guinean kina

Currency Code: PGK

Philippine peso

Currency Code: PHP

Pakistani rupee

Currency Code: PKR

Polish zloty

Currency Code: PLN

Paraguayan guarani

Currency Code: PYG

Qatari riyal

Currency Code: QAR

Romanian leu

Currency Code: RON

Serbian dinar

Currency Code: RSD

Russian ruble

Currency Code: RUB

Rwandan franc

Currency Code: RWF

Saudi Arabian riyal

Currency Code: SAR

Seychellois rupee

Currency Code: SCR

Sudanese pound

Currency Code: SDG

Swedish krona

Currency Code: SEK

Singapore dollar

Currency Code: SGD

Sierra Leonean leone

Currency Code: SLL

Somali shilling

Currency Code: SOS

Surinamese dollar

Currency Code: SRD

Sao Tome and Principe dobra

Currency Code: STD

Salvadoran Colon

Currency Code: SVC

Syrian pound

Currency Code: SYP

Swazi lilangeni

Currency Code: SZL

Thai baht

Currency Code: THB

Tajikistani somoni

Currency Code: TJS

Turkmen manat

Currency Code: TMT

Tunisian dinar

Currency Code: TND

Tongan pa’anga

Currency Code: TOP

Turkish lira

Currency Code: TRY

Trinidad and Tobago dollar

Currency Code: TTD

New Taiwan dollar

Currency Code: TWD

Tanzanian shilling

Currency Code: TZS

Ukrainian hryvnia

Currency Code: UAH

Ugandan shilling

Currency Code: UGX

Uruguayan peso

Currency Code: UYU

Uzbekistani som

Currency Code: UZS

Venezuelan bolivar

Currency Code: VEF

Vietnamese dong

Currency Code: VND

Vanuatu vatu

Currency Code: VUV

Samoan tala

Currency Code: WST

Central African CFA franc

Currency Code: XAF

East Caribbean dollar

Currency Code: XCD

West African CFA franc

Currency Code: XOF

Yemeni rial

Currency Code: YER

South African rand

Currency Code: ZAR

Zambian kwacha

Currency Code: ZMW

Zimbabwean Dollar

Currency Code: ZWD

Countries & Default Currencies

Nigeria

Country Code: NG , Default Currency: NGN

Spain

Country Code: ES , Default Currency: EUR

United Kingdom

Country Code: GB , Default Currency: GBP

United States

Country Code: US , Default Currency: USD

Afghanistan

Country Code: AF , Default Currency: AFN

Albania

Country Code: AL , Default Currency: ALL

Algeria

Country Code: DZ , Default Currency: DZD

Andorra

Country Code: AD , Default Currency: EUR

Angola

Country Code: AO , Default Currency: AOA

Anguilla

Country Code: AI , Default Currency: XCD

Antigua/Barbuda

Country Code: AG , Default Currency: XCD

Argentina

Country Code: AR , Default Currency: ARS

Armenia

Country Code: AM , Default Currency: AMD

Aruba

Country Code: AW , Default Currency: AWG

Australia

Country Code: AU , Default Currency: AUD

Austria

Country Code: AT , Default Currency: EUR

Azerbaijan

Country Code: AZ , Default Currency: AZN

Bahamas

Country Code: BS , Default Currency: BSD

Bahrain

Country Code: BH , Default Currency: BHD

Bangladesh

Country Code: BD , Default Currency: BDT

Barbados

Country Code: BB , Default Currency: BBD

Belarus

Country Code: BY , Default Currency: BYN

Belgium

Country Code: BE , Default Currency: EUR

Belize

Country Code: BZ , Default Currency: BZD

Benin

Country Code: BJ , Default Currency: XOF

Bermuda

Country Code: BM , Default Currency: BMD

Bhutan

Country Code: BT , Default Currency: BTN

Bolivia

Country Code: BO , Default Currency: BOB

Bosnia/Herzegovina

Country Code: BA , Default Currency: BAM

Botswana

Country Code: BW , Default Currency: BWP

Brazil

Country Code: BR , Default Currency: BRL

Brunei

Country Code: BN , Default Currency: BND

Bulgaria

Country Code: BG , Default Currency: BGN

Burkina Faso

Country Code: BF , Default Currency: XOF

Burma (Myanmar)

Country Code: MM , Default Currency: MMK

Burundi

Country Code: BI , Default Currency: BIF

Cambodia

Country Code: KH , Default Currency: KHR

Cameroon

Country Code: CM , Default Currency: XAF

Canada

Country Code: CA , Default Currency: CAD

Cape Verde

Country Code: CV , Default Currency: CVE

Central African Republic

Country Code: CF , Default Currency: XAF

Chad

Country Code: TD , Default Currency: XAF

Chile

Country Code: CL , Default Currency: CLP

China

Country Code: CN , Default Currency: CNY

Colombia

Country Code: CO , Default Currency: COP

Comoros

Country Code: KM , Default Currency: KMF

Congo, Dem.

Country Code: CD , Default Currency: CDF

Congo, Rep.

Country Code: CG , Default Currency: XAF

Costa Rica

Country Code: CR , Default Currency: CRC

Croatia

Country Code: HR , Default Currency: HRK

Cuba

Country Code: CU , Default Currency: CUP

Cyprus

Country Code: CY , Default Currency: EUR

Czech Republic

Country Code: CZ , Default Currency: CZK

Denmark

Country Code: DK , Default Currency: DKK

Djibouti

Country Code: DJ , Default Currency: DJF

Dominica

Country Code: DM , Default Currency: XCD

Dominican Republic

Country Code: DO , Default Currency: DOP

East Timor

Country Code: TL , Default Currency: USD

Ecuador

Country Code: EC , Default Currency: USD

Egypt

Country Code: EG , Default Currency: EGP

El Salvador

Country Code: SV , Default Currency: SVC

Equatorial Guinea

Country Code: GQ , Default Currency: XAF

Eritrea

Country Code: ER , Default Currency: ERN

Estonia

Country Code: EE , Default Currency: EUR

Ethiopia

Country Code: ET , Default Currency: ETB

Fiji

Country Code: FJ , Default Currency: FJD

Finland

Country Code: FI , Default Currency: EUR

France

Country Code: FR , Default Currency: EUR

Gabon

Country Code: GA , Default Currency: XAF

Gambia

Country Code: GM , Default Currency: GMD

Georgia

Country Code: GE , Default Currency: GEL

Germany

Country Code: DE , Default Currency: EUR

Ghana

Country Code: GH , Default Currency: GHS

Greece

Country Code: GR , Default Currency: EUR

Greenland

Country Code: GL , Default Currency: DKK

Grenada

Country Code: GD , Default Currency: XCD

Guadeloupe

Country Code: GP , Default Currency: EUR

Guatemala

Country Code: GT , Default Currency: GTQ

Guinea

Country Code: GN , Default Currency: GNF

Guinea-Bissau

Country Code: GW , Default Currency: XOF

Guyana

Country Code: GY , Default Currency: GYD

Haiti

Country Code: HT , Default Currency: HTG

Honduras

Country Code: HN , Default Currency: HNL

Hungary

Country Code: HU , Default Currency: HUF

Iceland

Country Code: IS , Default Currency: ISK

India

Country Code: IN , Default Currency: INR

Indian Ocean

Country Code: IO , Default Currency: USD

Indonesia

Country Code: ID , Default Currency: IDR

Iran

Country Code: IR , Default Currency: IRR

Iraq

Country Code: IQ , Default Currency: IQD

Ireland

Country Code: IE , Default Currency: EUR

Israel

Country Code: IL , Default Currency: ILS

Italy

Country Code: IT , Default Currency: EUR

Jamaica

Country Code: JM , Default Currency: JMD

Japan

Country Code: JP , Default Currency: JPY

Jordan

Country Code: JO , Default Currency: JOD

Kazakhstan

Country Code: KZ , Default Currency: KZT

Kenya

Country Code: KE , Default Currency: KES

Kiribati

Country Code: KI , Default Currency: AUD

Korea (north)

Country Code: KP , Default Currency: KPW

Korea (south)

Country Code: KR , Default Currency: KRW

Kuwait

Country Code: KW , Default Currency: KWD

Kyrgyzstan

Country Code: KG , Default Currency: KGS

Laos

Country Code: LA , Default Currency: LAK

Latvia

Country Code: LV , Default Currency: LVL

Lebanon

Country Code: LB , Default Currency: LBP

Lesotho

Country Code: LS , Default Currency: LSL

Liberia

Country Code: LR , Default Currency: LRD

Libya

Country Code: LY , Default Currency: LYD

Liechtenstein

Country Code: LI , Default Currency: CHF

Lithuania

Country Code: LT , Default Currency: LTL

Luxembourg

Country Code: LU , Default Currency: EUR

Macedonia

Country Code: MK , Default Currency: MKD

Madagascar

Country Code: MG , Default Currency: MGA

Malawi

Country Code: MW , Default Currency: MWK

Malaysia

Country Code: MY , Default Currency: MYR

Maldives

Country Code: MV , Default Currency: MVR

Mali

Country Code: ML , Default Currency: XOF

Malta

Country Code: MT , Default Currency: EUR

Martinique

Country Code: MQ , Default Currency: EUR

Mauritania

Country Code: MR , Default Currency: MRO

Mauritius

Country Code: MU , Default Currency: MUR

Mexico

Country Code: MX , Default Currency: MXN

Micronesia

Country Code: FM , Default Currency: USD

Moldova

Country Code: MD , Default Currency: MDL

Monaco

Country Code: MC , Default Currency: EUR

Mongolia

Country Code: MN , Default Currency: MNT

Montserrat

Country Code: MS , Default Currency: XCD

Morocco

Country Code: MA , Default Currency: MAD

Mozambique

Country Code: MZ , Default Currency: MZN

Namibia

Country Code: NA , Default Currency: NAD

Nauru

Country Code: NR , Default Currency: AUD

Nepal

Country Code: NP , Default Currency: NPR

Netherlands

Country Code: NL , Default Currency: EUR

Netherlands Antilles

Country Code: AN , Default Currency: ANG

New Zealand

Country Code: NZ , Default Currency: NZD

Nicaragua

Country Code: NI , Default Currency: NIO

Niger

Country Code: NE , Default Currency: XOF

Norway

Country Code: NO , Default Currency: NOK

Oman

Country Code: OM , Default Currency: OMR

Pakistan

Country Code: PK , Default Currency: PKR

Palau

Country Code: PW , Default Currency: USD

Panama

Country Code: PA , Default Currency: PAB

Papua New Guinea

Country Code: PG , Default Currency: PGK

Paraguay

Country Code: PY , Default Currency: PYG

Peru

Country Code: PE , Default Currency: PEN

Philippines

Country Code: PH , Default Currency: PHP

Poland

Country Code: PL , Default Currency: PLN

Portugal

Country Code: PT , Default Currency: EUR

Puerto Rico

Country Code: PR , Default Currency: USD

Qatar

Country Code: QA , Default Currency: QAR

Romania

Country Code: RO , Default Currency: RON

Russian Federation

Country Code: RU , Default Currency: RUB

Rwanda

Country Code: RW , Default Currency: RWF

Samoa

Country Code: WS , Default Currency: WST

San Marino

Country Code: SM , Default Currency: EUR

Sao Tome/Principe

Country Code: ST , Default Currency: STD

Saudi Arabia

Country Code: SA , Default Currency: SAR

Senegal

Country Code: SN , Default Currency: XOF

Serbia (Yugoslavia)

Country Code: RS , Default Currency: RSD

Seychelles

Country Code: SC , Default Currency: SCR

Sierra Leone

Country Code: SL , Default Currency: SLL

Singapore

Country Code: SG , Default Currency: SGD

Slovakia

Country Code: SK , Default Currency: EUR

Slovenia

Country Code: SI , Default Currency: EUR

Somalia

Country Code: SO , Default Currency: SOS

South Africa

Country Code: ZA , Default Currency: ZAR

Sri Lanka

Country Code: LK , Default Currency: LKR

St Vincent/Grenadines

Country Code: VC , Default Currency: XCD

St. Barts

Country Code: BL , Default Currency: USD

St. Kitts/Nevis

Country Code: KN , Default Currency: XCD

St. Lucia

Country Code: LC , Default Currency: XCD

St. Martin/Sint Maarten

Country Code: MF , Default Currency: EUR

Sudan

Country Code: SD , Default Currency: SDG

Suriname

Country Code: SR , Default Currency: SRD

Swaziland

Country Code: SZ , Default Currency: SZL

Sweden

Country Code: SE , Default Currency: SEK

Switzerland

Country Code: CH , Default Currency: CHF

Syria

Country Code: SY , Default Currency: SYP

Taiwan

Country Code: TW , Default Currency: TWD

Tajikistan

Country Code: TJ , Default Currency: TJS

Tanzania

Country Code: TZ , Default Currency: TZS

Thailand

Country Code: TH , Default Currency: THB

Togo

Country Code: TG , Default Currency: XOF

Tonga

Country Code: TO , Default Currency: TOP

Trinidad/Tobago

Country Code: TT , Default Currency: TTD

Tunisia

Country Code: TN , Default Currency: TND

Turkey

Country Code: TR , Default Currency: TRY

Turkmenistan

Country Code: TM , Default Currency: TMT

Turks/Caicos

Country Code: TC , Default Currency: USD

Tuvalu

Country Code: TV , Default Currency: AUD

Uganda

Country Code: UG , Default Currency: UGX

Ukraine

Country Code: UA , Default Currency: UAH

United Arab Emirates

Country Code: AE , Default Currency: AED

Uruguay

Country Code: UY , Default Currency: UYU

Uzbekistan

Country Code: UZ , Default Currency: UZS

Vanuatu

Country Code: VU , Default Currency: VUV

Vatican City

Country Code: VA , Default Currency: EUR

Venezuela

Country Code: VE , Default Currency: VEF

Vietnam

Country Code: VN , Default Currency: VND

Yemen

Country Code: YE , Default Currency: YER

Zambia

Country Code: ZM , Default Currency: ZMW

Zimbabwe

Country Code: ZW , Default Currency: ZWD


5.0 Market/Trading API


If you already (or planning to) have your own website, from which you offer the business of buying and selling digital currencies, then take advantage of theese automations to better and very easily serve your customers here.


5.1 Rates Automation

Use the following request parameters (through HTTP POST or HTTP GET commands) to programatically switch/alter your market rates and availability

Input Field Name Description Example Value
action The value for this key must be set_rate set_rate
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
from_currency_code The currency that you are buying (customers will pay you with this currency)
Value can be any of local country/fiat currencies, or the following digital currency codes: BTC, LTC, ETH
BTC
to_currency_code The currency that you are selling (customers will receive payments from you in this currency)
Value can be any of local country/fiat currencies, or the following digital currency codes: BTC, LTC, ETH
LTC
payment_system The payment-system used by this exchange services. See the list of payment systems and their respective IDs. LTC
instruction A well detailed but short information about your requirements (including bank or account details where you will receive payments if applicable) LTC
conv_rate Conversion rate, i.e:
1 (from_currency_code value) = conv_rate (to_currency_code value)
E.g: If from_currency_code= BTC and to_currency_code LTC
A value of 1000 here means that you will convert a person's 1 BTC to 100 LTC
1000
conv_charge_fixed Fixed conversion charge (e.g your processing fee) The payer will be requested to pay an addition of this amount, in the from_currency_code currency unit 0.5
min_purchase The minimum payment amount you accept (in from_currency_code currency unit) 1
max_purchase The maximum payment amount you accept (in from_currency_code currency unit) 100000000
exchanger_response_window Typical duration in minutes that it will take you to respond to a transaction request 15
Optional Fields
disabled 0 and 1 are the values that are allowed here 0
for_sci_conversion 0 and 1 are the values that are allowed here;
If you supply '1', then this exchange rate will ONLY be used for automated conversion of your amounts on your SCI.
It won't be avalible for trading (instant exchange); it will also not be advertised on the market
Default value is 0
0
checkout_url

Only applicable if you are submitting as an exchanger that will be facilitating 3-way exchange (i.e selling crypto-currencies to customers that needs it for checkout; in a unified transaction).

If supplied, the customer will be directed to this url where it's expected that you have an automated payment means in place;
Here is a typical example of how customers will be directed to your url
https://example.com/my_checkout_page?amount_to_pay=685&currency_to_pay=USD&transaction_reference=&payment_for_amount=0.1&payment_for_currency=BTC&validation_token=f63adc6c39ba03dca6e904104d29e274
Re-compute the validity token and compare to the one sent; to be sure that the values has not been altered en-route
$validity_token=md5(amount_to_pay+currency_to_pay+transaction_reference+sha512(password+email))
After payment, you can automatically acknowledge their payment remotely by releasing escrow through the API endpoint; for the transaction to be finalized
https://example.com/my_checkout_page
disable_3way 0 and 1 are the values that are allowed here;
If you supply '1', trusted customers won't be able to perform a third-party payment transaction on SCI by buying crypto-currencies from you
Default value is 0
0
Sample codes for configuring an exchange rate
https://unifiedpurse.com/api_v1?action=set_rate&from_currency_code=BTC&to_currency_code=NGN&payment_system=national-bank-transfer&conv_rate=2272727&conv_charge_fixed=0&min_purchase=0.01&max_purchase=10&exchanger_response_window=20&email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84&instruction=Supply+your+bank+account+number%2C+bank+name+and+account+name
<?php
	
	function updateUnifiedpurseRate($email,$password,$post_data,$token_key=''){
		$api_url='https://unifiedpurse.com/api_v1';
		if(empty($token_key))$token_key=time();
		$token=md5(hash('sha512',$password.$email).$token_key);
		
		$auth_params=array(
		'email'=>$email,
		'token_key'=>$token_key,
		'token'=>$token);
		$post_data=array_merge($auth_params,$post_data);
	
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $api_url);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //only uncomment if you do not have SSL, not-recomended
		
		$response = curl_exec($ch);
		$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
		if($response_code != 200)$response=curl_error($ch);
		curl_close($ch);
		
		if($response_code != 200)$result=array('error'=>"HTTP ERROR $response_code: $response");
		else {
			$result=@json_decode($response,true);
			if($result===null)$result=array('error'=>"INVALID RESPONSE: $response"); 
		}
		
		return $result;
	}
	
	$my_selling_rate=2272727; //e.g the rate at which you are selling 1 BTC
	$my_processing_fee=0; //e.g 0.0003
	
	$post_data=array(
		'action'=>'set_rate',
		'from_currency_code'=>'BTC',
		'to_currency_code'=>'NGN',
		'payment_system'=>'national-bank-transfer',
		'instruction'=>"Supply your bank account number, bank name and account name",
		'conv_rate'=>$my_selling_rate,
		'conv_charge_fixed'=>$my_processing_fee,
		'min_purchase'=>0.01,
		'max_purchase'=>10,
		'exchanger_response_window'=>20,
	);
	
		
	$account_email='sample@gmail.com';
	$account_pass='password';
	$result=updateUnifiedpurseRate($account_email,$account_pass,$post_data);
	echo "<pre>".json_encode($result,JSON_PRETTY_PRINT)."</pre>";
?>
Below is a sample successful process's response (a full record of all your rates settings)
[
    {
        "exchanger_rate_id": "2",
        "user_id": "1",
        "payment_system": "national-bank-transfer",
        "conv_rate": "2272727",
        "conv_charge": "0",
        "conv_charge_fixed": "0",
        "min_purchase": "0.01",
        "max_purchase": "10",
        "customer_payment_window": "1",
        "exchanger_response_window": "20",
        "instruction": "Supply your bank account number, bank name and account name",
        "to_currency_code": "NGN",
        "from_currency_code": "BTC",
        "for_sci_conversion": "0",
        "disabled": "0",
        "disable_3way": "0",
        "system_rating": "0",
        "customer_rating_positives": "0",
        "customer_rating_negatives": "0",
        "statistics": null
    }
]
	
Below is a sample response to a failed process, a JSON Object
{"error":"Invalid account credentials"}

5.2 UnfiedPurse Transaction Widget

Monitor and perform actions on your transaction history by loading the widget url //unifiedpurse.com/transaction_widget with the following parameters in an iframe, on your secured (private) webpage

Widget Url Parameter Description Example Value
email Your email address on UnifiedPurse sample@gmail.com
token A md5 hashing of sha512 hash generated from your account's password, email, and token key in this pattern
md5(sha512(password+email)+token_key)
+ here means concatenation of of values, not to include the + sign
3d51f06ca4a6454f4480113191e24e84
token_key A very random string; preferrably the unix timestamp generated and used when making this request 1502910803
Sample snippet for loading transaction history widget in an iframe
<iframe
	src='//unifiedpurse.com/transaction_widget?email=sample%40gmail.com&token_key=1502910803&token=3d51f06ca4a6454f4480113191e24e84' 
	style='width:100%;height:560px;border:1px solid #bbb;'
></iframe>
<?php

	$account_email='sample@gmail.com';
	$account_pass='password';
	$token_key=time();
	$token=md5(hash('sha512',$account_pass.$account_email).$token_key);

	$widget_url="//unifiedpurse.com/transaction_widget?email=$account_email&token_key=$token_key&token=$token";
?>
<iframe
	src='<?php echo $widget_url; ?>' 
	style='width:100%;height:560px;border:1px solid #bbb;'
></iframe>
		

6.0 Disclaimer

The Author accepts no responsibility for damages to persons, property or data incurred through the use or misuse of these API and scripts. To the maximum extent permitted by law, in no event shall the Author be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use or inability to use this API, even if the Author has been advised of the possibility of such damages.
This product is supplied as-is, with no warranties express or implied. Use this documentation at your own risk.