A Stripe and Xero integration

Background


According to Stripe, half of all U.S. internet users have made a payment through a merchant using their services. That translates to billions of dollars in transactions processed and a whole heck of a lot of bank transactions that need to be managed by accounting departments and their software of choice. Xero, the cloud-based accounting system, has 1.2 million subscribers, a large portion of which are also Stripe customers. Although the two companies work together to provide an integration between their software, those of us on the operations and accounting team at niolabs found that this integration just didn’t cut it. It does not include the ability to automatically sync transactions from Stripe to Xero with all of the necessary details included (sales amount, taxes, etc.), nor does the integration automate any journal entry creation resulting from a SaaS transaction, leaving the door open for us to automate these task-based accounting activities using nio.

What are you making using the nio Platform?


Equipped with the nio Platform which enables low-code development (as a Business Analyst with no development background, this is important), I decided to build a service that enhances the existing Xero and Stripe integration - A service that automatically syncs bank transactions between Stripe and Xero and radically improves (almost eliminates!) the dreaded manual journal entry creation process. Without having to deal with that busy work, I focus my efforts elsewhere by learning a new skill, tackling extra work, or basically anything other than uploading spreadsheets and making sure the debits and credits match up.


Difficulty Level


Easy

Build Time


Expert: 30 minutes
Beginner: 1 hour


Why would you use nio create this project?


As an accounting nerd with no development experience, the nio System Designer is my gateway into creating innovative solutions that make my job easier. The System Designer allowed me to utilize nio to alter and act upon signals coming from Stripe and into Xero with minimal help from the development team.

StripeXero service


The StripeXero service displayed above performs several actions that would otherwise be staff-level accountant drudgery - I am sure there are people who like to clean data, upload spreadsheets, and create journal entries, but I have yet to find one of them. When a transaction occurs in Stripe, nio initiates a webhook with the StripeWebHook block, pulling transactional data (total, subtotal, tax amount, customer id, etc.) and sends it to Xero, creating all of the related journal entries that go with a SaaS product transaction. The IsInvoiceCreated block determines whether the associated transaction is a new invoice (invoice.created) that is yet to be paid, or if it is a payment (invoice.paid). Then, the IsAnnual filter block determines whether the transaction is related to an annual or monthly plan. This is important because an annual plan brings SaaS revenue recognition rules in play when we accept payment prior to actually delivering services. Annual transactions are published by the PublishAnnual block to be used in the RevRec service, and monthly transactions trigger the creation of an invoice by the CreateInvoice block. If the transaction coming from Stripe is the payment of an outstanding invoice, the IsInvoiceCreated block sends the signal to the UpdateInvoice block, which marks the existing invoice in Xero as paid.

StripXero Service

Note: The Stripe block establishes a webserver and forwards data from a webhook created within Stripe. The webhook endpoint needs to be created in the Stripe Dashboard and input into the Stripe webhook secret key field in the Stripe block configuration. It is not secure to input your secret key directly within the block configuration, so it is best practice to use an environment variable to do so. On the Xero side, you need to create a developer app, and then input the API Consumer Key from the app into the Xero Consumer Key field of the various Xero block configurations. Again, it is best practice to input this using an environment variable.

RevRec Service

RevRec service


The RevRec service takes care of SaaS revenue recognition journal entries. With the upfront payment of an annual plan, until we deliver the services for the cash received, we cannot recognize that revenue until the services are delivered. As revenue is recognized monthly, the DivideBy12 block divides the annual payment amount from the invoice by 12, and the ReplicateSignal block replicates the new signal (with the “monthly” amount) 12 times. Then, the StaggerSignal block sends one signal at a set interval (the 1st of the month). This way, the RevRecJE block only receives a signal once a month, at which point a journal entry is created to offset the amount of revenue recognized for that month.


Instance Level
Instance Level


What’s next?


As our business grows and new complexities are introduced, i.e. varied payment plans, customer options, promotions, etc., version 2.0 of this service will tackle added complexity.

Another avenue I’d like to explore is incorporating revenue assurance practices within nio block logic. Accounting and consulting firms like PwC, Deloitte and Agility Solutions have built entire consulting practices to help companies guarantee the capture of revenue by finding lost revenue and implementing controls to avoid future losses - Answering the question, “Did we get paid what we thought we would?” A simple idea that is not quite so simple for large, complex business environments. With easily identifiable transactional data already available, using the System Designer to building a service that monitors and acts upon discrepancies based on the controls/parameters put in place would be a simple add-on to these existing services.

According to McKinsey Global Institute’s automation research, there are opportunities to fully automate 43% of finance activities, with significant opportunities for partial automation as well. So, while I have demonstrated one use case and mentioned another, it is evident that finance and accounting function automation is just tipping the iceberg. Task-based, transactional activities will be the first to go, followed by more complex processes with the help of machine learning and other advanced technologies.

Buckle up accounting nerds, things are about to get interesting!


This is just one example of how the nio Platform can help businesses streamline their internal processes.

Want to see what you can build with nio?