Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create Invoice with invoice information(contract Id, metadata)? #253

Open
seniorMLstar opened this issue Feb 17, 2019 · 2 comments
Open

Comments

@seniorMLstar
Copy link

Hi PyXero team!
I would like to get quick help from you.
I just came from this Xero API Previewer page:
https://app.xero.com/Preview/invoices/POST
xeroapi

As you can see, there is an option to post invoice with XML file.
I tried to implement invoice creation feature using PyXero like this:
invoice = xero.invoices.filter(Contract_ContractID=CONTRACT_ID)
invoice.post(some_data)

But it is showing me an error "{AttributeError}'Manager' object has no attribute 'post'"
I am not sure what is the solution to create an invoice with captured contract id and json or xml based data.

I would like to get the solution from you as soon as possible.
Thank you

@IdlePhysicist
Copy link

Hi there,
I have no solution for you, but I can say that Xero has no Contract field/attribute. Perhaps you mean Contact?

Also the invoice object has no attribute post (as your error shows) you probably need to use invoice.put(data) to create a new invoice, or invoice.save(data) to update an existing invoice.

Have a look at this code in the PyXero README file. It shows example get, filter, put, and save methods for the contacts object, they will work for the invoice object also.

I hope this helps you some.

@seniorMLstar
Copy link
Author

I mean Contact,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants