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
Attachments for Adjustment
and Transfer
transaction types are not supported for any integrations.
Integration | File size | File extension | Supported transaction type |
---|---|---|---|
Xero | 3 MB | 7Z, 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, ZIP | All supported types |
QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | ReimbursableExpenses , ExpensePayment , ExpenseRefund |
NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | ExpensePayment , ExpenseRefund |
Dynamics 365 Business Central | 350 MB | No explicit requirements outlined for text, image, and video files. | All supported types |
QuickBooks Desktop | NA | Does not support attachment upload | N/A |
FreeAgent | 5MB | PNG, 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
-
In the request setup, select Body, then form-data.
-
Click in the first KEY row, then select File from the File list.
-
In the corresponding VALUE field, click Select Files and choose the file you wish to attach.
-
Manually type the file name and extension in the KEY field.
-
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.
Read next
- Try Sync for Expenses in our interactive API reference