Recurring invoices
A recurring invoice is a template plus a schedule. EmiteCR replays the
template through the normal emission pipeline on each run, so every generated
document is a real invoice with its own clave and status.
POST /v1/recurring-invoicesGET /v1/recurring-invoicesGET /v1/recurring-invoices/:idPATCH /v1/recurring-invoices/:idDELETE /v1/recurring-invoices/:idPOST /v1/recurring-invoices/preview-next-runsGET /v1/recurring-invoices/:id/runsPOST /v1/recurring-invoices/:id/pausePOST /v1/recurring-invoices/:id/resumePOST /v1/recurring-invoices/:id/run-nowHow it works
Section titled “How it works”- The template holds a full invoice payload (docType, receiver, lines, taxes) plus a cadence (interval + start/end).
- A background sweep finds templates due to run and emits them by replaying the
template through
create()— the same path a manual invoice takes. - Each execution is a run you can inspect (
/runs), with the resulting invoice id and status.
Controlling a schedule
Section titled “Controlling a schedule”preview-next-runs— dry-run the next N dates before committing to a cadence.pause/resume— stop and restart without deleting the template.run-now— emit an out-of-band occurrence immediately (e.g. to catch up).
- Gated by the
recurring:*scopes and the recurring-invoices feature on the tenant’s plan. - Because each run goes through normal emission, all the usual rules apply — quota consumption (production), idempotency, Hacienda acceptance, webhooks.
- A run that fails (e.g. Hacienda rejection) is visible in
/runs; fix the template and let the next occurrence run, orrun-now.