What is Accounts Payable? A Beancount-Friendly Guide for Tracking Vendor Bills in Plain Text
Accounts payable (AP) is the money your business owes to its suppliers for goods or services you’ve already received but haven't paid for yet. In the world of accounting, AP is classified as a current liability on your balance sheet—an amount typically due within the next year, and often within 30 to 60 days.
This concept is central to accrual accounting, where you record the expense and the corresponding liability the moment a bill arrives, not when you actually send the cash. This guide will show you how to manage the entire AP workflow cleanly and efficiently using the plain-text accounting tool, Beancount.
Quick Summary
Before we dive into the details, let's cover the essentials:
- Accounts Payable (AP) represents your short-term debts to vendors. You'll find it under the
Liabilitiessection of your balance sheet. - Accrual vs. Cash: AP is a concept that exists only if you keep your books on an accrual basis. Beancount fully supports accrual workflows, and its web interface, Fava, will display your liabilities correctly.
- AP vs. AR: It's simple: Payables are what you owe, while Receivables (AR) are what others owe you.
Where AP Lives in Beancount (and Fava)
To start tracking AP, you first need to declare an account for it in your ledger. A standard convention is:
Liabilities:AccountsPayable
You can optionally create subaccounts for major vendors (e.g., Liabilities:AccountsPayable:ForestPaintSupply).
In Fava, this account will appear on your Balance Sheet under Liabilities. You can click on it to drill down and see a list of all open and paid items, giving you a clear view of your obligations. You can even see this in action in Fava's public example ledger, which includes a Liabilities:AccountsPayable account.
Beancount Building Blocks You’ll Use
A robust AP workflow in Beancount relies on a few core features:
- Accounts: You'll primarily use your
Liabilities:AccountsPayableaccount, a cash account likeAssets:Bank:Checking, and your various expense accounts (e.g.,Expenses:Supplies). - Metadata: You can attach key-value data to any transaction. For AP, you'll use metadata like
invoice:,due:,terms:, anddocument:. Fava even recognizes thedocument:key and will automatically create a clickable link to the attached file if you configure a documents folder. - Tags & Links: Use
#tags(like#ap) for easy filtering and^links(like^INV-10455) to programmatically tie a bill and its subsequent payment together. This creates a clear, auditable trail. - Queries (BQL): Beancount's SQL-like query language (BQL) allows you to run powerful reports, like listing all open payables sorted by due date, directly from the command line with
bean-queryor on Fava's "Query" page.
Core AP Workflow in Beancount
Managing AP in your ledger involves two or three key steps: recording the bill, paying it, and sometimes handling partial payments or discounts.
1) Record the Vendor Bill (This Creates the Liability)
First, you book the expense and create the payable when the invoice arrives.
; Optionally set your documents folder in your main Beancount file:
option "documents" "documents"
2025-08-05 * "Forest Paint Supply" "Paint order INV-10455" ^INV-10455 #ap
invoice: "INV-10455"
due: "2025-09-04"
terms: "2/10, n/30"
document: "invoices/2025-08-05-forest-paint-INV-10455.pdf"
Expenses:Supplies:Paint 500.00 USD
Liabilities:AccountsPayable -500.00 USD
This single entry accomplishes two critical things:
- It immediately recognizes the $500 expense in the correct period (August).
- It creates a corresponding $500 liability, showing that you owe money to Forest Paint Supply.
The ^INV-10455 link is a unique identifier that lets you attach the same link to the payment later, keeping the bill and payment transactions logically connected.
2) Pay the Bill (This Clears the Liability)
When you pay the invoice, you create a transaction that moves money from your bank account to clear the liability.
a) Standard Payment (No Discount):
2025-09-01 * "Forest Paint Supply" "Payment INV-10455" ^INV-10455
Liabilities:AccountsPayable 500.00 USD
Assets:Bank:Checking -500.00 USD
This entry reduces your AP balance by $500 and your checking account balance by the same amount. The liability is now cleared.
b) Early-Payment Discount (e.g., "2/10, n/30"):
If the terms are "2/10, n/30", you can take a 2% discount if you pay within 10 days. For our