Synchronize expenses
Automate classification and synchronization of expenses between your application and your customer’s preferred accounting service
Authorize end user
Your customer must first authorize your application to access their accounting service (e.g., Xero, Lexware Office, Sevdesk) via the respective authentication mechanism (e.g., OAuth2, API key) through maesn Connect.
Compile chart of accounts
Implement the following logic in your application to retrieve customers’ account data:
- Call the GET /accounts endpoint to fetch the accounts from your customer’s accounting system.
- Present your customer’s chart of accounts in your frontend, using fields like
classification
(e.g., ASSET, EQUITY, EXPENSE, LIABILITY, REVENUE) to group the accounts,parentAccount
to visualize the hierarchical relationships in your customers General Ledger (GL), etc. - Do not forget to call GET /accounts with regular intervals to keep track of any updates to your customer’s chart of accounts.
Synchronize contacts
Follow the steps outlined in the synchronize contacts use case to synchronize suppliers in your system with your customer’s accounting system.
Fetch tracking categories
If your customer has classes, locations, or departments configured, you can retrieve them from the accounting service with GET /trackingCategories.
Setup categorization rules
Presenting the data retrieved in the previous steps in your frontend, enable your customer to configure rules for categorizing the expenses that will be synchronized to the accounting system. The business logic will depend on your application, but bear in mind that:
- If your customer only wants to synchronize their expenses against one single GL account, a simple dropdown menu to select the account may be sufficient.
- Customers may want to categorize expenses based on conditional logic, such as “if Department = IT, use Account A”. This will require more from your UI!
- You may want to give your customers the possibility to categorize the transaction at the time when they synchronize it to their accounting service, which would imply that no categorization is required in the configuration or that it is possible to override the configuration.
Synchronize expenses
Whenever your customer incurs spend-related transactions in your application, e.g., credit card transactions or travel expenses, you can synchronize the transactions to your customer’s Accounting system with the correct classification via the POST /transactions endpoint. It is up to your application whether these transactions should be synchronized automatically or require an end user to manually export the expenses from within your application.
Keep your data fresh
After fetching data initially, you should make sure to keep your customer’s data up to date by regularly retrieving data from the maesn API and looking for changes. The lastModified
query parameter can be utilized on all our GET endpoints to save you the hassle of creating deltas to detect change. See our guide to keeping data fresh for more information!
Was this page helpful?