API:editInvoiceDetails - Edit invoice details

Edit invoice details, all params except ID are optional.

Required parameters

id
Invoice ID

Optional parameters

credit
Sets invoice credit, eg. 0.00
date
Sets invoice date
duedate
Sets invoice due date
payment_module
Sets invoice payment module (ID)
taxrate
Sets invoice Tax 1 rate (%, eg 10)
taxrate2
Sets invoice Tax 2 rate (%, eg 10)
invoicetype
Change invoice type. Available values: "standardinvoice" or "recurringinvoice"
recurring
Array of recurring invoice details, described below:
recurring[recurr]
For recurring invoice: Always Set to 1
recurring[start_from]
For recurring invoice: Date to start recurrence from
recurring[duedays]
For recurring invoice: Number of days since invoice issue till due date
recurring[paybefore]
For recurring invoice: Number of days since invoice issue till pay-before date
recurring[frequency]
For recurring invoice: Frequency of invoice generation, possible values: 1w,2w,4w,1m,2m,3m,6m,1y,2y
recurring[occurrences]
For recurring invoice: Number of occurences, 0 for infinite
recurring[next_invoice]
For recurring invoice: Date for issuing next invoice

Request

GET http://url_to_your_hostbill.com/admin/api.php?token=:TOKEN&call=editInvoiceDetails&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"
      ]
   }