export type CreateApiApiV1PlatformBillingOffersIdCancelArgs = {id: string}; export type CreateApiApiV1PlatformBillingOffersIdCancelOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1/platform/billing/offers/{id}/cancel */ export const createApiApiV1PlatformBillingOffersIdCancel = async (args: CreateApiApiV1PlatformBillingOffersIdCancelArgs, options?: CreateApiApiV1PlatformBillingOffersIdCancelOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/platform/billing/offers/${encodeURIComponent(String(args.id))}/cancel${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };