API:convertInvoice - Convert invoice

Convert invoice from draft to invoice [to be seen by customer once all invoice items has been added]

Required parameters

id
Invoice Id

Request

GET http://url_to_your_hostbill.com/admin/api.php?token=:TOKEN&call=convertInvoice&id=:ID

Response

{
      "success": true,
      "invoice": {
         "id": "64",
         "paid_id": "",
         "recurring_id": "0",
         "status": "Unpaid",
         "client_id": "2",
         "date": "2011-12-09",
         "duedate": "2011-12-09",
         "datepaid": "0000-00-00 00:00:00",
         "subtotal": "6.00",
         "credit": "25",
         "tax": "0.00",
         "taxrate": "20.00",
         "tax2": "0.00",
         "taxrate2": "0.00",
         "total": "6.00",
         "payment_module": "33",
         "currency_id": "0",
         "rate": "1.0000",
         "notes": "",
         "items": [
            {
               "id": "124",
               "invoice_id": "64",
               "type": "Hosting",
               "item_id": "49",
               "description": "Shared Hosting-Ultimate ultimatehost.com (09\/12\/2011 - 09\/01\/2012)",
               "amount": "6.00",
               "taxed": "0",
               "qty": "1",
               "linetotal": 6
            }
         ],
         "client": {
            "id": "2",
            "email": "localclient@mail.com",
            "password": "474bf122c92de249ace867a003cb7196",
            "lastlogin": "2011-10-07 07:08:51",
            "ip": "213.54.21.3",
            "host": "cmt-random.uk",
            "status": "Active",
            "parent_id": "0",
            "firstname": "Random",
            "lastname": "Customer",
            "companyname": "companyname",
            "address1": "adress1",
            "address2": "",
            "city": "Jaslo",
            "state": "Podkarpac",
            "postcode": "38-211",
            "country": "PL",
            "phonenumber": "9892478335",
            "datecreated": "2011-10-05",
            "notes": "",
            "language": "english",
            "company": "1",
            "credit": "0.00",
            "taxexempt": "0",
            "latefeeoveride": "0",
            "overideduenotices": "0",
            "client_id": "2",
            "cardnum": true,
            "currency_id": "0",
            "privileges": null
         },
         "gateway": "BankTransfer"
      },
      "call": "editInvoiceDetails",
      "server_time": 1323785924,
      "info": [
         "Invoice details changed"
      ]
   }