Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Bulk invoice attachment files

Started by Rafael Mardones -   in API Endpoints

Hello everyone, I'm using the PHP SDK's createInvoices method to push invoices in batches of 50 invoices, which is a lot faster than pushing one by one.

However, I also need to attach one CSV file to each of the created invoices, and for that, I'm using the SDK's createInvoiceAttachmentByFileName method. The issue is that this method only allows me to attach the files one at a time. Is there a way for me to attach 50 different (lightweight) files to 50 invoices in a single API call, using the PHP SDK?

Any help will be appreciated, thank you!

Unfortunately, with the way the Attachment endpoint work, where you'll need to specify the GUID of the document e.g. InvoiceID in the API call, you can't do a bulk API call to attach multiple attachments to multiple invoices.

Developer Center: Attachments
 

Welli Abdullah (Xero Staff)