create_invoice
Create a new invoice. Requires the Invoices module enabled on the account (disabled by default) — if the API returns 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support to request access. Subtotal, TaxAmount and Total are ALWAYS computed server-side from items, discount_amount and tax_rate — never calculate or promise totals yourself; report what the API returns. The computed total must be between $1 and $1,000,000. Creating an invoice NEVER notifies the recipient automatically — sharing the PublicLink is up to the user. DISPLAY RULE: never show InvoiceToken/PublicToken UUIDs to the user; the PublicLink URL and InvoiceNumber ARE meant to be shared.
create_invoice
When to use
Create a new invoice. Requires the Invoices module enabled on the account (disabled by default) — if the API returns 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support to request access. Subtotal, TaxAmount and Total are ALWAYS computed server-side from items, discount_amount and tax_rate — never calculate or promise totals yourself; report what the API returns. The computed total must be between $1 and $1,000,000. Creating an invoice NEVER notifies the recipient automatically — sharing the PublicLink is up to the user. DISPLAY RULE: never show InvoiceToken/PublicToken UUIDs to the user; the PublicLink URL and InvoiceNumber ARE meant to be shared.
Parameters to validate before calling
bill_to(object, required) — Recipient object with PascalCase keys exactly as the API expects: {"Name": "...", "Email": "..."} required; optional keys: Company, Phone, Address, City, State, ZipCode, Country, TaxIditems(array, required) — Line items array (min 1, max 60) with PascalCase keys: [{"Description": "..." (required), "Quantity": number (max 100), "Rate": number (max 1000000)}]. Amount per line is computed server-sidetitle(string, optional) — Invoice title/concept (max 200 characters, optional)issue_date(string, optional) — Issue date in ISO format YYYY-MM-DD (optional, defaults to today)due_date(string, optional) — Due date in ISO format YYYY-MM-DD (optional, defaults to account setting)discount_amount(number, optional) — Flat discount amount, capped at the subtotal (optional)tax_enabled(boolean, optional) — Apply tax to the invoice (optional, default false)tax_label(string, optional) — Tax label shown on the invoice (optional, default "Tax")tax_rate(number, optional) — range: 0–100 — Tax percentage 0-100 (optional)payment_method(string, optional) — one of:card,check,transfer— Payment method (optional, default "card")payment_instructions(string, optional) — Offline payment instructions — only for "check" or "transfer" methods (optional)notes_to_recipient(string, optional) — Notes shown to the recipient (max 3000 characters, optional)terms(string, optional) — Terms and conditions text (max 3000 characters, optional)status(string, optional) — one of:draft,pending— Initial status (optional, default "draft"). "pending" publishes immediately
Notes
Requires the Invoices module enabled on the account — on 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support
Subtotal, TaxAmount and Total are computed server-side from Items, DiscountAmount and TaxRate — never calculate totals yourself; report what the API returns
Computed total must be between $1 and $1,000,000; max 60 line items
Creating an invoice NEVER notifies the recipient — sharing the PublicLink is up to the user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Line items array (min 1, max 60) with PascalCase keys: [{"Description": "..." (required), "Quantity": number (max 100), "Rate": number (max 1000000)}]. Amount per line is computed server-side | |
| terms | No | Terms and conditions text (max 3000 characters, optional) | |
| title | No | Invoice title/concept (max 200 characters, optional) | |
| status | No | Initial status (optional, default "draft"). "pending" publishes immediately | |
| bill_to | Yes | Recipient object with PascalCase keys exactly as the API expects: {"Name": "...", "Email": "..."} required; optional keys: Company, Phone, Address, City, State, ZipCode, Country, TaxId | |
| due_date | No | Due date in ISO format YYYY-MM-DD (optional, defaults to account setting) | |
| tax_rate | No | Tax percentage 0-100 (optional) | |
| tax_label | No | Tax label shown on the invoice (optional, default "Tax") | |
| issue_date | No | Issue date in ISO format YYYY-MM-DD (optional, defaults to today) | |
| tax_enabled | No | Apply tax to the invoice (optional, default false) | |
| payment_method | No | Payment method (optional, default "card") | |
| discount_amount | No | Flat discount amount, capped at the subtotal (optional) | |
| notes_to_recipient | No | Notes shown to the recipient (max 3000 characters, optional) | |
| payment_instructions | No | Offline payment instructions — only for "check" or "transfer" methods (optional) |