CheckoutAPI is the global object the checkout platform mounts on window.CheckoutAPI, on the checkout page and on the thank-you page. Its methods are grouped into namespaces such as order, store and address, and let an extension read the order and the choices the buyer has made, listen for those values changing, and drive part of the checkout UI. The methods listed here are the checkout CheckoutAPI methods open to apps, following the platform's public capability list. Every type named in a method signature is defined in Types at the end of this page.
Quick start
CheckoutAPI splits its methods into 15 namespaces, and every call has the same shape: CheckoutAPI.<namespace>.<method>(). The example below prints an overview of the checkout page — the current step, the order, the totals and the line items — and to do that it reaches into three namespaces: step, store and summary. Get it running and you know how to use the whole page: when you need a piece of data, find the namespace that owns it and look up the method name in its table.
const MOUNT_INTERVAL_MS = 100 ;
const MOUNT_MAX_ATTEMPTS = 50 ;
function mount ( cb , attempt = 0 ) {
if ( window . CheckoutAPI ) {
cb ( window . CheckoutAPI ) ;
return ;
}
if ( attempt >= MOUNT_MAX_ATTEMPTS ) {
console . warn ( 'CheckoutAPI did not mount within the expected time' ) ;
return ;
}
window . setTimeout ( ( ) => mount ( cb , attempt + 1 ) , MOUNT_INTERVAL_MS ) ;
}
const onPricesChange = ( prices ) => console . log ( 'total is now' , prices . totalPrice ) ;
mount ( ( api ) => {
const order = api . store . getOrderInfo ( ) ;
const prices = api . store . getPrices ( ) ;
const products = api . summary . getProductList ( ) ;
console . log ( 'step:' , api . step . getStep ( ) ) ;
console . log ( 'order:' , order . orderNo , order . status , order . currencyCode ) ;
console . log ( 'subtotal / total:' , prices . subtotalPrice , prices . totalPrice ) ;
console . log ( 'lines:' , products . length , products . map ( ( p ) => p . productTitle + ' x' + p . quantity ) ) ;
api . store . onPricesChange ( onPricesChange ) ;
} ) ;
A method's name prefix tells you what kind of call it is:
Name pattern What it does get* / is* / has*Reads a value synchronously and returns it immediately. on* / remove*on* registers a callback, remove* takes it off again. Use them as a pair and pass the same function reference to both.register* / unregister*Registers a rewriter. The platform consumes what the callback returns, so returning the wrong thing breaks the whole page. Use these only when you mean to change platform behaviour. dispatch*Triggers one UI refresh. Returns a Promise Sends a request or runs a validation, so the result arrives later.
Read this before your first call
CheckoutAPI is not on window yet when your script starts. The platform attaches it only after the checkout page has finished loading, so poll for it the way the example above does rather than reading window.CheckoutAPI straight away. A worked example is in Scenario 3: API calls and event listening .
Pair every on* with its remove*. A callback registered with on* stays registered until the page is unloaded. Keep it in a variable and pass the same function reference to the matching remove* method once you no longer need it — a callback written inline as an arrow function can never be removed.
register* methods are providers, not listeners. A method whose name starts with register hands the checkout page a callback whose return value the platform consumes . registerUiShippingLinesChange, for example, decides which shipping lines the page renders: return undefined from it and the page reads undefined.length and crashes to an error screen. Register these only when you actually intend to change platform behaviour, and always return a value of the type in the signature. To watch a value without changing it, use the matching on* method instead.
address
The address namespace exposes the two address forms, shipping and billing: their values, the schema the UI renders them from, validation, and the addresses the buyer has saved. It also provides the country list and the address templates that decide which fields a given country collects.
Shipping address
Method Purpose Parameters Returns getShippingAddressGet the values of the shipping address form — AddressValues getShippingAddressSchemaGet the schema of the shipping address form; the UI renders the fields from this list — ExtendSchema []onShippingSchemaChangeRegister a callback for the shipping address schema changing; re-render the form when it fires cb: AddressChangeCb voidremoveShippingSchemaChangeCbRemove a shipping address schema change callback cb: AddressChangeCb voidonShippingAddressChangeRegister a callback for the shipping address values changing cb: AddressValuesChangeCb voidremoveShippingAddressChangeCbRemove a shipping address value change callback cb: AddressValuesChangeCb voidonShippingAddressChangeByInputRegister a callback for the shipping address values changing, fired only when the buyer edits the form and not when code changes the values cb: AddressValuesChangeCb voidremoveShippingAddressChangeByInputRemove a buyer-edit shipping address callback cb: AddressValuesChangeCb voidvalidateShippingAddressValidate the shipping address; pass ids to validate only those fields ids?: string[]options?: ValidateOptions Promise<ValidateResult []>isSaveAddressWhether the "save to address book" checkbox is ticked — booleansetIsSaveAddressSet the "save to address book" checkbox isSave: booleanvoidclearShippingAddressClear the shipping address — voidupdateShippingAddressUpdate the shipping address address: Partial<ShippingAddress >voidgetEmailSchemaGet the schema of the email field config: ContactSchemaConfig AddressItemEmailSchema | nullgetPhoneSchemaGet the schema of the phone field config: ContactSchemaConfig AddressItemGeneralPhoneSchema | AddressItemStringSchema | nullgetEmailOrPhoneSchemaGet the schema of the combined email-or-phone field — AddressItemStringSchema | nullvalidateContactValidate the contact field options?: ValidateOptions Promise<ValidateResult | undefined>getContactSchemaGet the schema of the contact field, combining getEmailSchema, getPhoneSchema and getEmailOrPhoneSchema — AddressItemPhoneSchema | AddressItemStringSchema | AddressItemEmailSchema registerShippingAddressSchemaSortRegister a sort callback for the shipping address form, used to reorder its fields cb: SortSchemaCb voidregisterShippingAddressSchemaChangeVisibilityRegister a visibility callback for the optional shipping address fields, used to hide them cb: SchemaItemVisibilityCb voidregisterShippingAddressSchemaChangeLabelRegister a rewrite callback for the shipping address field labels cb: SchemaChangeLabelCb voiddispatchShippingAddressSchemaChangeManually notify the UI to re-render the shipping address form — voidexpandShippingAddressExpand the shipping address form; reason records what triggered the expansion reason?: AddressExpandReason voidformatPhoneFormat a phone number using the country of the current shipping address value: stringstringgetCollapsibleShippingAddressSchemaGet the shipping address schema in its collapsed form: the autocomplete fields stay hidden until it expands, address acts as the autocomplete entry, and a manual-entry link is appended — ExtendSchema []getShippingAddressFocusIdPrefixGet the prefix of the focus ids used by the shipping address fields, so you can build the full id of an input — stringgetSubmitShippingAddressGet the shipping address in the shape submitted to the platform, which is nested rather than flat and fills in some defaults — ShippingAddress isFieldShowCheck whether a field is shown under the current address template key: keyof AddressValues booleanisShippingAddressExpandedCheck whether the shipping address form is currently expanded — booleanregisterShippingAddressSchemaChangeDisableRegister a disable callback for the shipping address fields, which can lock down fields that already have a value cb: SchemaChangeDisableCB voidregisterShippingAddressSchemaChangeValidateRuleRegister extra validation rules for the shipping address form, applied on top of the built-in ones cb: SchemaChangeValidateRuleCB void
Billing address
Method Purpose Parameters Returns getBillingAddressGet the billing address — AddressValues | ShippingAddress | undefinedgetBillingAddressSchemaGet the schema of the billing address form; the UI renders the fields from this list — AddressItemSchema []onBillingSchemaChangeRegister a callback for the billing address schema changing; re-render the form when it fires cb: BillingAddressChangeCb voidremoveBillingSchemaChangeCbRemove a billing address schema change callback cb: BillingAddressChangeCb voidvalidateBillingAddressValidate the billing address — Promise<ValidateResult []>onBillingAddressValuesChangeRegister a callback for the billing address values changing cb: BillingAddressValuesChangeCb voidremoveBillingAddressValuesChangeRemove a billing address value change callback cb: BillingAddressValuesChangeCb voidisUseShippingAsBillingAddressWhether the billing address reuses the shipping address, in which case the billing form is collapsed and the buyer does not fill it in — booleansetIsUseShippingAsBillingAddressSet whether the billing address reuses the shipping address isUse: booleanvoidonUseShippingAsBillingAddressChangeRegister a callback for the reuse-shipping-as-billing state changing cb: UseShippingAsBillingAddressCb voidremoveUseShippingAsBillingAddressChangeRemove a reuse-shipping-as-billing callback cb: UseShippingAsBillingAddressCb voidregisterBillingAddressSchemaChangeLabelRegister a rewrite callback for the billing address field labels cb: SchemaChangeLabelCb voidsetBillingAddressSet the values of the billing address form address: AddressValues voidregisterBillingAddressSchemaSortRegister a sort callback for the billing address form, used to reorder the billing fields of non-gift-card products cb: SortSchemaCb voiddispatchBillingAddressSchemaChangeManually notify listeners that the billing address form structure has changed — void
Address book
Method Purpose Parameters Returns onChangeAddressBookRegister a callback for the address book changing; call getAddressBookList again when it fires cb: AddressBookChangeCbs voidremoveAddressBookChangeCbRemove an address book change callback cb: AddressBookChangeCbs voidgetAddressBookListGet the buyer's saved addresses — IAddressBookItem []applyAddressFill the shipping address from a saved address id: stringsetBilling?: booleanvoid
Address utilities
Method Purpose Parameters Returns getAddressTemplateGet the address template for a country, province and preset; the template decides which fields that country collects params: GetAddressTemplateParams AddressTemplate getAllCountriesGet every country the platform supports — AddressCountry []getAvailableCountriesGet the countries the store has made available — AddressCountry []getDefaultAddressValuesGet an empty set of address values, usable as the initial value of a form — AddressValues getSchemaManagerCreate a schema manager for an address form, which builds and validates each field from the current values and the address template context: AddressSchemaManagerContext config: SchemaManagerConfig AddressSchemaManager hasCountryCheck whether a country code is in the store's available country list countryCode: stringbooleanisMiddleEastCountryCheck whether a country is one of the Middle East countries that need special address handling countryCode: stringbooleanisMultiLevelCountryCheck whether a country uses multi-level administrative divisions countryCode: stringboolean
base
The base namespace holds the plumbing of the checkout page: loading and pending state, phone number formatting, localized messages, and whether each native module is currently on screen.
Loading and pending state
Method Purpose Parameters Returns getLoadingStatusGet the global loading state — LoadingStatus onLoadingStatusChangeRegister a callback for the loading state changing cb: OnLoadingStatusChangeCallback voidremoveLoadingStatusChangeCbRemove a loading state callback cb: OnLoadingStatusChangeCallback voidsetLoadingStatusUpdate the loading state status: Partial<LoadingStatus >voidgetPendingGet the pending state of each module — Pending onPendingChangeRegister a callback for the pending state changing pending: OnSubmitPendingChangeCallback voidremovePendingChangeCbRemove a pending state callback cb: OnSubmitPendingChangeCallback voidresetAllPendingReset every pending flag — voidsetPricePendingSet the pending flag for price calculation pending: booleanvoidsetPickupLocationPendingSet the pending flag for the pickup location list pending: booleanvoidgetPickupLocationPendingGet the pending flag for the pickup location list — booleansetShippingLinesPendingSet the pending flag for the shipping line list pending: booleanvoidgetShippingLinesPendingGet the pending flag for the shipping line list — booleansetPaymentPendingSet the pending flag for loading the payment script pending: booleanvoid
Method Purpose Parameters Returns getPhoneAreaListGet the list of phone country codes — Country []getDefaultPhoneKeyGet the default phone country code, resolved from the buyer's IP first and from the browser language as a fallback — stringgetPhoneAreaResolve the country or region a phone number belongs to phone: stringphoneKey?: stringCountry | undefinedformatPhoneFormat a phone number for a country phone: stringcountryCode: stringstringisValidPhoneCheck whether a phone number is valid for a country phone: stringcountryCode?: stringbooleaninitPhoneInitialize the phone number and its country code: the country code is resolved from the number already on the order, then the number is reformatted to the standard form of that country phone: string_phoneAreaCode: stringisPhoneRequired: booleanInitPhoneResult | null
Localization
Method Purpose Parameters Returns getLocaleGet the current language, for example en — stringformatMessageLook up a message for the current language by key, falling back to defaultMessage when the key is missing; context fills the placeholders in the message id: stringdefaultMessage?: stringcontext?: Record<string, string | number>stringformatPriceFormat an amount into a display string with its currency symbol price: number | stringsymbolStr?: stringstringisRtlLocaleWhether the current language is written right to left, such as Arabic — booleanregisterLocaleMapRegister your extension's own messages, grouped by language locales: LocaleMap voidgetFullLocaleGet the full locale tag, for example en-US — Locale
Usage
Register your own messages per language, then read them back with formatMessage. Nested keys are flattened with a dot, so audit2: { deep: … } is read as 'audit2.deep'; context fills the {placeholder} slots in the message.
CheckoutAPI . base . registerLocaleMap ( {
'en-US' : { 'audit.greet' : 'Hi {name}' , audit2 : { deep : 'deep {name}' } } ,
'zh-CN' : { 'audit.greet' : '你好 {name}' , audit2 : { deep : '深层 {name}' } } ,
} ) ;
CheckoutAPI . base . getLocale ( ) ;
CheckoutAPI . base . getFullLocale ( ) ;
CheckoutAPI . base . formatMessage ( 'audit.greet' , '' , { name : 'Audit' } ) ;
CheckoutAPI . base . formatMessage ( 'audit2.deep' , '' , { name : 'Audit' } ) ;
CheckoutAPI . base . formatMessage ( 'probe.not_exist' ) ;
CheckoutAPI . base . formatMessage ( 'probe.not_exist' , 'FALLBACK TEXT' ) ;
CheckoutAPI . base . formatPrice ( 10 ) ;
CheckoutAPI . base . formatPrice ( '10.5' ) ;
CheckoutAPI . base . formatPrice ( 10 , '€' ) ;
The buyer's language decides which map is used: getLocale() returns the short form and getFullLocale() the full tag that keys the map. A key with no entry for the current language falls back to the defaultMessage argument, or to the key itself when you pass no fallback.
Module visibility
Method Purpose Parameters Returns getSpecialInstructionVisibleWhether the order note input is shown — booleangetBillingVisibleWhether the billing address is shown — booleangetVirtualBillingVisibleWhether the billing address for virtual products is shown — booleangetBillingSelectorVisibleWhether the "use the shipping address as the billing address" selector is shown — booleangetPickupAddressVisibleWhether the pickup location list is shown — booleangetPickupInformationVisibleWhether the pickup information module is shown — booleangetAddressCardVisibleWhether the filled-in information card is shown — booleangetDeliveryMethodVisibleWhether the delivery method module is shown — booleangetExpressCheckoutVisibleWhether express checkout is shown — booleangetDeliveryVisibleWhether the shipping line list is shown — booleangetMobileCouponVisibleWhether the discount code input is shown on mobile — booleangetSummaryCouponVisibleWhether the discount code input is shown on desktop — booleangetAddressBookVisibleWhether the address book is shown — booleangetShippingAddressVisibleWhether the shipping address is shown — booleangetContactInformationVisibleWhether the contact information module is shown — booleansetIsExpandedManuallyRecord that the buyer expanded the filled-in information card by hand val: booleanvoidgetIsExpandedManuallyWhether the buyer expanded the filled-in information card by hand — booleangetVisibleConfigGet the visibility state of every module at once — VisibleConfig onVisibleConfigChangeRegister a callback for module visibility changing cb: VisibleConfigChangeCb voidremoveVisibleConfigChangeCbRemove a module visibility callback cb: VisibleConfigChangeCb voidgetShowDetailsThe card-collapse configuration provided by the platform — ShowDetails getGiftCardBillingVisibleCheck whether the billing form of a gift card order is shown — boolean
config
The config namespace is read-only store and page configuration: theme, market, feature flags, and which of the two checkout pages is currently open.
Method Purpose Parameters Returns getFeatureConfigGet the checkout feature flags — CheckoutFeatures getThemeConfigGet the checkout theme configuration — CheckoutThemeConfig getAppConfigGet the checkout app configuration — CheckoutAppConfig getMarketConfigGet the market configuration — MarketInfo getShopConfigGet the store configuration — ShopConfig getRootUrlGet the API root URL — stringgetPolicyTitlesGet the titles of the policy links in the page footer — string[]isThankyouPageWhether the current page is the thank-you page — booleanisCheckoutPageWhether the current page is the checkout page — booleangetCSettingsGet the page-level checkout settings — CSettings isMobileLayoutWhether the mobile layout is in use, which happens when the window is narrower than 768px — booleanonThemeConfigChangeRegister a callback for the theme configuration changing cb: ThemeConfigChangeCb voidremoveThemeConfigChangeRemove a theme configuration callback cb: ThemeConfigChangeCb voidupdateThemeConfigUpdate the theme configuration config: Partial<CheckoutThemeConfig >void
coupon
The coupon namespace covers the savings a buyer can apply: coupons they hold, discount codes they type in, and gift cards. It reads what is currently applied, applies and removes codes and gift cards, and lets you rewrite how the gift card and discount code tags render.
Coupons
Method Purpose Parameters Returns applyCouponApply a coupon code: stringPromise<any>cancelCouponRemove a coupon that has been applied code: stringPromise<any>getAvailableCouponDataGet the coupons that can be used on this order — CouponData getSelectedDiscountCouponGet the coupon currently applied — DiscountApplication | undefinedgetUnavailableCouponDataGet the coupons that cannot be used on this order — CouponData isShowDiscountCouponCheck whether the coupon entry is shown — booleanonAvailableCouponDataChangeRegister a callback for the available coupon list changing cb: CouponListChangeCb voidonCouponChangeRegister a callback for the applied coupon changing cb: CouponChangeCb voidonUnavailableCouponDataChangeRegister a callback for the unavailable coupon list changing cb: CouponListChangeCb voidremoveAvailableCouponDataChangeCbRemove an available coupon list callback cb: CouponListChangeCb voidremoveCouponChangeCbRemove an applied coupon callback cb: CouponChangeCb voidremoveUnavailableCouponDataChangeCbRemove an unavailable coupon list callback cb: CouponListChangeCb voidrequestCouponListFetch the coupon list for the given availability status status: CouponAvailStatus Promise<void>
Gift cards and discount codes
Method Purpose Parameters Returns registerGiftCardTagChangeRegister a rewrite callback for one discount code or gift card tag, used to customize how that tag renders id: stringcb: GiftCardTagChange voidgetGiftCardTagsGet the discount code and gift card tags — GiftCardTagItem []onDiscountChangeRegister a callback for the tag list changing cb: GiftCardTagsChangeCb voidremoveDiscountChangeCbRemove a tag list callback cb: GiftCardTagsChangeCb voidgetGiftCardsGet the gift cards applied to this order — GiftCard []getDiscountCodesGet the discount codes applied to this order — DiscountApplication []getDiscountApplicationsGet every discount applied to this order, both codes and automatic promotions — DiscountApplication []applyGiftCardOrDiscountCodeApply a discount code or gift card; position records which input it came from and is used for tracking only code: stringposition?: 'coupon-pc' | 'coupon-mobile'Promise<any>cancelGiftCardOrDiscountCodeRemove an applied discount code or gift card parasm: CancelCouponParams Promise<any>applyDiscountApply one or more discount codes codes: string[]Promise<PriceResult | undefined>cancelDiscountCodeRemove one or more discount codes that have been applied codes: string[]Promise<PriceResult | undefined>isCurrentStepShowDiscountCodeCheck whether the discount code and gift card inputs are shown on the current step, per the store's settings step?: CheckoutStep booleanregisterGiftCardTagsFilterRegister a filter callback for the gift card and discount code tags, deciding which tags render cb: GiftCardTagsFilter void
exception
The exception namespace covers business errors raised during checkout: checking a response for an error code, reading and clearing the stored error, watching submit failures, and the state of the removed-items dialog.
Method Purpose Parameters Returns checkExceptionCheck a response for a business error code: when one is present the error is stored and the method returns false, otherwise it returns true. The stored error can then drive a dialog or another message exception?: ExceptNotification booleanonExceptionChangeRegister a callback for the stored business error changing, fired both when one is stored and when it is cleared cb: ExceptionChangeCbs voidremoveExceptionChangeCbRemove a business error callback cb: ExceptionChangeCbs voidunsetExceptionClear the stored business error — voidgetSubmitErrorInfoGet the current submit error — SubmitError | undefinedsetSubmitErrorInfoSet the submit error code. The platform already sets it when the order is submitted, so this is mostly used to clear it code: IExceptionCode | ''voidonSubmitErrorChangeRegister a callback for the submit error changing cb: SubmitErrorChangeCbs voidremoveSubmitErrorChangeCbRemove a submit error callback cb: SubmitErrorChangeCbs voidgetExceptionInfoGet the stored business error — ExceptionInfo getExceptionGet the business error currently stored — IException | undefinedhandleExceptionOkRun the handler behind the confirm button of the business error dialog — Promise<boolean>
extension
The extension namespace is about extensions themselves: registering one, reading what is registered at a point, watching extensions finish loading, checking and watching which native modules are hidden, and building the real name of a dynamic extension point.
Method Purpose Parameters Returns generateRealDynamicPointTurn a dynamic extension point template containing {id} into the real extension point name point: ExtensionPoint id?: stringstringgetExtensionComponentsReturn the extension component of the point, which carries more than getExtensionContent; an id means the point is dynamic point: ExtensionPoint id?: stringExtensionComponent []getExtensionContentReturn the extension string of the point, empty when there is none; an id means the point is dynamic point: ExtensionPoint id?: stringstringgetExtensionListGet the list of extensions — Extension []getPlaceholderContentReturn the placeholder content of the point, which the UI layer inserts with innerHTML point: ExtensionPoint stringisHideExtensionTargetWhether an extension target is hidden; the UI layer reads it to decide whether to hide that native module target: ExtensionTarget booleanonAllExtensionLoadedRegister a callback for all extensions having finished loading cb: AllExtensionLoadedCb voidonExtensionLoadRegister a callback that runs when the extension of a point has finished loading cb: ExtensionLoadCb voidonHideExtensionTargetRegister a callback for the result of isHideExtensionTarget changing cb: HideExtensionTargetCb voidregisterExtensionRegister an extension; extension developers call this function to complete the registration params: RenderParams Promise<void>removeAllExtensionLoadedCbRemove a callback registered for all extensions having finished loading cb: AllExtensionLoadedCb voidremoveHideExtensionTargetRemove the callback cb: HideExtensionTargetCb void
order
The order namespace covers what the buyer picks on the way to placing an order: delivery method, shipping line, shipping protection, tip, order note, and the submit step, together with the price refresh that follows every change.
Delivery method
Method Purpose Parameters Returns getDeliveryMethodListGet the delivery methods this checkout offers, such as shipping and in-store pickup — DeliveryMethodItem []getSelectedDeliveryMethodGet the delivery method the buyer has selected — DeliveryMethodItem updateDeliveryMethodSwitch the selected delivery method and return the recalculated prices type: CheckoutBusinessType Promise<PriceResult | undefined>onDeliveryMethodChangeRegister a callback for the selected delivery method changing cb: DeliveryMethodChangeCb voidremoveDeliveryMethodChangeCbRemove a delivery method change callback cb: DeliveryMethodChangeCb voidonDeliveryMethodListChangeRegister a callback for the delivery method list changing cb: DeliveryListChangeCb voidremoveDeliveryMethodListChangeRemove a delivery method list callback cb: DeliveryListChangeCb voidunregisterDeliveryMethodListChangeUnregister the delivery method list rewrite callback cb: DeliveryMethodListChangeCb voidregisterDeliveryMethodListChangeRegister a rewrite callback for the delivery method list, used to customize each entry, for example by hiding its icon or inserting content; the callback must return the full list cb: DeliveryMethodListChangeCb void
Line items
Submit and validation
Method Purpose Parameters Returns couldSubmitWhether the current step can be submitted, for driving the disabled state of a custom submit button — booleanonSubmitChangeRegister a callback for the submittable state changing cb: SubmitChangeCb voidremoveSubmitChangeCbRemove a submittable state callback cb: SubmitChangeCb voidpreSaveAddressPre-save the address currently entered in the form to the order — Promise<void>submitInformationAndNavigateSubmit the information step and navigate to the next one, running form validation and extension validation first; used only by the two-step and three-step layouts — Promise<ValidateResult [] | undefined>registerBuyerJourneyInterceptRegister a checkout interception rule: returning block from the callback stops the buyer and opens a dialog, returning allow lets the submission through cb: BuyerJourneyInterceptCb voidaddBeforeSubmitCbAdd a validation callback that runs before the address is submitted; the platform's own two cover email and address cb: BeforeSubmitCb voidremoveBeforeSubmitCbRemove a validation callback that runs before the address is submitted cb: BeforeSubmitCb voidsubmitAddressAndShippingLinesSubmit the address together with the selected shipping line — Promise<Res <SubmitSuccessData >>submitShippingLinesAndNavigateSubmit the shipping line and move to the next step; only the three-step layout uses this — Promise<ValidateResult [] | undefined>submitValidateThe general pre-submit validation: it picks the checks that apply to the current layout and step, and moves focus to the first input that fails — Promise<ValidateResult []>unregisterBuyerJourneyInterceptUnregister a checkout interception rule cb: BuyerJourneyInterceptCb void
Tipping
Method Purpose Parameters Returns getTippingOptionsGet the preset tip options offered on this checkout — TippingOption []onTippingChangeRegister a callback for the tip changing cb: TippingChangeCb voidremoveTippingChangeCbRemove a tip change callback cb: TippingChangeCb voidhandleTippingSubmit a tip, where type tells a preset option (select) from a buyer-entered amount (input) value: numbertype: 'select' | 'input'Promise<any>getTippingInfoGet the tipping state: whether tipping is supported and shown, the currency symbol, the tip received so far, and the product subtotal after discounts, free-shipping coupons excluded — TippingInfo
Shipping lines
Method Purpose Parameters Returns getShippingLinesGet the shipping lines available for the current address — FormatShippingLineType []getSelectedShippingLineGet the shipping line the buyer has selected, or null when none is selected — FormatShippingLineType | nullupdateSelectedShippingLineSwitch the selected shipping line shippingLine: ShippingLineType Promise<void>shouldCalculateShippingLineWhether shipping lines should be requested at this point; in the three-step layout it returns false on the information step — booleanonShippingChangeRegister a callback for the selected shipping line changing cb: ShippingChangeCb voidremoveShippingChangeCbRemove a shipping line change callback cb: ShippingChangeCb voidisShippingMethodAutoSelectWhether the store is configured to auto-select a shipping line — booleanisSupportShippingLinesCollapseWhether the shipping line list can be collapsed, which only the single-page and two-step layouts support — booleangetShippingPromptMessageGet the prompt currently shown on the shipping line list, or null when there is none — PromptMessage | nullonShippingPromptMessageChangeRegister a callback for the shipping line prompt changing cb: ShippingPromptMessageChangeCb voidremoveShippingPromptMessageChangeRemove a shipping line prompt callback cb: ShippingPromptMessageChangeCb voiddispatchShippingChangeManually notify listeners that the shipping line changed — voidgetShippingLinesErrorInfoGet the error information of the shipping line list — ShippingLinesErrorInfo getUiShippingLinesGet the shipping lines the page finally renders, which an extension may have rewritten — FormatShippingLineType []unregisterUiShippingLinesChangeUnregister the shipping line list rewrite callback cb: UiShippingLinesChangeCb voidregisterUiShippingLinesChangeRegister a rewrite callback for the shipping line list, deciding which lines the page finally renders; the callback must return the full list cb: UiShippingLinesChangeCb void
Shipping protection
Order note
Method Purpose Parameters Returns getSpecialInstructionNoteGet the order note the buyer has entered — stringupdateSpecialInstructionNoteWrite the order note, and persist it to the order when saveToBackend is true note: stringsaveToBackend?: booleanPromise<any>onChangeSpecialInstructionRegister a callback for the order note changing cb: (info: string) => voidvoidremoveSpecialInstructionChangeCbRemove an order note change callback cb: (info: string) => voidvoidexpendSpecialInstructionExpand the order note input — voidisInstructionCollapseWhether the order note input is currently collapsed — booleanonInstructionCollapseChangeRegister a callback for the order note input collapsing or expanding cb: IsSpecialInstructionCollapseChange voidremoveInstructionCollapseChangeRemove an order note collapse callback cb: IsSpecialInstructionCollapseChange void
Method Purpose Parameters Returns getCollapseInfoGet the contents of the filled-in information card: contact, shipping address, delivery method, shipping line, and whether the new-address button is shown — CollapseInfo onCollapseInfoChangeRegister a callback for the filled-in information card changing cb: CollapseInfoChangeCb voidremoveCollapseInfoChangeCbRemove a filled-in information card callback cb: CollapseInfoChangeCb void
Order data and price refresh
payment
The payment namespace covers the payment methods on offer: which ones the buyer can choose from, which one is selected, submitting the payment, and the callbacks that run when a payment is attempted, fails, or completes.
Method Purpose Parameters Returns paymentPayStart the payment after the buyer submits — Promise<void>getPaymentLinesGet every payment method in the list — PaymentUpdateParams ['paymentLines']getSelectedPaymentLineGet the payment method the buyer has selected — PaymentLine | null | undefinedonAfterPayRegister a callback that runs after payment completes cb: AfterPayCb voidonPayAttemptRegister a callback for a payment attempt; it fires before form validation, so a failed validation that never reaches the gateway still counts as an attempt cb: PayAttemptCb voidonPayFailedRegister a handler for a failed payment; several can be registered, they run in order, and the first one that returns a value decides the outcome handler: PayFailedHandler voidremovePayAttemptCbRemove a payment attempt callback cb: PayAttemptCb void
pickup
The pickup namespace covers in-store pickup: the pickup locations, the one the buyer selected, the pickup information form, and pickup validation.
Method Purpose Parameters Returns getPickupLocationsGet the pickup locations — PickupLocation []getPickupLocationValidateResultGet the validation result for the pickup location — ValidateResult | undefinedonPickupLocationValidateResultChangeRegister a callback for the pickup location validation result changing cb: ValidatePickupResultChangeCb voidremovePickupLocationValidateResultChangeRemove a pickup location validation callback cb: ValidatePickupResultChangeCb voidvalidatePickupLocationValidate that a pickup location has been chosen — Promise<ValidateResult | undefined>getSelectedPickupLocationGet the pickup location the buyer has selected — PickupLocation | undefinedupdatePickupLocationSwitch the selected pickup location and return the recalculated prices location: PickupLocation Promise<PriceResult | undefined>onPickupLocationsChangeRegister a callback for the pickup location list changing cb: PickupLocationsChangeCb voidremovePickupLocationsChangeCbRemove a pickup location list callback cb: PickupLocationsChangeCb voidonSelectedPickupLocationChangeRegister a callback for the selected pickup location changing cb: SelectedPickupLocationChangeCb voidremoveSelectedPickupLocationChangeCbRemove a selected pickup location callback cb: SelectedPickupLocationChangeCb voidonPickupInformationChangeRegister a callback for the pickup information changing cb: PickupInformationChangeCb voidremovePickupInformationChangeCbRemove a pickup information callback cb: PickupInformationChangeCb voidgetPickupInformationSchemaGet the schema of the pickup information form — AddressItemSchema []validatePickupInfoValidate the pickup information form — Promise<ValidateResult []>
step
The step namespace covers the steps of a checkout: reading the current step, moving between steps, the breadcrumb configuration, and leaving checkout for another page of the store.
Method Purpose Parameters Returns getStepGet the step the buyer is on — CheckoutStep isInformationStepWhether the buyer is on the information step — booleanisShippingStepWhether the buyer is on the shipping step, which only exists as the second page of the three-step layout — booleanisPaymentStepWhether the buyer is on the payment step, the last page of the three-step and two-step layouts — booleanstepNavToInformationNavigate to the information step type?: EventType Promise<void>stepNavToShippingNavigate to the shipping step type?: EventType Promise<void>stepNavToPaymentNavigate to the payment step — Promise<void>stepNavToNextNavigate to the next step, whatever the layout and checkout mode — Promise<void>stepNavToPreviousNavigate back to the previous step — voidhasShippingMethodStepWhether this order has a shipping step, which needs pickup to be unselected and the products to be physical — booleangetNavigateLinksGet the configuration of the step breadcrumb — NavigateLink []onNavigateLinksChangeRegister a callback for the step breadcrumb changing cb: NavigateLinksChangeCb voidremoveNavigateLinksChangeRemove a step breadcrumb callback cb: NavigateLinksChangeCb voidonStepChangeRegister a callback for the step changing cb: StepChangeCb voidremoveStepChangeCbRemove a step change callback cb: StepChangeCb voidnavigateClickNavigate to a step the way clicking the breadcrumb does id: CheckoutStep Promise<void>couldNavToWhether the breadcrumb can jump to a step. The breadcrumb only goes backwards; moving forward means submitting the current step id: CheckoutStep booleanstepNavToNavigate to a given step id: CheckoutStep location?: EventType Promise<any>navToReferrerPageNavigate back to the page the buyer came from before checkout — voidgoToOrderInfoPageNavigate to the order details page — voidgoToHomePageNavigate to the store home page — voiddisableJumpBlock step navigation, optionally only for the given ways of navigating way?: JumpWay []Promise<void>getReturnBtnTextGet the text of the return button; an empty string means the button is not shown — stringgoToThankyouPageRedirect to the thank-you page — voidisDisableJumpCheck whether step navigation is currently blocked — booleanlocationHrefNavigate to a given URL url: stringvoidstepNavToWithoutSubmitMove to the given step without submitting the current step's data id: CheckoutStep void
store
The store namespace is where the order data lives. The order itself, its prices, its business type and the checkout layout are all read from here, and this is where you listen for a refresh.
Method Purpose Parameters Returns onPricesChangeRegister a callback for the prices changing; when it fires the discounted line prices may still be the old values, so read line item data again a moment later cb: PricesChangeCb voidremovePricesChangeCbRemove a price change callback cb: PricesChangeCb voidgetOrderStatusGet the status of the order — OrderStatus onOrderChangeRegister a callback for the order data being refreshed, fired whenever the order and price APIs write new data. The callback carries no data — read it with the matching get methods cb: OnStoreDataChangeCb voidremoveOrderChangeCbRemove an order refresh callback cb: OnStoreDataChangeCb voidgetPricesGet the prices of the order — CheckoutPrices getOrderInfoGet the basic order information — OrderInfo getOrderConfigGet the order attributes, such as the checkout layout and the order business type — OrderConfig getBusinessTypeGet the business type of the order — CheckoutBusinessType getCheckoutSettingsGet the checkout settings of the store — CheckoutSettings getInstructionTypeGet the collapse mode configured for the order note input — InstructionType getCustomerAuthorityGet who is allowed to place the order; login means only signed-in buyers can — CustomerAuthority setBusinessTypeSet the business type of the order, which the pickup layout uses type: CheckoutBusinessType voidonBusinessTypeChangeRegister a callback for the order business type changing cb: CheckoutBusinessTypeChangeCb voidremoveBusinessTypeChangeCbRemove an order business type callback cb: CheckoutBusinessTypeChangeCb voidgetPageTypeGet the checkout layout, which does not change while the page is open — CheckoutPageType isThreeStepPageWhether this is the three-step checkout layout — booleanisTwoStepPageWhether this is the two-step checkout layout — booleanisOneStepPageWhether this is the single-page checkout layout — booleangetContactTypeGet how the store collects contact details — ContactType getAddressSettingsGet the address form settings — CheckoutAddressSettings isPageTypeSupportFirstStepCollapseWhether this layout can collapse the address into a card on the first step, which only the single-page and two-step layouts support — booleanisStandardTemplateWhether this is the shipped-goods checkout template — booleanisVirtualTemplateWhether this is the virtual-goods checkout template, used when every product in the order is virtual — booleanisStandardBusinessWhether the order business type is shipping — booleanisVirtualBusinessWhether the order business type is virtual goods — booleanisPickupTemplateWhether this is the pickup checkout template, which it becomes as soon as the merchant has pickup locations. Whether the buyer actually picks up is isSelectedPickup — booleanisSelectedPickupWhether this order is a pickup order, true only when this is the pickup template and the buyer selected pickup — booleanisDirectPaymentWhether the order was created from the merchant admin, in which case the buyer lands straight on the payment step — booleanisShippingInInformationStepWhether shipping lines are shown on the first step. The single-page and two-step layouts show them on the information step, which decides whether shipping has to be calculated there — booleanisCartOrderWhether the order was placed from the cart — booleanisBuyNowOrderWhether the order was placed with buy-now on a product page — booleangetReferInfoGet where the order came from — ReferInfo getTaxLinesGet the tax breakdown — TaxLines isGiftCardOrderCheck whether this is a gift card order — booleanisOrderIdEmptyCheck whether the order id is empty — booleanonPageTypeChangeRegister a callback for the checkout layout changing cb: PageTypeChangeCb voidremovePageTypeChangeRemove a checkout layout callback cb: PageTypeChangeCb voidsetOrderIdSet the order id id: stringvoidsetPageTypeSet the checkout layout type: CheckoutPageType void
summary
The summary namespace covers the order summary column: the line items, the price breakdown, and the text shown for the shipping cost.
Method Purpose Parameters Returns getProductListGet the line items, including the custom properties field — ProductItem []onProductListChangeRegister a callback for the line item list changing cb: ProductListChangeCb voidremoveProductListChangeCbRemove a line item list callback cb: ProductListChangeCb voidgetPriceListGet the grouped price breakdown computed by the platform — PriceGroupDetail []onPriceListChangeRegister a callback for the price breakdown changing cb: PriceListChangeCb voidremovePriceListChangeCbRemove a price breakdown callback cb: PriceListChangeCb voidgetShippingPriceDisplayGet the text shown for the shipping cost — stringonShippingPriceDisplayChangeRegister a callback for the shipping cost text changing cb: ShippingPriceDisplayChangeCb voidremoveShippingPriceDisplayChangeRemove a shipping cost text callback cb: ShippingPriceDisplayChangeCb voidregisterUiProductListChangeRegister a rewrite callback for the line item list, deciding which lines the page finally renders; the callback must return the full list cb: UiProductListChangeCb voidgetGiftCardPriceGet the gift card line of the price breakdown — PriceGroupDetail | undefineddispatchPriceListChangeManually notify the UI to re-render the price breakdown — voiddispatchProductListChangeManually trigger a refresh of the line item list in the UI — voidgetUiProductListGet the line items the order summary finally renders, which an extension may have rewritten — UIProduct []unregisterUiProductListChangeUnregister the line item list rewrite callback cb: UiProductListChangeCb void
track
The track namespace reports analytics events. It has a general-purpose track method plus one method per checkout milestone (entering checkout, filling the address, picking a shipping line, starting a payment and so on), and it can also read the order payload used for reporting and attach extra fields to a given event.
Method Purpose Parameters Returns trackReport a tracking event event: stringdata?: Record<string, any>voidgetAssemblyOrderGet the order payload used for analytics reporting — CheckoutOrder registerTrackExtraInfoAttach extra fields to one analytics event, which are then included every time that event is reported eventName: stringdata: Record<string, unknown>voidtrackAddPaymentInfoReport the add payment info event extra?: Record<string, any>voidtrackAddShippingMethodReport the add shipping method event — voidtrackAddressFillReport an address autofill event data: TrackAddressFillParams voidtrackAddressFormExpandReport the address form expand event reason: AddressExpandReason voidtrackAioBeforePayReport the event fired before an aggregated payment starts — voidtrackBeforePayReport the event fired before a payment starts extra?: Record<string, any>voidtrackCompleteOrderClickReport a click on the place order button — voidtrackCompleteOrderErrorReport a failed order submission data: stringvoidtrackContinueToPaymentReport the continue to payment event — voidtrackCouponChangeTabReport a tab switch in the coupon panel status: stringvoidtrackEnterCheckoutReport entering the checkout page — voidtrackGiftCardReport a gift card event type: TrackGiftCardProps info: Record<string, string | number>voidtrackInitialAddressFillReport the first address fill — voidtrackInitiateCheckoutReport the initiate checkout event — voidtrackLogoutReport a sign-out — voidtrackPaymentRedirectReport a payment redirect, taking the load time of the redirect page loadTime: numbervoidtrackShippingAddressSubmitErrorsReport a shipping address submission failure code: stringvoidtrackShippingMethodsCardExposeReport that the shipping method card was shown — voidtrackShippingMethodsRenderReport that the shipping methods rendered — voidtrackShippingMethodsRequestReport a shipping methods fetch triggerSource: ShippingMethodsFetchTriggerSource voidtrackSubmitAddressReport an address submission options?: TrackSubmitAddressParams voidtrackTippingReport a tipping event type: TrackTippingType data: TrackTippingData void
user
The user namespace covers who the buyer is and how to reach them: sign-in state, account details, the email and phone entered at checkout, and the marketing subscription.
Customer account
Method Purpose Parameters Returns isLoginWhether the buyer is signed in — booleangetIPAddressGet the buyer's IP address information — CheckoutIpAddress doLoginRedirect to the sign-in page; the parameters passed in are appended to the return URL returnUrlSearchParams?: Record<string, string>voiddoRegisterRedirect to the sign-up page — voiddoLogoutSign the buyer out — Promise<void>getUserInfoGet the account information of the signed-in buyer — UserInfo getCustomerInfoGet the customer information that is submitted with the order — CheckoutCustomerInfo updateCustomerInfoUpdate the customer information that is submitted with the order data: Partial<CheckoutCustomerInfo >voidonUserInfoChangeRegister a callback for the account information changing cb: UserInfoChangeCb voidremoveUserInfoChangeCbRemove an account information callback cb: UserInfoChangeCb void
Method Purpose Parameters Returns getEmailGet the contact email the buyer entered — stringgetPhoneGet the contact phone number the buyer entered — stringgetPhoneAreaCodeGet the phone country code the buyer entered — stringgetEmailOrPhoneWhen the store collects either an email or a phone number, get whichever the buyer entered — stringgetContactInformationGet the contact details: email, phone, phone country code, and the combined email-or-phone field — ContactInformation onContactInformationChangeRegister a callback for the contact details changing cb: ContactInformationChangeCb voidremoveContactInformationChangeCbRemove a contact details callback cb: ContactInformationChangeCb voidsetNewsletterSet the marketing email subscription checkbox val: NewsLetterStatus voidgetNewsletterGet the marketing email subscription checkbox — NewsLetterStatus
utils
The utils namespace provides the checkout page's own dialog and drawer, plus three lodash functions passed straight through.
Method Purpose Parameters Returns debouncelodash debounce, passed through unchanged — unknowngetlodash get, passed through unchanged — unknownthrottlelodash throttle, passed through unchanged — unknowncreateDialogCreate a dialog, a modal confirmation box content: DialogContent options?: DialogOptions IDialog createDrawerCreate a drawer, a panel that slides in from the edge of the screen content: DrawerContent options?: DrawerOptions IDrawer
Usage
Both take the content and the button labels as their first argument, and an optional second argument for options such as hiding a button or setting the size. createDialog returns { show, hide }; createDrawer returns { show, hide, onClose, destroy, getId }. show() resolves to true when the buyer confirms.
const dialog = CheckoutAPI . utils . createDialog ( {
content : '<div>Ship to this address?</div>' ,
footer : '<div>Delivery takes 3 to 5 days.</div>' ,
trueBtn : 'OK' ,
falseBtn : 'Cancel' ,
} ) ;
const confirmed = await dialog . show ( ) ;
const drawer = CheckoutAPI . utils . createDrawer ( {
content : '<div style="height:200px">Ship to this address?</div>' ,
footer : '<div>Delivery takes 3 to 5 days.</div>' ,
} ) ;
drawer . onClose ( ( type ) => {
} ) ;
await drawer . show ( ) ;
A drawer without trueBtn and falseBtn uses the default Yes and No labels. The dialog node stays in the DOM after it closes, hidden rather than removed, so create it once and reuse it rather than creating one per click.
utils.eventBus
The utils.eventBus object is an in-page event bus for passing messages between extensions on the same checkout page. Prefix every event name with your extension id, as {extension-id}:{event}, so it cannot collide with another extension's.
Method Purpose Parameters Returns emitEmit an event name: string...rest: any[]voidonListen for an event name: stringcb: FunctionvoidonceListen for an event once name: stringcb: FunctionvoidoffStop listening for an event name: stringcb: Functionvoid
Types
The types named in the method tables above. CountryCode comes from the libphonenumber-js package and is not redefined here.
AdditionalPrice
Field Type Description name?stringName of the add-on charge price?stringAmount of the add-on charge
AdditionalProperty
Field Type Description idstringField name, also the key used in extraInfo namestringLabel shown for the field inputType1 | 2 | 3 | 4Input type, which maps to the input control rendered on screen enable1Whether the field is enabled showType'all' | 'and' | 'or'Display condition: all always shows, and shows when every rule matches, or shows when any rule matches showRulesArray<{ field: string; rules: string[]; }>Display rules require0 | 1Whether the buyer must fill this in, 1 for yes descriptionstringDescription of this field validatesArray<{ type: 'regex'; regexp: ''; }>The validation rules that apply enums?Array<{ name: string; value: string; }>Options of a dropdown field
AdditionValues
Field Type Description [key: string]{ name: string; val: string; }Any other key, keyed by name
Field Type Description lineItemsAddProductInput []The line items of the order mutationSourceMutationSource A tag of your own naming what made this change
Field Type Description variantIdstringId of the variant quantitynumberQuantity properties?ProductProperties Custom properties to put on the new line, as a JSON string
AddressBookChangeCbs
export type AddressBookChangeCbs = ( ) => void ;
AddressBookItem
Field Type Description addressstring | nullStreet address address1string | nullFirst line of the street address areastring | nullArea or district citystring | nullCity companystring | nullCompany name countrystring | nullCountry or region name countryCodestring | nullCountry or region code createdAtstring | nullWhen this record was created emailstring | nullEmail address firstNamestring | nullFirst name genderstring | nullGender recorded on the address idstring | nullUnique id of this item isDefaultbooleanWhether this is the default address lastNamestring | nullLast name phonestring | nullPhone number phoneAreaCodestring | nullInternational dialling code of the phone number provincestring | nullProvince or state name provinceCodestring | nullProvince or state code zipstring | nullPostal code
export type AddressChangeByInputCb = (
changeValue : Partial < AddressValues > ,
fullAddress : AddressValues ,
config : ChangeValuesConfig ,
) => void ;
AddressChangeCb
export type AddressChangeCb = ( ) => void ;
AddressCountry
Field Type Description isoCode2stringTwo-letter country code namestringCountry name provincesAddressCountryProvince []Provinces or states of this country depthnumberNumber of address levels this country or region has codestringTwo-letter country or region code presetstringformat?AddressFormat Address format template
AddressCountryProvince
Field Type Description cnNamestringChinese name codestringProvince or state code namestringProvince or state name oldCodestringprovinceIdstringId of the province or state preset?stringformat?AddressFormat Format rules of this field
AddressExpandReason
Value Description 'manual_click'The buyer clicked to expand the form 'empty_fallback_click'The buyer clicked an empty collapsed form 'auto_fill'The form expanded because it was auto-filled 'submit_validate'The form expanded so a validation error could be shown 'browser_fill'The browser filled the form in
Field Type Description fieldsAddressFormatField []The fields this template contains [k: string]anyAny other key, keyed by name
Field Type Description idstringUnique id of this item label?stringLabel shown above the field show?0 | 1Whether this item is shown row?numberRow this field sits in within the form grid description?stringDescription of this field [k: string]anyAny other key, keyed by name
AddressItemActionSchema
Field Type Description idstringUnique id of this item showtrueWhether this item is shown typeFieldType .ActionField type, always the action type textstringText of the action rownumberRow this field sits in within the form grid colnumberColumn this field sits in within the form grid style?Record<string, string | number>Inline styles put on the element className?stringCSS class put on the element onClick()voidCalled when the buyer clicks this row
AddressItemCheckoutSchema
Field Type Description idstringUnique id of this item typeFieldType .CheckboxField type, always the checkbox type descstringLabel shown next to the checkbox showtrueWhether this item is shown valuebooleanWhether the checkbox is ticked rownumberRow this field sits in within the form grid colnumberColumn this field sits in within the form grid changeValue(isCheck)voidTicks or unticks the checkbox
AddressItemEmailSchema
Field Type Description typeFieldType .EmailField type, always email
AddressItemGeneralPhoneSchema
Schema of the phone field. It also carries every field of BaseAddressItemSchema and ValueInterface; only its own members are listed below.
Field Type Description typeFieldType .PhoneField type, always the phone type phoneInfoPhoneInfo Dialling code and formatting rules of the phone field maxLength?numberLargest number of characters accepted changePhone(value, format?, config?)voidWrites a new phone number into the field changePhoneAreaCode(value)voidWrites a new dialling code into the field
AddressItemPhoneSchema
Alias of AddressItemGeneralPhoneSchema.
export type AddressItemPhoneSchema = AddressItemGeneralPhoneSchema ;
AddressItemSchema
Schema of one address form field: select, phone, string or email.
export type AddressItemSchema =
| AddressItemSelectSchema
| AddressItemPhoneSchema
| AddressItemStringSchema
| AddressItemEmailSchema ;
AddressItemSelectSchema
Field Type Description typeFieldType .EnumField type, always the select type selectTypeSelectType Whether the option list is fixed or fetched, as a SelectType value optionsOptionValue []The options in the dropdown
AddressItemStringSchema
Field Type Description typeFieldType .StringField type, always string readOnly?booleanRead-only, the buyer cannot change it format?Array<[regexp: string, params: string[]]> | string[]Formatting rules for the value, for example a Brazilian tax number is reformatted on blur
AddressItemTitleSchema
Field Type Description idstringUnique id of this item showtrueWhether this item is shown typeFieldType .TitleField type, always the title type titlestringTitle text rownumberRow this field sits in within the form grid colnumberColumn this field sits in within the form grid
AddressManagerConfig
Field Type Description useAllCountrybooleanWhether every country or region is offered, not just the shippable ones
AddressSchemaManager
Schema manager for one address form: it reads and changes the values, hands out the per-field schemas, and validates them.
class AddressSchemaManager {
getFieldType ( key : keyof AddressValues ) ;
updateContext ( context : AddressSchemaManagerContext , config ? : AddressManagerConfig ) ;
onUpdateContext ( cb : UpdateContextCb ) ;
registerSchemaChange ( field : keyof AddressValues , cb : AddSchemaChangeCbs ) ;
onAddressChangeByInput ( cb : AddressChangeByInputCb ) ;
removeAddressChangeByInput ( cb : AddressChangeByInputCb ) ;
onAddressChange ( cb : AddressValuesChangeCb ) ;
removeAddressChange ( cb : AddressValuesChangeCb ) ;
onFieldsChange ( cb : FieldsChangeCb ) ;
getAddressValues ( ) ;
changeValues ( values : Partial < AddressValues > , config ? : ChangeValuesConfig ) ;
onValuesChange ( cb : AddressValuesChangeCb ) ;
removeValuesChangeCb ( cb : AddressValuesChangeCb ) ;
dispatchAddressValuesChange ( changeVal : Partial < AddressValues > , options ? : AddressValuesChangeOptions ) ;
validateFields ( fieldIds ? : Array < keyof AddressValues > , config ? : { updateUi ? : boolean ; onlyValidateExistValue ? : boolean } ) : Promise < ValidateResult [ ] > ;
onValidateResultChange ( cb : ValidateResultChangeCb ) ;
removeValidateResultChange ( cb : ValidateResultChangeCb ) ;
getCountries ( ) ;
hasCountry ( countryCode : string ) ;
getProvinces ( ) ;
isValidProvinceCode ( code : string ) ;
getAllSchema ( ) : Array < AddressItemSchema > ;
getCustomLabelById ( id : string ) ;
getCountryCodeSchema ( ) : AddressItemSelectSchema | null ;
getProvinceSchema ( config ? : { emptyHide : boolean } ) : AddressItemSelectSchema | AddressItemStringSchema | null ;
getCitySchema ( ) : AddressItemSelectSchema | AddressItemStringSchema | null ;
getAreaSchema ( ) : AddressItemSelectSchema | AddressItemStringSchema | null ;
getAddressSchema ( config ? : { ignoreSettings ? : boolean } ) : AddressItemSelectSchema | AddressItemStringSchema | null ;
getAddress1Schema ( config ? : { ignoreSettings ? : boolean } ) : AddressItemStringSchema | null ;
getZipSchema ( config ? : { noUseSetting : boolean } ) : AddressItemStringSchema | null ;
getFirstNameSchema ( config ? : { ignoreSettings ? : boolean } ) : AddressItemStringSchema | null ;
getLastNameSchema ( config ? : { ignoreSettings ? : boolean } ) : AddressItemStringSchema | null ;
getCompanySchema ( config ? : { ignoreSettings ? : boolean } ) : AddressItemStringSchema | null ;
getCustomizedFields ( ) : Array < AddressItemStringSchema | AddressItemPhoneSchema | AddressItemEmailSchema | AddressItemSelectSchema > ;
getPhoneSchema ( config : ContactSchemaConfig ) : AddressItemGeneralPhoneSchema | AddressItemStringSchema | null ;
getEmailSchema ( config : ContactSchemaConfig ) : AddressItemEmailSchema | null ;
getEmailOrPhoneSchema ( ) : AddressItemStringSchema | null ;
getIdNumberSchema ( ) : AddressItemStringSchema | null ;
getCpfSchema ( ) : AddressItemStringSchema | null ;
formatPhone ( value : string ) ;
changePhone ( value : string , format ? : boolean , config ? : ChangeValueConfig ) ;
changePhoneAreaCode ( code : string , setEmailOrPhone ? : boolean ) ;
changeEmailOrPhone ( values : Partial < AddressValues > , config ? : ChangeValueConfig ) ;
}
The manager keeps state of its own, so it is listed as source code rather than as a table. Get an instance from CheckoutAPI.address instead of constructing one yourself.
AddressSchemaManagerContext
Field Type Description addressValuesAddressValues Current values of the address form addressTemplateAddressTemplate Address template of the current country or region
AddressTemplate
Field Type Description fieldsAddressTemplateField []The address fields this template collects stringifystringpresetstringaddressLevelnumberNumber of address levels
AddressTemplateField
Field Type Description idstringUnique id of this item colnumberColumn this field sits in within the form grid rownumberRow this field sits in within the form grid show0 | 1Whether this item is shown format?Array<[regexp: string, params: string[]]> | string[]Format rules the value has to match length?number | { min?: number; max?: number }Allowed length of the value required0 | 1Whether the buyer must fill this in typeFieldType Type of this item label?stringLabel shown above the field tips?stringHint text shown under the field validate?AddressTemplateFieldValidate []The validation rules for this field
AddressTemplateFieldValidate
Field Type Description idstringUnique id of this item messagestringMessage shown when the check fails regexpstringRegular expression the value has to match
AddressValues
Field Type Description id?stringAddress id firstNamestringFirst name lastNamestringLast name countryCodestringCountry code countrystringCountry name provinceCodestringProvince or state code provincestringProvince or state name areastringDistrict or county citystringCity addressstringStreet address address1stringSecond address line, such as an apartment or suite number shortAddress?stringShort address zipstringPostal code cpf?stringTax number taxText?stringLabel of the tax number field idNumber?stringNational ID number idNumberText?stringLabel of the national ID field companystringCompany name latitude?stringLatitude longitude?stringLongitude source?stringWhere the current address values came from tags?stringgender?stringGender phonestringPhone number emailOrPhonestringValue of the combined email-or-phone field emailstringEmail phoneAreaCodestringPhone area code [key: string]string | undefinedAny other key, keyed by name originId?stringId of the address this value came from
AddressValuesChangeCb
export type CommonAddressValuesChangeCb = (
changeValue : Partial < AddressValues > ,
fullAddress : AddressValues ,
options ? : AddressValuesChangeOptions ,
) => void ;
AddressValuesChangeOptions
Field Type Description apiAutoFilled?booleanWhether the value was filled in by a request rather than by the buyer changeByInput?booleanWhether the change came from the buyer typing
AddSchemaChangeCbs
type AddSchemaChangeCbs = ( item : AddressItemSchema ) => AddressItemSchema ;
AfterPayCb
export type AfterPayCb = ( res : AfterPayParams ) => void ;
AfterPayParams
What the payment attempt produced: the PayResponse plus a loadTime when the payment call went through, an Error when it threw, or undefined when there is nothing to report.
export type AfterPayParams =
| ( PayResponse & {
loadTime : number ;
} )
| Error
| undefined ;
AllExtensionLoadedCb
export type AllExtensionLoadedCb = ( ) => void ;
AlreadyPaymentLines
An array of the payments already taken on this order. The fields below are those of one entry.
Field Type Description creditCardNumberstringCard number used for this payment extraInfo{ name: string; channel: string; method: string; lastCharacters: string; realPaidTotal: string; }Extra details of the payment paidTotalstringAmount taken by this payment
AppliedGiftCard
Field Type Description idstringUnique id of this item lastCharactersstringLast few characters of the gift card code amountUsedstringAmount taken off by the gift card realAmountCurrencystringCurrency the gift card is denominated in realSymbolstringCurrency symbol of the gift card's own currency realAmountUsedstringAmount used, in the gift card's own currency
BannerConfig
Field Type Description checkoutPcImagestringBanner image used on desktop checkoutMobileImagestringBanner image used on mobile checkoutImageHeight'normal' | 'large' | 'small'Height preset of the banner image checkoutAlignment'top' | 'center' | 'bottom'Vertical alignment of the banner checkoutIsFullWidthbooleanWhether the banner spans the full page width checkoutShowBottomMarginbooleanWhether a bottom margin is left under the banner
BaseAddressItemSchema
Field Type Description idstringUnique id of this item rownumberRow this field sits in within the form grid colnumberColumn this field sits in within the form grid showbooleanWhether this item is shown labelstringLabel shown above the field eventBusEventBus The event bus of this field description?stringDescription of this field max?numberLargest value accepted min?numberSmallest value accepted tips?stringHint text shown under the field autocomplete?stringValue put on the input's autocomplete attribute requiredbooleanWhether the buyer must fill this in readonly?booleanRead-only, the buyer cannot change it htmlAttr?Record<string, string | number>Extra HTML attributes put on the input fieldType?'standard' | 'custom'Whether this is a standard address field or one the merchant added focusId?stringId of the input to move focus to nameId?stringValue put on the input's name attribute placeType?PlaceType Which place types the address autocomplete looks for validateFn(updateUi?)Promise<ValidateResult | undefined>Validates the field's current value validateByValue?(val: string) => ValidateResult | undefinedValidates a value you pass in, without touching the field validateResult?ValidateResult Result of the last validation onValidateResultChange(cb)voidRegisters a callback for when the validation result changes removeValidateResultChange(cb)voidTakes a validation-result callback off again
BasePriceDetail
Field Type Description key?stringIdentifier of this breakdown row dataRobot?stringtitle?stringTitle of this row titleLangId?stringTranslation key of the title subTitle?stringSecondary title of this row subTitleLangId?stringTranslation key of the secondary title originPrice?stringPrice before the discount price?stringAmount of this row originalValue?stringUnformatted value of this row value?stringValue of this item desc?stringExtra description shown with this row descLangId?stringTranslation key of the description icon?stringIcon shown with this row isShow?booleanWhether this row is shown tooltip?stringTooltip text of this row
BaseResponse
Field Type Description okbooleanWhether the request succeeded configReqConfig Configuration carried with this request or order
BeforeSubmitCb
export type BeforeSubmitCb = ( params : BeforeSubmitCbParams ) => Promise < boolean > ;
BeforeSubmitCbParams
BillingAddress
Field Type Description id?stringUnique id of this item firstNamestringFirst name lastNamestringLast name emailstringEmail address emailOrPhonestringWhichever of email and phone the buyer filled in phonestringPhone number phoneAreaCodestringInternational dialling code of the phone number countryCodestringCountry or region code countrystringCountry or region name provinceCodestringProvince or state code provincestringProvince or state name areastringArea or district citystringCity addressstringStreet address address1stringFirst line of the street address zipstringPostal code companystringCompany name
BillingAddressChangeCb
export type BillingAddressChangeCb = ( ) => void ;
BillingAddressValuesChangeCb
export type BillingAddressValuesChangeCb = ( values : Partial < AddressValues > ) => void ;
BuyerJourneyInterceptCb
export type BuyerJourneyInterceptCb = ( ) => BuyerJourneyInterceptCbReturn ;
BuyerJourneyInterceptCbReturn
Field Type Description behavior'block' | 'allow'Whether to block the buyer or let them go on pointIdstringId of the extension point the interception came from hideTrueBtn?booleanHide the confirm button of the dialog hideFalseBtn?booleanHide the cancel button of the dialog
CancelCouponParams
export type CancelCouponParams =
| {
code : string ;
discountCodeType : DiscountCodeType . DISCOUNT_CODE ;
}
| {
id : string ;
discountCodeType : DiscountCodeType . GIFT_CARD ;
} ;
CardInfo
Field Type Description cardFirstNamestringFirst name of the cardholder cardLastNamestringLast name of the cardholder cardDatestringExpiry date on the card cardCodestringSecurity code on the card cardNumberstringCard number instalmentsPlansstringInstalment plan chosen on the card
Cards
Field Type Description supportCardsArray<PlayCardCards >Card types this payment method accepts
ChangedLineItem
Field Type Description idstringUnique id of this item productIdstringId of the product variantIdstringId of the variant quantitynumberQuantity originalQuantitynumberQuantity before the change image{ src: string; }Image of the product productTitlestringTitle of the product optionsArray<{ name: string; value: string }>The options available on this item propertiesstringCustom properties carried on this line reason| 'line_item_sold_out' | 'line_item_shortage' | 'line_item_off_line' | 'line_item_not_exist' | 'line_item_mismatch_wholesale_conditions'Why this line changed
ChangeValueConfig
Field Type Description format?booleanWhether the value is reformatted as it is written changeByInput?booleanWhether the change came from the buyer typing
ChangeValuesConfig
Field Type Description ignoreValidate?booleanWhether to skip validation for this change dispatchUpdate?booleanWhether to trigger a UI refresh after the change changeByInput?booleanWhether the change came from the buyer typing changeByUserInput?booleanThe buyer typed the value apiAutoFilled?booleanFilled in by address autocomplete, so the UI highlights the field onlyValidateExistValue?booleanWhether to validate only the fields that already have a value
ChargeQuote
Field Type Description quoteIdstringQuote id feeTitlestringFee title feestringFee amount feeValuestringFee as a formatted string currencystringCurrency code selectedbooleanWhether it is selected availablebooleanWhether it can be selected providerIconstringProvider icon providerNamestringProvider name titlestringTitle descriptionstringDescription tooltipstringTooltip text lineItemsArray<{ lineItemId: string; quantity: number; fee: string }>The line items this quote covers
CheckoutAddressSettings
CheckoutAppConfig
Field Type Description namespacestringNamespace of the app routes{ root: string; }Base paths of the app's routes currencySymbolstringCurrency symbol localeRtlbooleanWhether the current locale is right-to-left localestringCurrent locale favicon?stringSite favicon siteKeystring | nullSite key of the CAPTCHA provider cdnDomainstringCDN domain imageDomainstringImage domain currencySymbolPosstringWhether the currency symbol goes before or after the amount moneyFormatstringMoney format paymentSettings{ paypalExpressEnabled: boolean; }Payment settings marketMarketInfo Market information
CheckoutBusinessType
Checkout type: standard products, virtual products, or in-store pickup.
Member Value Description STANDARD0Ordinary physical products VIRTUAL_PRODUCT1Virtual products, which need no shipping PICKUP2In-store pickup
CheckoutBusinessTypeChangeCb
export type CheckoutBusinessTypeChangeCb = ( type : CheckoutBusinessType ) => void ;
CheckoutCustomerInfo
Field Type Description emailstringEmail phonestringPhone number emailOrPhonestringValue of the combined email-or-phone field firstNamestringFirst name lastNamestringLast name newsletter0 | 1Whether the buyer subscribed to marketing emails: 1 yes, 0 no notenull | stringBuyer note saveAddress0 | 1Whether the address is saved to the address book: 1 yes, 0 no
CheckoutFeatures
Feature switches of the checkout page: the key is the feature name, the value says whether it is on.
export type CheckoutFeatures = Record < string , boolean > ;
checkoutFontfamily
Field Type Description familystringFont family name fallbackFamiliesstringFallback font families stylestringFont style weightstringFont weight fontFacestringThe @font-face rule for this font
CheckoutIpAddress
Field Type Description countryCodestringCountry code provinceNamestringProvince or state name countryNamestringCountry name citystringCity ipstringIP address
Field Type Description idnumberUnique id of this item titlestringOnly the three built-in policies have a value here typestringMenu type: policy for the three built-in policies, web for a menu the merchant added urlstringBuilt-in policies use a fixed value: refund_policy, privacy_policy or service_policy. A merchant-added menu holds the URL they entered; an empty string renders text with no link
CheckoutOrder
Field Type Description failCodestring | nullFailure code, empty when nothing failed idstringOrder id orderNostringOrder number statusstringOrder status checkoutStatusstringCheckout status financialStatusstringPayment status fulfillmentStatusstringFulfillment status postSaleStatus?string | nullPost-sale status emailStatus?stringStatus of the order confirmation email note?string | nullOrder note customerNotestringBuyer note appliedGiftCardsArray<AppliedGiftCard >Gift cards applied to this order alreadyPaymentLinesAlreadyPaymentLines Payments already made cancelReasonstring | nullCancellation reason currencyCodestringCurrency code currencySymbolstringCurrency symbol discountApplicationsArray<DiscountApplication >Discounts applied to the order lineItemsArray<LineItem >Order line items shippingAddressShippingAddress Shipping address billingAddressBillingAddress Billing address pickupLocation?PickupLocation Pickup location subTotalstringSubtotal of the products shippingTotal?stringShipping total taxTotal?stringTax total discountTotal?stringDiscount total totalTipReceivedstringTip total discountShippingPricestringAmount taken off the shipping cost totalstringOrder total giftCardPricestringAmount covered by gift cards paymentDuestringAmount the buyer actually pays paidTotalstringAmount already paid pricesCheckoutPrices Price breakdown lineItemDiscountTotalstringLine item discount total codeDiscountTotalstringDiscount code total shippingLineShippingLineType | nullThe shipping option currently selected config{ checkoutBusinessType: number; checkoutTemplateType: number; pageType: 'single' | 'three_step' | 'two_step'; marketSetting: { marketId?: string; }; productTaxIncluded?: boolean; }Configuration carried with this request or order customerCustomer Buyer information referInfoReferInfo Referrer information paymentLine?PaymentLine The payment method currently selected paymentLinesArray<PaymentLine >The payment methods that can be selected discountSubTotal?stringSubtotal after the product discounts shippingTaxTotal?stringShipping tax total allTaxTotal?stringTotal of all taxes paymentDiscountTotal?stringPayment-method discount prePaymentAmount?stringpaymentDue without the payment-method discount, used to decide whether the payment list needs a refresh additionalPrices?AdditionalPrice []Additional charges checkoutPriceListPriceGroupDetail []Grouped price breakdown taxLinesTaxLines Tax breakdown checkoutId?stringCheckout id checkoutUrl?stringCheckout page URL createTime?stringCreation time identifierExtra?stringinstallmentFee?stringInstallment fee orderKey?stringorderStatusUrl?stringOrder status page URL orderToken?stringToken identifying the checkout session orderType?numberOrder type refund?stringRefund amount shippingAddressEditable?booleanWhether the shipping address can still be edited shippingTaxType?numberHow tax on shipping is worked out taxType?numberHow tax on the order is worked out updatedTime?stringUpdate time yetPayment?string
CheckoutPageType
Checkout layout: single page, two steps or three steps.
Member Value Description SINGLE'single'Single-page checkout THREE_STEP'three_step'Three-step checkout TWO_STEP'two_step'Two-step checkout
CheckoutPrices
Every price field below is a string holding a decimal amount in the primary unit , for example "10.99" for 10.99 USD — not the smallest unit (not "1099" cents). Use a library such as Decimal.js for arithmetic to avoid JavaScript floating-point errors.
Field Type Description subtotalPricestringSubtotal of the products shippingPricestringShipping cost taxPricestringTax discountCodePricestringAmount taken off by discount codes discountPricestringTotal discount totalPricestringOrder total discountLineItemPricestringAmount taken off the line items totalTipReceivedstringTip total discountShippingPricestringAmount taken off the shipping cost giftCardPricestringAmount covered by gift cards paymentDuestringAmount the buyer actually pays paidTotalstringAmount already paid discountSubTotal?stringSubtotal after the product discounts shippingTaxTotal?stringShipping tax total allTaxTotal?stringTotal of all taxes paymentDiscountTotal?stringPayment-method discount prePaymentAmount?stringpaymentDue without the payment-method discount, used to decide whether the payment list needs a refresh additionalPrices?AdditionalPrice []Additional charges chargeQuotes?ChargeQuote []Shipping protection
CheckoutSettings
Field Type Description customerAuthority'all' | 'login'Who can check out: all for everyone, login for signed-in buyers only discountShowV2string[]reductionShow{ single: string[]; twoStep: string[]; threeStep: string[]; }Which discount rows are shown, per checkout layout orderTimeoutnumberOrder timeout shippingCpfShippingCpf CPF field settings used for shipping zipCheckV2stringzipCheckConfigV2Record<CountryCode, number>Postal code check setting per country or region zipFormatCheckSwitchSetting Whether the postal code format is validated doorplateFormatCheckSwitchSetting Whether the house number format is checked forcedZipCheckCountryCode[]Countries where the postal code check is enforced instructionstringHow the order instructions box is shown, as an InstructionType value autoCompleteSwitchSetting Whether address autocomplete is on autoCompleteCollapseMode?SwitchSetting Whether the address form collapses after autocomplete fills it identificationInfo{ default: IdentificationConfig ; }Identity document settings, keyed by country or region shippingMethodDisplayStyle'auto_select' | 'manual_select'How a shipping option is picked: auto_select or manual_select additionalPropertiesAdditionalProperty []Extra fields the merchant added
CheckoutStep
Checkout step: contact information, shipping method or payment method.
Value Description 'contact_information'The step where the buyer fills in contact details and the address 'shipping_method'The step where the buyer picks a shipping method 'payment_method'The step where the buyer picks a payment method
CheckoutThemeConfig
Theme configuration of the checkout page, the fields of ThemeStyleConfig, LogoConfig, MenuPolicyConfig, BannerConfig, PluginConfig and InteractionConfig merged into one object.
Field Type Description checkoutRecommendImageLink'' | { url: string; type: string }Link of the promotion banner checkoutRecommendImagestringImage of the promotion banner checkoutPaymentBackgroundImagestringPayment area background image checkoutPaymentBackgroundColorstringPayment area background color; the image wins when both are set checkoutInputBackgroundColorstringInput background color checkoutOrderBackgroundImagestringOrder summary background image checkoutOrderBackgroundColorstringOrder summary background color; the image wins when both are set checkoutHeadingFontfamilycheckoutFontfamily Font of the headings checkoutBodyFontfamilycheckoutFontfamily Font of the body text checkoutButtonFontfamilycheckoutFontfamily Font of the buttons checkoutButtonBackgroundColorstringButton background color, also the text color of the footer return link checkoutButtonTextstringText colour of the buttons checkoutErrorColorstringText color of error messages checkoutFocusColorstringColour of the focus ring on inputs checkoutBorderRadiusstringCorner radius used across the page checkoutBorderColorstringForm area on the left checkoutTextMainColorstringPrimary text colour of the page checkoutTextSubColorstringSecondary text colour of the page checkoutEmptyBgColorstringBackground colour of empty areas checkoutBlockBorderColorstringInside the cards on the left, including inputs and shipping line cards checkoutBlockTextMainColorstringPrimary text colour inside cards checkoutBlockTextSubColorstringSecondary text colour inside cards checkoutSummaryBorderColorstringOrder summary area on the right checkoutSummaryTextMainColorstringPrimary text colour of the order summary checkoutSummaryTextSubColorstringSecondary text colour of the order summary checkoutSummaryBlockBorderColorstringInside the cards on the right checkoutSummaryBlockTextMainColorstringPrimary text colour of cards in the order summary checkoutSummaryBlockTextSubColorstringSecondary text colour of cards in the order summary checkoutLogoImagestringLogo image of the checkout page checkoutLogoSize'large' | 'medium' | 'small'Size preset of the logo checkoutLogoPositionstringWhere the logo sits checkoutMenuPolicyLink1?'' | CheckoutMenuPolicyLink Link target of the first policy menu item checkoutMenuPolicyLink2?'' | CheckoutMenuPolicyLink Link target of the second policy menu item checkoutMenuPolicyLink3?'' | CheckoutMenuPolicyLink Link target of the third policy menu item checkoutMenuPolicyText1?stringLabel of the first policy menu item checkoutMenuPolicyText2?stringLabel of the second policy menu item checkoutMenuPolicyText3?stringLabel of the third policy menu item checkoutMenuAlignmentstringAlignment of the policy menu blocksArray<{ type: string; settings: { checkoutMenuPolicyText: string; checkoutMenuPolicyLink: CheckoutMenuPolicyLink ; }; key: string; }>The current data format; the six fields above are the older one. When both are present, blocks wins checkoutPcImagestringBanner image used on desktop checkoutMobileImagestringBanner image used on mobile checkoutImageHeight'normal' | 'large' | 'small'Height preset of the banner image checkoutAlignment'top' | 'center' | 'bottom'Vertical alignment of the banner checkoutIsFullWidthbooleanWhether the banner spans the full page width checkoutShowBottomMarginbooleanWhether a bottom margin is left under the banner plugins{ appserval: { servalBg1Color: string; servalBg2Color: string; servalDiscountColor: string; servalHeadingColor: string; showNewCustomerExclusiveTag: boolean; exclusiveForNewUsers: false; }; }Configuration of the checkout plugins checkoutPaymentIconShowbooleanWhether payment method icons are shown checkoutMobileOrderSummaryCollapsebooleanWhether the order summary starts collapsed on mobile checkoutMobileDiscountBoxLocation'orderSummaryAndPaymentMethod' | 'orderSummary' | 'paymentMethod'Where the discount code box sits on mobile
CloseType
Value Description 'close_icon'The buyer clicked the close icon 'true_btn'The buyer clicked the confirm button 'false_btn'The buyer clicked the cancel button 'hide_fn'Your code called hide()
CollapseInfo
Field Type Description contactstringContact shown in the collapsed summary deliverystringDelivery method shown in the collapsed summary addressInfostringAddress shown in the collapsed summary addressInfoTitlestringTitle of the collapsed address line showNewBtnbooleanWhether the new shipping address button is shown
CollapseInfoChangeCb
export type CollapseInfoChangeCb = ( ) => void ;
CommonAddressValuesChangeCb
export type CommonAddressValuesChangeCb = (
changeValue : Partial < AddressValues > ,
fullAddress : AddressValues ,
options ? : AddressValuesChangeOptions ,
) => void ;
Value Description 'single'One contact field is collected 'multiple'More than one contact field is collected
Field Type Description emailstringEmail phonestringPhone number emailOrPhonestringValue of the combined email-or-phone field phoneAreaCodestringPhone area code
export type ContactInformationChangeCb = ( contactInformation : Partial < ContactInformation > ) => void ;
Field Type Description type'address' | 'contact'Type of this item showWhenOptional?booleanWhether the field is still shown when it is optional
How contact details are collected: email only, phone only, or either one.
Member Value Description ONLY_EMAIL'only_email'Only an email address is collected ONLY_PHONE'only_phone'Only a phone number is collected EMAIL_OR_PHONE'email_or_phone'Either an email address or a phone number is accepted
Country
Field Type Description cnNamestringChinese name namestringCountry name flagstringFlag phoneCodestringPhone country code phoneKeystringKey of the dialling code for this country or region isoCode2stringTwo-letter country code
CouponAvailStatus
Member Value Description AVAILABLE'available'The coupon can be used on this order UNAVAILABLE'unavailable'The coupon cannot be used on this order
CouponChangeCb
export type CouponChangeCb = ( ) => void ;
CouponData
Field Type Description pagenumberPage number limitnumberPage size dataCouponItem []The coupons on this page totalnumberTotal count
CouponItem
Field Type Description idstringUnique id of this item codestringCoupon code titlestringName of the coupon discountTextstringText describing what the coupon takes off prerequisiteTextstringWhat the buyer has to do to use the coupon createdAtstringWhen this record was created expiredAtstringWhen the coupon expires isFirstOrderbooleanWhether the coupon is for first orders only
CouponListChangeCb
export type CouponListChangeCb = ( data : CouponData ) => void ;
CSettings
Field Type Description localestringCurrent locale localeRtlbooleanWhether the current locale is right-to-left cdnDomainstringCDN domain customer{ customerId: string; customerEmail: string; customerPhone: string; }Buyer information imageDomainstringImage domain paymentSettings{ paypalExpressEnabled: true; expressCheckoutConfig: { expressAccountInfos: {}; expressChannels: string[]; expressThemeConfigs: {}; }; }Payment settings saServerUrlstringEndpoint analytics events are sent to saWebUrlstringURL the analytics script is loaded from currencyCodestringCurrency code currencySymbolstringCurrency symbol currencySymbolPosstringWhether the currency symbol goes before or after the amount theme{ themeVersionId: string; merchantThemeName: string; updatedAt: string; }Theme information meta{ page: { templateName: string; templateType: number; }; }Page metadata of the checkout front end moneyFormatstringMoney format slugstringclientSentryDsnstringSentry DSN the front end reports errors to environmentstringEnvironment the front end is running in regionstringRegion code storePlanstringStore plan storeTrialbooleanWhether the store is on trial passwordEnabledbooleanWhether the store is password protected namespacestringNamespace of the checkout front end siteKeynullSite key of the CAPTCHA provider routes{ root: string; }Base paths of the app's routes market{ marketId: string; }Market information shop{ customerId: string; finance: string; financeSymbol: string; cdnDomain: string; shopName: string; themeId: string; shopId: string; shopEnv: string; defaultImg: string; templateName: string; templateType: string; favicon: string; formLang: {}; contactEmail: string; serviceEmail: string; timeZone: string; }Store information
Customer
Field Type Description idstringId of the customer record firstNamestringFirst name lastNamestringLast name emailstringEmail address phonestring | nullPhone number namestringFull name of the customer orderCountnumberNumber of orders this customer has placed customerIdstringId of the customer createAtstringWhen the customer record was created registeredAtstringWhen the buyer registered registeredstringWhether the buyer has a store account subscribedbooleanWhether the buyer is subscribed to marketing email
CustomerAuthority
Who can check out: all for everyone, login for signed-in buyers only.
Value Description 'all'Anyone can check out 'login'Only signed-in buyers can check out
DayConfigOfPickupTime
Field Type Description day?number1-7 state?number0 closed, 1 open start?stringStart of the time window end?stringEnd of the time window
DeliveryListChangeCb
export type DeliveryListChangeCb = ( ) => void ;
DeliveryMethodChangeCb
export type DeliveryMethodChangeCb = ( id : DeliveryMethodItem ) => void ;
DeliveryMethodItem
Field Type Description iconTypestringWhich icon to use for this delivery method checkoutBusinessTypeCheckoutBusinessType The checkout type this delivery method belongs to textstringDisplay text
DeliveryMethodListChangeCb
export type DeliveryMethodListChangeCb = ( items : DeliveryMethodItem [ ] ) => DeliveryMethodItem [ ] ;
DialogContent
Field Type Description contentstringBody content of the dialog or drawer footer?stringFooter content of the dialog or drawer trueBtn?stringLabel of the confirm button falseBtn?stringLabel of the cancel button
DialogOptions
Field Type Description hideTrueBtn?booleanHide the confirm button hideFalseBtn?booleanHide the cancel button closeThroughResolve?booleanResolve instead of reject when the close icon is clicked; defaults to false maskBlur?booleanBlur the page behind the mask; defaults to false style?{ width?: number; height?: number; maxHeight?: number; maxWidth?: number; backgroundColor?: string; }Inline styles put on the element
DiscountApplication
Field Type Description typestringDiscount type codestringDiscount code statusstringDiscount status messagestringMessage discountIdstringDiscount id discountAmountstringDiscount on this product, e.g. "2.00" discountMessagestringMessage shown with this discount entitledProductListArray<{ productId: string; variantId: string; price: string; quantity: number; compareAtPrice: string; inventoryTracking: boolean; inventoryQuantity: number; spu: string; }>Products this discount applies to valueTypestringWhether the discount is a fixed amount or a percentage targetTypestringWhat the discount applies to, such as products or shipping targetSelectionstringWhich items the discount picks out titlestringDiscount title valuestringe.g. "20" discountTypestringKind of discount allocationMethodstringHow the discount is spread across the line items isFreeGiftbooleanWhether this is a free-gift discount totalDiscountAmountstringTotal discount of this promotion, e.g. "2" subTypestringFiner-grained kind of discount iconstringURL labelTextstringLabel text labelFontColorstringLabel text colour labelBackgroundColorstringLabel background colour
DiscountCodeType
Member Value Description DISCOUNT_CODE'discountCode'The code is a discount code GIFT_CARD'giftCard'The code is a gift card
DiscountTypeEnum
Member Value Description AUTOMATIC'automatic'Automatic discount, applied without a code DISCOUNT_REBATE'discount_rebate'Spend-and-save discount DISCOUNT_CODE'discount_code'Discount code the buyer types in DISCOUNT_COUPON'discount_coupon'Coupon held by the buyer GIFT_CARD'gift_card'Gift card
DrawerContent
Field Type Description contentstringBody content of the dialog or drawer footer?stringFooter content of the dialog or drawer trueBtn?stringLabel of the confirm button falseBtn?stringLabel of the cancel button
DrawerOptions
Field Type Description hideTrueBtn?booleanHide the confirm button hideFalseBtn?booleanHide the cancel button maskBlur?booleanBlur the page behind the mask; defaults to false style?{ width?: number; height?: number; maxHeight?: number; maxWidth?: number; backgroundColor?: string; }Inline styles put on the element
DynamicExtensionPoint
enum DynamicExtensionPoint {
PRODUCT_RENDER_AFTER = 'Checkout::Product-{id}::RenderAfter' ,
SHIPPING_LINE_RENDER_AFTER = 'Checkout::ShippingLine-{id}::RenderAfter' ,
}
EventBus
A small publish-subscribe bus. Each address field carries one on its eventBus property.
Field Type Description eventMapMap<string, Set<Function>>Callbacks registered per event name onceCbMapMap<Function, Function>Wrappers of the one-shot callbacks, keyed by the original function emit(name, ...rest)— Fires an event to every callback listening on that name on(name, cb)— Registers a callback on an event name once(name, cb)— Registers a callback that fires only the first time off(name, cb)— Removes one callback from an event name
EventType
Value Description 'change'A value on the page changed 'return'The buyer went back 'navigate'The page navigated somewhere else
ExceptionChangeCbs
export type ExceptionChangeCbs = ( tags ? : IException ) => void ;
ExceptionInfo
Field Type Description codestringError code message?stringError message title?stringTitle content?stringBody text footer?stringFooter text backStep?stringThe step the buyer is sent back to invalidLineItems?Array<InvalidLineItem >Line items that are no longer valid changedLineItems?Array<ChangedLineItem >Line items that changed
ExceptNotification
Field Type Description codestringError code of the exception message?stringError message of the exception nextAction?NextAction What the page should do next invalidLineItems?Array<InvalidLineItem >Line items that are no longer valid kickLineItems?Array<KickLineItem >Line items removed from the order thirdPartyErrorDetails?Record<string, unknown>[]Raw error details returned by a third party
ExtendSchema
Schema of one item in the address form: an ordinary field, a checkbox, a title or an action.
export type ExtendSchema =
| AddressItemSchema
| AddressItemCheckoutSchema
| AddressItemTitleSchema
| AddressItemActionSchema ;
Extension
Field Type Description componentsExtensionComponent []The extension's components namestringExtension name name_enstringEnglish extension name descstringExtension description desc_enstringEnglish extension description deleteTargetsstring[]Native modules this extension hides placeholderRecord<string, string>Placeholder text, keyed by field id
ExtensionComponent
Field Type Description extensionIdstringExtension id contentstringThe HTML that gets rendered pointstringThe extension point it renders at
ExtensionList
Field Type Description extensionIdstringId of the extension resourceUrlstringURL the extension's script is loaded from fields?stringFields the extension declares name?stringName of the extension name_en?stringEnglish name desc?stringDescription of the extension desc_en?stringEnglish description
ExtensionLoadCb
export type ExtensionLoadCb = ( point : ExtensionPoint ) => void ;
ExtensionPoint
export type ExtensionPoint = StaticExtensionPoint | DynamicExtensionPoint ;
ExtensionTarget
enum ExtensionTarget {
shippingList = 'shippingList' ,
couponDrawer = 'couponDrawer' ,
}
FailPriceResult
Field Type Description datanullPayload of the result messagestringError message statestringState of the result, success when it worked
FieldFnValidate
Field Type Description idstringId of this validation rule messagestringMessage shown when the check fails validate(value)booleanReturns whether the value passes
FieldRegExpValidate
Field Type Description idstringUnique id of this item messagestringMessage shown when the check fails regexpstringRegular expression the value has to match
FieldsChangeCb
export type FieldsChangeCb = ( fields ? : Array < keyof AddressValues > ) => void ;
FieldType
Member Value Description String0Plain text field Number1Numeric field Enum2Field with a fixed set of options Bool3True / false field Phone101Phone number field Email102Email field Checkbox103Checkbox Title104Title row, not an input Action105Action row such as a link or a button, not an input
FieldValidate
export type FieldValidate = FieldRegExpValidate | FieldFnValidate ;
Field Type Description formatDiscountShippingPricestringDiscounted shipping cost with the currency symbol formatShippingPricestringShipping cost with the currency symbol isFreebooleanWhether shipping is free
GetAddressTemplateParams
Field Type Description countryCodestringCountry or region code provinceCodestringProvince or state code
GiftCard
Field Type Description typeDiscountCodeType Code type codestringGift card code idstringGift card id titlestringGift card title lastCharacters?stringLast characters of the card number amountUsed?stringAmount used realAmountCurrency?stringCurrency the gift card is denominated in realSymbol?stringCurrency symbol of the gift card's own currency realAmountUsed?stringAmount used, in the gift card's own currency
GiftCardTagChange
export type GiftCardTagChange = ( item : GiftCardTagItem ) => GiftCardTagItem ;
GiftCardTagItem
Field Type Description disable?booleanWhether it is disabled hideIcon?booleanWhether the icon is hidden
export type GiftCardTagsChangeCb = ( tags : GiftCardTagItem [ ] ) => void ;
export type GiftCardTagsFilter = ( tags : GiftCardTagItem [ ] ) => GiftCardTagItem [ ] ;
HideExtensionTargetCb
export type HideExtensionTargetCb = ( ) => void ;
HttpCompleteResponse
Field Type Description statusnumberHTTP status code statusTextstringHTTP status text headersRecord<string, string>Request or response headers dataPayloadBody of the response
HttpFailResponse
Field Type Description okfalseWhether the request succeeded
HttpSuccessResponse
Field Type Description oktrueWhether the request succeeded
IAddressBookItem
Field Type Description showEmailbooleanWhether the email is shown showPhonebooleanWhether the phone number is shown
IdentificationConfig
Field Type Description countries?Record<string, string[]> | nullCountries or regions this configuration covers isFilledbooleanWhether the buyer has filled the field in formatCheckbooleanWhether the value format is checked rulesArray<{ countryCode: string; provinceCode?: string; name: string; regexp: string; exampleVal: string; }>The rules that apply, one entry per country or region
IDialog
Field Type Description show()Promise<boolean>Whether this item is shown hide()voidCloses the dialog or drawer
IDrawer
Field Type Description show()Promise<boolean>Whether this item is shown hide()voidCloses the dialog or drawer onClose(cb)voidRegisters a callback for when the drawer closes destroy()voidCloses the drawer and releases it
IException
Field Type Description codestringError code message?stringError message invalidLineItems?Array<InvalidLineItem >Line items that are no longer valid changedLineItems?Array<ChangedLineItem >Line items that changed kickLineItems?Array<KickLineItem | (Omit<KickLineItem , 'properties'> & { properties: Record<string, string> })>Line items removed from the order nextAction?NextAction What the page should do next thirdPartyErrorDetails?ThirdPartyErrorDetails Error details returned by a third party
IExceptionCode
Value Description '30002'Platform error code 30002 '30003'Platform error code 30003 '30005'Platform error code 30005 'line_items_variant_not_exist'A variant in the order no longer exists 'price_shipline_changed'The shipping price changed 'price_tax_changed'The tax changed 'price_shipping_tax_changed'The tax on shipping changed 'checkout_address_invalid'The address on the order is not valid 'shipping_not_available'No shipping method is available for this address 'payment_method_invalid'The chosen payment method cannot be used '80009'Platform error code 80009 'discount_code_expired'The discount code has expired 'discount_code_times_limit'The discount code has been used too many times 'shipping_line_changed'The shipping method changed 'shipping_line_changed_refresh'The shipping method changed and the page needs refreshing 'gift_card_disabled'The gift card is disabled 'gift_card_no_funds'The gift card has no balance left 'total_price_changed'The order total changed 'pickup_changed'The pickup location changed 'pay_cod_limit'The order is over the cash-on-delivery limit 'pay_ip_limit'Payment was blocked by an IP restriction 'price_shipline_changed_true'The shipping price changed and the new value is already applied 'system_busy'The platform is busy, try again
InitPhoneResult
A name this documentation gives the type so it can be referenced; in the source it is an inline type.
Field Type Description phoneAreaCodestringInternational dialling code of the phone number phonestringPhone number
InstructionType
How the order instructions box is shown: unfolded, folded or hidden.
Member Value Description UNFOLD'unfold'The order instructions box starts expanded FOLD'fold'The order instructions box starts collapsed HIDDEN'hidden'The order instructions box is not shown
InteractionConfig
Field Type Description checkoutPaymentIconShowbooleanWhether payment method icons are shown checkoutMobileOrderSummaryCollapsebooleanWhether the order summary starts collapsed on mobile checkoutMobileDiscountBoxLocation'orderSummaryAndPaymentMethod' | 'orderSummary' | 'paymentMethod'Where the discount code box sits on mobile
InvalidLineItem
Field Type Description productTitlestringTitle of the product image{ src: string; }Image of the product optionsArray<{ name: string; value: string | number; }>The options available on this item
isShowCountries
Field Type Description [key: string]{ countryCodes?: string; countries?: { [key: string]: string[] }; isFilled: boolean; title: string; formatCheck?: boolean; }Any other key, keyed by name
IsSpecialInstructionCollapseChange
export type IsSpecialInstructionCollapseChange = ( isCollapse : boolean ) => void ;
JumpWay
Value Description 'a'Follow an <a> link 'window.open'Open in a new window with window.open 'history'Push a history entry, no page reload 'hash'Change only the URL hash 'location'Assign to location, which reloads the page
KickLineItem
Field Type Description idstringUnique id of this item productIdstringId of the product variantIdstringId of the variant quantitynumberQuantity left after the adjustment originalQuantitynumberQuantity before the adjustment urlstringProduct image URL namestringProduct name without localization; use productTitle instead optionsArray<{ name: string; value: any }>The options available on this item productTitle?stringProduct name, localized propertiesstringCustom properties carried on this line
LineItem
Field Type Description idstringLine item id productTitlestringProduct title productIdstringProduct id productHandlestringProduct handle variantIdstringVariant id variantTitlestringVariant title quantitynumberQuantity fulfillmentStatusstringFulfillment status notestringNote image{ path: string; src: string; }Product image compareAtPricestringCompare-at price pricestringUnit price linePricestringPrice of this line totalstringTotal of this line skustringSKU weightstringWeight weightUnitstringWeight unit taxablebooleanWhether it is taxable requiresShippingbooleanWhether it needs shipping optionsArray<{ name: string; value: string }>Variant options vendorstringVendor productUrlstringProduct page URL propertiesstringCustom properties discountApplicationsArray<DiscountApplication >Discounts applied to this line finalPrice?stringUnit price after every discount, e.g. "9.00" finalLinePrice?stringUnit price after every discount x quantity, e.g. "18.00" discountTotal?stringTotal discount on this line, the sum of discountApplications, e.g. "2.00" isFreeGift?booleanWhether it is a free gift type?stringType of this item
LineMutationErrorCode
Value Description 'bundled_product_requires_real_item'A bundled product was added without the real product it belongs to 'checkout_token_missing'The checkout token was not found on the page 'checkout_token_invalid'The checkout token is not valid
LineMutationResult
Field Type Description state'success' | stringState of the result, success when it worked data?LineMutationResultData Payload of the result code?LineMutationErrorCode | stringError code when the change failed message?stringError message
LineMutationResultData
Field Type Description orderIdstringId of the order lineItemsLineItem []The line items of the order priceDirtybooleanTrue when the prices are stale and need recalculating lineItemsVersionnumberVersion number of the line items, bumped on every change shippingReselectRequired?booleanTrue only when the order flipped between needing shipping and not needing it paymentReselectRequired?booleanWhether the buyer has to pick a payment method again
LoadingStatus
Field Type Description globalLoadingbooleanWhether the whole page is loading
Locale
The language tags the checkout page supports.
Value Description 'ar-SA'Arabic (Saudi Arabia) 'de-DE'German (Germany) 'en-US'English (United States) 'es-ES'Spanish (Spain) 'fr-FR'French (France) 'id-ID'Indonesian (Indonesia) 'it-IT'Italian (Italy) 'ja-JP'Japanese (Japan) 'ko-KR'Korean (South Korea) 'nl-NL'Dutch (Netherlands) 'pl-PL'Polish (Poland) 'pt-PT'Portuguese (Portugal) 'ru-RU'Russian (Russia) 'th-TH'Thai (Thailand) 'zh-CN'Simplified Chinese (mainland China) 'zh-TW'Traditional Chinese (Taiwan)
LocaleMap
Field Type Description 'en-US'Record<string, string>One entry per locale; the value is the text for that language [k in Locale]Record<string, string>One entry per locale; the value is the text for that language
LogoConfig
Field Type Description checkoutLogoImagestringLogo image of the checkout page checkoutLogoSize'large' | 'medium' | 'small'Size preset of the logo checkoutLogoPositionstringWhere the logo sits
MarketInfo
Field Type Description marketIdstringMarket id marketPriceSettingMarketPriceSetting Price settings for this market
MarketPriceSetting
Field Type Description local_currency_enabledbooleanWhether prices are shown in the local currency custom_rate_enabledbooleanWhether a custom exchange rate is used custom_ratenumberManual rate, primary market currency -> market base currency ratenumberAutomatic rate, primary market currency -> market base or local currency back_ratenumberReverse automatic rate, market base or local currency -> primary market currency actual_ratenumberThe rate actually applied, primary market currency -> market base or local currency base_to_localnumberMarket base currency -> local currency local_to_basenumberLocal currency -> market base currency adjustnumberPrice adjustment price_round_enabledtrueWhether converted prices are rounded
Field Type Description checkoutMenuPolicyLink1?'' | CheckoutMenuPolicyLink Link target of the first policy menu item checkoutMenuPolicyLink2?'' | CheckoutMenuPolicyLink Link target of the second policy menu item checkoutMenuPolicyLink3?'' | CheckoutMenuPolicyLink Link target of the third policy menu item checkoutMenuPolicyText1?stringLabel of the first policy menu item checkoutMenuPolicyText2?stringLabel of the second policy menu item checkoutMenuPolicyText3?stringLabel of the third policy menu item checkoutMenuAlignmentstringAlignment of the policy menu blocksArray<{ type: string; settings: { checkoutMenuPolicyText: string; checkoutMenuPolicyLink: CheckoutMenuPolicyLink ; }; key: string; }>The current data format; the six fields above are the older one. When both are present, blocks wins
MutationSource
export type MutationSource = string ;
NameSetting
Value Description 'separate'First name and last name are two fields 'normal'The name is one single field
NavigateLink
Field Type Description idCheckoutStep The checkout step this link points to title'information' | 'shipping' | 'payment'Used for analytics textstringLink text
NavigateLinksChangeCb
export type NavigateLinksChangeCb = ( ) => void ;
NewsLetterStatus
Marketing email subscription status: not subscribed, or subscribed.
Member Value Description NO_SUBSCRIPTION0Not subscribed to marketing email SUBSCRIBED1Subscribed to marketing email
NextAction
Field Type Description redirectToUrl{ url: string; }The URL to send the buyer to type'redirect_to_url'Type of this item
NmeRequirementSetting
Value Description 'both'Both first name and last name are required 'last_name'Only the last name is required
OnCloseCb
export type OnCloseCb = ( type : CloseType ) => void ;
OnLoadingStatusChangeCallback
export type OnLoadingStatusChangeCallback = ( status : LoadingStatus ) => void ;
OnPayFailedPayload
Field Type Description sysCodeGroupstring | nullpaymentKeystringKey identifying the payment method
OnPayFailedResult
Field Type Description handledbooleanWhether your callback has already handled the failure
OnStoreDataChangeCb
export type OnStoreDataChangeCb = ( ) => void ;
OnSubmitPendingChangeCallback
export type OnSubmitPendingChangeCallback = ( val : Pending , change : Partial < Pending > ) => void ;
OptionValue
Field Type Description namestringName of the option codeCCode of this item alternateNames?string[]Other names this option is also known by
OrderConfig
The configuration carried on the order, taken from the config field of CheckoutOrder.
Field Type Description checkoutBusinessTypenumberCheckout type of this order, as a CheckoutBusinessType value checkoutTemplateTypenumberTemplate the checkout page renders with pageType'single' | 'three_step' | 'two_step'Checkout layout, as a CheckoutPageType value marketSetting{ marketId?: string; }Market this order belongs to productTaxIncluded?booleanWhether product prices already include tax
OrderInfo
Field Type Description currencyCodestringCheckout currency, for example USD currencySymbolstringCurrency symbol, for example $ alreadyPaymentLinesAlreadyPaymentLines Payments already made failCodestring | nullFailure code, empty when nothing failed idstringOrder id statusOrderStatus Order status checkoutStatusstringCheckout status financialStatusstringPayment status orderNostringOrder number cancelReasonstring | nullCancellation reason orderType?numberOrder type: 1 = gift card order, 0 = any other order (physical, digital and so on) exceptionError?stringThe next two fields only ever appear on the thank-you page exceptionErrorMessage?stringError message additionalPrices?AdditionalPrice []Additional charges
OrderResult
Field Type Description data?OrderResultData Payload of the response statestringState of the result, success when it worked errorsstring[]Error messages
OrderResultData
OrderStatus
Order status.
Value Description 'opened'The order exists but has not been placed yet 'placed'The order has been placed 'cancelled'The order was cancelled 'finished'The order is complete
PageTypeChangeCb
export type PageTypeChangeCb = ( type : CheckoutPageType ) => void ;
PayAttemptCb
export type PayAttemptCb = ( ) => void ;
PayFailedHandler
export type PayFailedHandler = ( payload : OnPayFailedPayload ) => Promise < OnPayFailedResult > ;
PaymentIconResource
Field Type Description paymentKeystringKey identifying the payment method iconstringIcon shown with this row
PaymentLine
Field Type Description failCode?string | nullFailure code, empty when nothing failed availableboolean | stringWhether this payment method is available createdAtstringCreation time descstringDescription idstringPayment method id namestringPayment method name paymentChannelstringPayment channel paymentMethodstringPayment method publicKeyanystatusstringStatus storeIdstringStore id tipsstringTip text updatedAtstringUpdate time supportTip?booleanWhether it supports tipping paypalClassicMode?booleanWhether the classic PayPal flow is used channelstringPayment channel methodstringPayment method fePay?booleanWhether the payment is completed in the front end failReason?stringFailure reason paymentKey?stringKey identifying the payment method discounts?Record<string, unknown>[]Discounts tied to this payment method
PaymentLinesSource
Value Description 'destroy'The previous payment line was torn down 'verificationError'Payment verification failed 'api'The payment lines came back from a request
PaymentResources
Field Type Description [key: string]Cards Any other key, keyed by name
PaymentSettings
Field Type Description supportChannelsstring[]Payment channels the store has turned on paymentResourcesPaymentResources Static resources the payment methods need paymentIconResources?PaymentIconResource []Icons of the available payment methods paypalExpressEnabledstringWhether PayPal Express is turned on
PaymentUpdateParams
Field Type Description paymentLinePaymentLine The payment method currently selected paymentLinesArray<PaymentLine >The payment methods that can be selected paymentButtonbooleanWhether the payment button is shown paymentReadybooleanWhether the payment method is ready to be submitted cardInfoPartial<CardInfo >Card information source?PaymentLinesSource What triggered this payment update, as a PaymentLinesSource value paymentFeatures?{ useCustomPaymentButton: boolean; useBillingAddress: boolean; }Which payment features this method needs
PayResponse
export type PayResponse = (
| {
data : {
exceptNotification : ExceptNotification ;
result ? :
| {
redirectType : 'newwindow' | 'redirect' | 'iframe' ;
redirectUrl : string ;
}
| {
redirectType : 'form' ;
form : string ;
} ;
} ;
state : 'success' ;
}
| {
data : null ;
state : 'pay_failed' ;
}
) & {
errors : string [ ] ;
message : string ;
} ;
Pending
Field Type Description pricebooleanPrice API call in flight shippingLinesbooleanShipping line list loading paymentbooleanPayment script loading, not the payment method list pickupLocationbooleanPickup location list loading
PhoneInfo
Field Type Description phonestringPhone number phoneAreaCodestringInternational dialling code of the phone number
export type PickupInformationChangeCb = ( pickupInformation ? : string ) => void ;
PickupLocation
Field Type Description deliveryMethod?number1 shipping, 2 local delivery, 3 in-store pickup businessTimeType?number1 one schedule for every day, 2 a schedule per day; defaults to 1 when absent id?stringPickup location id name?stringPickup location name desc?stringPickup location description shippingPrice?stringFee for this pickup location supportCod?number0 not supported, 1 supported locationId?stringId of the linked location country?stringCountry name countryCode?stringCountry code province?stringProvince or state name provinceCode?stringProvince or state code city?stringCity address?stringStreet address address1?stringSecond address line, such as an apartment or suite number company?stringCompany name zip?stringPostal code timeZone?stringTime zone timeDaySetting?DayConfigOfPickupTime []Pickup time slots per day timeRemark?stringNote about the pickup times businessStart?stringOpening time of the pickup location businessEnd?stringClosing time of the pickup location timeLag?stringEstimated wait before the order can be picked up, in hours estimatedTimeEnd?stringEstimated pickup time, for display estimatedTimeUnit?stringUnit of the estimated pickup time, either h or d pickupAt?stringPickup time the buyer chose lastSelected?booleanWhether this was the pickup location selected last time formattedPickAt?stringPickup time in the location's own time zone, formatted as YYYY-MM-DD HH:mm:ss
PickupLocationsChangeCb
export type PickupLocationsChangeCb = ( locations ? : PickupLocation [ ] ) => void ;
PlaceType
export type PlaceType =
| {
types : Array < string > ;
stringify ? : string ;
}
| Array < string > ;
PlayCardCards
Field Type Description cardNamestringDisplay name of the card type cardTypestringCard type, such as Visa or Mastercard countryCnName?stringChinese name of the country or region countryCode?stringCountry or region code countryEnName?stringEnglish name of the country or region iconstringIcon shown with this row name?stringName of this item pmId?string
PluginConfig
Field Type Description plugins{ appserval: { servalBg1Color: string; servalBg2Color: string; servalDiscountColor: string; servalHeadingColor: string; showNewCustomerExclusiveTag: boolean; exclusiveForNewUsers: false; }; }Configuration of the checkout plugins
PriceDetail
One row of the price breakdown: every field of BasePriceDetail, plus an id and an optional list of sub-rows.
Field Type Description key?stringIdentifier of this breakdown row dataRobot?stringtitle?stringTitle of this row titleLangId?stringTranslation key of the title subTitle?stringSecondary title of this row subTitleLangId?stringTranslation key of the secondary title originPrice?stringPrice before the discount price?stringAmount of this row originalValue?stringUnformatted value of this row value?stringValue of this item desc?stringExtra description shown with this row descLangId?stringTranslation key of the description icon?stringIcon shown with this row isShow?booleanWhether this row is shown tooltip?stringTooltip text of this row subList?SubPriceDetail []Sub-rows under this row idstringUnique id of this item
PriceGroupDetail
Field Type Description keyPriceGroupDetailKey Group key list?PriceDetail []Price entries in this group desc?stringDescription descLangId?stringTranslation key of the description
PriceGroupDetailKey
Value Description 'tax_total'Total tax 'shipping_tax_total'Tax on shipping 'sub_total'Subtotal of the products 'shipping_total'Total shipping 'discount_coupon_total'Total coupon discount 'discount_flash_sale_total'Total flash-sale discount 'discount_applications'The individual discounts applied 'total_tip_received'Total tip 'gift_card'Gift card 'payment_discount_total'Total payment-method discount 'additional_price'Shipping insurance 'charge_quotes'Add-on fees quoted for this order
PriceListChangeCb
export type PriceListChangeCb = ( newPriceList : PriceGroupDetail [ ] ) => void ;
PriceParams
Field Type Description reductions?Array<{ code: string }>Discount codes to apply, given by code discountApplications?Array<{ code: string; discountId: string; _delete: 1; }>The individual discounts applied calculateShippingLinebooleanWhether shipping should be recalculated totalTipReceivedstringTotal tip on the order appliedGiftCards?Record<string, { id: string; _delete: 1 }>Gift cards applied to this order type?DiscountTypeEnum Kind of discount being applied, as a DiscountTypeEnum value step?stringCheckout step this applies to paymentLine?PaymentLine | nullThe payment method chosen on the order config{ checkoutBusinessType: CheckoutBusinessType ; }Configuration carried with this request or order
PriceResult
export type PriceResult = SuccessPriceResult | FailPriceResult ;
PriceResultData
PricesChangeCb
export type PricesChangeCb = ( prices : CheckoutPrices ) => void ;
ProductItem
Derived from LineItem: the same fields, except properties is a key-value object (Record<string, string>) instead of a string.
Field Type Description idstringUnique id of this item productTitlestringTitle of the product productIdstringId of the product productHandlestringURL handle of the product variantIdstringId of the variant variantTitlestringTitle of the variant quantitynumberQuantity fulfillmentStatusstringFulfillment status of this line notestringNote attached to this line image{ path: string; src: string; }Image of the product compareAtPricestringCompare-at price of the variant pricestringAmount of this row linePricestringUnit price times quantity for this line totalstringTotal of this line skustringSKU of the variant weightstringWeight of the product weightUnitstringUnit the weight is measured in taxablebooleanWhether this line is taxable requiresShippingbooleanWhether this line needs shipping optionsArray<{ name: string; value: string }>The options available on this item vendorstringVendor of the product productUrlstringStorefront path of the product discountApplicationsArray<DiscountApplication >The individual discounts applied finalPrice?stringUnit price after every discount, e.g. "9.00" finalLinePrice?stringUnit price after every discount x quantity, e.g. "18.00" discountTotal?stringTotal discount on this line, the sum of discountApplications, e.g. "2.00" isFreeGift?booleanWhether this line is a free gift type?stringType tag of the line item propertiesRecord<string, string>Custom properties carried on this line
ProductListChangeCb
export type ProductListChangeCb = ( newProductList : ProductItem [ ] ) => void ;
ProductProperties
Field Type Description _shoplazza_bundled_product?booleanBundled product, which cannot be fulfilled as an order of its own _shoplazza_exclude_calculation?booleanLeft out of every calculation and only added back into the final total [key: string]anyAny other key, keyed by name
PromptMessage
Field Type Description typestringPrompt type dataRobotstringerrorMessage?stringError message localesstring[]Locales this message has text for
ReferInfo
Field Type Description clientIdstringClient id of the app countrystringCountry domainstringDomain fbcstringfbpstringipstringIP address source'buy_now' | 'back' | 'cart'Where the buyer came into checkout from: buy_now, back or cart userAgentstringBrowser user agent payMethod?stringPayment method note?stringNote
Field Type Description lineItemIdsstring[]Ids of the line items to act on mutationSourceMutationSource A tag of your own naming what made this change
RenderParams
Field Type Description idstringUnique id of this item extensionPointExtensionPoint Name of the extension point the content renders at componentPromise<string> | stringHTML the extension renders, or a promise resolving to it
ReqConfig
Field Type Description urlstringRequest URL method?RequestInit['method']HTTP method headers?Record<string, string>Request or response headers params?Record<string, any> | URLSearchParamsQuery parameters of the request data?Record<string, any> | stringPayload of the result timeout?numberRequest timeout in milliseconds withCredentials?booleanWhether cookies are sent with the request responseType?'json'Format the response is parsed as xsrfCookieName?stringName of the cookie the XSRF token is read from xsrfHeaderName?stringName of the header the XSRF token is sent in
Res
export type Res < Shape = Record < string , any > , ErrorPayload = Record < string , any > & { state : string | '' } > =
| HttpSuccessResponse < Shape >
| HttpFailResponse < ErrorPayload > ;
SaleTaxLine
Field Type Description key?stringIdentifier of this tax line price?stringAmount of this row
SchemaChangeDisableCB
export type SchemaChangeDisableCB = ( ) => Record < string , boolean > ;
SchemaChangeLabelCb
export type SchemaChangeLabelCb = ( ) => Record < string , string > ;
SchemaChangeValidateRule
SchemaChangeValidateRuleCB
export type SchemaChangeValidateRuleCB = ( ) => SchemaChangeValidateRule ;
SchemaChangeValidateRuleValue
Field Type Description requiredtrueWhether the buyer must fill this in validatesFieldValidate []The validation rules that apply
SchemaItemVisibilityCb
export type SchemaItemVisibilityCb = ( ) => Record < string , boolean > ;
SchemaManagerConfig
Field Type Description focusIdPrefixstringPrefix put in front of every generated focus id
SchemaManagerConfigFn
Field Type Description getAddressVisible()booleanReturns whether the address form is currently visible getCustomLabels?() => Record<string, string>Returns the labels the merchant customised, keyed by field id getCustomValidateRules?() => SchemaChangeValidateRule Returns the extra validation rules to apply getAddressExpanded?() => booleanWhether the address form is currently expanded; treated as expanded when not provided expandAddress?(reason: 'manual_click' | 'empty_fallback_click' | 'auto_fill') => voidExpand the address form
SelectedPickupLocationChangeCb
export type SelectedPickupLocationChangeCb = ( location ? : PickupLocation ) => void ;
SelectType
Value Description 'static'The option list is fixed 'dynamic'The option list is fetched as the buyer types
ShippingAddress
Field Type Description phoneCountryCode?stringCountry code the phone number belongs to id?stringAddress id firstNamestringFirst name lastNamestringLast name emailstringEmail phonestringPhone number countryCodestringCountry code countrystringCountry name provinceCodestringProvince or state code provincestringProvince or state name areastringDistrict or county citystringCity addressstringStreet address address1stringSecond address line, such as an apartment or suite number zipstringPostal code extraInfo{ cpf?: string; taxText?: string; idNumber?: string; idNumberText?: string; addition?: AdditionValues ; shortAddress?: string; }Extra address fields such as tax and ID numbers companystringCompany name emailOrPhonestringValue of the combined email-or-phone field phoneAreaCodestringPhone area code latitude?stringLatitude longitude?stringLongitude
ShippingChangeCb
export type ShippingChangeCb = ( ) => void ;
ShippingCpf
Field Type Description isShowbooleanWhether this row is shown configInfo{ configBr: { length: string; type: string; }; configDefault: { length: string; type: string; }; }Per-country configuration of the CPF field countriesany[]Countries or regions this configuration covers isShowCountriesisShowCountries Countries or regions the CPF field is shown in
ShippingLinesErrorInfo
Field Type Description message?stringError message
ShippingLineType
Field Type Description createdAt?stringCreation time desc?stringDescription idstring | numberShipping option id name?stringShipping option name rateAdditionalAmount?stringCharge for each additional unit rateAdditionalRange?stringSize of one additional billing unit rateAdditionalUnit?stringUnit the additional charge is measured in rateAmount?stringBase shipping charge rateFirstRange?stringSize of the first billing unit rateFirstUnit?stringUnit the first charge is measured in rateType?stringHow the shipping rate is worked out ruleRangeInfinite?numberWhether the billing range has no upper bound ruleRangeMax?stringUpper bound of the billing range ruleRangeMin?stringLower bound of the billing range ruleRangeUnit?stringUnit the billing range is measured in ruleType?stringWhat the billing range is measured on, such as weight or price shippingId?stringId of the shipping method shippingPrice?number | stringShipping cost storeId?numberStore id supportCod?numberWhether cash on delivery is supported selected?booleanWhether it is selected discountShippingPricenumber | stringShipping cost after discount
ShippingMethodsFetchTriggerSource
Value Description 'init'First load of the page 'address_change'The shipping address changed 'shipping_method_switch'The buyer switched shipping method 'tipping_change'The tip changed 'charge_quote_change'An add-on fee changed 'billing_address_change'The billing address changed 'step_change'The buyer moved to another step 'delivery_method_change'The buyer switched between delivery and pickup 'pickup_location_change'The buyer picked another pickup location 'coupon_apply'A coupon or discount code was applied 'coupon_cancel'A coupon or discount code was removed 'gift_card_remove'A gift card was removed 'payment_change'The buyer picked another payment method 'payment_cancel'The buyer cancelled the payment 'submit_retry'The buyer submitted the order again 'exception_recovery'The page recovered from an exception 'other'Any other trigger
ShippingPriceDisplayChangeCb
export type ShippingPriceDisplayChangeCb = ( ) => void ;
ShippingPromptMessageChangeCb
export type ShippingPromptMessageChangeCb = ( ) => void ;
ShippingProtectionChangeCb
export type ShippingProtectionChangeCb = ( ) => void ;
ShopConfig
Field Type Description contactEmailstringContact email defaultImgstringPlaceholder image used when a product has none shopNamestringStore name shopIdstringStore id faviconstringSite favicon financestringCurrency code of the store customerIdstringId of the customer financeSymbolstringCurrency symbol of the store serviceEmailstringCustomer service email cdnDomainstringCDN domain [key: string]anyAny other key, keyed by name
ShowDetails
Field Type Description isAddressAvailable?booleanWhether the address is usable
SimplesSetting
Value Description 'hidden'The field is not shown 'optional'The field is shown and optional 'required'The field is shown and must be filled in
SortSchemaCb
export type SortSchemaCb = ( items : SortSchemaItem [ ] ) => SortSchemaItem [ ] ;
SortSchemaItem
Field Type Description idstringUnique id of this item rownumberRow this field sits in within the form grid
StaticExtensionPoint
enum StaticExtensionPoint {
PAGE_BEFORE = 'Checkout::RenderBefore' ,
MAIN_AFTER = 'Checkout::Main::RenderAfter' ,
}
StepChangeCb
export type StepChangeCb = ( ) => void ;
SubmitChangeCb
export type SubmitChangeCb = ( ) => void ;
SubmitError
Field Type Description codestringError code messagestringError message
SubmitErrorChangeCbs
export type SubmitErrorChangeCbs = ( tags : { code : string ; message : string } ) => void ;
SubmitSuccessData
Field Type Description data?{ exceptNotification: ExceptNotification ; result: Record<string, any>; }Payload of the result statestringState of the result, success when it worked errorsstring[]Error messages
SubPriceDetail
One sub-row under a price breakdown row: the key, price, value, title, titleLangId and tooltip fields of BasePriceDetail.
Field Type Description key?stringIdentifier of this breakdown row title?stringTitle of this row titleLangId?stringTranslation key of the title price?stringAmount of this row value?stringValue of this item tooltip?stringTooltip text of this row
SuccessPriceResult
Field Type Description dataPriceResultData Payload of the result messagestringMessage text state'success'State of the result, success when it worked
Suggestion
Field Type Description textstringText shown on this row idstringUnique id of this item prefix?stringPart of the suggestion before the matched text suffix?stringPart of the suggestion after the matched text
SuggestionChangeCb
export type SuggestionChangeCb = ( sugs : Suggestion [ ] , status ? : SuggestionSearchStatus ) => void ;
SuggestionSchema
Field Type Description suggestions?Array<Suggestion >Suggestion list onSuggestionsChange?(cb)voidRegisters a callback for when the suggestion list changes removeSuggestionChangeCb?(cb)voidTakes a suggestion-change callback off again onSelectSuggestion?(item)voidCalled when the buyer picks one suggestion prefixIcon?stringIcon shown in front of the input, given as an Icon type name
SuggestionSearchStatus
Value Description 'idle'No search is running 'empty'The search finished with no results
SwitchSetting
Value Description 'disabled'Off 'enabled'On
SwitchShippingProtectionResult
Field Type Description successbooleanWhether the call worked messagestringMessage text dataanyPayload of the result
TaxLines
Field Type Description salesTaxLines?SaleTaxLine []Sales tax breakdown
ThemeConfigChangeCb
export type ThemeConfigChangeCb = ( ) => void ;
ThemeStyleConfig
Field Type Description checkoutRecommendImageLink'' | { url: string; type: string }Link of the promotion banner checkoutRecommendImagestringImage of the promotion banner checkoutPaymentBackgroundImagestringPayment area background image checkoutPaymentBackgroundColorstringPayment area background color; the image wins when both are set checkoutInputBackgroundColorstringInput background color checkoutOrderBackgroundImagestringOrder summary background image checkoutOrderBackgroundColorstringOrder summary background color; the image wins when both are set checkoutHeadingFontfamilycheckoutFontfamily Font of the headings checkoutBodyFontfamilycheckoutFontfamily Font of the body text checkoutButtonFontfamilycheckoutFontfamily Font of the buttons checkoutButtonBackgroundColorstringButton background color, also the text color of the footer return link checkoutButtonTextstringText colour of the buttons checkoutErrorColorstringText color of error messages checkoutFocusColorstringColour of the focus ring on inputs checkoutBorderRadiusstringCorner radius used across the page checkoutBorderColorstringForm area on the left checkoutTextMainColorstringPrimary text colour of the page checkoutTextSubColorstringSecondary text colour of the page checkoutEmptyBgColorstringBackground colour of empty areas checkoutBlockBorderColorstringInside the cards on the left, including inputs and shipping line cards checkoutBlockTextMainColorstringPrimary text colour inside cards checkoutBlockTextSubColorstringSecondary text colour inside cards checkoutSummaryBorderColorstringOrder summary area on the right checkoutSummaryTextMainColorstringPrimary text colour of the order summary checkoutSummaryTextSubColorstringSecondary text colour of the order summary checkoutSummaryBlockBorderColorstringInside the cards on the right checkoutSummaryBlockTextMainColorstringPrimary text colour of cards in the order summary checkoutSummaryBlockTextSubColorstringSecondary text colour of cards in the order summary
ThirdPartyErrorDetails
export type ThirdPartyErrorDetails = Record < string , unknown > [ ] ;
TippingChangeCb
export type TippingChangeCb = ( ) => void ;
TippingInfo
Field Type Description productTotalPricenumberProduct total isShowTippingbooleanWhether the tipping block is shown isSupportTippingbooleanWhether tipping is supported currencySymbolstringCurrency symbol totalTipReceivedstringTip total
TippingOption
Field Type Description percentnumber | 'none' | 'custom'Percentage; none is no tip, custom is the amount the buyer types in valuenumberAmount formatValuestringAmount with the currency symbol
TipSchema
Field Type Description tip?stringTip amount tipChangeEvent?string
TrackAddressFillParams
A name this documentation gives the type so it can be referenced; in the source it is an inline type.
Field Type Description dataPartial<AddressBookItem >Payload of the result fillTypenumber
TrackGiftCardProps
Value Description 'checkout_coupon_apply_begin'The buyer started applying a gift card 'checkout_coupon_close_begin'The buyer started closing the gift card box 'checkout_coupon_fail'Applying the gift card failed
TrackSubmitAddressParams
A name this documentation gives the type so it can be referenced; in the source it is an inline type.
Field Type Description skipSetShippingAddress?booleanWhether the shipping address step is skipped
TrackTippingData
Field Type Description total?stringTip amount reported with the event rate?numberTip rate the buyer picked keyword?string
TrackTippingType
Value Description 'checkout_tipping_add_tip'The buyer added a tip 'checkout_tipping_select'The buyer picked a tip amount 'checkout_tipping_visible'The tipping module came into view 'checkout_tipping_focus'The buyer focused the tip input
UIProduct
Field Type Description idstringUnique id of this item variantIdstringVariant id productTitlestringProduct title propertiesProductItem ['properties']Custom properties discountApplicationsProductItem ['discountApplications']Discounts applied to this line optionsProductItem ['options']Variant options isFreeGiftbooleanWhether it is a free gift quantityProductItem ['quantity']Quantity linePriceProductItem ['linePrice']Price of this line discountTotal?ProductItem ['discountTotal']Total discount on this line finalLinePrice?ProductItem ['finalLinePrice']Price of this line after discount compareAtPriceProductItem ['compareAtPrice']Compare-at price priceProductItem ['price']Unit price coverUrlstringCover image URL
UiProductListChangeCb
export type UiProductListChangeCb = ( product : UIProduct [ ] ) => UIProduct [ ] ;
UiShippingLinesChangeCb
export type UiShippingLinesChangeCb = ( lines : FormatShippingLineType [ ] ) => FormatShippingLineType [ ] ;
UpdateContextCb
type UpdateContextCb = ( context : AddressSchemaManagerContext ) => void ;
UpdateDataByOrderAndPriceApiResult
A name this documentation gives the type so it can be referenced; in the source it is an inline type.
UpdateDataByPriceApiParams
The fields of PriceParams, all optional here: pass only the ones you want to change.
Field Type Description reductions?Array<{ code: string }>Discount codes to apply, given by code discountApplications?Array<{ code: string; discountId: string; _delete: 1; }>The individual discounts applied calculateShippingLine?booleanWhether shipping should be recalculated totalTipReceived?stringTotal tip on the order appliedGiftCards?Record<string, { id: string; _delete: 1 }>Gift cards applied to this order type?DiscountTypeEnum Type of this item step?stringCheckout step this applies to paymentLine?PaymentLine | nullThe payment method chosen on the order config?{ checkoutBusinessType: CheckoutBusinessType ; }Configuration carried with this request or order
UserInfo
Buyer information: every field of Customer is optional here.
Field Type Description id?stringUnique id of this item firstName?stringFirst name lastName?stringLast name email?stringEmail address phone?string | nullPhone number name?stringName of this item orderCount?numberNumber of orders this customer has placed customerId?stringId of the customer createAt?stringWhen the customer record was created registeredAt?stringWhen the buyer registered registered?stringWhether the buyer has a store account subscribed?booleanWhether the buyer is subscribed to marketing email
UserInfoChangeCb
export type UserInfoChangeCb = ( d : UserInfo ) => void ;
UseShippingAsBillingAddressCb
export type UseShippingAsBillingAddressCb = ( val : boolean ) => void ;
ValidateOptions
Field Type Description updateUi?booleanWhether the validation result is shown on screen
ValidatePickupResultChangeCb
export type ValidatePickupResultChangeCb = ( result : ValidateResult | undefined ) => void ;
ValidateResult
Field Type Description fieldIdstringField id focusIdstringId of the input to move focus to idstringUnique id of this item messagestringValidation message
ValidateResultChangeCb
export type ValidateResultChangeCb = ( fieldId : string , result : ValidateResult | undefined ) => void ;
ValueInterface
Field Type Description valuestringValue of this item onBlur?(val: string) => voidCalled when the input loses focus changeValues(values: Partial<AddressValues >, config?: ChangeValueConfig ) => voidWrites new values into the address form onValuesChange(cb)voidRegisters a callback for when the field values change removeValuesChangeCb(cb)voidTakes a value-change callback off again
VisibleConfig
Field Type Description billingbooleanWhether the billing address block is shown virtualProductBillingbooleanWhether the billing address block for virtual products is shown billingSelectorbooleanWhether the billing address selector is shown addressCardbooleanWhether the address card is shown deliveryMethodbooleanWhether the delivery method block is shown specialInstructionbooleanWhether the order instructions block is shown pickupInformationbooleanWhether the pickup information block is shown pickupAddressbooleanWhether the pickup address is shown expressCheckoutbooleanWhether the express checkout block is shown deliverybooleanWhether the delivery block is shown mobileCouponbooleanWhether the mobile coupon block is shown summaryCouponbooleanWhether the coupon block in the order summary is shown addressBookbooleanWhether the address book is shown shippingAddressbooleanWhether the shipping address block is shown contactInformationbooleanWhether the contact information block is shown
VisibleConfigChangeCb
export type VisibleConfigChangeCb = ( visibleConfig : VisibleConfig ) => void ;