API Reference

Explore LedgerLine API groups without sending requests.

Explore LedgerLine's server-side API groups, request shapes, response examples, workflow notes, SDK snippets, and accounting boundaries. This reference is read-only and never sends live requests.

Read-only reference

This API reference does not send requests or ask for API keys. Use fake examples here and real test keys only from your server-side environment.
Read-onlyServer-side onlyTest mode

15

Route groups

44

Examples

This API Reference is documentation only. It never sends live API requests.

Use fake examples here; keep real LedgerLine API keys on your app server.

API keys determine organization, connected app, and test/live environment.

Trusted scope fields such as organization_id and environment are rejected.

Module labels are setup guidance today; hard module enforcement is not active by default.

Accounting entries are created only by documented posting/payment/reversal routes.

Read-only explorer

Filter endpoint groups by workflow.

Choose a workflow group, copy fake examples, and keep real test keys in server-side environment variables only.

Standard Error Shape

Public API routes return the shared error envelope. Branch on `error.code`, not message text.

The future `module_disabled` code is documented for planned hard module enforcement, but this reference remains read-only and current APIs are not broadly blocked by module state.

Error response

{
  "error": {
    "code": "validation_failed",
    "message": "Validation failed.",
    "details": [],
    "request_id": "req_example"
  }
}

Auth

Check that a server-side API key is valid.

Always available

GET/api/v1/auth/check

Check API key

Returns the connected app, organization, and environment context resolved from the bearer API key.

View
AuthBearer API key required
SDK helpercheckLedgerlineAuth
ModulesAlways available
Read-only. No accounting records are changed.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/auth/check \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { checkLedgerlineAuth } from "@/lib/sdk";

await checkLedgerlineAuth({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,

});

Response example

{
  "data": {
    "authenticated": true,
    "environment": "test",
    "connected_app_id": "app_demo_123"
  }
}

Customers

Create and read customer reference records for money-in workflows.

Module guidance: customers

GET/api/v1/customers

List customers

Returns organization-scoped customers with standard pagination.

View
AuthBearer API key required
SDK helperlistCustomers
ReferenceCustomer API
ModulesModule guidance: customers
Read-only. Customer records alone do not affect accounting.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/customers \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listCustomers } from "@/lib/sdk";

await listCustomers({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
  offset: 0,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000001",
      "external_customer_id": "cus_demo_123",
      "name": "Acme Holdings",
      "email": "billing@example.com",
      "status": "active"
    }
  ],
  "customers": [
    {
      "id": "00000000-0000-4000-8000-000000000001",
      "external_customer_id": "cus_demo_123",
      "name": "Acme Holdings",
      "email": "billing@example.com",
      "status": "active"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/customers

Create customer

Creates a customer. Use external_customer_id for retry-safe creates.

View
AuthBearer API key required
SDK helpercreateCustomer
ReferenceCustomer API
ModulesModule guidance: customers
Creates operational customer metadata only.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/customers \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_customer_id": "cus_demo_123",
  "name": "Acme Holdings",
  "email": "billing@example.com"
}'

SDK snippet

import { createCustomer } from "@/lib/sdk";

await createCustomer({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  customer: {
    externalCustomerId: "cus_demo_123",
    name: "Acme Holdings",
    email: "billing@example.com",
  },
});

Request body

{
  "external_customer_id": "cus_demo_123",
  "name": "Acme Holdings",
  "email": "billing@example.com"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000001",
    "external_customer_id": "cus_demo_123",
    "name": "Acme Holdings",
    "email": "billing@example.com",
    "status": "active"
  },
  "customer": {
    "id": "00000000-0000-4000-8000-000000000001",
    "external_customer_id": "cus_demo_123",
    "name": "Acme Holdings",
    "email": "billing@example.com",
    "status": "active"
  }
}
GET/api/v1/customers/{id}

Get customer

Reads one customer by id in the API key organization scope.

View
AuthBearer API key required
SDK helpergetCustomer
ReferenceCustomer API
ModulesModule guidance: customers
Read-only. No accounting records are changed.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/customers/00000000-0000-4000-8000-000000000001 \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getCustomer } from "@/lib/sdk";

await getCustomer({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  customerId: "00000000-0000-4000-8000-000000000001",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000001",
    "external_customer_id": "cus_demo_123",
    "name": "Acme Holdings",
    "email": "billing@example.com",
    "status": "active"
  },
  "customer": {
    "id": "00000000-0000-4000-8000-000000000001",
    "external_customer_id": "cus_demo_123",
    "name": "Acme Holdings",
    "email": "billing@example.com",
    "status": "active"
  }
}

Invoices

Create invoices and post approved invoices to Accounts Receivable and revenue.

Module guidance: invoices

GET/api/v1/invoices

List invoices

Returns invoices with standard pagination and status/customer filters.

View
AuthBearer API key required
SDK helperlistInvoices
ReferenceInvoice API
ModulesModule guidance: invoices
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/invoices \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listInvoices } from "@/lib/sdk";

await listInvoices({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  status: "open",
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "external_invoice_id": "inv_demo_123",
      "customer_id": "00000000-0000-4000-8000-000000000001",
      "status": "open",
      "total_cents": 25000,
      "currency": "USD"
    }
  ],
  "invoices": [
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "external_invoice_id": "inv_demo_123",
      "customer_id": "00000000-0000-4000-8000-000000000001",
      "status": "open",
      "total_cents": 25000,
      "currency": "USD"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/invoices

Create invoice

Creates a draft/open invoice. Posting is a separate accounting action.

View
AuthBearer API key required
SDK helpercreateInvoice
ReferenceInvoice API
ModulesModule guidance: invoices
Invoice creation is operational until posted.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/invoices \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_invoice_id": "inv_demo_123",
  "customer_id": "00000000-0000-4000-8000-000000000001",
  "invoice_number": "INV-1001",
  "issue_date": "2026-05-20",
  "due_date": "2026-06-19",
  "line_items": [
    {
      "description": "Platform subscription",
      "quantity": 1,
      "unit_amount_cents": 25000
    }
  ]
}'

SDK snippet

import { createInvoice } from "@/lib/sdk";

await createInvoice({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  invoice: {
    externalInvoiceId: "inv_demo_123",
    customerId: "00000000-0000-4000-8000-000000000001",
    invoiceNumber: "INV-1001",
    issueDate: "2026-05-20",
    dueDate: "2026-06-19",
    lineItems: [{ description: "Platform subscription", quantity: 1, unitAmountCents: 25000 }],
  },
});

Request body

{
  "external_invoice_id": "inv_demo_123",
  "customer_id": "00000000-0000-4000-8000-000000000001",
  "invoice_number": "INV-1001",
  "issue_date": "2026-05-20",
  "due_date": "2026-06-19",
  "line_items": [
    {
      "description": "Platform subscription",
      "quantity": 1,
      "unit_amount_cents": 25000
    }
  ]
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000002",
    "external_invoice_id": "inv_demo_123",
    "customer_id": "00000000-0000-4000-8000-000000000001",
    "status": "open",
    "total_cents": 25000,
    "currency": "USD"
  },
  "invoice": {
    "id": "00000000-0000-4000-8000-000000000002",
    "external_invoice_id": "inv_demo_123",
    "customer_id": "00000000-0000-4000-8000-000000000001",
    "status": "open",
    "total_cents": 25000,
    "currency": "USD"
  }
}
POST/api/v1/invoices/{id}/post

Post invoice

Posts an eligible invoice to the ledger.

View
AuthBearer API key required
SDK helperpostInvoice
ModulesModule guidance: invoices
Creates balanced A/R debit and revenue credit journal lines.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/invoices/00000000-0000-4000-8000-000000000002/post \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { postInvoice } from "@/lib/sdk";

await postInvoice({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  invoiceId: "00000000-0000-4000-8000-000000000002",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000002",
    "external_invoice_id": "inv_demo_123",
    "customer_id": "00000000-0000-4000-8000-000000000001",
    "status": "open",
    "total_cents": 25000,
    "currency": "USD"
  },
  "invoice": {
    "id": "00000000-0000-4000-8000-000000000002",
    "external_invoice_id": "inv_demo_123",
    "customer_id": "00000000-0000-4000-8000-000000000001",
    "status": "open",
    "total_cents": 25000,
    "currency": "USD"
  },
  "action": {
    "type": "posted",
    "status": "completed"
  }
}

Payments

Record customer payments and provider payout clearing.

Module guidance: payments

POST/api/v1/payments

Create payment

Records a customer payment against an invoice.

View
AuthBearer API key required
SDK helpercreatePayment
ReferencePayments API
ModulesModule guidance: payments
Reduces Accounts Receivable. It does not create revenue.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/payments \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_payment_id": "pay_demo_123",
  "invoice_id": "00000000-0000-4000-8000-000000000002",
  "amount_cents": 25000,
  "received_at": "2026-05-20",
  "source": "manual"
}'

SDK snippet

import { createPayment } from "@/lib/sdk";

await createPayment({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  payment: {
    externalPaymentId: "pay_demo_123",
    invoiceId: "00000000-0000-4000-8000-000000000002",
    amountCents: 25000,
    receivedAt: "2026-05-20",
    source: "manual",
  },
});

Request body

{
  "external_payment_id": "pay_demo_123",
  "invoice_id": "00000000-0000-4000-8000-000000000002",
  "amount_cents": 25000,
  "received_at": "2026-05-20",
  "source": "manual"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000005",
    "external_payment_id": "pay_demo_123",
    "invoice_id": "00000000-0000-4000-8000-000000000002",
    "amount_cents": 25000,
    "source": "manual"
  },
  "payment": {
    "id": "00000000-0000-4000-8000-000000000005",
    "external_payment_id": "pay_demo_123",
    "invoice_id": "00000000-0000-4000-8000-000000000002",
    "amount_cents": 25000,
    "source": "manual"
  }
}
GET/api/v1/payments

List payments

Returns customer payments with standard pagination.

View
AuthBearer API key required
SDK helperlistPayments
ReferencePayments API
ModulesModule guidance: payments
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/payments \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listPayments } from "@/lib/sdk";

await listPayments({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000005",
      "external_payment_id": "pay_demo_123",
      "invoice_id": "00000000-0000-4000-8000-000000000002",
      "amount_cents": 25000,
      "source": "manual"
    }
  ],
  "payments": [
    {
      "id": "00000000-0000-4000-8000-000000000005",
      "external_payment_id": "pay_demo_123",
      "invoice_id": "00000000-0000-4000-8000-000000000002",
      "amount_cents": 25000,
      "source": "manual"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/processor-payouts

Create provider payout clearing

Records provider payout clearing through the current processor-payout API when supported metadata is available.

View
AuthBearer API key required
SDK helpercreateProcessorPayout
ModulesModule guidance: payments
Payout clearing follows the documented provider payout accounting boundary while the public contract keeps processor_payout names.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/processor-payouts \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_payout_id": "po_demo_123",
  "processor": "stripe",
  "payout_date": "2026-05-20",
  "gross_cents": 25000,
  "fee_cents": 750,
  "net_cents": 24250
}'

SDK snippet

import { createProcessorPayout } from "@/lib/sdk";

await createProcessorPayout({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  payout: {
    externalPayoutId: "po_demo_123",
    processor: "stripe",
    payoutDate: "2026-05-20",
    grossCents: 25000,
    feeCents: 750,
    netCents: 24250,
  },
});

Request body

{
  "external_payout_id": "po_demo_123",
  "processor": "stripe",
  "payout_date": "2026-05-20",
  "gross_cents": 25000,
  "fee_cents": 750,
  "net_cents": 24250
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  },
  "processor_payout": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  }
}

Provider Payouts

Create and read provider payout clearing records through the current processor-payout API.

Module guidance: payments

GET/api/v1/processor-payouts

List provider payouts

Returns provider payouts with standard pagination.

View
AuthBearer API key required
SDK helperlistProcessorPayouts
ReferenceOpenAPI YAML
ModulesModule guidance: payments
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/processor-payouts \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listProcessorPayouts } from "@/lib/sdk";

await listProcessorPayouts({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000009",
      "external_payout_id": "po_demo_123",
      "status": "created",
      "net_cents": 24250
    }
  ],
  "processor_payouts": [
    {
      "id": "00000000-0000-4000-8000-000000000009",
      "external_payout_id": "po_demo_123",
      "status": "created",
      "net_cents": 24250
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/processor-payouts

Create provider payout clearing

Records provider payout clearing through the current processor-payout API when supported metadata is available.

View
AuthBearer API key required
SDK helpercreateProcessorPayout
ReferenceOpenAPI YAML
ModulesModule guidance: payments
Payout clearing follows the documented provider payout accounting boundary while the public contract keeps processor_payout names.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/processor-payouts \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_payout_id": "po_demo_123",
  "processor": "stripe",
  "payout_date": "2026-05-20",
  "gross_cents": 25000,
  "fee_cents": 750,
  "net_cents": 24250
}'

SDK snippet

import { createProcessorPayout } from "@/lib/sdk";

await createProcessorPayout({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  payout: {
    externalPayoutId: "po_demo_123",
    processor: "stripe",
    payoutDate: "2026-05-20",
    grossCents: 25000,
    feeCents: 750,
    netCents: 24250,
  },
});

Request body

{
  "external_payout_id": "po_demo_123",
  "processor": "stripe",
  "payout_date": "2026-05-20",
  "gross_cents": 25000,
  "fee_cents": 750,
  "net_cents": 24250
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  },
  "processor_payout": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  }
}
GET/api/v1/processor-payouts/{id}

Get provider payout

Reads one provider payout by id.

View
AuthBearer API key required
SDK helpergetProcessorPayout
ReferenceOpenAPI YAML
ModulesModule guidance: payments
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/processor-payouts/00000000-0000-4000-8000-000000000009 \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getProcessorPayout } from "@/lib/sdk";

await getProcessorPayout({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  processorPayoutId: "00000000-0000-4000-8000-000000000009",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  },
  "processor_payout": {
    "id": "00000000-0000-4000-8000-000000000009",
    "external_payout_id": "po_demo_123",
    "status": "created",
    "net_cents": 24250
  }
}

Events

Ingest retry-safe events from connected apps.

Module guidance: webhooks

POST/api/v1/events

Send event

Stores an event and processes supported payment.received events.

View
AuthBearer API key required
SDK helpersendLedgerlineEvent
ModulesModule guidance: webhooks
Only supported payment events can trigger existing payment accounting behavior.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/events \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "event_type": "payment.received",
  "external_event_id": "evt_demo_001",
  "payload": {
    "external_payment_id": "pay_demo_123",
    "external_invoice_id": "inv_demo_123",
    "amount_cents": 25000,
    "received_at": "2026-05-20"
  }
}'

SDK snippet

import { sendLedgerlineEvent } from "@/lib/sdk";

await sendLedgerlineEvent({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  eventType: "payment.received",
  externalEventId: "evt_demo_001",
  idempotencyKey: "evt_demo_001",
  payload: {
    external_payment_id: "pay_demo_123",
    external_invoice_id: "inv_demo_123",
    amount_cents: 25000,
    received_at: "2026-05-20",
  },
});

Request body

{
  "event_type": "payment.received",
  "external_event_id": "evt_demo_001",
  "payload": {
    "external_payment_id": "pay_demo_123",
    "external_invoice_id": "inv_demo_123",
    "amount_cents": 25000,
    "received_at": "2026-05-20"
  }
}

Response example

{
  "data": {
    "event_id": "evt_demo_001",
    "event_type": "payment.received",
    "duplicate": false,
    "status": "processed"
  },
  "event": {
    "event_id": "evt_demo_001",
    "event_type": "payment.received",
    "duplicate": false,
    "status": "processed"
  }
}

Estimates

Manage non-accounting estimate workflows and conversion to draft invoices.

Module guidance: estimates

POST/api/v1/estimates

Create estimate

Creates a non-accounting estimate.

View
AuthBearer API key required
SDK helpercreateEstimate
ReferenceEstimate API
ModulesModule guidance: estimates
Estimates do not affect accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/estimates \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_estimate_id": "est_demo_123",
  "customer_id": "00000000-0000-4000-8000-000000000001",
  "issue_date": "2026-05-20",
  "line_items": [
    {
      "description": "Implementation package",
      "quantity": 1,
      "unit_amount_cents": 50000
    }
  ]
}'

SDK snippet

import { createEstimate } from "@/lib/sdk";

await createEstimate({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  estimate: {
    externalEstimateId: "est_demo_123",
    customerId: "00000000-0000-4000-8000-000000000001",
    issueDate: "2026-05-20",
    lineItems: [{ description: "Implementation package", quantity: 1, unitAmountCents: 50000 }],
  },
});

Request body

{
  "external_estimate_id": "est_demo_123",
  "customer_id": "00000000-0000-4000-8000-000000000001",
  "issue_date": "2026-05-20",
  "line_items": [
    {
      "description": "Implementation package",
      "quantity": 1,
      "unit_amount_cents": 50000
    }
  ]
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000010",
    "external_estimate_id": "est_demo_123",
    "status": "draft",
    "total_cents": 50000
  },
  "estimate": {
    "id": "00000000-0000-4000-8000-000000000010",
    "external_estimate_id": "est_demo_123",
    "status": "draft",
    "total_cents": 50000
  }
}
POST/api/v1/estimates/{id}/status

Update estimate status

Moves an estimate through supported non-accounting statuses.

View
AuthBearer API key required
SDK helperupdateEstimateStatus
ReferenceEstimate API
ModulesModule guidance: estimates
Status changes do not affect accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/estimates/00000000-0000-4000-8000-000000000010/status \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "status": "sent"
}'

SDK snippet

import { updateEstimateStatus } from "@/lib/sdk";

await updateEstimateStatus({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  estimateId: "00000000-0000-4000-8000-000000000010",
  status: "sent",
});

Request body

{
  "status": "sent"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000010",
    "status": "sent"
  },
  "estimate": {
    "id": "00000000-0000-4000-8000-000000000010",
    "status": "sent"
  }
}
POST/api/v1/estimates/{id}/convert

Convert estimate

Converts an accepted estimate into a draft invoice.

View
AuthBearer API key required
SDK helperconvertEstimateToInvoice
ModulesModule guidance: estimates
Conversion creates a draft invoice only. Invoice posting is separate.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/estimates/00000000-0000-4000-8000-000000000010/convert \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { convertEstimateToInvoice } from "@/lib/sdk";

await convertEstimateToInvoice({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  estimateId: "00000000-0000-4000-8000-000000000010",
});

Response example

{
  "data": {
    "estimate_id": "00000000-0000-4000-8000-000000000010",
    "invoice_id": "00000000-0000-4000-8000-000000000002",
    "invoice_status": "draft"
  }
}

Documents

Manage private evidence documents, links, shares, and render metadata.

Module guidance: documents

POST/api/v1/documents

Upload document

Uploads an evidence file with safe metadata.

View
AuthBearer API key required
SDK helpercreateDocument
ModulesModule guidance: documents
Document uploads do not mutate accounting.

curl example

curl https://your-ledgerline-domain.com/api/v1/documents \
  -H "Authorization: Bearer ll_test_replace_me" \
  -F "file=@receipt.pdf" \
  -F "source=api" \
  -F "document_type=receipt"

SDK snippet

import { createDocument } from "@/lib/sdk";

await createDocument({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  file: receiptFile,
  metadata: {
    source: "api",
    documentType: "receipt",
  },
});

Request body

multipart/form-data
file=@receipt.pdf
source=api
document_type=receipt

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000006",
    "file_name": "receipt.pdf",
    "document_type": "receipt",
    "status": "uploaded"
  },
  "document": {
    "id": "00000000-0000-4000-8000-000000000006",
    "file_name": "receipt.pdf",
    "document_type": "receipt",
    "status": "uploaded"
  }
}
GET/api/v1/documents

List documents

Returns evidence documents with standard pagination and filters.

View
AuthBearer API key required
SDK helperlistDocuments
ModulesModule guidance: documents
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/documents \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listDocuments } from "@/lib/sdk";

await listDocuments({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000006",
      "file_name": "receipt.pdf",
      "status": "uploaded"
    }
  ],
  "documents": [
    {
      "id": "00000000-0000-4000-8000-000000000006",
      "file_name": "receipt.pdf",
      "status": "uploaded"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/documents/{id}/link

Link document

Links an evidence document to a customer, invoice, estimate, vendor, or bill where supported.

View
AuthBearer API key required
SDK helperlinkDocument
ModulesModule guidance: documents
Linking evidence does not mutate accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/documents/00000000-0000-4000-8000-000000000006/link \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "record_type": "invoice",
  "record_id": "00000000-0000-4000-8000-000000000002"
}'

SDK snippet

import { linkDocument } from "@/lib/sdk";

await linkDocument({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  documentId: "00000000-0000-4000-8000-000000000006",
  recordType: "invoice",
  recordId: "00000000-0000-4000-8000-000000000002",
});

Request body

{
  "record_type": "invoice",
  "record_id": "00000000-0000-4000-8000-000000000002"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000006",
    "linked_record_id": "00000000-0000-4000-8000-000000000002"
  },
  "document": {
    "id": "00000000-0000-4000-8000-000000000006",
    "linked_record_id": "00000000-0000-4000-8000-000000000002"
  },
  "action": {
    "type": "linked",
    "status": "completed"
  }
}
GET/api/v1/documents/{id}/download

Download document

Downloads the file stream through the API route.

View
AuthBearer API key required
SDK helpergetDocumentDownloadUrl
ModulesModule guidance: documents
Binary download only. No JSON envelope and no accounting mutation.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/documents/00000000-0000-4000-8000-000000000006/download \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getDocumentDownloadUrl } from "@/lib/sdk";

const downloadUrl = getDocumentDownloadUrl({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  documentId: "00000000-0000-4000-8000-000000000006",
});

Response example

application/octet-stream
(binary file response)
POST/api/v1/document-shares

Create document share

Creates safe share metadata for customer-facing documents where supported.

View
AuthBearer API key required
SDK helpercreateDocumentShare
ModulesModule guidance: documents
Share links do not mutate accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/document-shares \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "record_type": "invoice",
  "record_id": "00000000-0000-4000-8000-000000000002"
}'

SDK snippet

import { createDocumentShare } from "@/lib/sdk";

await createDocumentShare({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  recordType: "invoice",
  recordId: "00000000-0000-4000-8000-000000000002",
});

Request body

{
  "record_type": "invoice",
  "record_id": "00000000-0000-4000-8000-000000000002"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "active",
    "record_id": "00000000-0000-4000-8000-000000000002"
  },
  "document_share": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "active",
    "record_id": "00000000-0000-4000-8000-000000000002"
  }
}
GET/api/v1/document-renders/{id}

Get document render

Reads safe render metadata for generated customer-facing documents.

View
AuthBearer API key required
SDK helpergetDocumentRender
ModulesModule guidance: documents
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/document-renders/00000000-0000-4000-8000-000000000007 \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getDocumentRender } from "@/lib/sdk";

await getDocumentRender({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  renderId: "00000000-0000-4000-8000-000000000007",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "ready",
    "document_type": "invoice"
  },
  "document_render": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "ready",
    "document_type": "invoice"
  }
}

Document Shares/Renders

Browse customer-facing share and render metadata without exposing storage paths.

Module guidance: documents

GET/api/v1/document-shares

List document shares

Returns safe document share metadata with pagination.

View
AuthBearer API key required
SDK helperlistDocumentShares
ReferenceOpenAPI YAML
ModulesModule guidance: documents
Read-only. Share metadata does not mutate accounting.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/document-shares \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listDocumentShares } from "@/lib/sdk";

await listDocumentShares({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000007",
      "status": "active",
      "record_id": "00000000-0000-4000-8000-000000000002"
    }
  ],
  "document_shares": [
    {
      "id": "00000000-0000-4000-8000-000000000007",
      "status": "active",
      "record_id": "00000000-0000-4000-8000-000000000002"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/document-shares/{id}/revoke

Revoke document share

Revokes an active document share.

View
AuthBearer API key required
SDK helperrevokeDocumentShare
ReferenceOpenAPI YAML
ModulesModule guidance: documents
Share revocation does not mutate accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/document-shares/00000000-0000-4000-8000-000000000007/revoke \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { revokeDocumentShare } from "@/lib/sdk";

await revokeDocumentShare({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  shareId: "00000000-0000-4000-8000-000000000007",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "revoked"
  },
  "document_share": {
    "id": "00000000-0000-4000-8000-000000000007",
    "status": "revoked"
  },
  "action": {
    "type": "revoked",
    "status": "completed"
  }
}
GET/api/v1/document-renders

List document renders

Returns safe render metadata with pagination.

View
AuthBearer API key required
SDK helperlistDocumentRenders
ReferenceOpenAPI YAML
ModulesModule guidance: documents
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/document-renders \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listDocumentRenders } from "@/lib/sdk";

await listDocumentRenders({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000007",
      "status": "ready",
      "document_type": "invoice"
    }
  ],
  "document_renders": [
    {
      "id": "00000000-0000-4000-8000-000000000007",
      "status": "ready",
      "document_type": "invoice"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}

Settings and Defaults

Read capabilities and manage connected-app document branding/default settings.

Capabilities always available; defaults/branding use embedded_settings

GET/api/v1/settings/capabilities

Get settings capabilities

Returns enabled public settings capabilities for the API key context.

View
AuthBearer API key required
SDK helpergetSettingsCapabilities
ModulesCapabilities always available; defaults/branding use embedded_settings
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/settings/capabilities \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getSettingsCapabilities } from "@/lib/sdk";

await getSettingsCapabilities({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,

});

Response example

{
  "data": {
    "document_branding": true,
    "invoice_defaults": true,
    "estimate_defaults": true
  }
}
PUT/api/v1/settings/document-branding

Update document branding

Updates safe document branding settings when the capability is active.

View
AuthBearer API key required
SDK helperupdateDocumentBrandingSettings
ModulesCapabilities always available; defaults/branding use embedded_settings
Branding changes do not mutate accounting.

curl example

curl -X PUT https://your-ledgerline-domain.com/api/v1/settings/document-branding \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "business_name": "Acme Holdings",
  "payment_instructions": "Pay by ACH using the instructions on file."
}'

SDK snippet

import { updateDocumentBrandingSettings } from "@/lib/sdk";

await updateDocumentBrandingSettings({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  settings: {
    businessName: "Acme Holdings",
    paymentInstructions: "Pay by ACH using the instructions on file.",
  },
});

Request body

{
  "business_name": "Acme Holdings",
  "payment_instructions": "Pay by ACH using the instructions on file."
}

Response example

{
  "data": {
    "business_name": "Acme Holdings",
    "payment_instructions": "Pay by ACH using the instructions on file."
  }
}
GET/api/v1/settings/invoice-defaults

Get invoice defaults

Reads connected-app invoice default settings.

View
AuthBearer API key required
SDK helpergetInvoiceDefaults
ReferenceOpenAPI YAML
ModulesCapabilities always available; defaults/branding use embedded_settings
Read-only settings.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/settings/invoice-defaults \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getInvoiceDefaults } from "@/lib/sdk";

await getInvoiceDefaults({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,

});

Response example

{
  "data": {
    "default_terms": "Net 30",
    "default_memo": "Thank you for your business."
  }
}
PUT/api/v1/settings/estimate-defaults

Update estimate defaults

Updates connected-app estimate default settings.

View
AuthBearer API key required
SDK helperupdateEstimateDefaults
ReferenceOpenAPI YAML
ModulesCapabilities always available; defaults/branding use embedded_settings
Estimate defaults do not mutate accounting.

curl example

curl -X PUT https://your-ledgerline-domain.com/api/v1/settings/estimate-defaults \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "default_terms": "Valid for 30 days"
}'

SDK snippet

import { updateEstimateDefaults } from "@/lib/sdk";

await updateEstimateDefaults({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  settings: {
    defaultTerms: "Valid for 30 days",
  },
});

Request body

{
  "default_terms": "Valid for 30 days"
}

Response example

{
  "data": {
    "default_terms": "Valid for 30 days"
  }
}

Reports

Read summary, receivables, payables, and 1099 support reports.

Module guidance: reports; A/P also bills_ap; 1099 also tax_1099

GET/api/v1/reports/summary

Report summary

Reads high-level accounting report summary data.

View
AuthBearer API key required
SDK helpergetReportSummary
ModulesModule guidance: reports; A/P also bills_ap; 1099 also tax_1099
Read-only report.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/reports/summary \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getReportSummary } from "@/lib/sdk";

await getReportSummary({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  from: "2026-01-01",
  to: "2026-12-31",
});

Response example

{
  "data": {
    "from": "2026-01-01",
    "to": "2026-12-31",
    "revenue_cents": 25000,
    "accounts_receivable_cents": 0
  },
  "report_summary": {
    "from": "2026-01-01",
    "to": "2026-12-31",
    "revenue_cents": 25000,
    "accounts_receivable_cents": 0
  }
}
GET/api/v1/reports/accounts-receivable

A/R summary

Reads open Accounts Receivable summary data.

View
AuthBearer API key required
SDK helpergetAccountsReceivableSummary
ReferenceOpenAPI YAML
ModulesModule guidance: reports; A/P also bills_ap; 1099 also tax_1099
Read-only report.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/reports/accounts-receivable \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getAccountsReceivableSummary } from "@/lib/sdk";

await getAccountsReceivableSummary({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  asOf: "2026-12-31",
});

Response example

{
  "data": {
    "total_open_cents": 25000,
    "customer_count": 1
  },
  "accounts_receivable": {
    "total_open_cents": 25000,
    "customer_count": 1
  }
}
GET/api/v1/reports/accounts-payable

A/P summary

Reads posted-bill open A/P with payment-aware allocations.

View
AuthBearer API key required
SDK helpergetAccountsPayableSummary
ModulesModule guidance: reports; A/P also bills_ap; 1099 also tax_1099
Read-only report.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/reports/accounts-payable \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { getAccountsPayableSummary } from "@/lib/sdk";

await getAccountsPayableSummary({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  asOf: "2026-12-31",
});

Response example

{
  "data": {
    "total_open_cents": 75000,
    "vendor_count": 1
  },
  "accounts_payable": {
    "total_open_cents": 75000,
    "vendor_count": 1
  }
}
GET/api/v1/reports/1099-summary

1099 summary

Reads CPA/tax-support totals from posted, non-reversed vendor payments.

View
AuthBearer API key required
SDK helperget1099Summary
ModulesModule guidance: reports; A/P also bills_ap; 1099 also tax_1099
Read-only support reporting. Not IRS filing or tax advice.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/reports/1099-summary \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { get1099Summary } from "@/lib/sdk";

await get1099Summary({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  year: 2026,
  includeIneligible: false,
});

Response example

{
  "data": {
    "reporting_year": 2026,
    "total_reportable_paid_cents": 75000,
    "eligible_vendor_count": 1
  },
  "tax_1099_summary": {
    "reporting_year": 2026,
    "total_reportable_paid_cents": 75000,
    "eligible_vendor_count": 1
  }
}

1099 Summary

Review CPA/tax-support vendor payment totals without filing forms.

Module guidance: reports + tax_1099

GET/api/v1/reports/1099-summary

1099 summary

Reads support totals from posted, non-reversed vendor payments by payment date.

View
AuthBearer API key required
SDK helperget1099Summary
ReferenceOpenAPI YAML
ModulesModule guidance: reports + tax_1099
Read-only support reporting. It is not IRS filing, e-filing, payroll, or tax advice.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/reports/1099-summary \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { get1099Summary } from "@/lib/sdk";

await get1099Summary({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  year: 2026,
  includeIneligible: false,
});

Response example

{
  "data": {
    "reporting_year": 2026,
    "total_reportable_paid_cents": 75000,
    "eligible_vendor_count": 1,
    "missing_w9_count": 0
  },
  "tax_1099_summary": {
    "reporting_year": 2026,
    "total_reportable_paid_cents": 75000,
    "eligible_vendor_count": 1,
    "missing_w9_count": 0
  }
}

Vendors

Manage vendor master data and 1099 support metadata.

Module guidance: vendors

POST/api/v1/vendors

Create vendor

Creates organization-scoped vendor metadata.

View
AuthBearer API key required
SDK helpercreateVendor
ReferenceVendor API
ModulesModule guidance: vendors
Vendor records alone do not affect accounting.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/vendors \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_vendor_id": "vendor_demo_123",
  "display_name": "Jordan Smith",
  "vendor_type": "contractor",
  "is_1099_eligible": true
}'

SDK snippet

import { createVendor } from "@/lib/sdk";

await createVendor({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  vendor: {
    externalVendorId: "vendor_demo_123",
    displayName: "Jordan Smith",
    vendorType: "contractor",
    is1099Eligible: true,
  },
});

Request body

{
  "external_vendor_id": "vendor_demo_123",
  "display_name": "Jordan Smith",
  "vendor_type": "contractor",
  "is_1099_eligible": true
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000003",
    "external_vendor_id": "vendor_demo_123",
    "display_name": "Jordan Smith",
    "vendor_type": "contractor",
    "is_1099_eligible": true
  },
  "vendor": {
    "id": "00000000-0000-4000-8000-000000000003",
    "external_vendor_id": "vendor_demo_123",
    "display_name": "Jordan Smith",
    "vendor_type": "contractor",
    "is_1099_eligible": true
  }
}
GET/api/v1/vendors

List vendors

Returns vendors with standard pagination and filters.

View
AuthBearer API key required
SDK helperlistVendors
ReferenceVendor API
ModulesModule guidance: vendors
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/vendors \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listVendors } from "@/lib/sdk";

await listVendors({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000003",
      "external_vendor_id": "vendor_demo_123",
      "display_name": "Jordan Smith",
      "vendor_type": "contractor",
      "is_1099_eligible": true
    }
  ],
  "vendors": [
    {
      "id": "00000000-0000-4000-8000-000000000003",
      "external_vendor_id": "vendor_demo_123",
      "display_name": "Jordan Smith",
      "vendor_type": "contractor",
      "is_1099_eligible": true
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}

Bills

Create operational bills and post reviewed bills to A/P and expense.

Module guidance: bills_ap

POST/api/v1/bills

Create bill

Creates an operational vendor bill.

View
AuthBearer API key required
SDK helpercreateBill
ReferenceBills API
ModulesModule guidance: bills_ap
Bill creation is operational until posted.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/bills \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "vendor_id": "00000000-0000-4000-8000-000000000003",
  "external_bill_id": "bill_demo_123",
  "bill_number": "BILL-1001",
  "issue_date": "2026-05-20",
  "due_date": "2026-06-19",
  "line_items": [
    {
      "description": "Contractor services",
      "quantity": 1,
      "unit_amount_cents": 75000
    }
  ]
}'

SDK snippet

import { createBill } from "@/lib/sdk";

await createBill({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  bill: {
    vendorId: "00000000-0000-4000-8000-000000000003",
    externalBillId: "bill_demo_123",
    billNumber: "BILL-1001",
    issueDate: "2026-05-20",
    dueDate: "2026-06-19",
    lineItems: [{ description: "Contractor services", quantity: 1, unitAmountCents: 75000 }],
  },
});

Request body

{
  "vendor_id": "00000000-0000-4000-8000-000000000003",
  "external_bill_id": "bill_demo_123",
  "bill_number": "BILL-1001",
  "issue_date": "2026-05-20",
  "due_date": "2026-06-19",
  "line_items": [
    {
      "description": "Contractor services",
      "quantity": 1,
      "unit_amount_cents": 75000
    }
  ]
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "total_cents": 75000,
    "currency": "USD"
  },
  "bill": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "total_cents": 75000,
    "currency": "USD"
  }
}
POST/api/v1/bills/{id}/post

Post bill

Posts an eligible bill to A/P and expense.

View
AuthBearer API key required
SDK helperpostBill
ModulesModule guidance: bills_ap
Debits expense and credits Accounts Payable.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/bills/00000000-0000-4000-8000-000000000004/post \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { postBill } from "@/lib/sdk";

await postBill({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  billId: "00000000-0000-4000-8000-000000000004",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "total_cents": 75000,
    "currency": "USD"
  },
  "bill": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "total_cents": 75000,
    "currency": "USD"
  },
  "action": {
    "type": "posted",
    "status": "completed"
  }
}
POST/api/v1/bills/{id}/reverse

Reverse bill

Creates a reversing journal entry for an eligible posted bill.

View
AuthBearer API key required
SDK helperreverseBill
ReferenceBill Reversal
ModulesModule guidance: bills_ap
Debits A/P and credits expense through a reversal journal.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/bills/00000000-0000-4000-8000-000000000004/reverse \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "reversal_reason": "Entered in error"
}'

SDK snippet

import { reverseBill } from "@/lib/sdk";

await reverseBill({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  billId: "00000000-0000-4000-8000-000000000004",
  reversalReason: "Entered in error",
});

Request body

{
  "reversal_reason": "Entered in error"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "reversed",
    "total_cents": 75000,
    "currency": "USD"
  },
  "bill": {
    "id": "00000000-0000-4000-8000-000000000004",
    "external_bill_id": "bill_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "reversed",
    "total_cents": 75000,
    "currency": "USD"
  },
  "action": {
    "type": "reversed",
    "status": "completed"
  }
}

Vendor Payments

Manage vendor payment records and post them to reduce A/P.

Module guidance: bills_ap

POST/api/v1/vendor-payments

Create vendor payment

Creates an operational vendor payment record with allocations.

View
AuthBearer API key required
SDK helpercreateVendorPayment
ModulesModule guidance: bills_ap
Create/update/void are operational until posted.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/vendor-payments \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "external_vendor_payment_id": "vp_demo_123",
  "vendor_id": "00000000-0000-4000-8000-000000000003",
  "amount_cents": 75000,
  "payment_date": "2026-05-20",
  "cash_account_id": "00000000-0000-4000-8000-000000000011",
  "allocations": [
    {
      "bill_id": "00000000-0000-4000-8000-000000000004",
      "amount_cents": 75000
    }
  ]
}'

SDK snippet

import { createVendorPayment } from "@/lib/sdk";

await createVendorPayment({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  vendorPayment: {
    externalVendorPaymentId: "vp_demo_123",
    vendorId: "00000000-0000-4000-8000-000000000003",
    amountCents: 75000,
    paymentDate: "2026-05-20",
    cashAccountId: "00000000-0000-4000-8000-000000000011",
    allocations: [{ billId: "00000000-0000-4000-8000-000000000004", amountCents: 75000 }],
  },
});

Request body

{
  "external_vendor_payment_id": "vp_demo_123",
  "vendor_id": "00000000-0000-4000-8000-000000000003",
  "amount_cents": 75000,
  "payment_date": "2026-05-20",
  "cash_account_id": "00000000-0000-4000-8000-000000000011",
  "allocations": [
    {
      "bill_id": "00000000-0000-4000-8000-000000000004",
      "amount_cents": 75000
    }
  ]
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "amount_cents": 75000,
    "currency": "USD"
  },
  "vendor_payment": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "amount_cents": 75000,
    "currency": "USD"
  }
}
GET/api/v1/vendor-payments

List vendor payments

Returns vendor payments with pagination and vendor/status filters.

View
AuthBearer API key required
SDK helperlistVendorPayments
ModulesModule guidance: bills_ap
Read-only.

curl example

curl -X GET https://your-ledgerline-domain.com/api/v1/vendor-payments \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { listVendorPayments } from "@/lib/sdk";

await listVendorPayments({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  vendorId: "00000000-0000-4000-8000-000000000003",
  limit: 50,
});

Response example

{
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000008",
      "external_vendor_payment_id": "vp_demo_123",
      "vendor_id": "00000000-0000-4000-8000-000000000003",
      "status": "posted",
      "amount_cents": 75000,
      "currency": "USD"
    }
  ],
  "vendor_payments": [
    {
      "id": "00000000-0000-4000-8000-000000000008",
      "external_vendor_payment_id": "vp_demo_123",
      "vendor_id": "00000000-0000-4000-8000-000000000003",
      "status": "posted",
      "amount_cents": 75000,
      "currency": "USD"
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "count": 1,
    "has_more": false
  }
}
POST/api/v1/vendor-payments/{id}/post

Post vendor payment

Posts an eligible vendor payment to reduce A/P.

View
AuthBearer API key required
SDK helperpostVendorPayment
ModulesModule guidance: bills_ap
Debits Accounts Payable and credits cash, bank, or clearing.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/vendor-payments/00000000-0000-4000-8000-000000000008/post \
  -H "Authorization: Bearer ll_test_replace_me"

SDK snippet

import { postVendorPayment } from "@/lib/sdk";

await postVendorPayment({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  vendorPaymentId: "00000000-0000-4000-8000-000000000008",
});

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "amount_cents": 75000,
    "currency": "USD"
  },
  "vendor_payment": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "posted",
    "amount_cents": 75000,
    "currency": "USD"
  },
  "action": {
    "type": "posted",
    "status": "completed"
  }
}
POST/api/v1/vendor-payments/{id}/reverse

Reverse vendor payment

Creates a reversing journal entry for an eligible posted vendor payment.

View
AuthBearer API key required
SDK helperreverseVendorPayment
ModulesModule guidance: bills_ap
Debits cash/bank/clearing and credits Accounts Payable through a reversal journal.

curl example

curl -X POST https://your-ledgerline-domain.com/api/v1/vendor-payments/00000000-0000-4000-8000-000000000008/reverse \
  -H "Authorization: Bearer ll_test_replace_me" \
  -H "Content-Type: application/json" \
  --data '{
  "reversal_reason": "Payment returned"
}'

SDK snippet

import { reverseVendorPayment } from "@/lib/sdk";

await reverseVendorPayment({
  baseUrl: process.env.LEDGERLINE_BASE_URL!,
  apiKey: process.env.LEDGERLINE_API_KEY!,
  vendorPaymentId: "00000000-0000-4000-8000-000000000008",
  reversalReason: "Payment returned",
});

Request body

{
  "reversal_reason": "Payment returned"
}

Response example

{
  "data": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "reversed",
    "amount_cents": 75000,
    "currency": "USD"
  },
  "vendor_payment": {
    "id": "00000000-0000-4000-8000-000000000008",
    "external_vendor_payment_id": "vp_demo_123",
    "vendor_id": "00000000-0000-4000-8000-000000000003",
    "status": "reversed",
    "amount_cents": 75000,
    "currency": "USD"
  },
  "action": {
    "type": "reversed",
    "status": "completed"
  }
}

Developer Docs

Use the reference with the rest of the docs

The API Reference stays read-only. Use the surrounding docs for setup, workflow recipes, accounting boundaries, security posture, and the OpenAPI source.