Skip to main content
If you need to create invoices in bulk, on a schedule, or as part of a deployment pipeline, Kibble gives you two automation-friendly approaches: pipe a JSON payload to 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

Set "send_now": false to create a draft invoice without emailing the vendor. You can send it later with POST /api/invoices/{id}/send once you have reviewed it.

Option 2: REST API

Call POST /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 the CreateInvoiceSchema validation. Required fields are marked with an asterisk.

Complete JSON example

API response

A successful request returns HTTP 201 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.