Use the Delete Invoice API to delete the invoice of the user, that are generated by the admin. The API response will contain "done" as "true" after successful removal of the invoice.
HTTP Request
https://hostname:4085/index.php?act=invoices
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | invoices | The action will return done as the true after success | Yes |
delete | POST | Int | The ID of the invoices to be deleted. For deleting multiple invoices pass in the IDs as comma separated values | Yes |
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);
$post = array();
$post['delete'] = 3;
$post['delete'] = '1,2'; // for deleting multiple invoices
$output = $admin->deleteinvoice($post);
print_r(json_encode($output));
?>
Output
{
"title": "Invoices",
"done": true,
"invoices": {
"3": {
"invoid": "3",
"invonum": "3",
"invodate": "19950118",
"invotime": "790387200",
"duedate": "19990118",
"uid": "57",
"paydate": "0",
"paytime": "0",
"item": "xyxsss",
"additional_desc": null,
"item_desc": "",
"amt": "1005550.00",
"disc": "0.00",
"additional_disc": "0.00",
"net": "1005550.00",
"token": "",
"cancelled": "0",
"email": "samplemail@gmail.com",
"status": "unpaid",
"status_txt": null
}
},
"timenow": 1537273934,
"time_taken": "0.211"
}