Expense Attachments
The Attachment Object
A Rutter Expense Attachment represents a file that can be attached to an expense. In general we provide attachments data only for attachments that have been created through our POST endpoint. However, there are some platform specific differences.
Platform Differences
Netsuite:
- For POSTs, we will programmatically create a folder in the end user’s Netsuite instance titled “Upload Attachments (DO NOT DELETE)”— please notify the end user not to delete this folder, as all attachments uploaded through our API will be stored here.
- There is a 1:1 relationship for attachments and entities. If you would like the same attachment to be attached to multiple different entities (ie the same receipt attached to a bill and an expense), please make multiple POSTs and we will create duplicates of the file content in the “Upload Attachments (DO NOT DELETE)” folder. The Rutter Id’s and links to download file content will be unique.
Properties
id
stringThe Rutter ID of the attachment. This can be the same as the Platform ID. This ID is not guaranteed to be unique across all attachment objects for a connection.
platform_id
stringThe platform specific ID of the attachment.
attached_to_id
stringnullableThe Rutter ID of the entity linked to the attachment.
file_name
stringThe file name of the attachment.
file_url
stringThe Rutter generated URL containing a downloadable version of the attachment.
attached_to_type
stringnullableThe type of entity linked to the attachment.
created_at
stringThe ISO 8601 timestamp that the attachment was created.
Note: The following platforms dont't support this field, and may return an empty string:
- Xero
List Expense Attachments
Request Parameters
access_token
stringqueryRequiredThe access token of the connection.
attached_to_id
stringqueryOptionalThe ID of the entity that the attachment is attached to.
cursor
stringqueryOptionalUsed to paginate to the next batch of objects. Should be a copy of the next_cursor
value from the previous response.
limit
integerqueryOptionalUsed to limit the number of returned objects. Defaults to 50.
expand
enumqueryOptionalInclude platform specific data (includes additional fields not provided by the Rutter object).
updated_at_max
integerqueryOptionalUsed to filter objects with a updated_at
value less than or equal to the supplied value. Should be a Unix time in milliseconds.
updated_at_min
integerqueryOptionalUsed to filter objects with a updated_at
value greater than or equal to the supplied value. Should be a Unix time in milliseconds.
force_fetch
enumqueryOptionalUsed to force a response even if the underlying connection has not finished its initial sync.
Response Body
- QuickBooks
- Xero
- NetSuite
- Zoho Books
1{
2 "attachments": [
3 {
4 "id": "00000000-0000-0000-0000-000000000000",
5 "platform_id": "12345678",
6 "attached_to_id": "00000000-0000-0000-0000-000000000000",
7 "file_name": "receipt.jpg",
8 "file_url": "https://rutteraccountingattachments.s3.amazonaws.com/00000000-0000-0000-0000-000000000000-receipt.jpg",
9 "attached_to_type": "EXPENSE",
10 "created_at": "2023-01-02T02:34:56.000Z"
11 }
12 ],
13 "next_cursor": "MTY3NDgzMTk0Ml82MDY4ZDI0ZC02NGRmLTRmN2EtYTM0Ny0zN2ZmNjY5MGVmMjU="
14}
Fetch an Expense Attachment
Request Parameters
id
stringpathRequiredThe Rutter generated unique ID of the attachment.
access_token
stringqueryRequiredThe access token of the connection.
force_fetch
enumqueryOptionalUsed to force a response even if the underlying connection has not finished its initial sync.
Response Body
- QuickBooks
- Xero
- NetSuite
- Zoho Books
List Attachments for an Expense
Request Parameters
id
stringpathRequiredThe Rutter generated unique ID of the object that has the attachment.
access_token
stringqueryRequiredThe access token of the connection.
force_fetch
enumqueryOptionalUsed to force a response even if the underlying connection has not finished its initial sync.
Response Body
- QuickBooks
- NetSuite
- Zoho Books
- Dynamics 365 Business Central
1{
2 "attachments": [
3 {
4 "id": "00000000-0000-0000-0000-000000000000",
5 "platform_id": "12345678",
6 "attached_to_id": "00000000-0000-0000-0000-000000000000",
7 "file_name": "attachment.pdf",
8 "file_url": "/accounting/expenses/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000/file",
9 "attached_to_type": "EXPENSE",
10 "created_at": "2023-01-02T02:34:56.000Z"
11 }
12 ]
13}
Download an Expense Attachment
Request Parameters
id
stringpathRequiredThe Rutter generated unique ID of the object that has the attachment.
attachmentId
stringpathRequiredThe platform unique ID of the attachment.
access_token
stringqueryRequiredThe access token of the connection.
force_fetch
enumqueryOptionalUsed to force a response even if the underlying connection has not finished its initial sync.
Response Body
- QuickBooks
- NetSuite
- Zoho Books
- Dynamics 365 Business Central
Create an Expense Attachment
For this endpoint, the request body is not application/json, it is multipart/form-data.
Request Parameters
id
stringpathRequiredThe Rutter generated unique ID of the underlying entity type.
access_token
stringqueryRequiredThe access token of the connection.
Request Body
file
stringThe file content (PDF, JPG, CSV, TXT, etc).
file_name
stringThe file name of the attachment.
response_mode
enumOptionalThe response mode for our async endpoints. prefer_sync
allows calling the API in a best-effort, synchronous fashion and wait for the response. If this takes too long we will instead return the asynchronous response. This is the default behavior. async
makes the API respond with the asynchronous response. See Asynchronous Operations.
Response Body
- QuickBooks
- Xero
- NetSuite
- Zoho Books
1{
2 "file": "multipart/form-data",
3 "file_name": "T-shirt Receipt"
4}
1{
2 "attachment": {
3 "id": "00000000-0000-0000-0000-000000000000",
4 "platform_id": "12345678",
5 "attached_to_id": "00000000-0000-0000-0000-000000000000",
6 "file_name": "receipt.jpg",
7 "file_url": "https://rutteraccountingattachments.s3.amazonaws.com/00000000-0000-0000-0000-000000000000-receipt.jpg",
8 "attached_to_type": "EXPENSE",
9 "created_at": "2023-01-02T02:34:56.000Z"
10 }
11}
Have questions?
Contact support for personalized guidance.