import {z} from 'zod' export type CreateApiV2510BetaExperiencesExperienceIdCheckoutBlocksArgs = {experienceId: string, body: {blockType: 'trustBadge', variationId: string, name?: string | undefined, template?: ('badgeList' | 'badgeTiles' | 'callOut' | 'grid' | 'header' | 'images' | 'brandLogo' | 'textOnly') | undefined, variables?: ({headerText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, items?: (Array<{order: number, title?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}> | null) | undefined, subtitle?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}> | null) | undefined, type: string, icon?: (string | null) | undefined, iconColor?: (string | null) | undefined, iconSize?: (string | null) | undefined, imageSize: number | null, imageSizeUnit: 'pixels' | 'percentage', imageAspectRatio?: (string | null) | undefined, image?: (string | null) | undefined, mediaSpacing: string}>) | undefined}) | undefined, styles?: ({typography?: ({header?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, itemTitle?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, itemSubtitle?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined}) | undefined, backgroundColors?: ({header?: string | undefined, item?: string | undefined, block?: string | undefined}) | undefined, colors?: ({headerText?: string | undefined, itemTitleText?: string | undefined, itemSubtitleText?: string | undefined}) | undefined, layout?: ({headerTextAlign?: string | undefined, bodyAlign?: string | undefined, itemTextAlign?: string | undefined, itemPositionAlign?: string | undefined, rowCount?: number | undefined, columnCount?: number | undefined}) | undefined, appearance?: ({headerBorderThickness?: string | undefined, headerBorderStyle?: string | undefined, headerCornerRadius?: string | undefined, headerPadding?: string | undefined, bodySpacing?: string | undefined, headingToBodySpacing?: string | undefined, blockBorderThickness?: string | undefined, blockBorderStyle?: string | undefined, blockPadding?: string | undefined, blockCornerRadius?: string | undefined, itemBorderThickness?: string | undefined, itemBorderStyle?: string | undefined, itemCornerRadius?: string | undefined, itemTextSpacing?: string | undefined}) | undefined}) | undefined, displayConditions?: ({match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}) | undefined} | {blockType: 'upsell', variationId: string, name?: string | undefined, template?: ('productTiles' | 'productList' | 'singleProduct' | 'singleProductCheckbox') | undefined, variables?: ({headerText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, maxProductLimit?: number | undefined, excludeItemsInCart?: boolean | undefined, excludeOutOfStock?: boolean | undefined, buttonText?: string | undefined, imageSize?: number | undefined, imageSizeUnit?: ('pixels' | 'percentage') | undefined, imageAspectRatio?: string | undefined, mediaSpacing?: string | undefined}) | undefined, styles?: ({typography?: ({header?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, productTitle?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, variantTitle?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, price?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, button?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined}) | undefined, backgroundColors?: ({header?: string | undefined, item?: string | undefined, block?: string | undefined, button?: string | undefined, productUnit?: string | undefined}) | undefined, colors?: ({headerText?: string | undefined, productText?: string | undefined, variantText?: string | undefined, priceText?: string | undefined, carouselArrowColor?: string | undefined, carouselArrowStyle?: string | undefined}) | undefined, layout?: ({headerTextAlign?: string | undefined, bodyAlign?: string | undefined, itemTextAlign?: string | undefined, itemPositionAlign?: string | undefined, mobile?: ({rowCount?: number | undefined, columnCount?: number | undefined}) | undefined, desktop?: ({rowCount?: number | undefined, columnCount?: number | undefined}) | undefined}) | undefined, appearance?: ({headerBorderThickness?: string | undefined, headerBorderStyle?: string | undefined, headerCornerRadius?: string | undefined, headerPadding?: string | undefined, bodySpacing?: string | undefined, headingToBodySpacing?: string | undefined, blockBorderThickness?: string | undefined, blockBorderStyle?: string | undefined, blockPadding?: string | undefined, blockCornerRadius?: string | undefined, productBorderThickness?: string | undefined, productBorderStyle?: string | undefined, productCornerRadius?: string | undefined, productTextSpacing?: string | undefined}) | undefined}) | undefined, displayConditions?: ({match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}) | undefined, upsellProductRules?: (Array<{priority?: number | undefined, when: {match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}, recommend: {source: 'shopifyRecommendations'} | {source: 'collection', collectionId: string, tags?: Array | undefined} | {source: 'tag', tags: Array} | {source: 'products', products: Array<{productId: string, variantIds?: Array | undefined}>}}>) | undefined} | {blockType: 'shippingProgressBar', variationId: string, name?: string | undefined, template?: ('minimal' | 'milestones') | undefined, variables?: ({headerText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, currency?: string | undefined, template?: ('minimal' | 'milestones') | undefined, tiers?: (Array<{threshold: number, message: string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>, messageComplete: string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>, activeIconId?: string | undefined, inactiveIconId?: string | undefined, breakpointText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined}>) | undefined}) | undefined, styles?: ({typography?: ({header?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, label?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined}) | undefined, backgroundColors?: ({header?: string | undefined, item?: string | undefined, block?: string | undefined, milestoneIcon?: string | undefined}) | undefined, colors?: ({headerText?: string | undefined, labelText?: string | undefined, barTone?: string | undefined}) | undefined, layout?: ({headerTextAlign?: string | undefined, bodyAlign?: string | undefined, itemTextAlign?: string | undefined, itemPositionAlign?: string | undefined, messageTextAlign?: string | undefined}) | undefined, appearance?: ({headerBorderThickness?: string | undefined, headerBorderStyle?: string | undefined, headerCornerRadius?: string | undefined, headerPadding?: string | undefined, bodySpacing?: string | undefined, headingToBodySpacing?: string | undefined, blockBorderThickness?: string | undefined, blockBorderStyle?: string | undefined, blockPadding?: string | undefined, blockCornerRadius?: string | undefined, milestoneIconCornerRadius?: string | undefined, milestoneIconSize?: string | undefined, milestoneIconPadding?: string | undefined}) | undefined}) | undefined, displayConditions?: ({match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}) | undefined} | {blockType: 'timer', variationId: string, name?: string | undefined, template?: ('textCountdown' | 'digitalClock' | 'inlinePill') | undefined, variables?: ({timerMode?: ('fixedDate' | 'perVisitor' | 'recurring') | undefined, endDateTime?: (string | null) | undefined, durationMinutes?: number | undefined, resetIntervalUnit?: ('hour' | 'day' | 'week' | null) | undefined, resetTimeOfDay?: (string | null) | undefined, resetDayOfWeek?: (number | number | number | number | number | number | number | null) | undefined, resetMinuteOfHour?: (number | null) | undefined, resetTimezone?: (string | null) | undefined, expiredBehavior?: ('remove' | 'showText') | undefined, timerTemplate?: ('textCountdown' | 'digitalClock' | 'inlinePill') | undefined, showDays?: boolean | undefined, showHours?: boolean | undefined, showMinutes?: boolean | undefined, showSeconds?: boolean | undefined, countdownText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, expiredText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, headline?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined}) | undefined, styles?: ({typography?: ({text?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined}) | undefined, backgroundColors?: ({block?: string | undefined, expired?: string | undefined}) | undefined, colors?: ({text?: string | undefined, expiredText?: string | undefined, digit?: string | undefined}) | undefined, layout?: ({textAlign?: string | undefined}) | undefined, appearance?: ({blockBorderStyle?: string | undefined, blockBorderThickness?: string | undefined, blockCornerRadius?: string | undefined, blockPadding?: string | undefined}) | undefined, digits?: ({separator?: ('colon' | 'dot' | 'units') | undefined, size?: ('small' | 'base') | undefined}) | undefined}) | undefined, displayConditions?: ({match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}) | undefined} | {blockType: 'faqs', variationId: string, name?: string | undefined, template?: 'faqsAccordion' | undefined, variables?: ({headerText?: (string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>) | undefined, showDivider?: boolean | undefined, allowMultipleOpen?: boolean | undefined, questions?: (Array<{id: string, question: string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>, answer: string | Array<{text: string, bold?: boolean | undefined, italic?: boolean | undefined, strike?: boolean | undefined, link?: {href: string} | undefined}>, openByDefault?: boolean | undefined}>) | undefined}) | undefined, styles?: ({typography?: ({header?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, question?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined, answer?: ({fontSize?: string | undefined, fontStyle?: string | undefined}) | undefined}) | undefined, backgroundColors?: ({header?: string | undefined, item?: string | undefined, block?: string | undefined}) | undefined, colors?: ({headerText?: string | undefined, questionText?: string | undefined, answerText?: string | undefined}) | undefined, layout?: ({headerTextAlign?: string | undefined, bodyAlign?: string | undefined, itemTextAlign?: string | undefined, itemPositionAlign?: string | undefined}) | undefined, appearance?: ({headerBorderThickness?: string | undefined, headerBorderStyle?: string | undefined, headerCornerRadius?: string | undefined, headerPadding?: string | undefined, bodySpacing?: string | undefined, headingToBodySpacing?: string | undefined, blockBorderThickness?: string | undefined, blockBorderStyle?: string | undefined, blockPadding?: string | undefined, blockCornerRadius?: string | undefined}) | undefined}) | undefined, displayConditions?: ({match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}) | undefined} | {blockType: 'postPurchaseUpsell', variationId: string, name?: string | undefined, variables?: ({excludeOutOfStock?: boolean | undefined, excludeItemsInCart?: boolean | undefined, descriptionEnabled?: boolean | undefined, quantitySelectorEnabled?: boolean | undefined, countdownTimerEnabled?: boolean | undefined, compareAtPriceDisplay?: ('none' | 'compareAtPrice' | 'regularPrice') | undefined, bannerTitle?: string | undefined, bannerSubtitle?: string | undefined, customerFirstNameFallback?: string | undefined, maxProductLimit?: number | undefined, offerTimeout?: number | undefined, headingLevel?: ('1' | '2' | '3' | 'auto') | undefined, imageAspectRatio?: ('original' | '1:1') | undefined, quantityLabel?: string | undefined, maxQuantityType?: ('noMaximum' | 'setMaximum') | undefined, maxQuantity?: number | undefined, timerCheckout?: ({countdownText?: string | undefined, expiredText?: string | undefined, durationMinutes?: number | undefined, expiredBehavior?: ('remove' | 'showText') | undefined}) | undefined}) | undefined, styles?: ({backgroundColors?: ({banner?: ('secondary' | 'transparent') | undefined, countdown?: ('secondary' | 'transparent') | undefined, expired?: ('secondary' | 'transparent') | undefined}) | undefined, colors?: ({expiredText?: ('critical' | 'warning' | 'success' | 'subdued') | undefined}) | undefined, appearance?: ({bannerTextAlign?: ('left' | 'center' | 'right') | undefined, countdownTextAlign?: ('left' | 'center' | 'right') | undefined, bannerBorderStyle?: ('none' | 'block') | undefined, countdownBorderStyle?: ('none' | 'block') | undefined, bannerSpacing?: ('none' | 'tight' | 'loose') | undefined, countdownSpacing?: ('none' | 'tight' | 'loose') | undefined, imageFit?: ('cover' | 'contain') | undefined, imageBorder?: boolean | undefined, pricingAppearance?: ('default' | 'critical' | 'warning' | 'success') | undefined, pricingEmphasized?: boolean | undefined, descriptionSubdued?: boolean | undefined, separatorWidth?: ('xtight' | 'tight' | 'loose' | 'xloose') | undefined, secondaryButtonStyle?: ('default' | 'subdued' | 'plain') | undefined}) | undefined}) | undefined, upsellProductRules?: (Array<{priority?: number | undefined, when: {match?: ('all' | 'any') | undefined, conditions: Array<{attribute: 'anything'} | {attribute: 'cartSubtotal', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'cartItemCount', operator: 'greaterThan' | 'lessThan' | 'equalTo' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between', value: number, valueMax?: number | undefined} | {attribute: 'collection', operator?: ('includes' | 'doesNotInclude') | undefined, collectionIds: Array} | {attribute: 'tag', operator?: ('includes' | 'doesNotInclude') | undefined, tags: Array} | {attribute: 'subscription', operator?: ('includes' | 'doesNotInclude') | undefined} | {attribute: 'productId', operator?: ('includes' | 'doesNotInclude') | undefined, products: Array<{productId: string, variantIds: Array}>}>}, recommend: {source: 'shopifyRecommendations'} | {source: 'collection', collectionId: string, tags?: Array | undefined} | {source: 'tag', tags: Array} | {source: 'products', products: Array<{productId: string, variantIds?: Array | undefined}>}}>) | undefined}}; export type CreateApiV2510BetaExperiencesExperienceIdCheckoutBlocksOptions = {baseUrl?: string | undefined, intelligemsAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; export const schema0: z.ZodType = z.object({discountType: z.enum(["none", "percentage", "fixed"]), discountValue: z.number().nullable().optional(), compareAtPriceDisplay: z.enum(["none", "compareAtPrice", "regularPrice"]), expression: z.array(z.object({query: z.object({key: z.enum(["shopifyRecommendations", "productId", "collection", "tag"]), type: z.enum(["shopifyRecommendations", "productId", "collection", "tag"]), filter: z.enum(["includes", "doesNotInclude"]).optional(), value: z.union([z.string(), z.number(), z.array(z.object({order: z.number(), productId: z.string(), productTitle: z.string(), handle: z.string().nullable().optional(), productImage: z.string().nullable().optional(), description: z.string().nullable().optional(), options: z.array(z.object({name: z.string(), values: z.array(z.string())})).optional(), variants: z.array(z.object({variantId: z.string(), variantTitle: z.string(), variantImage: z.string().nullable().optional(), price: z.number(), compareAtPrice: z.number().nullable().optional(), currencyCode: z.string().optional(), availableForSale: z.boolean().optional(), sig: z.string().nullable().optional(), inclusionType: z.enum(["include", "exclude"]), variantOptions: z.array(z.object({name: z.string(), value: z.string()})).optional()})), defaultVariantId: z.string().nullable().optional()}))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()})), onAccept: z.lazy(() => schema0.nullable().optional()), onDecline: z.lazy(() => schema0.nullable().optional())}); export const createApiV2510BetaExperiencesExperienceIdCheckoutBlocksResponse = z.object({block: z.union([z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("trustBadge"), blockTemplate: z.enum(["badgeList", "badgeTiles", "callOut", "grid", "header", "images", "brandLogo", "textOnly"]).nullable().optional(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({headerText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), items: z.array(z.object({order: z.number(), title: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]).nullable().optional(), subtitle: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]).nullable().optional(), type: z.string(), icon: z.string().nullable().optional(), iconColor: z.string().nullable().optional(), iconSize: z.string().nullable().optional(), imageSize: z.number().gte(1).lte(500).nullable(), imageSizeUnit: z.enum(["pixels", "percentage"]), imageAspectRatio: z.string().nullable().optional(), image: z.string().nullable().optional(), mediaSpacing: z.string()}))}), styles: z.object({typography: z.object({header: z.object({fontSize: z.string(), fontStyle: z.string()}), itemTitle: z.object({fontSize: z.string(), fontStyle: z.string()}), itemSubtitle: z.object({fontSize: z.string(), fontStyle: z.string()})}), backgroundColors: z.object({header: z.string(), item: z.string(), block: z.string()}), colors: z.object({headerText: z.string(), itemTitleText: z.string(), itemSubtitleText: z.string()}), layout: z.object({headerTextAlign: z.string(), bodyAlign: z.string(), itemTextAlign: z.string(), itemPositionAlign: z.string(), rowCount: z.number().int().gte(-9007199254740991).lte(9007199254740991), columnCount: z.number().int().gte(-9007199254740991).lte(9007199254740991)}), appearance: z.object({headerBorderThickness: z.string(), headerBorderStyle: z.string(), headerCornerRadius: z.string(), headerPadding: z.string(), bodySpacing: z.string(), headingToBodySpacing: z.string(), blockBorderThickness: z.string(), blockBorderStyle: z.string(), blockPadding: z.string(), blockCornerRadius: z.string(), itemBorderThickness: z.string(), itemBorderStyle: z.string(), itemCornerRadius: z.string(), itemTextSpacing: z.string()})})}), z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("upsell"), blockTemplate: z.enum(["productTiles", "productList", "singleProduct", "singleProductCheckbox"]).nullable().optional(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({headerText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), maxProductLimit: z.number().int().gte(1).lte(10), excludeItemsInCart: z.boolean(), excludeOutOfStock: z.boolean(), buttonText: z.string(), imageSize: z.number().gte(1).lte(500), imageSizeUnit: z.enum(["pixels", "percentage"]), imageAspectRatio: z.string(), mediaSpacing: z.string(), discount: z.object({discountType: z.enum(["none", "percentage", "fixed"]), discountValue: z.number().nullable().optional(), compareAtPriceDisplay: z.enum(["none", "compareAtPrice", "regularPrice"])}).optional()}), styles: z.object({typography: z.object({header: z.object({fontSize: z.string(), fontStyle: z.string()}), productTitle: z.object({fontSize: z.string(), fontStyle: z.string()}), variantTitle: z.object({fontSize: z.string(), fontStyle: z.string()}), price: z.object({fontSize: z.string(), fontStyle: z.string()}), button: z.object({fontSize: z.string(), fontStyle: z.string()})}), backgroundColors: z.object({header: z.string(), item: z.string(), block: z.string(), button: z.string(), productUnit: z.string()}), colors: z.object({headerText: z.string(), productText: z.string(), variantText: z.string(), priceText: z.string(), carouselArrowColor: z.string(), carouselArrowStyle: z.string()}), layout: z.object({headerTextAlign: z.string(), bodyAlign: z.string(), itemTextAlign: z.string(), itemPositionAlign: z.string(), mobile: z.object({rowCount: z.number().int().gte(-9007199254740991).lte(9007199254740991), columnCount: z.number().int().gte(-9007199254740991).lte(9007199254740991)}), desktop: z.object({rowCount: z.number().int().gte(-9007199254740991).lte(9007199254740991), columnCount: z.number().int().gte(-9007199254740991).lte(9007199254740991)})}), appearance: z.object({headerBorderThickness: z.string(), headerBorderStyle: z.string(), headerCornerRadius: z.string(), headerPadding: z.string(), bodySpacing: z.string(), headingToBodySpacing: z.string(), blockBorderThickness: z.string(), blockBorderStyle: z.string(), blockPadding: z.string(), blockCornerRadius: z.string(), productBorderThickness: z.string(), productBorderStyle: z.string(), productCornerRadius: z.string(), productTextSpacing: z.string()})}), upsellProductRules: z.array(z.object({id: z.string(), checkoutBlockId: z.string(), priority: z.number().int().gte(0).lte(9007199254740991), cartTargeting: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}), action: schema0, variationId: z.string()})), agenticLogicPlacementId: z.string().nullable().optional(), agenticLogicRuleId: z.string().nullable().optional()}), z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("shippingProgressBar"), blockTemplate: z.enum(["minimal", "milestones"]).nullable().optional(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({headerText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]).optional(), currency: z.string(), template: z.enum(["minimal", "milestones"]), tiers: z.array(z.object({threshold: z.number().gt(0), message: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), messageComplete: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), activeIconId: z.string().optional(), inactiveIconId: z.string().optional(), breakpointText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]).optional()}))}), styles: z.object({typography: z.object({header: z.object({fontSize: z.string(), fontStyle: z.string()}), label: z.object({fontSize: z.string(), fontStyle: z.string()})}), backgroundColors: z.object({header: z.string(), item: z.string(), block: z.string(), milestoneIcon: z.string()}), colors: z.object({headerText: z.string(), labelText: z.string(), barTone: z.string()}), layout: z.object({headerTextAlign: z.string(), bodyAlign: z.string(), itemTextAlign: z.string(), itemPositionAlign: z.string(), messageTextAlign: z.string()}), appearance: z.object({headerBorderThickness: z.string(), headerBorderStyle: z.string(), headerCornerRadius: z.string(), headerPadding: z.string(), bodySpacing: z.string(), headingToBodySpacing: z.string(), blockBorderThickness: z.string(), blockBorderStyle: z.string(), blockPadding: z.string(), blockCornerRadius: z.string(), milestoneIconCornerRadius: z.string(), milestoneIconSize: z.string(), milestoneIconPadding: z.string()})})}), z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("timer"), blockTemplate: z.enum(["textCountdown", "digitalClock", "inlinePill"]).nullable().optional(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({timerMode: z.enum(["fixedDate", "perVisitor", "recurring"]), endDateTime: z.string().nullable().optional(), durationMinutes: z.number().int().gte(1).lte(9007199254740991), resetIntervalUnit: z.enum(["hour", "day", "week"]).nullable().optional(), resetTimeOfDay: z.string().nullable().optional(), resetDayOfWeek: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4), z.literal(5), z.literal(6), z.literal(7)]).nullable().optional(), resetMinuteOfHour: z.number().int().gte(0).lte(59).nullable().optional(), resetTimezone: z.string().nullable().optional(), expiredBehavior: z.enum(["remove", "showText"]), timerTemplate: z.enum(["textCountdown", "digitalClock", "inlinePill"]), showDays: z.boolean(), showHours: z.boolean(), showMinutes: z.boolean(), showSeconds: z.boolean(), countdownText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), expiredText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), headline: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))])}), styles: z.object({typography: z.object({text: z.object({fontSize: z.string(), fontStyle: z.string()})}), backgroundColors: z.object({block: z.string(), expired: z.string()}), colors: z.object({text: z.string(), expiredText: z.string(), digit: z.string()}), layout: z.object({textAlign: z.string()}), appearance: z.object({blockBorderStyle: z.string(), blockBorderThickness: z.string(), blockCornerRadius: z.string(), blockPadding: z.string()}), digits: z.object({separator: z.enum(["colon", "dot", "units"]), size: z.enum(["small", "base"])})})}), z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("faqs"), blockTemplate: z.literal("faqsAccordion").nullable().optional(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({headerText: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]).optional(), showDivider: z.boolean(), allowMultipleOpen: z.boolean(), questions: z.array(z.object({id: z.string().min(1), question: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), answer: z.union([z.string(), z.array(z.object({text: z.string().min(1), bold: z.boolean().optional(), italic: z.boolean().optional(), strike: z.boolean().optional(), link: z.object({href: z.string()}).optional()}))]), openByDefault: z.boolean()}))}), styles: z.object({typography: z.object({header: z.object({fontSize: z.string(), fontStyle: z.string()}), question: z.object({fontSize: z.string(), fontStyle: z.string()}), answer: z.object({fontSize: z.string(), fontStyle: z.string()})}), backgroundColors: z.object({header: z.string(), item: z.string(), block: z.string()}), colors: z.object({headerText: z.string(), questionText: z.string(), answerText: z.string()}), layout: z.object({headerTextAlign: z.string(), bodyAlign: z.string(), itemTextAlign: z.string(), itemPositionAlign: z.string()}), appearance: z.object({headerBorderThickness: z.string(), headerBorderStyle: z.string(), headerCornerRadius: z.string(), headerPadding: z.string(), bodySpacing: z.string(), headingToBodySpacing: z.string(), blockBorderThickness: z.string(), blockBorderStyle: z.string(), blockPadding: z.string(), blockCornerRadius: z.string()})})}), z.object({id: z.string(), variationId: z.string(), locationId: z.string(), blockType: z.literal("postPurchaseUpsell"), blockTemplate: z.unknown(), name: z.string(), displayConditions: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}).optional(), variables: z.object({headerText: z.string(), discountType: z.enum(["none", "percentage", "fixed"]), discountValue: z.number().nullable().optional(), compareAtPriceDisplay: z.enum(["none", "compareAtPrice", "regularPrice"]), imageAspectRatio: z.string(), excludeOutOfStock: z.boolean(), excludeItemsInCart: z.boolean(), maxProductLimit: z.number().int().gte(-9007199254740991).lte(9007199254740991), bannerEnabled: z.boolean(), bannerTitle: z.string().optional(), bannerSubtitle: z.string().optional(), customerFirstNameFallback: z.string().optional(), compareAtPriceEnabled: z.boolean(), descriptionEnabled: z.boolean(), quantitySelectorEnabled: z.boolean(), quantityLabel: z.string().optional(), maxQuantityType: z.string().optional(), maxQuantity: z.number().int().gte(-9007199254740991).lte(9007199254740991).optional(), moneyLineEnabled: z.boolean(), moneyLineSubtotal: z.boolean(), moneyLineShipping: z.boolean(), moneyLineTaxes: z.boolean(), primaryButtonText: z.string(), secondaryButtonEnabled: z.boolean(), secondaryButtonText: z.string(), headingLevel: z.string(), countdownTimerEnabled: z.boolean().optional(), timerCheckout: z.object({timerMode: z.enum(["fixedDate", "perVisitor", "recurring"]), endDateTime: z.string().nullable().optional(), durationMinutes: z.number().int().gte(1).lte(9007199254740991), resetIntervalUnit: z.enum(["hour", "day", "week"]).nullable().optional(), resetTimeOfDay: z.string().nullable().optional(), resetDayOfWeek: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4), z.literal(5), z.literal(6), z.literal(7)]).nullable().optional(), resetMinuteOfHour: z.number().int().gte(0).lte(59).nullable().optional(), resetTimezone: z.string().nullable().optional(), expiredBehavior: z.enum(["remove", "showText"]), timerTemplate: z.enum(["textCountdown", "digitalClock", "inlinePill"]), showDays: z.boolean(), showHours: z.boolean(), showMinutes: z.boolean(), showSeconds: z.boolean(), countdownText: z.string(), expiredText: z.string(), headline: z.string()}).optional(), offerTimeout: z.number().optional(), discount: z.object({discountType: z.enum(["none", "percentage", "fixed"]), discountValue: z.number().nullable().optional(), compareAtPriceDisplay: z.enum(["none", "compareAtPrice", "regularPrice"])}).optional()}), styles: z.object({typography: z.object({banner: z.object({fontSize: z.string(), fontStyle: z.string()}).optional(), productTitle: z.object({fontSize: z.string(), fontStyle: z.string()}), price: z.object({fontSize: z.string(), fontStyle: z.string()}), description: z.object({fontSize: z.string(), fontStyle: z.string()}).optional(), primaryButton: z.object({fontSize: z.string(), fontStyle: z.string()}), secondaryButton: z.object({fontSize: z.string(), fontStyle: z.string()}).optional()}), backgroundColors: z.object({banner: z.string(), primaryButton: z.string(), secondaryButton: z.string().optional(), countdown: z.string().optional(), expired: z.string().optional()}), colors: z.object({bannerText: z.string().optional(), productText: z.string(), priceText: z.string(), descriptionText: z.string().optional(), primaryButtonText: z.string(), secondaryButtonText: z.string().optional(), expiredText: z.string().optional()}), appearance: z.object({bannerBorderStyle: z.string(), bannerSpacing: z.string(), bannerTextAlign: z.string(), separatorWidth: z.string(), imageFit: z.string(), imageBorder: z.boolean(), pricingAppearance: z.string().optional(), pricingEmphasized: z.boolean(), pricingSubduedStyle: z.boolean().optional(), descriptionSubdued: z.boolean(), secondaryButtonStyle: z.string(), countdownTextAlign: z.string().optional(), countdownBorderStyle: z.string().optional(), countdownSpacing: z.string().optional()})}), upsellProductRules: z.array(z.object({id: z.string(), checkoutBlockId: z.string(), priority: z.number().int().gte(0).lte(9007199254740991), cartTargeting: z.object({id: z.string(), expression: z.array(z.object({query: z.object({key: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), type: z.enum(["anything", "productId", "collection", "tag", "cartSubtotal", "cartItemCount", "subscription"]), filter: z.enum(["includes", "doesNotInclude", "greaterThan", "lessThan", "equalTo", "greaterThanOrEqual", "lessThanOrEqual", "between"]), value: z.union([z.string(), z.number(), z.record(z.string(), z.array(z.object({variantId: z.string(), inclusionType: z.enum(["include", "exclude"])})))]).optional()}).optional(), operator: z.enum(["and", "or", "start_paren", "end_paren"]).optional()}))}), action: schema0, variationId: z.string()})), agenticLogicPlacementId: z.string().nullable().optional(), agenticLogicRuleId: z.string().nullable().optional()})]), adjustments: z.array(z.string()).optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Add checkout block * * POST /v25-10-beta/experiences/{experienceId}/checkout-blocks */ export const createApiV2510BetaExperiencesExperienceIdCheckoutBlocks = async (args: CreateApiV2510BetaExperiencesExperienceIdCheckoutBlocksArgs, options?: CreateApiV2510BetaExperiencesExperienceIdCheckoutBlocksOptions) => { const {baseUrl = "https://api.intelligems.io", fetch: fetchFn = fetch, intelligemsAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (intelligemsAccessToken !== undefined) headers.set("intelligems-access-token", intelligemsAccessToken) const url = `${baseUrl.replace(/\/+$/, '')}/v25-10-beta/experiences/${encodeURIComponent(String(args.experienceId))}/checkout-blocks${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 validateResponse(createApiV2510BetaExperiencesExperienceIdCheckoutBlocksResponse, await res.json()) };