latestOpenAPI 3.0.42026-08-213579001013.0 KB

5f993bd211f5

Billing

Returns how far a bulk close has got, what it has written off so far, and one verdict per period it has reached.

A run reports Completed once it reaches the end of its selection, which says nothing about whether individual periods succeeded — read failed and the per-period error values for that. sweepError is set only when the run itself died. For a run started with dryRun, the counts and amounts describe what the sweep would do and nothing was written.

get/billing-periods/close-bulk/{bulkCloseId}

Path parameters

bulkCloseIdstring required

The run identifier returned when the bulk close was started.

Response

OK

bulkCloseIdstring required

The run this progress is about.

state'Sweeping' | 'Completed' | 'Failed' required
dryRunboolean required

Whether this run only reports what it would have written off.

endedBeforestring date-time required

The selection's cut-off date.

maxNetInvoiceableAmountnumber double nullable

The selection's cap, or null when the run was uncapped.

reasonstring required

Why the remaining amounts will never be invoiced.

expectedTotalinteger required

How many periods matched the selection when the sweep started. Zero until it starts.

processedinteger required

How many periods the run has reached so far.

succeededinteger required

How many periods were closed, or would be closed in a dry run.

failedinteger required

How many periods were refused or failed. A non-zero count here does not stop the run, and does not make its state Failed.

writeOffAmountnumber double required

The total written off so far, or the total that would be written off in a dry run.

sweepErrorstring nullable

Why the run itself stopped early, when it did. Set only for a run-level failure; a period the sweep refused leaves this null and reports itself in its own error.

createdAtstring date-time required

When the run was requested.

createdByIdstring uuid required

The operator accountable for the run, as recorded on every period it closes.

createdByMailstring required

The operator's mail address.

completedAtstring date-time nullable

When the run finished, whether it completed or failed. Null while it is still sweeping.