export type UpdateApiV1ReservationBookingIdRequestPaymentArgs = {id: number}; export type UpdateApiV1ReservationBookingIdRequestPaymentOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Requests a payment for a booking * * PUT /v1/reservation/booking/{id}/request_payment */ export const updateApiV1ReservationBookingIdRequestPayment = async (args: UpdateApiV1ReservationBookingIdRequestPaymentArgs, options?: UpdateApiV1ReservationBookingIdRequestPaymentOptions) => { const {baseUrl = "https://api.lodgify.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-ApiKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/reservation/booking/${encodeURIComponent(String(args.id))}/request_payment${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };