client
): InvoiceClient
Name | Type |
---|---|
client | SpaceportSDK |
InvoiceClient
params
): Promise
<ImportInvoicesResponse
>
Import invoices from a CSV file into the Directus database
This method uploads a CSV file to the backend and processes it to create
invoice records in the database. It can be used in preview mode to validate
the data before actual import.
Name | Type | Description |
---|---|---|
params | ImportInvoicesParams | Import parameters including CSV file and options |
Promise
<ImportInvoicesResponse
>
Promise resolving to import results
Example
options?
): Promise
<GeneratedInvoiceCSV
>
Generates mock Roblox invoice data for testing purposes
This method creates realistic-looking invoice data distributed across quarters
with randomized revenue and pricing data suitable for testing royalty calculations.
Name | Type | Description |
---|---|---|
options | GenerateInvoiceCSVOptions | Configuration options for CSV generation |
Promise
<GeneratedInvoiceCSV
>
Promise resolving to generated CSV data and metadata
Example
filename?
, options?
): Promise
<{ file
: File
; metadata
: Omit
<GeneratedInvoiceCSV
, "csvContent"
> }>
Generates a File object containing mock CSV data
This is a convenience method that combines generateMockInvoiceData with File creation
for direct use with file upload APIs.
Name | Type | Default value | Description |
---|---|---|---|
filename | string | 'mock-invoices.csv' | The filename for the generated file |
options | GenerateInvoiceCSVOptions | {} | Configuration options for CSV generation |
Promise
<{ file
: File
; metadata
: Omit
<GeneratedInvoiceCSV
, "csvContent"
> }>
Promise resolving to a File object and metadata
Example
params?
): Promise
<Invoice
[]>
Fetch invoices from the backend with optional filtering
This method retrieves invoice records from the database with support for
various filters including product ID, date ranges, and status.
Name | Type | Description |
---|---|---|
params | FetchInvoicesParams | Fetch parameters for filtering invoices |
Promise
<Invoice
[]>
Promise resolving to array of invoices
Example