export type DeleteApiCustomersCustomerIdCardsCardIdArgs = {customerId: number, cardId: number}; export type DeleteApiCustomersCustomerIdCardsCardIdOptions = {baseUrl?: string | undefined, ApiAccessAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete customer card * * DELETE /customers/{customerId}/cards/{cardId} */ export const deleteApiCustomersCustomerIdCardsCardId = async (args: DeleteApiCustomersCustomerIdCardsCardIdArgs, options?: DeleteApiCustomersCustomerIdCardsCardIdOptions) => { const {baseUrl = "https://api.helcim.com/v2", fetch: fetchFn = fetch, ApiAccessAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiAccessAuth !== undefined) headers.set("api-token", ApiAccessAuth) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customerId))}/cards/${encodeURIComponent(String(args.cardId))}${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 };