export type GetApiV3CustomersIdInvoicesInvoiceIdCreditMemosArgs = {id: string, invoiceId: string}; export type GetApiV3CustomersIdInvoicesInvoiceIdCreditMemosOptions = {baseUrl?: string | undefined, customHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * List invoice credit memos * * GET /v3/customers/{id}/invoices/{invoiceId}/credit-memos */ export const getApiV3CustomersIdInvoicesInvoiceIdCreditMemos = async (args: GetApiV3CustomersIdInvoicesInvoiceIdCreditMemosArgs, options?: GetApiV3CustomersIdInvoicesInvoiceIdCreditMemosOptions) => { const {baseUrl = "https://integrators.prod.api.tabsplatform.com", fetch: fetchFn = fetch, customHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (customHeader !== undefined) headers.set("Authorization", customHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v3/customers/${encodeURIComponent(String(args.id))}/invoices/${encodeURIComponent(String(args.invoiceId))}/credit-memos${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };