Skip to main content

Documentation Index

Fetch the complete documentation index at: https://help.daylit.com/llms.txt

Use this file to discover all available pages before exploring further.

The invoices endpoints give you full programmatic access to your AR invoice data in Daylit. You can list and filter invoices across multiple dimensions — status, aging bucket, due date, customer, and more — create new invoice records, update individual or bulk sets of invoices, and trigger payment reminder notifications. All endpoints are scoped to a company_id.

List invoices


GET /api/companies/{company_id}/invoices
Returns a paginated list of invoices for the given company. On the first request (no cursor), the response includes a count of matching records and a facets breakdown by status. Pass the returned next_cursor to fetch subsequent pages.

Path parameters

company_id
string
required
UUID of the company whose invoices you want to list.

Query parameters

status
string
Filter by invoice status. Supports comma-separated values for multi-select (e.g., current,overdue). Accepted values: current, overdue, past_due_1_30, past_due_31_60, past_due_61_90, past_due_90p, closed_paid, closed_overpaid, closed_credit_memo, closed_written_off. Pass any or omit to return all.
aging_bucket
string
Filter by AR aging bucket. Supports comma-separated values (e.g., 1_30,31_60). Accepted values: current, 1_30, 31_60, 61_90, 91_over. Status is calculated dynamically from the current date — not from a stored field.
customer_id
string
UUID of a specific customer. Returns only that customer’s invoices.
due_date_from
string
ISO 8601 date (YYYY-MM-DD). Returns invoices with due_date on or after this date.
due_date_to
string
ISO 8601 date (YYYY-MM-DD). Returns invoices with due_date on or before this date.
overdue_only
boolean
Pass true to return only invoices with a positive balance whose due_date is in the past.
Case-insensitive partial match against invoice number or customer name.
ar_owner
string
UUID of a team member. Filters invoices belonging to customers assigned to that AR owner.
sales_owner
string
UUID of a team member. Filters invoices belonging to customers assigned to that sales owner.
is_person
boolean
Pass true to return invoices for individual person contacts only. Pass false for company accounts.
labels
string
Comma-separated list of label UUIDs. Returns invoices matching any of the given labels (OR semantics).
hide_zero_balance
boolean
Pass true to exclude invoices with a zero balance.
group_by
string
Pass customer to return aggregated parent rows grouped by customer instead of individual invoice rows.
group_mode
string
Pass children together with group_by=customer and a customer_id to fetch the individual invoice rows within a grouped parent. Requires customer_id.
sort
string
default:"due_date"
Field to sort by. Accepted values: due_date, balance, amount, customer_name. Combine with order or append _asc / _desc (e.g., balance_desc).
order
string
default:"desc"
Sort direction: asc or desc.
limit
number
default:"30"
Maximum number of invoices to return per page. Capped at 500.
cursor
string
Opaque cursor returned as next_cursor from a previous response. Omit on the first request.

Response fields

count
number
Total invoices matching the applied filters. Only present on the first page (no cursor).
facets
object
Counts of invoices broken down by status bucket. Only present on the first page. Useful for rendering filter badges.
limit
number
The page size used for this response.
has_more
boolean
true when additional pages are available.
next_cursor
string
Pass this value as cursor on your next request. null when you have reached the last page.
applied_filters
object
Echo of all filters active for this request.
items
object[]
Array of invoice objects for the current page.

Example

curl --request GET \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices?status=past_due_31_60,past_due_61_90&sort=balance_desc&limit=30" \
  --header "Authorization: Token YOUR_API_KEY"
{
  "count": 18,
  "facets": {
    "current": 45,
    "past_due_1_30": 12,
    "past_due_31_60": 10,
    "past_due_61_90": 8,
    "past_due_90p": 3
  },
  "limit": 30,
  "has_more": false,
  "next_cursor": null,
  "applied_filters": {
    "company_id": "9e8f1234-0000-0000-0000-abcdef012345",
    "status": "past_due_31_60,past_due_61_90"
  },
  "items": [
    {
      "id": "inv00001-0000-0000-0000-000000000001",
      "customer": "c1a2b3c4-0000-0000-0000-000000000001",
      "customer_name": "Acme Corp",
      "invoice_number": "INV-2026-0042",
      "invoice_date": "2026-02-01",
      "due_date": "2026-03-03",
      "total_amount": 8500.00,
      "paid_amount": 0.00,
      "balance": 8500.00,
      "status": "past_due_61_90",
      "status_display": "Past Due 61-90",
      "days_outstanding": 70,
      "aging_bucket": "61_90",
      "ar_owner": "Jane Smith",
      "last_touch_date": "2026-04-15T10:30:00Z",
      "last_touched_by": "Jane Smith",
      "labels": [],
      "signals": [],
      "created_at": "2026-02-01T09:00:00Z",
      "updated_at": "2026-05-01T00:00:00Z"
    }
  ]
}

Create an invoice


POST /api/companies/{company_id}/invoices
Creates a new invoice record under the given company. Returns HTTP 201 with the created invoice. When paid_amount or balance is omitted, the API initializes both from total_amount.

Path parameters

company_id
string
required
UUID of the company.

Request body

customer
string
required
UUID of the customer this invoice belongs to.
total_amount
number
required
Original invoice amount.
due_date
string
Payment due date in YYYY-MM-DD format.
issue_date
string
Invoice issue date in YYYY-MM-DD format.
number
string
Invoice number as shown to customers.
URL to the payment portal for this invoice.
next_follow_up_date
string
Date (YYYY-MM-DD) for the next scheduled follow-up on this invoice.

Example

curl --request POST \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices" \
  --header "Authorization: Token YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "customer": "c1a2b3c4-0000-0000-0000-000000000001",
    "number": "INV-2026-0099",
    "total_amount": 12500.00,
    "issue_date": "2026-05-01",
    "due_date": "2026-05-31"
  }'

Get an invoice


GET /api/companies/{company_id}/invoices/{invoice_id}
Returns a single invoice with full detail, including the dunning plan if one is active on this invoice.

Path parameters

company_id
string
required
UUID of the company.
invoice_id
string
required
UUID of the invoice to retrieve.

Response fields

The detail response includes all fields from the list response, plus:
dunning_plan
object[]
The scheduled dunning plan for this invoice. Each entry describes a planned or completed touchpoint with its step, scheduled date, channel, and status. Only present when a collection program is active on this invoice.
is_progress_invoice
boolean
true when this invoice is a progress billing invoice linked to a parent invoice.
parent_invoice
string
UUID of the parent invoice for progress billing, or null.
progress_percentage
number
Percentage of the parent contract billed by this progress invoice, or null.
transaction_type
string
Transaction type as classified by the accounting system.
customer_location
string
UUID of the customer location associated with this invoice, or null.

Example

curl --request GET \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/inv00001-0000-0000-0000-000000000001" \
  --header "Authorization: Token YOUR_API_KEY"

Update an invoice


PATCH /api/companies/{company_id}/invoices/{invoice_id}
PUT  /api/companies/{company_id}/invoices/{invoice_id}
Updates an existing invoice. Use PATCH to update individual fields. Use PUT to replace the full record. You can atomically update label assignments by including label_ids in the PATCH body.

Path parameters

company_id
string
required
UUID of the company.
invoice_id
string
required
UUID of the invoice to update.

Request body (PATCH)

due_date
string
Updated due date in YYYY-MM-DD format.
Updated pay link URL.
next_follow_up_date
string
Updated follow-up date in YYYY-MM-DD format.
label_ids
string[]
Array of label UUIDs to assign. Replaces the invoice’s current label set entirely.

Example

curl --request PATCH \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/inv00001-0000-0000-0000-000000000001" \
  --header "Authorization: Token YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "next_follow_up_date": "2026-05-20",
    "label_ids": ["label-uuid-3"]
  }'

Invoice AR summary


GET /api/companies/{company_id}/invoices/summary
Returns an aggregated summary of AR across all invoices in the company — total open balance, bucket breakdowns, invoice counts by status, and other portfolio-level metrics. Use this endpoint to power dashboard summary cards.

Path parameters

company_id
string
required
UUID of the company.

Example

curl --request GET \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/summary" \
  --header "Authorization: Token YOUR_API_KEY"

Bulk update invoices


PATCH /api/companies/{company_id}/invoices/bulk
Updates a set of invoices in a single request. You can apply field updates and add or remove labels atomically across any number of invoices identified by their UUIDs.

Path parameters

company_id
string
required
UUID of the company.

Request body

invoice_ids
string[]
required
Array of invoice UUIDs to update.
updates
object
Object of field-value pairs to apply to all invoices in invoice_ids. Supports any writable invoice field (e.g., next_follow_up_date, payment_link).
add_labels
string[]
Array of label UUIDs to add to all invoices in invoice_ids. Existing labels are preserved.
remove_labels
string[]
Array of label UUIDs to remove from all invoices in invoice_ids.

Response fields

updated
number
Number of invoice records updated.

Example

curl --request PATCH \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/bulk" \
  --header "Authorization: Token YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "invoice_ids": [
      "inv00001-0000-0000-0000-000000000001",
      "inv00001-0000-0000-0000-000000000002"
    ],
    "updates": {
      "next_follow_up_date": "2026-05-25"
    },
    "add_labels": ["label-uuid-5"]
  }'
{
  "updated": 2
}

Bulk send payment reminders


POST /api/companies/{company_id}/invoices/bulk/send-reminders
Queues payment reminder notifications for a list of invoices. The reminders are dispatched asynchronously. This endpoint returns immediately with a queued status once the job is accepted.

Path parameters

company_id
string
required
UUID of the company.

Request body

invoice_ids
string[]
required
Array of invoice UUIDs to send reminders for.

Response fields

status
string
Always queued when the request is accepted.
invoice_ids
string[]
Echo of the invoice UUIDs that were queued.
message
string
Human-readable confirmation message.

Example

curl --request POST \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/bulk/send-reminders" \
  --header "Authorization: Token YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "invoice_ids": [
      "inv00001-0000-0000-0000-000000000001",
      "inv00001-0000-0000-0000-000000000003"
    ]
  }'
{
  "status": "queued",
  "invoice_ids": [
    "inv00001-0000-0000-0000-000000000001",
    "inv00001-0000-0000-0000-000000000003"
  ],
  "message": "Reminder notifications queued"
}

List payments on an invoice


GET /api/companies/{company_id}/invoices/{invoice_id}/payments
Returns all payment records linked to a specific invoice, ordered by transaction date descending. See the Payments reference for the full payment object schema.

Path parameters

company_id
string
required
UUID of the company.
invoice_id
string
required
UUID of the invoice.

Response fields

count
number
Total number of payments for this invoice.
data
object[]
Array of payment objects. See Get a payment for the full field list.

Example

curl --request GET \
  --url "https://your-instance.com/api/companies/9e8f1234-0000-0000-0000-abcdef012345/invoices/inv00001-0000-0000-0000-000000000001/payments" \
  --header "Authorization: Token YOUR_API_KEY"
{
  "count": 1,
  "data": [
    {
      "id": "pay00001-0000-0000-0000-000000000001",
      "invoice": "inv00001-0000-0000-0000-000000000001",
      "invoice_number": "INV-2026-0042",
      "payment_date": "2026-04-10",
      "amount": 4250.00,
      "payment_method": "ACH",
      "status": "PAID",
      "created_at": "2026-04-10T14:00:00Z"
    }
  ]
}