Sign in

Upload invoice attachment

documented

Upload an attachment to an invoice.

POST /Invoices/{InvoiceID}/AttachmentsInvoicesno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://api.xero.com/api.xro/2.0/Invoices/{{$InvoiceID}}/Attachments/{{$FileName}}" \
  -X POST \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "xero-tenant-id: {{XERO_TENANT_ID}}" \
  -H "Accept: application/json" \
  -H "Content-Type: {{AttachmentMimeType}}" \
  -H "Idempotency-Key: {{IDEMPOTENCY_KEY}}" \
  --data-binary @{{$AttachmentPath}} \
  
  # Note: The official Xero Accounting API for uploading invoice attachments uses
  # POST /Invoices/{InvoiceID}/Attachments/{FileName} (with FileName in the path).
  # The endpoint without a FileName ("/Attachments") is not documented in the
  # official API docs. See: createInvoiceAttachmentByFileName (Xero Node SDK) for reference. \
  # References: turn4view0 turn3view0 turn1search5 turn1search3
Upload invoice attachment · Xero · OpenIntegrations