export type DeleteApiV3CheckoutShoppingCartsShoppingCartIdFeesFeeIdArgs = {shoppingCartId: string, feeId: string, 'AD-ShoppingCart-Partner'?: string | undefined}; export type DeleteApiV3CheckoutShoppingCartsShoppingCartIdFeesFeeIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete shopping cart fees * * DELETE /v3/checkout/shoppingCarts/{shoppingCartId}/fees/{feeId} */ export const deleteApiV3CheckoutShoppingCartsShoppingCartIdFeesFeeId = async (args: DeleteApiV3CheckoutShoppingCartsShoppingCartIdFeesFeeIdArgs, options?: DeleteApiV3CheckoutShoppingCartsShoppingCartIdFeesFeeIdOptions) => { const {baseUrl = "https://marketplace.appdirect.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['AD-ShoppingCart-Partner'] != null) headers.set("AD-ShoppingCart-Partner", String(args['AD-ShoppingCart-Partner'])) const url = `${baseUrl.replace(/\/+$/, '')}/v3/checkout/shoppingCarts/${encodeURIComponent(String(args.shoppingCartId))}/fees/${encodeURIComponent(String(args.feeId))}${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 };