Create invoice
Create a draft invoice for a client or a completed job.
POST https://cotlet.dev/api/v1/jobber/clients/{client_id}/invoices
write
Creates an invoice in Draft status from a job or from line items. A draft is not sent and not due, so create_invoice reaches no one and runs without asking first. Check the total, then send it with send_invoice.
Parameters
| Name | Type | Description |
|---|---|---|
| client_id string required | string | Client ID from list_clients. |
| job_id string | string | Invoice this job. Without it, pass line_items. |
| line_items array | array | Items with name, quantity and unit_price. |
Request
curl -X POST https://cotlet.dev/api/v1/jobber/clients/client_8c41d2/invoices \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("jobber", "create_invoice", {"client_id":"client_8c41d2"}) const result = await cotlet.call('jobber', 'create_invoice', {"client_id":"client_8c41d2"}); cotlet call jobber create_invoice --data '{"client_id":"client_8c41d2"}' Example response
{
"invoice_id": "inv_20431",
"number": 1051,
"status": "draft",
"total": 480,
"balance": 480,
"currency": "USD"
}