Type Alias: CreateInvoiceDtoPayload
@arolariu/website / types/invoices/Invoice / CreateInvoiceDtoPayload
Type Alias: CreateInvoiceDtoPayload
CreateInvoiceDtoPayload =
object
Defined in: types/invoices/Invoice.ts:396
DTO payload for creating a new invoice via the API.
Remarks
Required Fields:
userIdentifier: The authenticated user's ID (from Clerk)initialScan: At least one document scan to process
Metadata Handling:
The metadata field accepts both reserved keys (SpecialMetadataKeys)
and arbitrary string keys for extensibility. Reserved keys trigger
special backend behaviors.
Validation:
userIdentifiermust be a valid Clerk user IDinitialScan.locationmust be a valid Azure Blob Storage URL- Scan type must match the actual file format
Example
const payload: CreateInvoiceDtoPayload = {
userIdentifier: "user_abc123",
initialScan: {
scanType: InvoiceScanType.JPEG,
location: "https://cdn.arolariu.ro/uploads/receipt.jpg",
metadata: {}
},
metadata: {
isImportant: "true",
requiresAnalysis: "true",
source: "mobile-app"
}
};
const response = await fetch("/api/invoices", {
method: "POST",
body: JSON.stringify(payload)
});
See
- Invoice for the created entity structure
- InvoiceScan for scan details
Properties
userIdentifier
readonlyuserIdentifier:string
Defined in: types/invoices/Invoice.ts:398
The user identifier associated with the invoice.
initialScan
readonlyinitialScan:InvoiceScan
Defined in: types/invoices/Invoice.ts:400
The initial scan associated with the invoice.
metadata
readonlymetadata:Record<SpecialMetadataKeys|string&object,string>
Defined in: types/invoices/Invoice.ts:403
The metadata associated with the invoice.