Invoicing Automation

Setting up an Invoicing Automation (Accounts Receivable) workflow with Rutter

Introduction

An invoicing automation workflow streamlines the process of creating, sending, and tracking invoices with minimal manual effort. By automating tasks like sending invoices or payment reminders, invoice automation helps businesses reduce errors, save time, and improve cash flow.

This guide shows you the primary steps for setting up invoicing and payment automation using Rutter’s API.

  1. Connect to a business entity’s accounting system using Rutter Link.
  2. Create or link the business entity’s Accounts used for logging Invoices and Invoice Payments.
  3. Create Invoices and link Customers, asset Accounts, Items, and Tracking Categories (Classes, Locations, and Departments).
  4. Upload Attachments to your logged Invoices.
  5. Create and link Invoice Payments and Invoice Credit Memos to Customers and unpaid Invoices.

See the platform coverage and API endpoint support available for Invoice automation.


Connect to the Business Entity's Accounting System

Embed Rutter Link into your application and walk through an end to end business authentication flow in order to create a new Connection. This Connection represents the business accounting system and contains an access_token used to read and write data for that instance.

Make your first connection in minutes

Follow our guide to get up and running

Explore Quickstart

When logging invoices, every invoice must push into an account reflecting the receivable asset. This is an Account of category = 'asset' and account_type = 'accounts_receivable'.

When logging invoice payments, every invoice payment credits the accounts receivable account linked to the invoice and debits the business entity’s cash account.

Usually companies contain an existing accounts receivable account in their chart of accounts for you to link to, although sometimes you may want to create an AR account to reflect invoices that you process only. The GET /accounts and POST /accounts endpoints let you link existing accounts or create new ones if they don’t exist.

Example GET Account API Response Body
1
{
2
"accounts": [
3
{
4
"id": "00000000-0000-0000-0000-000000000000",
5
"platform_id": "12345678",
6
"parent_id": "00000000-0000-0000-0000-000000000000",
7
"account_type": "accounts_receivable",
8
"category": "asset",
9
"status": "active",
10
"balance": 123.45,
11
"currency_code": "USD",
12
"name": "Accounts Receivable",
13
"nominal_code": "1001",
14
//...
15
],
16
"created_at": "2023-01-02T02:34:56.000Z",
17
"updated_at": "2023-01-02T02:34:56.000Z",
18
"last_synced_at": "2023-01-02T02:34:56.000Z",
19
// ...
20
}
21
],
22
// ...
23
}
Example POST Account API Request Body
1
{
2
"account": {
3
"account_type": "accounts_receivable",
4
"currency_code": "USD",
5
"name": "Accounts Receivable",
6
"nominal_code": "1001",
7
// ...
8
}
9
}

Creating a detailed invoice

The POST /invoices endpoint lets you create an invoice. There are a couple of important required and optional components:

  • Debit Account: This is the account being debited in the invoice. This is an Account of category = 'liability' and account_type = 'accounts_receivable'.

  • Customer: This is the customer linked to the bill. The GET /customers and POST /customers endpoints let you create and link customers as you log invoices.

  • Item: Every invoice contains multiple items (either goods or services) that were sold as part of the invoice, each of which credit certain accounts depending on what comprises their cost of goods sold. The GET /items endpoint lets you fetch all items in the business entity’s catalog.

Example POST Invoice API Request Body
1
{
2
"invoice": {
3
"customer_id": "00000000-0000-0000-0000-000000000000",
4
"payment_terms_id": "00000000-0000-0000-0000-000000000000",
5
"due_date": "2023-01-02T02:34:56.000Z",
6
"issue_date": "2023-01-02T02:34:56.000Z",
7
"currency_code": "USD",
8
"document_number": "CUSTINVC-1",
9
"memo": "For a Rutter shirt.",
10
"line_items": [
11
{
12
"total_amount": 12.34,
13
"description": "A Rutter Shirt",
14
"item": {
15
"id": "00000000-0000-0000-0000-000000000000",
16
"quantity": 1,
17
"unit_amount": 12.34
18
}
19
}
20
]
21
}
22
}

Uploading an attachment to a logged invoice

POST /invoices/:id/attachmentslets you upload any supporting documentation in PDF or image format and attach it to the logged invoice.

Example POST Invoice Attachment API Request Body
1
{
2
"file": "multipart/form-data",
3
"file_name": "T-shirt Receipt"
4
}
Example POST Invoice Attachment API Response Body
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
}

Creating and applying invoice payments

To create and link invoice payments, you can use POST /invoice_payments. An Invoice Payment debits an accounts receivable account and credits an asset account.

Example POST Invoice Payment API Request Body
1
{
2
"invoice_payment": {
3
"account_id": "00000000-0000-0000-0000-000000000000",
4
"customer_id": "00000000-0000-0000-0000-000000000000",
5
"payment_method_id": "00000000-0000-0000-0000-000000000000",
6
"txn_date": "2023-01-02T02:34:56.000Z",
7
"currency_code": "USD",
8
"total_amount": 12.34,
9
"memo": "Payment for a shirt.",
10
"linked_invoices": [
11
{
12
"id": "00000000-0000-0000-0000-000000000000",
13
"allocated_at": "2023-01-02T02:34:56.000Z",
14
"amount": 12.34
15
}
16
]
17
}
18
}

Creating and applying invoice credit memos

To create and link invoice credit memos, you can use POST /invoice_credit_memos. An invoice credit memo is linked to a customer object. The invoice credit memo can be created and immediately applied to an invoice, or created unapplied.

Example POST Invoice Credit Memos API Request Body
1
{
2
"invoice_credit_memo": {
3
"account_id": "00000000-0000-0000-0000-000000000000",
4
"customer_id": "00000000-0000-0000-0000-000000000000",
5
"issue_date": "2023-01-02T02:34:56.000Z",
6
"currency_code": "USD",
7
"line_items": [
8
{
9
"account_id": "00000000-0000-0000-0000-000000000000",
10
"description": "Discount for future Rutter shirts.",
11
"total_amount": "3",
12
"item": {
13
"id": "00000000-0000-0000-0000-000000000000",
14
"quantity": 1,
15
"unit_amount": "3"
16
}
17
}
18
]
19
}
20
}