Step 1
Authenticate first
Start with `GET /api/v1/auth/check` from server-side code.
API Recipes
Use these server-side integration patterns to wire customers, invoices, payments, vendors, bills, documents, reports, settings, events, and error handling into your app. Examples use fake placeholders and are implementation guidance, not production approval.
Quickstart Order
Step 1
Start with `GET /api/v1/auth/check` from server-side code.
Step 2
Use the read-only starter and API Reference to verify setup.
Step 3
Use opt-in workflow scripts with fake data and a non-placeholder `ll_test_` key.
Step 4
Review whether the call stays operational, posts a journal, or updates a report.
Pick By Workflow
If you are not sure which group applies, start with Build with AI to generate a setup plan and then return here for exact endpoint details.
Customers, estimates, invoices, payments, and A/R readback.
Vendors, bills, vendor payments, A/P, and 1099 support.
Evidence files, document links, shares, renders, and private downloads.
Webhooks, events, errors, test/live separation, and safe retries.
Create a customer, create and post an invoice, record a payment, and read the Accounts Receivable summary.
Create a customer, create an estimate, convert it to an invoice, post the invoice, record trusted payment confirmation, and read reports.
Create an estimate, move it through status, convert it to a draft invoice, and post the invoice separately.
Create a vendor, create and post a bill, create and post a vendor payment, and read the Accounts Payable summary.
Upload, list, link, and archive private evidence files through server-routed APIs.
Read summary, A/R, A/P, and 1099 support reports after posting workflows run.
Read connected-app capabilities and update safe document branding or defaults through public APIs.
Send events with retry-safe identifiers and receive outbound webhooks when configured.
Handle public API failures through stable error codes and avoid branching on message text.
Keep test and live environments separate, use external ids for retry safety, and avoid trusted scope fields.
Create a customer, create and post an invoice, record a payment, and read the Accounts Receivable summary.
const customer = await createCustomer({
baseUrl,
apiKey,
customer: {
externalCustomerId: "cus_example",
name: "Example Customer",
},
});
const invoice = await createInvoice({
baseUrl,
apiKey,
invoice: {
invoiceNumber: "INV-1001",
externalInvoiceId: "inv_example",
customerId: customer.data.id,
issueDate: "2026-05-25",
dueDate: "2026-06-24",
lineItems: [{ description: "Subscription", quantity: 1, unitAmountCents: 25000 }],
},
});
await postInvoice({ baseUrl, apiKey, invoiceId: invoice.data.id });
await createPayment({
baseUrl,
apiKey,
payment: {
externalPaymentId: "pay_example",
invoiceId: invoice.data.id,
amountCents: 25000,
receivedAt: "2026-05-25T12:00:00Z",
source: "manual",
},
});Create a customer, create an estimate, convert it to an invoice, post the invoice, record trusted payment confirmation, and read reports.
const customer = await ledgerline.customers.create({ name: "Example Customer" });
const estimate = await ledgerline.estimates.create({
customer_id: customer.data.id,
estimate_number: "EST-1001",
line_items: [{ description: "Subscription", quantity: 1, unit_amount_cents: 25000 }],
});
const invoice = await ledgerline.estimates.convert(estimate.data.id, {
invoice_number: "INV-1001",
});
await ledgerline.documentShares.create({ document_type: "invoice", invoice_id: invoice.data.id });
await ledgerline.invoices.post(invoice.data.id, { posted_at: "2026-05-25T12:00:00Z" });
await ledgerline.payments.create({
invoice_id: invoice.data.id,
external_payment_id: "pay_example",
amount_cents: 25000,
received_at: "2026-05-25T12:05:00Z",
source: "manual",
});
const ar = await ledgerline.reports.accountsReceivable({ asOf: "2026-05-31" });Create an estimate, move it through status, convert it to a draft invoice, and post the invoice separately.
const estimate = await createEstimate({
baseUrl,
apiKey,
estimate: {
estimateNumber: "EST-1001",
customerName: "Example Customer",
issueDate: "2026-05-25",
lineItems: [{ description: "Implementation", quantity: 1, unitAmountCents: 50000 }],
},
});
await updateEstimateStatus({ baseUrl, apiKey, estimateId: estimate.data.id, status: "sent" });
const converted = await convertEstimateToInvoice({ baseUrl, apiKey, estimateId: estimate.data.id });Create a vendor, create and post a bill, create and post a vendor payment, and read the Accounts Payable summary.
const vendor = await createVendor({
baseUrl,
apiKey,
vendor: {
externalVendorId: "ven_example",
vendorType: "contractor",
displayName: "Example Vendor",
},
});
const bill = await createBill({
baseUrl,
apiKey,
bill: {
billNumber: "BILL-1001",
externalBillId: "bill_example",
vendorId: vendor.data.id,
issueDate: "2026-05-25",
dueDate: "2026-06-24",
lineItems: [{ description: "Hosting", quantity: 1, unitAmountCents: 12000 }],
},
});
await postBill({ baseUrl, apiKey, billId: bill.data.id });
const payment = await createVendorPayment({
baseUrl,
apiKey,
vendorPayment: {
vendorId: vendor.data.id,
externalVendorPaymentId: "vp_example",
paymentDate: "2026-05-25",
amountCents: 12000,
cashAccountId: "00000000-0000-4000-8000-000000000020",
status: "ready",
allocations: [{ billId: bill.data.id, amountCents: 12000 }],
},
});
await postVendorPayment({ baseUrl, apiKey, vendorPaymentId: payment.data.id });Upload, list, link, and archive private evidence files through server-routed APIs.
const document = await createDocument({
baseUrl,
apiKey,
file: new Blob(["example"], { type: "application/pdf" }),
fileName: "invoice-evidence.pdf",
title: "Invoice evidence",
documentType: "receipt",
status: "needs_review",
});
await linkDocument({
baseUrl,
apiKey,
documentId: document.data.id,
targetType: "invoice",
targetId: "inv_example",
});Read summary, A/R, A/P, and 1099 support reports after posting workflows run.
const summary = await getReportSummary({ baseUrl, apiKey });
const ar = await getAccountsReceivableSummary({ baseUrl, apiKey });
const ap = await getAccountsPayableSummary({ baseUrl, apiKey });
const taxSupport = await get1099Summary({ baseUrl, apiKey, year: 2026 });Read connected-app capabilities and update safe document branding or defaults through public APIs.
const capabilities = await getSettingsCapabilities({ baseUrl, apiKey });
await updateInvoiceDefaults({
baseUrl,
apiKey,
defaults: {
defaultInvoiceTerms: "Due on receipt.",
defaultPaymentInstructions: "Pay by ACH.",
documentFooter: "Thank you.",
},
});Send events with retry-safe identifiers and receive outbound webhooks when configured.
await sendLedgerlineEvent({
baseUrl,
apiKey,
eventType: "payment.received",
externalEventId: "evt_example",
idempotencyKey: "evt_example",
payload: {
external_payment_id: "pay_example",
external_invoice_id: "inv_example",
amount_cents: 25000,
},
});Handle public API failures through stable error codes and avoid branching on message text.
try {
await checkLedgerlineAuth({ baseUrl, apiKey });
} catch (error) {
if (error instanceof LedgerlineApiError) {
if (error.code === "module_disabled") {
// Future hard enforcement: enable the required module and retry.
}
if (error.code === "rate_limited") {
// Back off and retry later.
}
}
}Keep test and live environments separate, use external ids for retry safety, and avoid trusted scope fields.
const auth = await checkLedgerlineAuth({
baseUrl: "https://your-ledgerline-domain.com",
apiKey: process.env.LEDGERLINE_API_KEY!,
});
// Store ll_test_replace_me only as a fake docs placeholder.
// Use the real test key only in server-side environment variables.Product Truth
Developer Docs
Pair workflow examples with setup guidance, accounting rules, security boundaries, and the read-only API Reference.
Browse the technical LedgerLine developer documentation hub.
Open docs homeFollow the first-run setup/testing path for connected apps.
Start setup pathReview server-side API keys, first calls, webhooks, errors, and boundaries.
Read guideBrowse read-only route groups, fake examples, SDK snippets, and response shapes.
Open referenceDownload the manual OpenAPI 3.1 source for the public API.
View specPreserved bridge to the Build with AI prompt library.
Open bridgeReview event schemas, idempotency, webhook signatures, and active/planned events.
Review eventsReview API versioning, changelog, deprecation, and compatibility policy.
Review policyUnderstand posting, reversals, A/R, A/P, reports, and documents.
Read modelReview API-key safety, scope isolation, storage, rate limits, and gates.
Read securityUse the guided setup planner when you are not sure which endpoints you need.
Open planner