The Attachment object
A Rutter Attachment represents a file that can be attached to other accounting entities (e.g. bills, bill payments, invoices, expenses, etc.) owned by a business entity. Note: Rutter currently supports bills and expenses as the entity type of an attachment.
Properties
id
stringThe Rutter generated unique ID of the attachment.
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.
{
"id": "00000000-0000-0000-0000-000000000000",
"platform_id": "12345678",
"attached_to_id": "00000000-0000-0000-0000-000000000000",
"file_name": "receipt.jpg",
"file_url": "https://rutteraccountingattachments.s3.amazonaws.com/00000000-0000-0000-0000-000000000000-receipt.jpg",
"attached_to_type": "EXPENSE",
"created_at": "2023-01-02T02:34:56.000Z"
}
List Attachments
GET /accounting/:entityType/attachmentsRequest Parameters
entityType
enumpathThe entity type of the attachment.
access_token
stringqueryThe access token of the connection.
cursor
stringoptionalqueryThe cursor to use for pagination. This value is passed in from next_cursor
field in a previous request.
expand
enumoptionalqueryUsed to request inclusion of optional objects.
force_fetch
enumoptionalqueryForce a response even if the underlying connection hasn't finished the initial sync.
limit
integeroptionalqueryThe limit on the number of entities returned.
updated_at_max
integeroptionalqueryThe Unix Timestamp in milliseconds maximum updated_at datetime to fetch entities from.
updated_at_min
integeroptionalqueryThe Unix Timestamp in milliseconds minimum updated_at datetime to fetch entities from.
Response Body
attachments
arrayattachments
attributesnext_cursor
stringnullable{
"attachments": [
{
"id": "00000000-0000-0000-0000-000000000000",
"platform_id": "12345678",
"attached_to_id": "00000000-0000-0000-0000-000000000000",
"file_name": "receipt.jpg",
"file_url": "https://rutteraccountingattachments.s3.amazonaws.com/00000000-0000-0000-0000-000000000000-receipt.jpg",
"attached_to_type": "EXPENSE",
"created_at": "2023-01-02T02:34:56.000Z"
}
],
"next_cursor": "MTY3NDgzMTk0Ml82MDY4ZDI0ZC02NGRmLTRmN2EtYTM0Ny0zN2ZmNjY5MGVmMjU="
}
Fetch an Attachment
GET /accounting/:entityType/attachments/:idRequest Parameters
entityType
enumpathThe entity type of the attachment.
id
stringpathThe Rutter generated unique ID of the underlying entity type.
access_token
stringqueryThe access token of the connection.
force_fetch
enumoptionalqueryForce a response even if the underlying connection hasn't finished the initial sync.
Response Body
attachment
objectattachment
attributesCreate an Attachment
POST /accounting/:entityType/:id/attachmentsFor this endpoint, the request body is not application/json, it is multipart/form-data.
Request Parameters
entityType
enumpathThe entity type of the attachment.
id
stringpathThe Rutter generated unique ID of the underlying entity type.
access_token
stringqueryThe 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 Body
Any of:
attachment
objectattachment
attributesasync_response
objectoptionalasync_response
attributeserrors
arrayoptionalerrors
attributes{
"file": "multipart/form-data",
"file_name": "T-shirt Receipt"
}
{
"attachment": {
"id": "00000000-0000-0000-0000-000000000000",
"platform_id": "12345678",
"attached_to_id": "00000000-0000-0000-0000-000000000000",
"file_name": "receipt.jpg",
"file_url": "https://rutteraccountingattachments.s3.amazonaws.com/00000000-0000-0000-0000-000000000000-receipt.jpg",
"attached_to_type": "EXPENSE",
"created_at": "2023-01-02T02:34:56.000Z"
}
}
Platform Differences
There can be some differences in functionality due to platform-specific limitations.
Netsuite
Currently only entityType expenses is supported.
- We will provide GET /:entityType/attachments data only for attachments that have been created through our POST endpoint.
- For POSTs, we will programmatically create a folder in the end user’s Netsuite instance titled “Upload Attachments (DO NOT DELETE)”— tell your 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.