export type CreateApiV1SellerOrderInvoiceArgs = {body: BodyInit}; export type CreateApiV1SellerOrderInvoiceOptions = {baseUrl?: string | undefined, SellerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Upload Invoice * * POST /v1/seller/order/invoice */ export const createApiV1SellerOrderInvoice = async (args: CreateApiV1SellerOrderInvoiceArgs, options?: CreateApiV1SellerOrderInvoiceOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, SellerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (SellerAuth !== undefined) headers.set('authorization', `Bearer ${SellerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/seller/order/invoice${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };