export type OrderTicketKeysRequestDto = {order_ticket_keys: Array}; export type CreateApiEventsEventIdCheckInTicketsArgs = {event_id: string, body: OrderTicketKeysRequestDto}; export type CreateApiEventsEventIdCheckInTicketsOptions = {baseUrl?: string | undefined, oauth2Implicit?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check in event tickets. * * POST /events/{event_id}/check_in/tickets * * Also accepts auth: oauth2_access_code */ export const createApiEventsEventIdCheckInTickets = async (args: CreateApiEventsEventIdCheckInTicketsArgs, options?: CreateApiEventsEventIdCheckInTicketsOptions) => { const {baseUrl = "https://api.cc.email/v3", fetch: fetchFn = fetch, oauth2Implicit} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2Implicit !== undefined) headers.set('authorization', `Bearer ${oauth2Implicit}`) const url = `${baseUrl.replace(/\/+$/, '')}/events/${encodeURIComponent(String(args.event_id))}/check_in/tickets${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };