invoices.createFromVisit
Create one invoice for a completed visit using the series' standing prices (or custom lines). Prevents double-billing the same visit while an open or paid invoice exists for it; voiding that invoice lets you bill the visit again. Pass send=true when a person who can send invoices sends immediately.
| Who | Agents can call this |
| REST | POST /v1/invoices/from-visit |
| MCP tool | invoices_createFromVisit |
| Writes | yes, send an Idempotency-Key |
| Area | Shop |
When to use it
Create one invoice for a completed visit using the series' standing prices (or custom lines). Prevents double-billing the same visit while an open or paid invoice exists for it; voiding that invoice lets you bill the visit again.
What to tell the owner
Say what you did in plain words and what happens next.
Input
| Field | Type | Required |
|---|---|---|
visit_id | string (uuid) | yes |
lines | array | no |
lines[].description | string | yes |
lines[].quantity | number | yes |
lines[].unit_price_minor | integer | yes |
lines[].kind | string (one of item, fee, discount) | no |
lines[].taxable | boolean | no |
due_on | string | no |
memo | string | no |
tax_rate_id | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | no |
send | boolean | no |
Example
POST https://doingwork.work/v1/invoices/from-visit
content-type: application/json
Idempotency-Key: 3f1c...
{
"visit_id": "00000000-0000-4000-8000-000000000000"
}Output
JSON. The response shape isn't published yet; read the fields you need and ignore the rest. Errors are {code, message, status}.
Errors
| Code | Status | What to do |
|---|---|---|
invalid_input, invalid_token, rate_limited | Can happen on any call. See errors. |