How to send money using blockchain API? I am not very familiar with php but I just want to know how this works. I am trying to use the blockchain API to send some money for testing purposes but the transaction isn't taking place. My current code is this :-

&lt;?

$guid="xxxxxxxx";
$main_password="xxxxxxxx";
$amount = "50000";
$to = "xxxxxxxx";


$json_url = "https://blockchain.info/merchant/$guid/payment?password=$main_password&amp;second_password=$second_password&amp;to=$address&amp;amount=$amount&amp;from=$from&amp;shared=$shared&amp;fee=$fee&amp;note=$note";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed-&gt;message;
$tx_hash = $json_feed-&gt;tx_hash;

?&gt;


Please tell me what is the error in my code and also how to print out the response on the screen.
You don't have to use all the optional variables in your request link, specially when you have not set a second password, etc...

this suffice the request to send your transaction:

$json_url = "https://blockchain.info/merchant/$guid/payment?password=$firstpassword&amp;to=$addressa&amp;amount=$amounta&amp;fee=$fee";


even if you remove "fee" variable, it would still work but you should consider 0.0001 miners fee that is there by default for minimum miners fee.

also you can get these values from the response:

$json_feed = json_decode($json_data); 

$message = $json_feed-&gt;message; 
$txid = $json_feed-&gt;tx_hash; 
$notice = $json_feed-&gt;error;