Operations API
Run bounded bulk receivables actions and generate operational exports.
Operations endpoints apply one reviewed action to explicit record selections or produce bounded data exports. Always check counts and identifier arrays in the response. The API can skip eligible, inaccessible, terminal, or approval-gated records.
Batch Operations
/v1/operations/batches| Method | Path | Request schema | Success response |
|---|---|---|---|
POST | /invoices/delete | BatchInvoiceIdsRequest | BatchDeleteResponse |
POST | /invoices/status | BatchUpdateStatusRequest | BatchStatusUpdateResponse |
POST | /invoices/send | BatchSendRequest | BatchSendResponse |
POST | /invoices/mark-paid | BatchMarkPaidRequest | BatchMarkPaidResponse |
POST | /invoices/assign-template | BatchAssignTemplateRequest | BatchAssignTemplateResponse |
POST | /invoices/duplicate | BatchInvoiceIdsRequest | BatchDuplicateResponse |
POST | /clients/archive | BatchClientIdsRequest | BatchArchiveClientsResponse |
Identifier arrays accept 1–100 UUIDs. Status updates add status. Mark-paid adds optional paidAt. Template assignment adds templateId. Batch sending can include emailSubject with maximum 500 characters and emailBody with maximum 5,000 characters.
{
"invoiceIds": [
"550e8400-e29b-41d4-a716-446655440000",
"0f8fad5b-d9cb-469f-a165-70867728950e"
],
"status": "pending"
}Response fields vary by operation but include the processed count and affected IDs. Status and send operations can also include skippedCount, skipped IDs, IDs that need approval, blocked IDs, or a summary message.
Exports
/v1/operations/exports| Method | Path | Request schema | Success response |
|---|---|---|---|
POST | /invoices | ExportInvoicesRequest | ExportInvoicesResponse |
POST | /clients | ExportClientsRequest | ExportClientsResponse |
POST | /invoice/{invoiceId} | ExportSingleInvoiceRequest | ExportSingleInvoiceResponse |
POST | /summary | ExportSummaryRequest | ExportSummaryResponse |
Invoice and client exports support json or csv. Invoice filters include status, ISO 8601 date range, client, and optional line-item inclusion. Client exports can include archived records and per-client statistics. Summary periods are month, quarter, or year.
Export responses include format, filename, content, recordCount, and truncated. A truncated response means that more records match beyond the bounded export limit. Narrow the filters or split the export window. Do not assume that the file is complete.
Concurrency and Retry Safety
- disable repeated submission while a batch is in progress
- use a stable idempotency key when the operation documents support for one
- after a timeout, check affected records before you retry a destructive batch or a batch that the client sees
- refresh invoice, client, collections, and analytics views after a successful operation
- treat generated export content as potentially sensitive organization data