export type DeleteApiApiV1CounterpartiesCounterpartyIdArgs = {counterpartyId: string, 'Client-ID': string, Authorization: string}; export type DeleteApiApiV1CounterpartiesCounterpartyIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Counterparty * * DELETE /api/v1/counterparties/:counterpartyId */ export const deleteApiApiV1CounterpartiesCounterpartyId = async (args: DeleteApiApiV1CounterpartiesCounterpartyIdArgs, options?: DeleteApiApiV1CounterpartiesCounterpartyIdOptions) => { const {baseUrl = "https://merchant-api.accruesavings.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Client-ID'] != null) headers.set("Client-ID", String(args['Client-ID'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/counterparties/:counterpartyId${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 };