/** * Price, error, and validation response types. */ export interface Price { gross: number; net: number; tax: number; discount?: number; breakdown?: PriceBreakdown[]; } export interface PriceBreakdown { amount: number; name: string; metadata: | { parcelId?: number | undefined; surcharge?: | 'out-of-gauge' | 'remote-destination' | 'local-tax' | undefined; [name: string]: string | number | boolean | undefined; } | undefined; } export interface GenericErrorResponse { title?: string; type?: string; detail?: string; status?: string; issues?: QuoteError[]; } export type QuoteError = { type: string; title: string; detail: string; field?: string; itemId?: string; itemRef?: string | null; section?: string; }; /** Checkout validate API response shape. */ export type ValidationResponse = { success: boolean; error: GenericErrorResponse | null | undefined; warnings: GenericErrorResponse[] | null | undefined; price: Price | null | undefined; };