Get list of client's transactions.
GET http://url_to_your_hostbill.com/admin/api.php?api_id=API_ID&api_key=API_KEY&call=getClientTransactions&id=ID
<?php include 'class.hbwrapper.php'; HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key'); $params = array( 'id'=>ID ); $return = HBWrapper::singleton()->getClientTransactions($params); print_r($return); ?>
<?php $url = 'http://url_to_hb.com/admin/api.php'; $post = array( 'api_id' => API_ID, 'api_key' => API_Key, 'call' => 'getClientTransactions', 'id'=>ID ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $data = curl_exec($ch); curl_close($ch); $return = json_decode($data, true); print_r($return); ?>
<?php /* Use this method to access HostBill api from HostBill modules */ $api = new ApiWrapper(); $params = array( 'id'=>ID ); $return = $api->getClientTransactions($params); print_r($return); ?>
{ "success": true, "transactions": [ { "in": "15.00", "out": "0.00", "id": "1", "firstname": "John", "lastname": "Doe", "date": "2011-11-04 00:00:00", "currency_id": "0", "description": "some transaction", "fee": "0.00", "module": "AlertPay", "client_id": "1", "trans_id": "LOU338KGGFQKE", "invoice_id": "1" } ], "call": "getClientTransactions", "server_time": 1323444520 }