> ## Documentation Index
> Fetch the complete documentation index at: https://integrations.docs.commenda.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Expense Management

> Automate your customers' expense reconciliation with their respective accounting systems.

***

## Introduction

This comprehensive guide is designed to help Expense Management companies automate their customers' expense reconciliation with their respective accounting systems using RootFi' Unified Accounting API.

***

## Need for Accounting Integrations

Automation transforms how your expense management product handles your business customers' expenses by simplifying the expense collection, verification, and approval process. The challenge arises when you need to connect to different customers' accounting platforms to automate expense reconciliation.

Accounting integrations bridge the data gap between your product and your customers' accounting systems. While these integrations are crucial, building and maintaining multiple integrations in-house is time-consuming, expensive, and resource-intensive.

***

## Benefits of RootFi' Unified Accounting API

RootFi' Unified API offers a more efficient approach by allowing you to leverage one API to integrate with multiple accounting platforms. The benefits include:

1. **Global Connectivity**: Simplifies integration with multiple accounting platforms, ensuring maximum coverage for current and future customers.
2. **Accelerated Go-to-Market**: Integrating with one Unified API significantly cuts down the time required to build, test, and launch an integrated product.
3. **Cost Savings**: Lowers the overall cost of developing and maintaining integrations, allowing resources to focus on core product development.
4. **Maintenance Ease**: Offloads integration maintenance responsibilities, allowing your team to focus on core product enhancement.

Partnering with RootFi can accelerate your time to market and enhance your product's value to your customers, thereby increasing customer satisfaction, product appeal, and revenue potential.

***

This workflow can be used for the following types of accounts:

* Pre-Paid Cards
* Credit Cards
* Debit Cards

***

<Steps titleSize="h2">
  <Step title="Connect with your customers' accounting platform (One-Time Activity)" titleSize="h2" stepNumber="1">
    RootFi provides two convenient options to connect with your customers’ accounting platform:

    Use RootFi’ Connect Link, a convenient and secure URL, **or**
    Embed RootFi’ Connect SDK into your application
    The Invite Link requires no code to use, making it suitable to get started without a developer. You can customize and white-label this onboarding process with RootFi’ Connect SDK, allowing authentication to occur natively in your product.

    Either way, your customers will be guided through a simple authorization flow to connect their respective accounting platforms to your product.

    Use our Dashboard or APIs to connect a customer’s accounting platform a. Use the POST/invite-link. b. Name your customers’ company.
    A unique `company_id` will be generated once your customer completes the authentication flow. This `company_id` will be used to read and write data to their accounting platform.

    ***
  </Step>

  <Step title="Link or Create your customer's credit card or bank account (One-Time Activity)" titleSize="h2" stepNumber="2">
    Every expense transaction must have an **Account** as a source of funds that is credited.

    <Tabs>
      <Tab title="For Pre-Paid / Debit Cards">
        This is a Bank Account with a **category = 'Bank'**

        1. Use [GET/bank\_accounts](/api-reference/v3/accounting/bank-accounts/get-all-bank-accounts) to get the **Bank Account ID** if the account already exists in the customer's accounting platform, **or**
        2. Use [POST/bank\_accounts](/api-reference/v3/accounting/bank-accounts/create-bank-accounts) to create a bank account and get the **Bank Account ID**.
      </Tab>

      <Tab title="For Credit / Debit Cards">
        This is an Account with a **category = 'Liability'**

        1. Use [GET/accounts](/api-reference/v3/accounting/accounts/get-all-accounts) to get the **Account ID** if the account already exists in the customer's accounting platform.
           **OR**
        2. Use [POST/accounts](/api-reference/v3/accounting/accounts/create-accounts) to create an Account and get the **Account ID**.
      </Tab>
    </Tabs>

    ***
  </Step>

  <Step title="Create Expenses (Recurring)" titleSize="h2" stepNumber="3">
    Generally, use the [POST/expenses](/api-reference/v3/accounting/expenses/create-expenses) to create expenses.

    <Note> If Expenses are unavailable for a particular accounting platform like Xero and Tally, use the [POST/bills](/api-reference/v3/accounting/bills/create-bills) or [POST/journal\_entries](/api-reference/v3/accounting/journal-entries/create-journal-entries). </Note>

    Essential points to note:

    1. **Credit Account**: The account from which funds are drawn. Refer to Step 2 for more information.
    2. **Vendor**: The employee linked to the expense. Use the [GET/contacts](/api-reference/v3/accounting/contacts/get-all-contacts) and [POST/contacts](/api-reference/v3/accounting/contacts/create-contacts) and filter on type = `vendor`. A **Contact ID** is required to post an Expense or Bill. If the employee doesn't exist on the accounting platform, create a new vendor using the [POST/contacts](/api-reference/v3/accounting/contacts/create-contacts).
    3. **Expense Account or Debited Account**: You can push multiple line items (usually just 1) when pushing an expense. Each line item will have an expense **account** associated (category = `expense`). Use the [GET/accounts](/api-reference/v3/accounting/accounts/get-all-accounts) to fetch all accounts, and filter the account type by **category = `expense`** through Postman or GraphQL.

    ***
  </Step>

  <Step title="Upload Documents (Recurring)" titleSize="h2" stepNumber="4">
    Use the [POST/documents](/api-reference/v3/accounting/documents/create-documents) to upload and attach files from a customer's employee to an expense, invoice, or bill.

    ***
  </Step>

  <Step title="Record a Credit Card Repayment (Recurring)" titleSize="h2" stepNumber="5">
    Use the [POST/journal\_entries](/api-reference/v3/accounting/journal-entries/create-journal-entries) to reflect a credit card repayment.

    1. **Credited Account**: The bank account used to make the repayment.
    2. **Contact**: In this case, it will be the expense management company (your company).
    3. **Debited Account**: The credit card liability account.

    ***
  </Step>

  <Step title="Process Bank Account Withdrawals or Top Ups for Pre-Paid Cards (Recurring)" titleSize="h2" stepNumber="6">
    Use [POST/journal\_entries](/api-reference/v3/accounting/journal-entries/create-journal-entries) to reflect withdrawals and top-ups for a bank account/prepaid card.

    1. **Credited Account**: The bank account used to make the top-up.
    2. **Debited Account**: The account being topped up (pre-paid asset or bank account).

    ***
  </Step>

  <Step title="Process Employee Reimbursement Requests and Payments (Recurring)" titleSize="h2" stepNumber="7">
    Employee reimbursement requests and reimbursement payments are reflected in the accounting system as **Bills** and **Bill Payments**.

    1. To log a reimbursement request, use [POST/bills](/api-reference/v3/accounting/bills/create-bills) to create a bill containing the reimbursement amount.
       * Use [POST/contacts](/api-reference/v3/accounting/contacts/create-contacts) (filter on type = 'vendor') to create a specific vendor per employee you link to the Bill.
    2. Once the reimbursement is approved and the payment is made, use the [POST/bill\_payments](/api-reference/v3/accounting/bill-payments/create-bill-payments) to log a payment against the requested reimbursement.

    ***
  </Step>
</Steps>

## Conclusion

This detailed guide outlines how to manage the most common actions of an expense management product with RootFi' accounting integrations. If you have more questions or would like to build an automated expense management product with RootFi' Unified APIs, contact RootFi' integration experts for assistance in getting started.

***
