Delete Transactions

Use the Delete Transactions API to delete the transaction information of the user. These are transactions entries that are added by the admin. The API response will contain “done” as “true” on successful removal of the transaction entry.

HTTP Request

https://hostname:4085/index.php?act=transactions

Parameters

NameMethodValueDescriptionRequired
actGETtransactionsThe action will return done as true on successYes
deletePOSTIntThe ID of the transaction to be deleted. For deleting multiple transaction entries pass in the IDs as comma separated valuesYes

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 values

    $output = $admin->deletetransactions($post);

    print_r(json_encode($output));
?>

Output


{
    "title": "Transactions",
    "done": true,
    "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": 1537283730,
    "time_taken": "0.211"
}
Was this helpful to you?