API:meteredGetUsage - Metered Billing: Get usage

Get usage of metered billing components for certain HostBill account in current billing period. This method returns list of variables, summary of each is available under charge and usage values.

Required parameters

account_id
HostBill account ID

Request

GET http://url_to_your_hostbill.com/admin/api.php?api_id=API_ID&api_key=API_KEY&call=meteredGetUsage&account_id=ACCOUNT_ID

Response

   {
      "success": true,
      "variables": {
         "5": {
            "id": "5",
            "product_id": "11",
            "name": "Domains",
            "variable_name": "powerdnspanel",
            "unit_name": "domain(s)",
            "cycle": "Monthly",
            "scheme": "volume",
            "options": "0",
            "usage": "2",
            "charge": 5,
            "values": [
               {
                  "id": "109",
                  "variable_name": "powerdnspanel",
                  "unit_name": "domain(s)",
                  "cycle": "Monthly",
                  "date_created": "2011-12-13 07:00:39",
                  "name": "Domains",
                  "date_updated": "2011-12-13 07:00:39",
                  "charge": "5.00",
                  "qty": "2",
                  "output": "",
                  "rawoutput": "",
                  "variable_id": "5",
                  "scheme": "volume",
                  "options": "0"
               }
            ]
         }
      },
      "call": "meteredGetUsage",
      "server_time": 1323788715
   }