# Invoice

The bill a client pays: numbered, due on a day, with how to pay, marked paid when the money arrives.

**What it is.** The bill a client pays: numbered, due on a day, with how to pay, marked paid when the money arrives, made by an AI agent such as Claude Code or Codex in Artifacts (tryartifacts.com), the office for AI agents. **Ask for it** in plain words: “Make an Artifacts invoice to Acme for the October retainer, due in 30 days, and log it in the invoices sheet.” It stays a live item at its own link in the space, and the space’s owner can [publish](/docs/publishing) it as a web page anyone can open. See one an agent made: [Client invoice](/p/northwind-invoice), numbered, totalled and ready to send.

> Agents read this guide with the `guide` tool, topic `invoices`, before they first make an invoice. It is shown here word for word, so people and their agents work from the same method.

| | |
| --- | --- |
| Guide topic | `invoices` |
| Tools | [5 tools](/docs/reference/invoices) |

An invoice is the bill a team sends a client, as one compact page: its number, who it is from and who it is to,
the day it was issued and the day it is due, the price lines — each an item with its quantity, unit price and
amount — with the subtotal, discount, tax and amount due, how to pay (bank details), and a short note. Artifacts
numbers it (INV-0001, INV-0002… per space) and adds the numbers up; you never type a total.

The client reads it on its **published page**, without an account, and can print it or save it as a PDF. They pay
the way **How to pay** says; when the money arrives, a person marks it **paid** (or tells you to). Artifacts keeps the
day, the amount, a note (the transfer reference) and who marked it, and the invoice stops changing.

Its status: **draft** (not published), **sent** (published), **overdue** (past its due day, not paid), **paid**.

**The invoice list.** A space can list its invoices in a sheet or a database it has, one row each: Number, Client,
Amount, Due, Status (Draft, Sent, Paid). It is picked once for the space (`list_invoices_in`, or Invoice list in the
app); every invoice is written there, and its row follows when the invoice changes, is published or is marked paid.
People sort, filter and chart it like any other sheet or database.

Tools: `create_invoice`, `read_invoice`, `update_invoice` (with `paid` to mark it paid), `list_invoices_in`,
`render_invoice` (screenshot and checks), `comment` with `clause` (a price line), and `publish_item` /
`unpublish_item` for its page. Every invoice tool answers with `checks`: what to fix before the client sees it.

## The order of work

1. **Know what is billed.** Read what the person says and the space: the sheet or database of orders, hours or
   deals. Every price, quantity and due day comes from there or from the person; never invent one.
2. **Make it** with `create_invoice`: a title people find it by ("Invoice: Redfern Logistics, November"),
   `client` (company, contact, email, address), `lines`, and `due` when the person says (default: 30 days).
   `from` and `payment` start as the space's last invoice had them; give them on the first invoice of a space.
3. **Check it** with `render_invoice` and fix every check.
4. **Hand it over**: tell the person it is ready. When they ask you to send or publish it, `publish_item` and give
   them the link; otherwise tell them Publish in the top bar gives it.
5. **When the person says it was paid**, `update_invoice` with `paid` (the day, and the reference as `note`). Never
   mark an invoice paid on a guess.

## What makes it professional

- **One screen.** The parties, the dates, the lines, the totals, how to pay. Keep `notes` to a line or two.
- **From:** your company as the client pays it, an email for questions, the address when the client's books need it.
- **Bill to:** the client company, the person who approves it, their email, the billing address when known.
- **Price lines:** one per thing billed, named as the order named it, the `unit` saying what one is ("seat / year",
  "hour"), and a `description` for the period or what is included ("Nov 2026 – Oct 2027").
- **How to pay:** the bank, account name, account and routing numbers (or IBAN and SWIFT), and the reference to
  quote — the invoice number. Only details the person gave you; never make up an account.
- **Discount and tax:** only when the person or the order says so.

## Changing it

`update_invoice` changes only what you give: `change_lines` with a line's id and the parts that change, `add_lines`
with `after` to put one in place, `order_lines` with every id once. A paid invoice refuses changes; `paid: null`
undoes a payment marked by mistake. A published invoice shows the client the version published last: after a
change, publish it again (`publish_item`, when the person asks) or tell them to.

## Checks

Every invoice tool lists what to fix: no sender, no client, no price lines, a total of 0, no payment details,
overdue, an invoice list that cannot be written, not published yet, and changed since it was published.

## See it in use

- **Examples:** [24 pages agents made for a sample company](/examples)
