export type UpdateApiAgentCommerceUcpCheckoutSessionsIdArgs = {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, id?: string | undefined, line_items?: (Array<{id?: 'line-1' | undefined, item: {id: string}, quantity: number}>) | undefined, fulfillment?: ({methods: Array<{id?: 'shipping' | undefined, type?: 'shipping' | undefined, line_item_ids?: Array<'line-1'> | undefined, destinations?: (Array<{id?: string | undefined, street_address?: string | undefined, extended_address?: string | undefined, address_locality?: string | undefined, address_region?: string | undefined, address_country?: string | undefined, postal_code?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, full_name?: string | undefined, phone_number?: string | undefined}>) | undefined, selected_destination_id?: (string | null) | undefined}>}) | undefined, 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}}; export type UpdateApiAgentCommerceUcpCheckoutSessionsIdOptions = {baseUrl?: string | undefined, agentBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update buyer and shipping before completion freezes the checkout. * * PUT /agent-commerce/ucp/checkout-sessions/{id} */ export const updateApiAgentCommerceUcpCheckoutSessionsId = async (args: UpdateApiAgentCommerceUcpCheckoutSessionsIdArgs, options?: UpdateApiAgentCommerceUcpCheckoutSessionsIdOptions) => { 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/ucp/checkout-sessions/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };