export type GetApiAgentCommerceAcpCheckoutSessionsIdArgs = {id: string}; export type GetApiAgentCommerceAcpCheckoutSessionsIdOptions = {baseUrl?: string | undefined, agentBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Read this agent's checkout and actual order status. * * GET /agent-commerce/acp/checkout_sessions/{id} */ export const getApiAgentCommerceAcpCheckoutSessionsId = async (args: GetApiAgentCommerceAcpCheckoutSessionsIdArgs, options?: GetApiAgentCommerceAcpCheckoutSessionsIdOptions) => { const {baseUrl = "https://mondoir.art", fetch: fetchFn = fetch, agentBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (agentBearer !== undefined) headers.set('authorization', `Bearer ${agentBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/agent-commerce/acp/checkout_sessions/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };