Jump to content

Update Invoice API unable to add new line item


Recommended Posts

Hello,

I have been working with the WHMCS api and am having an issue updating an invoice via the api. The goal is to add a new line item to a specific invoice, but even though the api returns a successful response, the new line item has not been added.

I am coding in python, and have formatted the request like this:

data = {
  "identifier": self.identifier,
  "secret": self.secret,
  "action": "UpdateInvoice",
  "invoiceid": invoiceid,
  "newitemdescription": ["Test Item"],
  "newitemamount": [10.00],
  "newitemtaxed": [False],
  "responsetype": "json"
}

r = requests.post(url, data, verify=False)

I've tried doing a dictionary like {"0": "Test Item"} a list of dictionaries [{"0": "Test Item"}] and using the next available invoice item id, but nothing has worked so far. Any suggestions to where I may be going wrong?

 

Thanks in advance

Edited by temi
formatting
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated