# Send an invoice

URL: /systems/finance/send-an-invoice · Id: `guide: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](/business/nouns/customer) an [Invoice](/business/nouns/invoice) they pay on a hosted page, with reminders until it is paid.

Needs: [Open a bank account](/systems/finance/open-a-bank-account) · [Customer](/business/nouns/customer)

**Before it runs**

- Who says yes: You. Your agent shows you the run and waits for your [Approval](/business/nouns/approval).
- You leave the chat: Never: it all happens in the chat.

## What you get
- 1 Invoice with its lines, number and due date (Invoice)
- 1 hosted page to pay by card or bank transfer (Invoice)
- 1 PDF, emailed from your domain (Message)
- 3 reminders before and after the due date (Process)
- 1 sales tax on the lines (Invoice)
- 2 lines in your books: money owed to you, then cash in once paid (Entry)

## Your agent does
**For agents**

- Guide: `guide:send-an-invoice`, status `live`. Page: [/systems/finance/send-an-invoice.md](/systems/finance/send-an-invoice.md).
- Approval: ask the founder first. Show the run, then wait for their Approval; a refusal ends it.
- Leaves the chat: never.
- Needs first: [Open a bank account](/systems/finance/open-a-bank-account), [Customer](/business/nouns/customer).
- Run: call the steps in order, each through the API, SDK, CLI or MCP tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Invoice.create`](/business/nouns/invoice/create) (`verb:Invoice.create`) | `total` money, required: example `{"amount":29,"currency":"USD"}`; `due` date, required: example `"2026-11-22"`; `collection` string: example `"send"` | `invoice` Invoice |
| 2 | [`Invoice.bill`](/business/nouns/invoice/bill) (`verb:Invoice.bill`) | `invoice` Invoice (an id), required: the `$id` step 1 returns | `invoice` Invoice |

Returns: the last call answers with `invoice` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "invoice": {
    "$id": "https://api.sb/leaseline.app/invoices/invoice_1",
    "$type": "Invoice",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "due": "2026-11-22",
    "collection": "send",
    "status": "open"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Invoice.bill",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Make it net 15”, or “Charge their saved card on the due date”.

Calls: `Invoice.create` → `Invoice.bill`

Ask:

```text
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.
```

API:

```bash
# 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"
```

SDK:

```ts
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 })
```

CLI:

```bash
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"'"}'
```

MCP:

```json
{
  "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](/systems/billing), [Ledger](/systems/ledger), [Tax](/systems/tax)
- Nouns: [Invoice](/business/nouns/invoice), [Customer](/business/nouns/customer), [Entry](/business/nouns/entry)
- Events: `Invoice.created`, [`Invoice.billed`](/business/events/Invoice.billed), [`Invoice.collected`](/business/events/Invoice.collected)
- Stripe objects: `Customer`, `Invoice`, `Invoice Item`, `PaymentIntent`, `Tax Calculation`, `Hosted Invoice Page`

[`Invoice.bill`](/business/nouns/invoice/bill) finalizes the Invoice, so its number and lines no longer change. To correct one, void it and send another. [`Invoice.collect`](/business/nouns/invoice/collect) charges a saved card on the due date when the Customer has one.