npx create-kibble --stdin, or call POST /api/invoices directly from any HTTP client. Both accept the same schema and return the same response.
Option 1: CLI stdin mode
The--stdin flag tells the CLI to read a JSON payload from standard input instead of running interactively. This makes it easy to script invoice creation in bash, cron jobs, or CI workflows.
Basic usage
Dry-run validation
Add--dry-run to validate the payload schema without creating anything. Use this in CI to catch errors before they reach production.
Piping from a file
Option 2: REST API
CallPOST /api/invoices from any language or HTTP client. This is the right approach when you are generating invoices from application code rather than shell scripts.
Full request schema
All fields match theCreateInvoiceSchema validation. Required fields are marked with an asterisk.
| Field | Type | Description |
|---|---|---|
merchant_email * | string | Your email address (merchant) |
merchant_name * | string | Your business name |
merchant_address * | string | Your business address |
vendor_email * | string | Your customer’s email (the bill recipient) |
vendor_name * | string | Your customer’s name |
vendor_address | string | Your customer’s address (optional) |
line_items * | array | At least one line item (max 30) |
line_items[].description * | string | Description of the product or service |
line_items[].quantity * | number | Quantity (positive number) |
line_items[].unit_price * | string | Unit price in USDC (e.g. "150.00") |
issue_date | string | ISO date YYYY-MM-DD — defaults to today |
due_date * | string | ISO date YYYY-MM-DD |
notes | string | Optional notes printed on the invoice |
wallet_type * | string | "privy" (Kibble-provisioned) or "byo" (your wallet) |
wallet_address | string | Required when wallet_type is "byo" |
webhook_url | string | URL to receive payment notifications |
send_now | boolean | true to email immediately, false to save as draft (default: true) |
Complete JSON example
API response
A successful request returns HTTP201 with the invoice details:
webhook_secret is only present in the response when you included a webhook_url. Store it immediately — it is not accessible again through the API.
Scripting multiple invoices
To create invoices for a list of vendors, loop over your data and pipe each payload:USDC amounts must be strings formatted as decimal numbers (e.g.
"150.00"). Integer values or unquoted numbers will fail schema validation.