Type Alias: DeleteInvoiceDtoPayload\<T\>
@arolariu/website / types/invoices/Invoice / DeleteInvoiceDtoPayload
Type Alias: DeleteInvoiceDtoPayload<T>
DeleteInvoiceDtoPayload<
T> =object
Defined in: types/invoices/Invoice.ts:486
DTO payload for deleting an invoice via the API.
Remarks
Soft Delete:
Invoices are soft-deleted by default. The isDeleted flag is set
to true and the invoice is excluded from normal queries. Data
is retained for analytics and potential recovery.
Authorization:
Only the invoice owner (userIdentifier) can delete an invoice.
Shared users cannot delete invoices they don't own.
Cascade Behavior: Deleting an invoice does NOT delete:
- Associated scans (retained for audit trail)
- Merchant references (shared across invoices)
- User account data
Example
const deletePayload: DeleteInvoiceDtoPayload = {
id: "invoice-uuid-to-delete",
userIdentifier: "user_abc123"
};
await fetch(`/api/invoices/${deletePayload.id}`, {
method: "DELETE",
body: JSON.stringify(deletePayload)
});
See
Invoice for the entity being deleted
Type Parameters
T
T = string
The type of the invoice identifier. Defaults to string.
Properties
id
readonlyid:T
Defined in: types/invoices/Invoice.ts:488
The unique identifier of the invoice to be deleted.
userIdentifier
readonlyuserIdentifier:string
Defined in: types/invoices/Invoice.ts:490
The user identifier associated with the invoice.