export type DeleteApiV2FreightProviderAccountsFreightProviderAccountIdOptions = {baseUrl?: string | undefined, apiKeys?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disconnect a freight provider account * * DELETE /v2/freight/provider_accounts/{freight_provider_account_id} */ export const deleteApiV2FreightProviderAccountsFreightProviderAccountId = async (options?: DeleteApiV2FreightProviderAccountsFreightProviderAccountIdOptions) => { const {baseUrl = "https://api.shipstation.com", fetch: fetchFn = fetch, apiKeys} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeys !== undefined) headers.set("api-key", apiKeys) const url = `${baseUrl.replace(/\/+$/, '')}/v2/freight/provider_accounts/${encodeURIComponent(String(args.freight_provider_account_id))}${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 };