Contents

Modern Treasury now supports syncing to both NetSuite and QuickBooks. The transition to supporting multiple accounting systems introduced a variety of technical challenges, as each individual system is unique. This post will be an overview of the approach we took and the lessons we learned.

Overview

Accounting systems such as NetSuite and QuickBooks are used by millions of businesses to keep track of finances, manage inventory, and more. We’ve described the role they play in this post

Complexity in supporting multiple accounting systems stems from the uniqueness of each individual system. We refer to objects in accounting systems as resources. Examples of resources are customers, vendors, accounts, and transactions. 

There are three challenges we encountered in the process of adding Netsuite. The first challenge is that the resources available to developers differ across accounting systems. For example, QuickBooks has a single Deposit resource but NetSuite has both Deposit and CustomerDeposit resources. Even when the same resource exists across accounting systems, a resource for a given system may have different attributes from its counterparts in other systems. Finally, there is varying support for operations we can perform on a resource, such as creation or deletion. A pronounced example of this is in QuickBooks, where an account resource cannot be deleted. 

Accounting software systems typically support the concepts of vendors and customers. We have built support for these objects into LedgerSync, our open-sourced ledger-connector library. LedgerSync tries to remain “unopinionated” about accounting systems, giving developers the freedom to choose the most suitable resources to use for their use-case. The goal of the library is to have resources, attributes, and operations that match as closely to the API as possible.

Imagine you run Modern Brinery, a gourmet pickle vendor, and you need to sync your supplier Sonoma Salt to both NetSuite and QuickBooks. In Modern Treasury, a counterparty is an entity outside of your organization that you want to send or receive money from. A counterparty can be an individual or a business. Here is a simplified counterparty object for Sonoma Salt:

{
  "id": "928db55e-6552-4aaf-96d7-10c693922b1f",
  "name": "Sonoma Salt",
  "email": "salt@sonomasalt.com"
}


Approach #1 Creating Resources Directly

Our first approach will be to create the LedgerSync resources directly and then perform an operation that will create a vendor object in our desired accounting system. Here's how that looks for QuickBooks:

vendor = LedgerSync::Ledgers::QuickBooks::Vendor.new(
external_id: counterparty.id,
display_name: counterparty.name,
email: counterparty.email
)
# client is an authenticated LedgerSync client
quickbooks_online_client.operation_for(method: :create, resource: vendor).perform


And for NetSuite:

vendor = LedgerSync::Ledgers::NetSuite::Vendor.new(
external_id: counterparty.id,
company_name: counterparty.name,
email: counterparty.email
)
netsuite_client.operation_for(method: :create, resource: vendor).perform

The issue with this approach is that it requires a developer to have system-specific knowledge for every interaction with LedgerSync or to define a new resource, operation, and validation layers entirely. 

Approach #2 Using LedgerSync Converters

To handle more complex resources, we built a resource converter class into LedgerSync. We can use this utility class to convert our counterparty into a LedgerSync resource.

Here's what a converter class looks like for a QuickBooks Vendor:

module QuickBooks
  class VendorExporter < LedgerSync::Util::ResourceConverter
    attribute :external_id, source_attribute: :id
    attribute :display_name, source_attribute: :name
    attribute :email
  end
end

And for a NetSuite Vendor:

module NetSuite
  class VendorExporter < LedgerSync::Util::ResourceConverter
    attribute :external_id, source_attribute: :id
    attribute :company_name, source_attribute: :name
    attribute :email
  end
end


And here's how we call them:

# QuickBooks
quickbooks_online_vendor = LedgerSync::Ledgers::QuickBooks::Vendor.new()
vendor = QuickBooks::VendorExporter.new.convert(source: counterparty, destination: quickbooks_online_vendor)

# NetSuite
ns_vendor = LedgerSync::Ledgers::NetSuite::Vendor.new()
vendor = NetSuite::VendorExporter.new.convert(source: counterparty, destination: ns_vendor)

# To sync to the ledger
client.operation_for(method: :create, resource: vendor).perform


Converters simplify operations by providing a common interface across ledgers and are especially useful for more complex objects with many references. 

Ledger integrations at Modern Treasury have been built to exclusively use converters. This scalable approach means we can add additional ledger integrations faster and provide more granular configuration options for our customers. 

Summary 

Moving to a new ERP system doesn’t have to be difficult. Our aim is to make shipping payments data to any ERP easy and seamless. If you’re interested in learning how your company can use Modern Treasury, please reach out.

References

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.