export type DeleteApiV3CheckoutPortalChannelsChannelIdReservationsIdArgs = {channel_id: string, id: string, 'Accept-Language'?: string | undefined}; export type DeleteApiV3CheckoutPortalChannelsChannelIdReservationsIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE checkout_portal_reservation * * DELETE /v3/checkout_portal/channels/{channel_id}/reservations/{id} * * Also accepts auth: OAuth2 */ export const deleteApiV3CheckoutPortalChannelsChannelIdReservationsId = async (args: DeleteApiV3CheckoutPortalChannelsChannelIdReservationsIdArgs, options?: DeleteApiV3CheckoutPortalChannelsChannelIdReservationsIdOptions) => { const {baseUrl = "https://api.bookingexperts.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Accept-Language'] != null) headers.set("Accept-Language", String(args['Accept-Language'])) if (ApiKeyAuth !== undefined) headers.set("X-API-KEY", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/checkout_portal/channels/${encodeURIComponent(String(args.channel_id))}/reservations/${encodeURIComponent(String(args.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 };