Recurring invoices
Templates with a schedule that generate invoices through the same path as POST /invoices.
A recurring invoice is an invoice template plus a schedule and automation flags. The daily jobs (02:00 and 18:45 UAE time) turn due templates into invoices; each generated invoice goes through the normal creation path (PINT AE validation, number allocation, optional submission and email), so everything documented for outgoing invoices applies.
Create and activate
curl -X POST "$BASE/recurring-invoices" -H "X-API-KEY: $KEY" -H "Content-Type: application/json" -d '{
"name": "Monthly retainer – Buyer LLC",
"buyer": { "id": "…" },
"items": [{ "description": "Retainer", "quantity": 1, "unitPrice": 5000, "unitCode": "MON" }],
"subject": "Monthly retainer",
"payment": { "termsDays": 14 },
"projectId": "…",
"schedule": { "frequency": "monthly", "dayOfMonth": 1, "startDate": "2027-01-01", "periodOffset": -1, "periodTextTemplate": "for {{periodMonth}} {{periodYear}}" },
"automation": { "validate": true, "submit": true, "send": true, "sendTo": ["ap@buyer.ae"] },
"status": "active"
}'
Templates are created as draft unless status: "active" is given. POST /recurring-invoices/{id}/activate, /pause and /cancel change the status; PATCH edits the template (items replaces all lines; schedule changes recompute nextRunOn).
Schedule
| Field | Meaning |
|---|---|
frequency | weekly, monthly, quarterly, half_yearly, yearly, custom |
intervalCount | Every N periods (default 1) |
dayOfMonth | 1–31, or 0 for the last day; clamped in shorter months |
weekday | ISO weekday 1 (Monday) to 7 (Sunday), weekly only |
customDates | Explicit dates for custom |
startDate, endDate, maxOccurrences | Bounds; the template becomes completed when they are reached |
periodOffset | Billed period relative to the run: -1 previous (in arrears), 0 current, 1 next (in advance) |
issueDateOffsetDays | Issue date = run date + offset |
fillInvoicingPeriod | Write the billed period into BT-73/BT-74 (default true) |
periodTextTemplate | Appended to the subject; tokens {{periodStart}}, {{periodEnd}}, {{periodMonth}}, {{periodYear}}, {{runDate}}, {{n}} |
GET /recurring-invoices/{id}/preview returns the next occurrences with their periods and the exact POST /invoices payload of the next run. The MCP resource einvoicing://reference/recurring-schedules documents the same fields.
Runs
- The daily jobs process templates whose
nextRunOnis today or earlier, at most twelve catch-up occurrences per template. POST /recurring-invoices/{id}/run(body{ "date": "YYYY-MM-DD" }optional) generates now and returns201withinvoiceId, or422with the error.GET /recurring-invoices/{id}/runslists runs (success,failed,skipped) with the invoice id and number. One invoice per template and date is guaranteed; failed runs are retried at the next run.- Generated invoices carry
recurringInvoiceIdandexternalId: "recurring:<templateId>:<date>"; filter withGET /invoices?recurringInvoiceId=. POST /invoices/{id}/make-recurringcopies an existing invoice into a draft template.
Webhooks and MCP
Events recurring_invoice.generated (with invoiceId, nextRunOn) and recurring_invoice.failed (with error). MCP tools: list_recurring_invoices, get_recurring_invoice, create_recurring_invoice, update_recurring_invoice, activate_recurring_invoice, pause_recurring_invoice, cancel_recurring_invoice, run_recurring_invoice_now, list_recurring_runs, preview_recurring_invoice, make_invoice_recurring, delete_recurring_invoice.