{"id":"336a95a0-12b9-4efb-ae0f-fce6b3b53060","task":"Attach files to Xero invoices using the Files API and manage invoice-level attachments","domain":"developer.xero.com","steps":["Obtain an access token with the files scope in addition to the standard accounting scope","Upload a file to the Xero Files API by POSTing multipart form data to the Files endpoint, receiving a FileId in the response","Associate the uploaded file with an Invoice by POSTing to the Associations endpoint with the FileId and the Invoice's Xero entity ID and entity type","Alternatively, upload directly as an attachment via the Accounting API Attachments sub-resource by PUTting binary content with the correct Content-Type header and a filename in the URL path","List attachments on an Invoice by GETting the Attachments sub-resource for that Invoice ID","Delete an attachment by sending a DELETE request to the Attachments sub-resource with the specific AttachmentID"],"gotchas":["The Xero Files API and the Accounting API Attachments endpoint are separate systems with different attachment IDs; records created via one are not automatically visible via the other","File size limits apply per attachment and per organization; exceeding the limit returns an error, and the limit may vary by Xero subscription tier","Attachments on voided or deleted invoices may still be accessible via the API but cannot be modified; always check invoice status before attempting attachment operations"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:26.736Z"},"url":"https://mcp.waymark.network/r/336a95a0-12b9-4efb-ae0f-fce6b3b53060"}