export type GetApiFinanceManagerFinancialOverviewArgs = {clientId?: string | undefined, 'access-token'?: string | undefined, body: {channel?: Array | undefined, endDate?: string | undefined, listingIds?: Array | undefined, payoutDates?: Array | undefined, startDate?: string | undefined}}; export type GetApiFinanceManagerFinancialOverviewOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Financial Deduction Breakdown * * GET /finance-manager/financial/overview */ export const getApiFinanceManagerFinancialOverview = async (args: GetApiFinanceManagerFinancialOverviewArgs, options?: GetApiFinanceManagerFinancialOverviewOptions) => { const {baseUrl = "https://growapiservicesv2server.voosh.ai", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (args.clientId != null) query.append("clientId", String(args.clientId)) if (args['access-token'] != null) headers.set("access-token", String(args['access-token'])) if (apiKey !== undefined) headers.set("x-api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/finance-manager/financial/overview${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };