Learn how Monite handles ledger accounts from your accounting system.

Overview

A general ledger (GL) account is a component of an accounting system that is used to record and categorize a company’s financial transactions. Some examples of common ledger accounts are:

  • Expenses: office supplies, utilities, salaries, taxes, and so on,
  • Income: sales and revenue, dividends, and so on,
  • Assets: cash, inventory, and so on,
  • Liabilities: accounts payable, debt, and so on.

Within an accounting system, each line item on an invoice is assigned a ledger account in order to properly categorize various expenses and income sources. In Monite, the ledger_account_id field of products and payable line items is used to assign ledger accounts to business objects.

Products and payables pulled from the accounting system have the ledger_account_id pre-filled. However, when new products and payables are created in Monite, the user must manually specify the ledger_account_id for those objects. This is required for Monite to be able to push invoices (both payables and receivables) to the accounting system.

The typical flow is as follows:

  1. After connecting an entity to an accounting system, wait until the initial data pull is completed.
  2. Call GET /ledger_accounts to get a list of an entity’s general ledgers pulled from the accounting system.
  3. If an entity uses Accounts Payable:
    1. Get the line items of all payables and check if the line items have ledger_account_id.
    2. If any line item is missing a value for ledger_account_id, prompt the user to assign the appropriate ledger account.
  4. If an entity uses Accounts Receivable:
    1. Get all products and check if they have ledger_account_id.
    2. If any product is missing a value for ledger_account_id, prompt the user to assign the appropriate ledger account.

Get ledger accounts

Ledger accounts cannot be created in Monite and can only be pulled from an accounting system.

After connecting to an accounting system, Monite automatically retrieves a list of ledger accounts from there. Once the initial data synchronization has completed, you can call GET /ledger_accounts to get an entity’s ledger accounts that exist in the accounting system:

1curl 'https://api.sandbox.monite.com/v1/ledger_accounts' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN'

Below is an example of ledger account details. Note down the IDs of the ledger accounts - these are the possible values of the ledger_account_id field in products and payable line items.

1{
2 "data": [
3 {
4 "id": "f5f85999-cc35-43e6-93ad-46d22907022a",
5 "currency": "EUR",
6 "current_balance": 0,
7 "description": "Outstanding invoices the company has issued out to the client but has not yet received in cash at balance date.",
8 "is_bank_account": false,
9 "name": "Accounts Receivable",
10 "nominal_code": "610",
11 "status": "Active",
12 "subtype": "Current",
13 "type": "Asset"
14 },
15 {
16 "id": "8ecb60fd-88fd-40e4-8bd9-5fa154435b78",
17 "currency": "EUR",
18 "current_balance": 0,
19 "description": "Income from business activity",
20 "is_bank_account": false,
21 "name": "Sales",
22 "nominal_code": "200",
23 "type": "Income",
24 "status": "Active",
25 "subtype": "Revenue"
26 },
27 ...
28 ],
29 "next_pagination_token": null,
30 "prev_pagination_token": null
31}

Assign ledger accounts to products and payable line items

Before payables can be pushed to an accounting system, each line item in all payables must have the ledger_account_id specified. Similarly, before Account Receivable invoices can be pushed to accounting, all products listed on invoices must have the ledger_account_id specified.

To specify an associated ledger account for a payable line item or a product, PATCH this object and provide the value for ledger_account_id. For example:

1curl -X PATCH 'https://api.sandbox.monite.com/v1/products/51846...39d' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer ACCESS_TOKEN' \
5 -H 'Content-Type: application/json' \
6 -d '{
7 "ledger_account_id": "f5f85999-cc35-43e6-93ad-46d22907022a"
8 }'