Invoices API

Create, retrieve, and manage invoices through the Invoices API.

List Invoices

Retrieve all invoices for your organization.

curl https://api.lawnledgercrm.com/api/invoices \
  -b cookies.txt

Response:

{
  "data": [
    {
      "id": "inv_xyz789",
      "invoiceNumber": "INV-0042",
      "customerId": "cust_abc123",
      "status": "sent",
      "subtotal": 350.00,
      "tax": 28.00,
      "total": 378.00,
      "amountPaid": 0,
      "balance": 378.00,
      "invoiceDate": "2025-06-01",
      "dueDate": "2025-06-15",
      "createdAt": "2025-06-01T09:00:00Z"
    }
  ]
}

Query Parameters

ParameterTypeDescription
statusstringFilter by status: draft, sent, paid, overdue, void
customerIdstringFilter by customer ID
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
pagenumberPage number
limitnumberResults per page

Example:

curl "https://api.lawnledgercrm.com/api/invoices?status=overdue&limit=25" \
  -b cookies.txt

Get Invoice

Retrieve a single invoice by ID.

curl https://api.lawnledgercrm.com/api/invoices/inv_xyz789 \
  -b cookies.txt

Create Invoice

Create a new invoice.

curl -X POST https://api.lawnledgercrm.com/api/invoices \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "customerId": "cust_abc123",
    "propertyId": "prop_def456",
    "invoiceDate": "2025-06-15",
    "dueDate": "2025-07-15",
    "lineItems": [
      {
        "description": "Weekly Lawn Mowing",
        "quantity": 4,
        "unitPrice": 75.00
      },
      {
        "description": "Edge trimming",
        "quantity": 4,
        "unitPrice": 25.00
      }
    ],
    "notes": "Thank you for your business!"
  }'

Required Fields

FieldTypeDescription
customerIdstringCustomer ID
lineItemsarrayAt least one line item

Line Item Fields

FieldTypeDescription
descriptionstringService or item description
quantitynumberQuantity
unitPricenumberPrice per unit

Update Invoice

Update an existing invoice. Only draft invoices can be fully edited.

curl -X PUT https://api.lawnledgercrm.com/api/invoices/inv_xyz789 \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "dueDate": "2025-07-30",
    "notes": "Extended payment terms"
  }'

Record Payment

Record a payment against an invoice.

curl -X POST https://api.lawnledgercrm.com/api/payments \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "invoiceId": "inv_xyz789",
    "amount": 378.00,
    "paymentDate": "2025-06-20",
    "method": "check"
  }'

When a payment covers the full invoice balance, the invoice status automatically changes to Paid.