vsmsconnect — API — invoices

← all endpoints

GET/api/v1/businesses/:businessId/invoices/batches auth: jwt (administrator | view_invoices | submit_invoices)

Paginated list of import batches for the business. Each batch row carries row counts (imported/failed) and the originating file metadata. Registered before /:invoiceId so the literal 'batches' segment never collides with the dynamic id.

handlers: InvoicesController.listBatches

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID. Enforced by requireBusinessAccess (Administrator bypasses).
offset query
integer
no0Pagination offset. Coerced from string; min 0.
limit query
integer
no50Page size. Coerced from string; min 1, max 200.

Outputs

200
APIResponseDataList<ImportBatchDTO>
Page of import batches with totalRows + hasMore.
GET/api/v1/businesses/:businessId/invoices/daily-fiscal-report auth: jwt (administrator | view_invoices | submit_invoices)

Daily fiscal report. Signed-type classification (TAXCORE-922): every figure reads what V-SDC SIGNED (InvoicePayments.WireInvoiceType / WireTransactionType, with the wire mapper's fallbacks), through one shared filter shared with /payment-records — so any figure equals the records behind it. Cancellations are identified by CancelsPaymentId; a cancelled original still counts as a sale and its cancellation as the refund it signed, netting to 0. byPaymentType is split by tender. Adds byReceiptType, byReceiptCode (per TaxCore code NS/AS/NR/AR/CS/CR/PS/PR/TS/TR with its cancellations), byPaymentTypeNet (Normal + Advance, refunds subtracting), saleRefundTotals.saleCount/refundCount and cancellations.byTransactionType; every earlier field keeps its shape. Window precedence fromDay/toDay > dateFromMs/dateToMs > legacy ISO dateFrom/dateTo. Fires DAILY_FISCAL_REPORT_GENERATED with the resolved window and scope.

handlers: InvoicesController.getDailyFiscalReport

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
fromDay query
YYYY-MM-DD
no—Preferred window start — a Vanuatu calendar day, resolved server-side to 00:00:00.000 UTC+11. Takes precedence over the ms and ISO pairs. Supply with toDay.
toDay query
YYYY-MM-DD
no—Window end — resolved to 23:59:59.999 UTC+11 on that Vanuatu day.
dateFromMs query
epoch ms
no—Inclusive window start (TAXCORE-701). Used when fromDay/toDay are absent.
dateToMs query
epoch ms
no—Inclusive window end.
dateFrom query
ISO-8601 datetime
no—Deprecated legacy window start, kept for installed app builds (old UTC end-of-day normalisation intact).
dateTo query
ISO-8601 datetime
no—Deprecated legacy window end.
provider query
CSV of Invoices.Source
no—Any-of connector filter.
tillId query
CSV of uuid
no—Any-of till filter.
locationId query
CSV of uuid
no—Any-of location filter — matches LocationId OR BusinessLocationId.
outletId query
CSV of string
no—Any-of Lightspeed outlet filter.
receiptType query
CSV of SALE|REFUND|COPY|ADVANCE|PROFORMA|TRAINING
no—Any-of SIGNED receipt type.
transactionType query
CSV of SALE|REFUND
no—Any-of SIGNED direction. With receiptType it selects a TaxCore code — ADVANCE + REFUND is AR.
receiptCode query
CSV of NS|NR|AS|AR|CS|CR|PS|PR|TS|TR
no—Any-of TaxCore receipt code — any mix (NS + AR lists exactly those two).
status query
CSV of signed|blocked|error
no—Any-of status. Figures always count signed receipts; completeness blocked/error.
search query
string
no—Substring over fiscal number, invoice number, buyer name and buyer TIN.

Outputs

200
APIResponseDataObject<DailyFiscalReportResponse>
Dense report — every enum key present.
422
APIError
VALIDATION_ERROR — missing/half window, fromDay > toDay, or an unknown axis value.
GET/api/v1/businesses/:businessId/invoices/daily-fiscal-report/export.csv auth: jwt (administrator | view_invoices | submit_invoices)

The daily report as CSV: the window (Vanuatu time), the applied scope and completeness, then one "section, bucket, count, amount" row per bucket. Same query as the JSON report. UTF-8 BOM, every cell quoted, formula-trigger text neutralised. Fires RECEIPT_RECORDS_EXPORTED (kind: summary).

handlers: InvoicesController.exportDailyFiscalReportCsv

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
fromDay query
YYYY-MM-DD
no—Preferred window start — a Vanuatu calendar day, resolved server-side to 00:00:00.000 UTC+11. Takes precedence over the ms and ISO pairs. Supply with toDay.
toDay query
YYYY-MM-DD
no—Window end — resolved to 23:59:59.999 UTC+11 on that Vanuatu day.
dateFromMs query
epoch ms
no—Inclusive window start (TAXCORE-701). Used when fromDay/toDay are absent.
dateToMs query
epoch ms
no—Inclusive window end.
provider query
CSV of Invoices.Source
no—Any-of connector filter.
tillId query
CSV of uuid
no—Any-of till filter.
locationId query
CSV of uuid
no—Any-of location filter — matches LocationId OR BusinessLocationId.
outletId query
CSV of string
no—Any-of Lightspeed outlet filter.
receiptType query
CSV of SALE|REFUND|COPY|ADVANCE|PROFORMA|TRAINING
no—Any-of SIGNED receipt type.
transactionType query
CSV of SALE|REFUND
no—Any-of SIGNED direction. With receiptType it selects a TaxCore code — ADVANCE + REFUND is AR.
receiptCode query
CSV of NS|NR|AS|AR|CS|CR|PS|PR|TS|TR
no—Any-of TaxCore receipt code — any mix (NS + AR lists exactly those two).
status query
CSV of signed|blocked|error
no—Any-of status. Figures always count signed receipts; completeness blocked/error.
search query
string
no—Substring over fiscal number, invoice number, buyer name and buyer TIN.

Outputs

200
text/csv; charset=utf-8
Content-Disposition: attachment.
422
APIError
VALIDATION_ERROR — missing/half window, fromDay > toDay, or an unknown axis value.
GET/api/v1/businesses/:businessId/invoices/payment-records auth: jwt (administrator | view_invoices | submit_invoices)

One row per PAYMENT (signed or not) under the shared reporting filter, with each row's TaxCore receiptCode, countsByReceiptType (computed without the receiptType axis) and countsByCode (without receiptType and transactionType), countsByStatus (without status), totalRows and familyLinkedOnly. invoiceId switches on family mode: every receipt on those invoices and every invoice linked by refund / copy / adjustment, window ignored. Registered before /:invoiceId.

handlers: InvoicesController.listPaymentRecords

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
fromDay query
YYYY-MM-DD
no—Preferred window start — a Vanuatu calendar day, resolved server-side to 00:00:00.000 UTC+11. Takes precedence over the ms and ISO pairs. Supply with toDay.
toDay query
YYYY-MM-DD
no—Window end — resolved to 23:59:59.999 UTC+11 on that Vanuatu day.
dateFromMs query
epoch ms
no—Inclusive window start (TAXCORE-701). Used when fromDay/toDay are absent.
dateToMs query
epoch ms
no—Inclusive window end.
provider query
CSV of Invoices.Source
no—Any-of connector filter.
tillId query
CSV of uuid
no—Any-of till filter.
locationId query
CSV of uuid
no—Any-of location filter — matches LocationId OR BusinessLocationId.
outletId query
CSV of string
no—Any-of Lightspeed outlet filter.
receiptType query
CSV of SALE|REFUND|COPY|ADVANCE|PROFORMA|TRAINING
no—Any-of SIGNED receipt type.
transactionType query
CSV of SALE|REFUND
no—Any-of SIGNED direction. With receiptType it selects a TaxCore code — ADVANCE + REFUND is AR.
receiptCode query
CSV of NS|NR|AS|AR|CS|CR|PS|PR|TS|TR
no—Any-of TaxCore receipt code — any mix (NS + AR lists exactly those two).
status query
CSV of signed|blocked|error
no—Any-of status. Figures always count signed receipts; completeness blocked/error.
search query
string
no—Substring over fiscal number, invoice number, buyer name and buyer TIN.
invoiceId query
CSV of uuid (≤ 20)
no—Family mode — makes the window optional and ignored.
offset query
integer ≥ 0
no—Default 0.
limit query
integer 1–200
no—Default 50.
sortBy query
paymentDate | amount
no—Default paymentDate; InvoicePaymentId is the tie-break.
sortDirection query
asc | desc
no—Default desc.
printable query
a4 | slip
no—Only payments the receipts bundle can render in this format, so totalRows is the bundle page count.

Outputs

200
APIResponseDataObject<ReceiptRecordsResponse>
A page of ReceiptRecordDTO rows.
422
APIError
VALIDATION_ERROR — missing/half window, fromDay > toDay, or an unknown axis value.
GET/api/v1/businesses/:businessId/invoices/payment-records/export.csv auth: jwt (administrator | view_invoices | submit_invoices)

Every payment record the filter matches, streamed in 500-row pages. One column per payment method (a split-tender payment shows each tender under its own method) plus a method text column; payment dates in Vanuatu time. Fires RECEIPT_RECORDS_EXPORTED (kind: records, rowCount).

handlers: InvoicesController.exportPaymentRecordsCsv

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
fromDay query
YYYY-MM-DD
no—Preferred window start — a Vanuatu calendar day, resolved server-side to 00:00:00.000 UTC+11. Takes precedence over the ms and ISO pairs. Supply with toDay.
toDay query
YYYY-MM-DD
no—Window end — resolved to 23:59:59.999 UTC+11 on that Vanuatu day.
dateFromMs query
epoch ms
no—Inclusive window start (TAXCORE-701). Used when fromDay/toDay are absent.
dateToMs query
epoch ms
no—Inclusive window end.
provider query
CSV of Invoices.Source
no—Any-of connector filter.
tillId query
CSV of uuid
no—Any-of till filter.
locationId query
CSV of uuid
no—Any-of location filter — matches LocationId OR BusinessLocationId.
outletId query
CSV of string
no—Any-of Lightspeed outlet filter.
receiptType query
CSV of SALE|REFUND|COPY|ADVANCE|PROFORMA|TRAINING
no—Any-of SIGNED receipt type.
transactionType query
CSV of SALE|REFUND
no—Any-of SIGNED direction. With receiptType it selects a TaxCore code — ADVANCE + REFUND is AR.
receiptCode query
CSV of NS|NR|AS|AR|CS|CR|PS|PR|TS|TR
no—Any-of TaxCore receipt code — any mix (NS + AR lists exactly those two).
status query
CSV of signed|blocked|error
no—Any-of status. Figures always count signed receipts; completeness blocked/error.
search query
string
no—Substring over fiscal number, invoice number, buyer name and buyer TIN.
invoiceId query
CSV of uuid (≤ 20)
no—Family mode.
sortBy query
paymentDate | amount
no—Default paymentDate.
sortDirection query
asc | desc
no—Default asc.

Outputs

200
text/csv; charset=utf-8
Content-Disposition: attachment.
422
APIError
VALIDATION_ERROR — missing/half window, fromDay > toDay, or an unknown axis value.
POST/api/v1/businesses/:businessId/invoices/receipts auth: jwt (administrator | view_invoices | submit_invoices)

One merged PDF of signed receipts. Body is exactly one of { invoiceIds (1–20), includeLinked? } | { paymentIds (1–40) } | { filter: ReceiptRecordsQuery }, plus format (slip | a4) and order (paymentDate | invoice). Capped at 40 rendered pages, counted before rendering. X-Receipts-Rendered / X-Receipts-Skipped headers carry the counts. Fires INVOICE_RECEIPTS_DOWNLOADED with variant and pages.

handlers: InvoicesController.getReceiptsBundle

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
body body
ReceiptsBundleRequest
yes—See summary.

Outputs

200
application/pdf
The merged bundle.
422
APIError
RECEIPT_BUNDLE_TOO_LARGE with data { pages, maxPages }, INVOICE_NOT_FISCALISED when nothing renders, or VALIDATION_ERROR.
GET/api/v1/businesses/:businessId/invoices auth: jwt (administrator | view_invoices | submit_invoices)

Paginated invoice list for the business. RTK infinite-query compatible. Returns invoices in the same shape as the single-invoice GET (with embedded payments[] and line-items omitted).

handlers: InvoicesController.list

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
offset query
integer
no0Pagination offset. min 0.
limit query
integer
no50Page size. min 1, max 200.

Outputs

200
APIResponseDataList<InvoiceDTO>
Page of invoices with totalRows + hasMore.
GET/api/v1/businesses/:businessId/invoices/:invoiceId auth: jwt (administrator | view_invoices | submit_invoices)

Fetch a single invoice with its line items and payments[] embedded. Cross-tenant probing returns 404 since the repo filters by businessId.

handlers: InvoicesController.getById

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Invoice UUID.

Outputs

200
APIResponseDataObject<InvoiceDTO>
Invoice with line items and embedded payments[].
404
APIError
INVOICE_NOT_FOUND — invoice does not exist under this business.
GET/api/v1/businesses/:businessId/invoices/:invoiceId/payments auth: jwt (administrator | view_invoices | submit_invoices)

List every payment under a single invoice. Returns the same payments[] array embedded on GET /invoices/:invoiceId plus per-payment fiscal data (FiscalInvoiceNumber, FiscalTimestamp, etc.). Ordered by PaymentDate ASC, CreatedAt ASC. Lets the FE refresh only the payments list after a per-payment action without re-fetching the parent invoice.

handlers: InvoicesController.listPayments

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Parent invoice UUID. Existence under businessId is verified before payments are listed (prevents cross-tenant probing of payment IDs).

Outputs

200
APIResponseDataObject<GetInvoicePaymentsResponse>
{ payments: InvoicePaymentDTO[] } — possibly empty.
404
APIError
INVOICE_NOT_FOUND — invoice does not exist under this business.
GET/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId auth: jwt (administrator | view_invoices | submit_invoices)

Direct drill-down for a single InvoicePayments row. Returns the same InvoicePaymentDTO shape that appears inside the parent invoice's payments[] array. Returns 404 when the payment doesn't belong to the (invoiceId, businessId) pair — protects against cross-tenant or cross-invoice probing.

handlers: InvoicesController.getPaymentById

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Parent invoice UUID.
paymentId path
uuid
yes—Payment UUID. Must belong to invoiceId under businessId.

Outputs

200
APIResponseDataObject<GetInvoicePaymentByIdResponse>
Single InvoicePaymentDTO.
404
APIError
INVOICE_NOT_FOUND — payment missing or under a different invoice/business.
POST/api/v1/businesses/:businessId/invoices/reprocess-unmapped auth: jwt (administrator)

Re-sync blocked invoices. Re-evaluates the business's blocked payments in sequential passes: tax mapping (MISSING_TAX_MAPPING), credit notes waiting on their original (REFERENT_NOT_FISCALISED / REFERENT_DOCUMENT_MISSING), currency (CURRENCY_MISMATCH), then each connector's location / certificate pass (http, xero, lightspeed-x, hike, amicus, sage100, eposnow, sage200evolution, atrex). Released payments are dispatched as fiscalisation jobs of at most 20. `source` limits the run to one provider's invoices; `invoiceIds` limits it to a selection; `tenantId` (with `source=xero`) to one Xero organisation. Runs in the background: replies `202 { runId }` at once and stores the outcome on the run. The finished run's `result` is an `APIResponseDataObject<ReprocessSelectionResult>` (`reprocessed`, `nowEligible`, `nowEligibleInvoices`, `nowEligibleQuotes`, `stillBlocked`, `autoFiscalisationJobIds`, `notResyncable`).

handlers: InvoicesController.reprocessUnmapped

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
source query
InvoiceSource
no—Only this provider's blocked invoices.
tenantId query
string
no—With `source=xero`: only this Xero organisation's blocked invoices.
invoiceIds body
uuid[] (1-20)
no—Only these invoices (the home dashboard selection). Body may be omitted.

Outputs

202
APIResponseDataObject<BackgroundRunAcceptedDTO>
Started in the background: `{ runId }`. Poll `GET /api/v1/businesses/:businessId/background-runs/:runId`; once `status` is `done`, `result` holds the response body this endpoint used to return.
409
APIError
BACKGROUND_RUN_IN_PROGRESS — a blocked-invoice re-sync for this business (every re-sync entry point shares one lock) is already running. `data` is `BackgroundRunInProgressDTO` (`runId`, `kind`, `params`, `startedAt`) of the running run.
POST/api/v1/businesses/:businessId/invoices/cancel-bulk auth: jwt (administrator | submit_invoices)

Bulk cancel up to MAX_PAYMENTS_PER_FISCALISATION_JOB fiscalised payments in one job. Builds a cancellation row per valid payment, then dispatches every freshly-inserted cancellation in a single FiscalisationJob so the client polls one jobId. Invalid IDs come back in blocked[]; IDs whose original already has a cancellation in flight come back in inFlight[]. Fires INVOICE_PAYMENT_CANCELLATION_REQUESTED audit per dispatched payment.

handlers: InvoicesController.cancelBulk

Inputs

Request body type: CancelInvoicesBulkBody

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
paymentIds body
uuid[]
yes—1..MAX_PAYMENTS_PER_FISCALISATION_JOB payment UUIDs to cancel. Validated by CancelInvoicesBulkBodySchema.

Outputs

202
APIResponseDataObject<BulkCancelInvoiceResponse>
{ jobIds, cancelledPaymentIds, blocked[], inFlight[] } — jobIds is empty when nothing was dispatched.
422
APIError
INVOICE_CANCELLATION_BULK_EMPTY | CERTIFICATE_NOT_CONFIGURED | VALIDATION_ERROR (schema bound exceeded).
POST/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId/cancel auth: jwt (administrator | submit_invoices)

Cancel a single fiscalised payment. Issues a cancellation row (Sale → Refund / Refund → Sale) with the same line items but BuyerTin set to the seller's TIN and ReferentDocumentNumber pointing back at the original SDC fiscal number, then dispatches it through the standard fiscalisation pipeline. Poll the returned jobId — on success the original payment is marked cancelled by the consumer. Fires INVOICE_PAYMENT_CANCELLATION_REQUESTED audit.

handlers: InvoicesController.cancel

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Parent invoice UUID.
paymentId path
uuid
yes—Payment UUID to cancel. Must be fiscalised and not already in flight.

Outputs

202
APIResponseDataObject<CancelInvoiceResponse>
{ jobId, cancellationPaymentId } — poll the job for terminal status.
409
APIError
INVOICE_CANCELLATION_IN_FLIGHT | INVOICE_NOT_CANCELLABLE | INVOICE_ALREADY_CANCELLED.
422
APIError
INVOICE_TYPE_NOT_SUPPORTED_FOR_CANCELLATION | CERTIFICATE_NOT_CONFIGURED.
POST/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId/copy auth: jwt (administrator | submit_invoices)

Per-payment Copy. Inserts a new Invoices row with InvoiceType='COPY', CopiesInvoiceId pointing at the source invoice, totals scaled to the source payment's amount, plus a synthetic InvoicePayments row carrying CopiesPaymentId. Source payment's SDC FiscalInvoiceNumber is the V-SDC referent on the new submission; TransactionType is preserved (Copy of Sale → Sale, Copy of Refund → Refund). One-time per source payment (retry of a failed copy allowed). Immediately dispatches for fiscalisation and fires INVOICE_COPY_REQUESTED audit.

handlers: InvoicesController.copy

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Source invoice UUID.
paymentId path
uuid
yes—Source payment UUID. Must be a fiscalised payment under a supported invoice type.

Outputs

202
APIResponseDataObject<CopyInvoiceResponse>
{ invoiceId, invoicePaymentId, invoiceNumber, jobId } — jobId is null when triggerFiscalisation did not queue (e.g. already_fiscalised / all_blocked).
404
APIError
INVOICE_NOT_FOUND.
409
APIError
INVOICE_ALREADY_COPIED.
422
APIError
INVOICE_NOT_COPYABLE | INVOICE_TYPE_NOT_SUPPORTED_FOR_COPY | CERTIFICATE_NOT_CONFIGURED.
POST/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId/refund auth: jwt (administrator | submit_invoices)

Per-payment Refund. Inserts a new Invoices row with TransactionType='REFUND' and InvoiceType inherited from the source (Normal → Normal Refund, Advance → Advance Refund), RefundsInvoiceId pointing at the source invoice, totals scaled to the source payment's amount, plus a synthetic InvoicePayments row carrying RefundsPaymentId. Source payment's SDC FiscalInvoiceNumber is the V-SDC referent on the new submission. Only valid on a fiscalised SALE payment under a Normal or Advance invoice — refunding a refund is rejected. One-time per source payment (retry of a failed refund allowed). FE button is hidden on Normal/Advance (only surfaced for PROFORMA quotes); backend stays permissive so the service-layer REFUNDABLE_TYPES guard remains the source of truth. Fires INVOICE_REFUND_REQUESTED audit.

handlers: InvoicesController.refund

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Source invoice UUID.
paymentId path
uuid
yes—Source SALE payment UUID. Must be fiscalised and not already refunded.

Outputs

202
APIResponseDataObject<RefundPaymentResponse>
{ invoiceId, invoicePaymentId, invoiceNumber, jobId } — jobId null when not queued.
404
APIError
INVOICE_NOT_FOUND.
409
APIError
INVOICE_ALREADY_REFUNDED.
422
APIError
INVOICE_NOT_REFUNDABLE | INVOICE_TYPE_NOT_SUPPORTED_FOR_REFUND | CERTIFICATE_NOT_CONFIGURED.
GET/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId/invoice-pdf auth: jwt (administrator | view_invoices | submit_invoices)

Render the fiscal receipt of one signed payment as an inline PDF. `format=a4` (default) is the branded A4 invoice rebuilt from the persisted invoice; `format=slip` renders the thermal slip from the signed fiscal journal.

handlers: InvoicesController.getInvoicePdf

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Invoice UUID.
paymentId path
uuid
yes—Payment UUID under that invoice.
format query
slip | a4
noa4Document layout.

Outputs

200 application/pdf
application/pdf
The PDF (Content-Disposition inline; filename Invoice-<no>.pdf or Receipt-<no>.pdf).
404
APIError
INVOICE_NOT_FOUND — payment not found under this invoice.
422
APIError
INVOICE_NOT_FISCALISED (no verification URL, or no fiscal journal for slip), BUSINESS_NOT_FOUND, or VALIDATION_ERROR.
POST/api/v1/businesses/:businessId/invoices/:invoiceId/payments/:paymentId/send-receipt-email auth: jwt (administrator | submit_invoices)

Email the fiscalised receipt of one payment to the customer and/or the business. At least one address is required; addresses are not persisted. The PDF attachment uses the business's per-connector receipt email format. Delivery is fire-and-forget: responds 202 immediately and audits `RECEIPT_EMAIL_SENT` or `RECEIPT_EMAIL_FAILED` once the send settles.

handlers: InvoicesController.sendReceiptEmail

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
invoiceId path
uuid
yes—Invoice UUID.
paymentId path
uuid
yes—Payment UUID under that invoice.
customerEmail body
string (email) | null
yes—Customer address, or null to skip.
businessEmail body
string (email) | null
yes—Business copy address, or null to skip. At least one of the two must be non-null.

Outputs

202
APIResponseDataObject<{ accepted: true }>
Receipt email accepted for delivery.
404
APIError
INVOICE_NOT_FOUND — payment not found under this invoice.
422
APIError
INVOICE_NOT_FISCALISED (no fiscal receipt), BUSINESS_NOT_FOUND, or VALIDATION_ERROR (neither address given / invalid email).
POST/api/v1/businesses/:businessId/invoices/reprocess-credit-notes auth: jwt (administrator)

Re-evaluate every REFUND payment blocked by REFERENT_NOT_FISCALISED or REFERENT_DOCUMENT_MISSING. Where the original invoice is now fiscalised, replaces the stored referent document number with the V-SDC fiscal invoice number and marks the payment eligible. Does not dispatch for fiscalisation itself. Idempotent.

handlers: InvoicesController.reprocessCreditNotes

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.

Outputs

200
APIResponseDataObject<ReprocessCreditNotesResult>
Counts { reprocessed, nowEligible, stillBlocked, nowEligibleInvoices, nowEligibleQuotes, autoFiscalisationJobIds } plus examinedPaymentIds and releasedPaymentIds.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.