export type DeleteApiApiV1CartsCustomerIdArgs = {customerId: string}; export type DeleteApiApiV1CartsCustomerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the shopping cart * * DELETE /api/v1/carts/{customerId} */ export const deleteApiApiV1CartsCustomerId = async (args: DeleteApiApiV1CartsCustomerIdArgs, options?: DeleteApiApiV1CartsCustomerIdOptions) => { const {baseUrl = "https://ecommerce.swagger.io/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/carts/${encodeURIComponent(String(args.customerId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };