Create an invoice
Create a pending invoice from line items. The invoice number (INV-YYYY-NNNN) is assigned automatically. Nothing is emailed.
POST
https://api.centerfy.ai/webhooks/inbound/invoices Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | Authenticates the request; or use Authorization: Bearer <key>. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
contact_id | string (uuid) | Yes | — | Contact in this sub-account to bill. |
items | { item, quantity, amount }[] | Yes | — | Line items (1–200). item: non-empty string; quantity: integer ≥ 1; amount: unit price, number ≥ 0.01. The total is the sum of amount × quantity, rounded to cents. |
due_date | string (YYYY-MM-DD) | No | — | Due date. Defaults to 30 days from today. |
notes | string | No | — | Notes shown on the invoice. |
Request body
{
"contact_id": "3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f",
"items": [
{
"item": "Website redesign",
"quantity": 1,
"amount": 1500
},
{
"item": "Monthly hosting",
"quantity": 3,
"amount": 25
}
],
"due_date": "2026-11-05",
"notes": "Net 30"
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/invoices" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f",
"items": [
{
"item": "Website redesign",
"quantity": 1,
"amount": 1500
},
{
"item": "Monthly hosting",
"quantity": 3,
"amount": 25
}
],
"due_date": "2026-11-05",
"notes": "Net 30"
}' import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.invoices.create({
"contact_id": "3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f",
"items": [
{
"item": "Website redesign",
"quantity": 1,
"amount": 1500
},
{
"item": "Monthly hosting",
"quantity": 3,
"amount": 25
}
],
"due_date": "2026-11-05",
"notes": "Net 30"
});
console.log(result); centerfy invoices create '{"contact_id":"3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f","items":[{"item":"Website redesign","quantity":1,"amount":1500},{"item":"Monthly hosting","quantity":3,"amount":25}],"due_date":"2026-11-05","notes":"Net 30"}' MCP tool: centerfy_invoices_create (see MCP server)
Response
{
"status": "success",
"invoice": {
"id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
"invoice_number": "INV-2026-0012",
"contact_id": "3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f",
"quote_id": null,
"amount": 1575,
"status": "pending",
"issued_at": "2026-10-06T10:00:00.000Z",
"due_date": "2026-11-05",
"paid_at": null,
"payment_method": null,
"notes": "Net 30",
"items": [
{
"item": "Website redesign",
"quantity": 1,
"amount": 1500
},
{
"item": "Monthly hosting",
"quantity": 3,
"amount": 25
}
],
"payment_url": null,
"payment_link_expires_at": null,
"created_at": "2026-10-06T10:00:00.000Z",
"updated_at": "2026-10-06T10:00:00.000Z"
}
}Errors
400— if contact_id is not a UUID, an item is invalid, or due_date is not a valid date.404— if the contact is not in this sub-account.
Notes
Returns 201. Payment links for invoices can’t be created through the API.