Skip to content

List materialization runs for a schedule

GET
/v1/recurring-invoices/{id}/runs
curl --request GET \
--url 'https://api.emite.cr/v1/recurring-invoices/example/runs?page=1&pageSize=25' \
--header 'Authorization: Bearer <token>'

Paginated history of the schedule: one run per occurrence (RecurringInvoiceRunDto), newest run date first; a retry updates its run and bumps attempt. Each run carries its status (pending / materialized / failed / skipped), the produced materializedInvoiceId, and a machine readable errorReason (on failure). An occurrence that came due while the schedule was paused gets no run unless the schedule is reactivated through PATCH (see there).

id
required
string

Schedule UUID

page
number
Example
1

1-indexed page number. Default 1.

pageSize
number
Example
25

Rows per page. Default 25, max 100.

Media typeapplication/json
object
items
required

The runs on this page, newest occurrence date first.

Array<object>
object
id
required

Id of the run.

string format: uuid
runDate
required

Date of the occurrence this run covers (YYYY-MM-DD). One run per occurrence: a retry updates the same run. An occurrence brought forward with run-now keeps its own date, even though the invoice is created that day.

string format: date
status
required

Outcome of the occurrence:

  • pending: being processed, or interrupted and waiting for its retry.
  • materialized: its invoice was created (and, with autoSubmit, signed: sent to Hacienda, or waiting to be sent when Hacienda did not answer).
  • failed: it failed. A transient failure (Hacienda or the BCCR not answering) is retried, and a later success turns the run materialized; a permanent one pauses the schedule and emails the company.
  • skipped: the schedule was no longer active when the queued run was processed (for example, it was paused after a run-now).
string
Allowed values: pending materialized failed skipped
materializedInvoiceId
required

Id of the invoice this run created; null while none was created (a skipped run, or a failure before the invoice existed) and if the invoice was deleted later. A failed run can carry one: the invoice was created and a later step failed.

string format: uuid
nullable
errorReason
required

What made the last failed attempt fail, at most 64 characters: the error code when the error carries one (CERTIFICATE_INVALID, FX_UNAVAILABLE, …), otherwise the name of the error. null when no attempt failed; a run that succeeded on a retry keeps the value of the attempt that failed.

string
nullable <= 64 characters
attempt
required

Attempts made for this occurrence: 1 on the first, one more per retry.

number
createdAt
required

When the first attempt claimed the occurrence (ISO 8601 instant).

string format: date-time
total
required

How many runs the schedule has, across all pages.

number
page
required

The page returned (1-based).

number
pageSize
required

Rows per page used for this answer: 25 by default, at most 100.

number
Example
{
"items": [
{
"runDate": "2026-10-01",
"status": "pending",
"errorReason": "CERTIFICATE_INVALID",
"attempt": 1
}
],
"total": 6,
"page": 1,
"pageSize": 25
}

Schedule not found, canceled, or in another company or environment.