Updating an invoice (via UID)

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
benjii
2 Posts
User

2Posts

0Kudos

0Solutions

Updating an invoice (via UID)

Hi,

 

So we am trying to update an invoice via the MYOB AccountRight Live API. Our platform has a use-case where, after an invoice is created, it can be updated.

 

And so, when our platform creates an invoice we need to be able to link to it (store some kind of identifier in our database) so that we can update it later. A UID would be ideal, however, neither the UID that we set during create (POST) seems applied to the invoice in MYOB, nor do we recieve a UID back. We get an empty body in the response.

 

And so what we have done is use oData queries to get back to the original invoice. Like this:

 

${companyFileUri}/Sale/Invoice/Service/?$filter=Number eq '${formattedInvoiceNumber}' and Customer/UID eq guid'${customerUid}'

 

This works but seems a bit "brittle". It seems very, very unlikely that there would ever be a customer with invoices with the same number, but I suppose it is possible. If we had a UID we would be able to guarantee uniqueness.

 

Have I missed something here? It seems if MYOB were to pass back the UID that it generates for a new invoice we'd be golden.

 

Thanks for your time.

 

Kind regards,

Ben

2 REPLIES 2
Yendall
4 Posts
User

4Posts

3Kudos

0Solutions

Re: Updating an invoice (via UID)

It's not documented well, but if you pass ?returnBody=true in the request, it will return the new GUID (alongside all other details) and you can then store it for reference. Found that out through experimentation

benjii
2 Posts
User

2Posts

0Kudos

0Solutions

Re: Updating an invoice (via UID)

Thank you Yendall. This worked perfectly for me. I appreciate that you took the time to reply and help me out. Smiley Happy

Cheers,

Ben

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post