Skip to main content

Upload receipts as attachments

Attach receipts to a transaction for a complete audit trail

Upload attachments

When creating an expense or transfers transaction, your SMB customer may want to save a copy of the associated receipt in their accounting software.

Use the Upload attachment endpoint to attach one or multiple files to the transaction, relating them via its transactionId. The endpoint accepts attachments as multipart form data and writes them synchronously.

POST https://api.codat.io/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments
Content-Type: multipart/form-data; boundary=yourBoundaryString

--yourBoundaryString
Content-Type: application/json
Content-Disposition: form-data; name="yourFileMetaData"

{ "includeWhenSent": false }

--yourBoundaryString
Content-Type: application/octet-stream
Content-Disposition: form-data; name="yourFileData"; filename="TEST_SEND_FILE.txt"

--yourBoundaryString--

File size and format support

Exceptions

Attachments for Adjustment and Transfer transaction types are not supported for any integrations.

IntegrationFile sizeFile extensionSupported transaction type
Xero3 MB7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIPAll supported types
QuickBooks Online100 MBAI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XMLReimbursableExpenses, ExpensePayment, ExpenseRefund
NetSuite100 MBBMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIPExpensePayment, ExpenseRefund
Dynamics 365 Business Central350 MBNo explicit requirements outlined for text, image, and video files.All supported types
QuickBooks DesktopNADoes not support attachment uploadN/A
FreeAgent5MBPNG, X-PNG, JPEG, PJG, GIF, X-PDF

Attach a receipt using Postman

If you are using Postman to attach files, there are additional steps you need to complete.

Perform a POST request to the Upload attachment endpoint (review our example here):

POST https://api.codat.io/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments
  1. In the request setup, select Body, then form-data.

  2. Click in the first KEY row, then select File from the File list.

  3. In the corresponding VALUE field, click Select Files and choose the file you wish to attach.

  4. Manually type the file name and extension in the KEY field.

  5. Press Send to make the request.

Update attachments

If your user wants to update any of the attached documents, they should delete the existing attachment directly in the accounting software first.

Then, they can attach the correct document using the Upload attachment endpoint.

Alternatively, the user can upload the correct file directly to the accounting software.



Was this page useful?
👏
👍
🤔
👎
😭