Skip to content

Send an invoice

Say "invoice them $29, due in 30 days" and get an invoice with a pay page, a PDF from your domain, reminders, sales tax and the payment in your books.

Send a Customer an Invoice they pay on a hosted page, with reminders until it is paid.

Needs Open a bank account · Customer

What you get

  • 1Invoice with its lines, number and due dateInvoice
  • 1hosted page to pay by card or bank transferInvoice
  • 1PDF, emailed from your domainMessage
  • 3reminders before and after the due dateProcess
  • 1sales tax on the linesInvoice
  • 2lines in your books: money owed to you, then cash in once paidEntry

Your agent does

Invoice.create → Invoice.bill
You, to your agent

Send a customer a $29 invoice, due in 30 days.

Bill Harbor Properties for this month’s setup work.

Send the invoice and chase it if they pay late.

# 1. Invoice.create
INVOICE=$(curl -X POST https://api.sb/leaseline.app/invoices \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"total":{"amount":29,"currency":"USD"},"due":"2026-11-22","collection":"send"}' | jq -r '.invoice["$id"] | split("/") | last')

# 2. Invoice.bill
curl -X POST https://api.sb/leaseline.app/invoices/$INVOICE/bill \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
import { $ } from 'startup-builder'

const invoice = await $.Invoice.create({ total: { amount: 29, currency: 'USD' }, due: '2026-11-22', collection: 'send' })
await $.Invoice.bill({ invoice: invoice.$id })
INVOICE=$(npx startup-builder do Invoice.create --json '{"total":{"amount":29,"currency":"USD"},"due":"2026-11-22","collection":"send"}' | jq -r '.invoice["$id"] | split("/") | last')
npx startup-builder do Invoice.bill --json '{"invoice":"'"$INVOICE"'"}'
{
  "name": "do",
  "arguments": {
    "code": "const invoice = await $.Invoice.create({ total: { amount: 29, currency: 'USD' }, due: '2026-11-22', collection: 'send' })\nreturn await $.Invoice.bill({ invoice: invoice.$id })"
  }
}

Change it

  • Make it net 15.
  • Charge their saved card on the due date.
  • Void it and send a corrected one.

Under the hood

Systems
Billing, Ledger, Tax
Nouns
Invoice, Customer, Entry
Events
Invoice.created, Invoice.billed, Invoice.collected
Stripe objects
Customer, Invoice, Invoice Item, PaymentIntent, Tax Calculation, Hosted Invoice Page

Invoice.bill finalizes the Invoice, so its number and lines no longer change. To correct one, void it and send another. Invoice.collect charges a saved card on the due date when the Customer has one.