Skip to main content

Type Alias: CreateInvoiceScanDtoPayload

@arolariu/website


@arolariu/website / types/invoices/Invoice / CreateInvoiceScanDtoPayload

Type Alias: CreateInvoiceScanDtoPayload

CreateInvoiceScanDtoPayload = object

Defined in: types/invoices/Invoice.ts:530

DTO payload for adding a new scan to an existing invoice.

Remarks

Use Cases:

  • Adding back-side of a two-sided receipt
  • Uploading higher quality rescan
  • Attaching supporting documents (warranties, etc.)

Storage: The location should be a pre-signed Azure Blob Storage URL obtained from the upload API endpoint before calling this.

Processing: New scans automatically trigger OCR processing to extract additional product data and merge with existing invoice items.

Example

const scanPayload: CreateInvoiceScanDtoPayload = {
type: InvoiceScanType.PNG,
location: "https://cdn.arolariu.ro/invoices/user123/scan-002.png",
additionalMetadata: {
pageNumber: "2",
side: "back"
}
};

await fetch(`/api/invoices/${invoiceId}/scans`, {
method: "POST",
body: JSON.stringify(scanPayload)
});

See

Properties

type

readonly type: InvoiceScanType

Defined in: types/invoices/Invoice.ts:532

The type of the invoice scan.


location

readonly location: string

Defined in: types/invoices/Invoice.ts:534

The location (URL or path) of the invoice scan.


additionalMetadata

readonly additionalMetadata: Record<string, string>

Defined in: types/invoices/Invoice.ts:536

Additional metadata associated with the invoice scan.

// was this page useful?