export type CreateApiAgentCommerceAcpCheckoutSessionsIdArgs = {id: string, body: {buyer?: ({email?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, full_name?: string | undefined, phone_number?: string | undefined}) | undefined, currency?: 'USD' | undefined, line_items?: (Array<{id: string, name?: string | undefined, unit_amount?: number | undefined}>) | undefined, capabilities?: ({extensions?: Array | undefined, interventions?: {supported: Array} | undefined, payment?: ({handlers: Array<{id: string} | {[key: string]: unknown}>}) | undefined}) | undefined, metadata?: ({mondoir?: ({payer?: (string | string) | undefined, network?: ('eip155:8453' | 'eip155:137' | 'eip155:42161' | 'eip155:480' | 'eip155:143' | 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp') | undefined, quantity?: number | undefined, variantId?: string | undefined, editionNumber?: number | undefined, editionNumbers?: Array | undefined, walletAddress?: string | undefined}) | undefined}) | undefined, fulfillment_details?: ({name?: string | undefined, email?: string | undefined, phone_number?: string | undefined, address?: ({name: string, line_one: string, line_two?: string | undefined, city: string, state: string, country: string, postal_code: string}) | undefined}) | undefined, selected_fulfillment_options?: (Array<{type: 'shipping' | 'digital', option_id: 'standard', item_ids: Array<'line-1'>}>) | undefined}}; export type CreateApiAgentCommerceAcpCheckoutSessionsIdOptions = {baseUrl?: string | undefined, agentBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update buyer and shipping before completion freezes the checkout. * * POST /agent-commerce/acp/checkout_sessions/{id} */ export const createApiAgentCommerceAcpCheckoutSessionsId = async (args: CreateApiAgentCommerceAcpCheckoutSessionsIdArgs, options?: CreateApiAgentCommerceAcpCheckoutSessionsIdOptions) => { const {baseUrl = "https://mondoir.art", fetch: fetchFn = fetch, agentBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") 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: "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 };