export type CreateApiV1ShopsShopIdInvoicesInvoiceIdResendEmailArgs = {body: {email?: string | undefined}}; export type CreateApiV1ShopsShopIdInvoicesInvoiceIdResendEmailOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resend Invoice Email * * POST /v1/shops/{shopId}/invoices/{invoiceId}/resend-email */ export const createApiV1ShopsShopIdInvoicesInvoiceIdResendEmail = async (args: CreateApiV1ShopsShopIdInvoicesInvoiceIdResendEmailArgs, options?: CreateApiV1ShopsShopIdInvoicesInvoiceIdResendEmailOptions) => { const {baseUrl = "https://api.sellauth.com", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/shops/${encodeURIComponent(String(args.shopId))}/invoices/${encodeURIComponent(String(args.invoiceId))}/resend-email${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };