The Attachment object

A Rutter Invoice Attachment represents a file that can be attached to an invoice. 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.

Xero:

  • We provide historical attachments that were created outside of our API.

Properties

idstring

The Rutter generated unique ID of the attachment.

platform_idstring

The platform specific ID of the attachment.

attached_to_idstringnullable

The Rutter ID of the entity linked to the attachment.

file_namestring

The file name of the attachment.

file_urlstring

The Rutter generated URL containing a downloadable version of the attachment.

attached_to_typestringnullable

The type of entity linked to the attachment.

created_atstring

The ISO 8601 timestamp that the attachment was created.

Example Attachment Object
{
  "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 Invoice Attachments

GET /accounting/invoices/attachments
Supported for: NetSuiteQuickBooksXero

Request Parameters

    access_tokenstringquery

    The access token of the connection.

    attached_to_idstringoptionalquery

    The ID of the entity that the attachment is attached to.

    cursorstringoptionalquery

    The cursor to use for pagination. This value is passed in from next_cursor field in a previous request.

    expandenumoptionalquery

    Used to request inclusion of optional objects.

    Can beplatform_data.
    force_fetchenumoptionalquery

    Force a response even if the underlying connection hasn't finished the initial sync.

    One oftrue or false.
    limitintegeroptionalquery

    The limit on the number of entities returned.

    updated_at_maxintegeroptionalquery

    Unix Timestamp in milliseconds representing the maximum updated_at datetime to fetch entities from.

    updated_at_minintegeroptionalquery

    Unix Timestamp in milliseconds representing the minimum updated_at datetime to fetch entities from.

Response Body

    attachmentsarray
    Show attachments attributes
    next_cursorstringnullable
Example Response Body
{
  "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 Invoice Attachment

GET /accounting/invoices/attachments/:id
Supported for: NetSuiteQuickBooksXero

Request Parameters

    idstringpath

    The Rutter generated unique ID of the attachment.

    access_tokenstringquery

    The access token of the connection.

    force_fetchenumoptionalquery

    Force a response even if the underlying connection hasn't finished the initial sync.

    One oftrue or false.

Response Body

    attachmentobject
    Show attachment attributes

Create an Invoice Attachment

POST /accounting/invoices/:id/attachments
Supported for: NetSuiteQuickBooks

For this endpoint, the request body is not application/json, it is multipart/form-data.

Request Parameters

    idstringpath

    The Rutter generated unique ID of the underlying entity type.

    access_tokenstringquery

    The access token of the connection.

Request Body

    filestring

    The file content (PDF, JPG, CSV, TXT, etc).

    file_namestring

    The file name of the attachment.

Response Body

    Any of:

    attachmentobject
    Show attachment attributes
    async_responseobjectoptional
    Show async_response attributes
    errorsarrayoptional
    Show errors attributes
Example Request Body
{
  "file": "multipart/form-data",
  "file_name": "T-shirt Receipt"
}
Example Response Body
{
  "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"
  }
}
Previous
Invoices