export type DeleteApiApiTaxesPlanPlanIdTaxIdArgs = {planId: string, taxId: string}; export type DeleteApiApiTaxesPlanPlanIdTaxIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unassign a tax from a plan * * DELETE /api/taxes/plan/{planId}/{taxId} */ export const deleteApiApiTaxesPlanPlanIdTaxId = async (args: DeleteApiApiTaxesPlanPlanIdTaxIdArgs, options?: DeleteApiApiTaxesPlanPlanIdTaxIdOptions) => { const {baseUrl = "https://api.novabilling.one", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/taxes/plan/${encodeURIComponent(String(args.planId))}/${encodeURIComponent(String(args.taxId))}${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 };