Skip to content
Advertisement

add an attachment in Xero using php Xero api

Can anyone help me add a pdf to a Xero Invoice using the official (non calcanai) PHP SDK. I’m connected with oAuth2 and have previously created a draft invoice.

I then update the invoice to Authorised and try to add an attachment to the invoice. At this point I am not getting any luck, the attachments is sent but comes back in the respose as null. The docs are not at all useful and do not give any examples of adding an attachment or even minimal fields. So this is what I have:

JavaScript

any ideas?

thanks

* CODE AFTER *

JavaScript

Advertisement

Answer

Adding an attachment requires two API calls.

// Create or Get your Invoice ID, then create Attachment

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement