General Ledger

1. How it works

As explained in the Accounting API docs, Hurdlr's "Invisible" Double-Entry Accounting is enabled in the background for all users.

When you create a user via the Hurdlr API, and you specify their business type, Hurdlr automatically generates a chart of accounts for that user. As the user takes actions in your product, i.e. they send out invoices, classify expenses, and make tax payments, Hurdlr creates the proper double-entry transactions into the user's General Ledger (GL).

2. What it enables

With a full-fledged General Ledger behind the scenes, and double-entry transactions being created automatically, you can provide your users with robust financial reporting, tax reporting, and tax filings with just a simple network call.

3. Getting the user's GL transactions

Most users will never need to look at a General Ledger. But, if your product serves accountants or bookkeepers, then they may want direct access to the General Ledger. At any time, you can retrieve the user's GL transactions:

curl \
  --request GET \
  --url https://sandbox.hurdlr.com/rest/v5/accounting/generalLedgerEntries \
  --header 'Authorization: Bearer ${access_token}' \
  --header 'Content-Type: application/json' \

The response from GET /generalLedgerEntries contains an array of entries:

{
    "data": [
        {
            "id": "1633478400000_1633531536000_0007661262",
            "sourceTable": "ArInvoiceItem",
            "sourceDisplayName": "INVOICE",
            "sourceDisplayId": "27837",
            "sourceId": "73071",
            "name": "Invoice for James Bond",
            "tranDate": "2021-10-06T00:00:00.000Z",
            "entryDate": "2021-10-06T14:45:36.000Z",
            "transactions": [
                {
                    "id": "7661262",
                    "accountNo": "11500",
                    "accountName": "Accounts Receivable",
                    "drAmount": 100.00,
                    "crAmount": 0.00,
                    "description": "Invoice for James Bond",
                    "accountId": "45907729",
                    "status": "ACTIVE"
                },
                {
                    "id": "7661263",
                    "accountNo": "41000",
                    "accountName": "Services Income",
                    "drAmount": 0.00,
                    "crAmount": 100.00,
                    "description": "Invoice for James Bond",
                    "accountId": "45907765",
                    "status": "ACTIVE"
                }
            ]
        },
        {
            "id": "1633478400000_1633532129000_0007661280",
            "sourceTable": "ArPayment",
            "sourceDisplayName": "INVOICE",
            "sourceDisplayId": "27837",
            "sourceId": "11257",
            "name": "Payment Received",
            "tranDate": "2021-10-06T00:00:00.000Z",
            "entryDate": "2021-10-06T14:55:29.000Z",
            "transactions": [
                {
                    "id": "7661280",
                    "accountNo": "11100",
                    "accountName": "Bank Account Operating",
                    "drAmount": 96.80,
                    "crAmount": 0.00,
                    "description": "Payment Received",
                    "accountId": "45907724",
                    "status": "ACTIVE"
                },
                {
                    "id": "7661281",
                    "accountNo": "11500",
                    "accountName": "Accounts Receivable",
                    "drAmount": 0.00,
                    "crAmount": 100.00,
                    "description": "Payment Received",
                    "accountId": "45907729",
                    "status": "ACTIVE"
                },
                {
                    "id": "7661282",
                    "accountNo": "50050",
                    "accountName": "Merchant Account Fees",
                    "drAmount": 3.20,
                    "crAmount": 0.00,
                    "description": "Payment Received",
                    "accountId": "45907773",
                    "status": "ACTIVE"
                }
            ]
        }
    ],
    "paginatedResponse": {
        "filter": null,
        "year": 2021,
        "offset": 5,
        "totalCount": 5
    }
}

On each entry, you may find the following attributes to be of particular interest:

FieldDescriptionFormat
sourceTableEntity that originated the underlying GL transactionsString
nameDisplayable name describing the entryString
tranDateAccounting date of the underlying GL transactionsyyyy-MM-dd'T'HH:mm:ss.SSSZ
entryDateDate the entry was addedyyyy-MM-dd'T'HH:mm:ss.SSSZ
transactionsList of GL transactionsArray of transaction objects, explained below

For each GL transaction, you may find the following attributes to be of particular interest:

FieldDescriptionFormat
accountNoAccount number, referencing an account in the Chart of AccountsString (of numbers)
accountNameName of the accountString
drAmountAccounting debit amountNumeric, with 2 decimal places
crAmountAccounting credit amountNumeric, with 2 decimal places

4. Adding journal entries

Most GL transactions can be handled by updating expense and income transactions accordingly. But occasionally, there may be an advanced use case where an accountant or bookkeeper wants to make a manual journal entry directly into the General Ledger.

For example, if an owner was infusing $100,000 into their single-owner S-Corporation, then the Paid-in Capital account would need to be increased. Simply look at the user's chart of accounts, and pull out the account number (accountNo) for each account. In this case 11100 corresponds to Bank Account Operating and 35000 corresponds to Paid-in Capital:

curl \
  --request POST \
  --url https://sandbox.hurdlr.com/rest/v5/accounting/journalEntry \
  --header 'Authorization: Bearer ${access_token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "journalEntry": {
      "tranDate": "2021-10-06T04:00:00.000Z",
      "name": "Capital infusion"
      "transactions": [
        {
          "description": "Capital infusion",
          "accountNo": "11100",
          "drAmount": 100000.00,
          "crAmount": 0
        },
        {
          "description": "Capital infusion",
          "accountNo": "35000",
          "drAmount": 0,
          "crAmount": 100000.00
        }
      ],
    }
  }'