Use the List Transaction API to list all the transaction information added by the admin. The API response contains the list of the transactions, which are listed according to their transaction ID. To filter or limit the size of the list, you can specify one or more query parameters.
HTTP Request
https://hostname:4085/index.php?act=transactions
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | transactions | The action will the list of all the transaction information | Yes |
page | GET | Int | If not specified, then only first 50 records are returned | No |
reslen | GET | Int | Number of records to be returned, default is 50 | No |
trid | POST | Int | Filter the list using the transaction ID | No |
invoid | POST | Int | Filter the list using the invoice ID | No |
uid | POST | Int | Filter the list using the user ID of the user making the transaction | No |
Post | text | Filter the list using the user email of the user making the transaction | No | |
date | POST | text | Filter the list using the date on which the transaction was made, should be in the format YYYY/MM/DD | No |
gateway | POST | text | Filter the list using the name of the payment gateway used for the transaction | No |
token | POST | text | Filter the list using the payment transaction token | No |
amt | POST | Int | Filter the list using the transaction amount | No |
fees | POST | Int | Filter the list using the Fees charged by the Gateway | No |
net | POST | Int | Filter the list using the net transaction amount | No |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$page = 1;
$reslen = 1;
$post = array();
$post['uid'] = 57; // use uid or email
$post['email'] = '';
$post['date'] = '2018/09/18'; //YYYY/MM/DD
$post['gateway'] = 'New API two';
$post['amt'] = 1000;
$post['trid'] = '';
$post['invoid'] = '';
$post['token'] = '';
$post['fees'] = '';
$post['net'] = '';
$output = $admin->listtransaction($page, $reslen, $post);
print_r(json_encode($output));
?>
Output
{
"title": "Transactions",
"transactions": {
"10": {
"trid": "10",
"uid": "57",
"date": "20180918",
"unixtime": "1537281235",
"invoid": "0",
"gateway": "New API two",
"token": "",
"amt": "1000.00",
"fees": "0.00",
"net": "1000.00",
"bal": "10000.00",
"used": "0",
"email": "samplemail@gmail.com"
}
},
"timenow": 1537282856,
"time_taken": "0.207"
}