Skip to main content

CheckoutAPI reference

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; // 100ms * 50 ≈ 5 seconds

// CheckoutAPI is attached to window only after the checkout page has finished
// loading, so poll for it instead of reading window.CheckoutAPI directly.
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);
}

// Kept in a variable so it can be taken off again with
// api.store.removePricesChangeCb(onPricesChange).
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 patternWhat 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 PromiseSends 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

MethodPurposeParametersReturns
getShippingAddressGet the values of the shipping address formAddressValues
getShippingAddressSchemaGet the schema of the shipping address form; the UI renders the fields from this listExtendSchema[]
onShippingSchemaChangeRegister a callback for the shipping address schema changing; re-render the form when it firescb: AddressChangeCbvoid
removeShippingSchemaChangeCbRemove a shipping address schema change callbackcb: AddressChangeCbvoid
onShippingAddressChangeRegister a callback for the shipping address values changingcb: AddressValuesChangeCbvoid
removeShippingAddressChangeCbRemove a shipping address value change callbackcb: AddressValuesChangeCbvoid
onShippingAddressChangeByInputRegister a callback for the shipping address values changing, fired only when the buyer edits the form and not when code changes the valuescb: AddressValuesChangeCbvoid
removeShippingAddressChangeByInputRemove a buyer-edit shipping address callbackcb: AddressValuesChangeCbvoid
validateShippingAddressValidate the shipping address; pass ids to validate only those fieldsids?: string[]
options?: ValidateOptions
Promise<ValidateResult[]>
isSaveAddressWhether the "save to address book" checkbox is tickedboolean
setIsSaveAddressSet the "save to address book" checkboxisSave: booleanvoid
clearShippingAddressClear the shipping addressvoid
updateShippingAddressUpdate the shipping addressaddress: Partial<ShippingAddress>void
getEmailSchemaGet the schema of the email fieldconfig: ContactSchemaConfigAddressItemEmailSchema | null
getPhoneSchemaGet the schema of the phone fieldconfig: ContactSchemaConfigAddressItemGeneralPhoneSchema | AddressItemStringSchema | null
getEmailOrPhoneSchemaGet the schema of the combined email-or-phone fieldAddressItemStringSchema | null
validateContactValidate the contact fieldoptions?: ValidateOptionsPromise<ValidateResult | undefined>
getContactSchemaGet the schema of the contact field, combining getEmailSchema, getPhoneSchema and getEmailOrPhoneSchemaAddressItemPhoneSchema | AddressItemStringSchema | AddressItemEmailSchema
registerShippingAddressSchemaSortRegister a sort callback for the shipping address form, used to reorder its fieldscb: SortSchemaCbvoid
registerShippingAddressSchemaChangeVisibilityRegister a visibility callback for the optional shipping address fields, used to hide themcb: SchemaItemVisibilityCbvoid
registerShippingAddressSchemaChangeLabelRegister a rewrite callback for the shipping address field labelscb: SchemaChangeLabelCbvoid
dispatchShippingAddressSchemaChangeManually notify the UI to re-render the shipping address formvoid
expandShippingAddressExpand the shipping address form; reason records what triggered the expansionreason?: AddressExpandReasonvoid
formatPhoneFormat a phone number using the country of the current shipping addressvalue: stringstring
getCollapsibleShippingAddressSchemaGet 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 appendedExtendSchema[]
getShippingAddressFocusIdPrefixGet the prefix of the focus ids used by the shipping address fields, so you can build the full id of an inputstring
getSubmitShippingAddressGet the shipping address in the shape submitted to the platform, which is nested rather than flat and fills in some defaultsShippingAddress
isFieldShowCheck whether a field is shown under the current address templatekey: keyof AddressValuesboolean
isShippingAddressExpandedCheck whether the shipping address form is currently expandedboolean
registerShippingAddressSchemaChangeDisableRegister a disable callback for the shipping address fields, which can lock down fields that already have a valuecb: SchemaChangeDisableCBvoid
registerShippingAddressSchemaChangeValidateRuleRegister extra validation rules for the shipping address form, applied on top of the built-in onescb: SchemaChangeValidateRuleCBvoid

Billing address

MethodPurposeParametersReturns
getBillingAddressGet the billing addressAddressValues | ShippingAddress | undefined
getBillingAddressSchemaGet the schema of the billing address form; the UI renders the fields from this listAddressItemSchema[]
onBillingSchemaChangeRegister a callback for the billing address schema changing; re-render the form when it firescb: BillingAddressChangeCbvoid
removeBillingSchemaChangeCbRemove a billing address schema change callbackcb: BillingAddressChangeCbvoid
validateBillingAddressValidate the billing addressPromise<ValidateResult[]>
onBillingAddressValuesChangeRegister a callback for the billing address values changingcb: BillingAddressValuesChangeCbvoid
removeBillingAddressValuesChangeRemove a billing address value change callbackcb: BillingAddressValuesChangeCbvoid
isUseShippingAsBillingAddressWhether the billing address reuses the shipping address, in which case the billing form is collapsed and the buyer does not fill it inboolean
setIsUseShippingAsBillingAddressSet whether the billing address reuses the shipping addressisUse: booleanvoid
onUseShippingAsBillingAddressChangeRegister a callback for the reuse-shipping-as-billing state changingcb: UseShippingAsBillingAddressCbvoid
removeUseShippingAsBillingAddressChangeRemove a reuse-shipping-as-billing callbackcb: UseShippingAsBillingAddressCbvoid
registerBillingAddressSchemaChangeLabelRegister a rewrite callback for the billing address field labelscb: SchemaChangeLabelCbvoid
setBillingAddressSet the values of the billing address formaddress: AddressValuesvoid
registerBillingAddressSchemaSortRegister a sort callback for the billing address form, used to reorder the billing fields of non-gift-card productscb: SortSchemaCbvoid
dispatchBillingAddressSchemaChangeManually notify listeners that the billing address form structure has changedvoid

Address book

MethodPurposeParametersReturns
onChangeAddressBookRegister a callback for the address book changing; call getAddressBookList again when it firescb: AddressBookChangeCbsvoid
removeAddressBookChangeCbRemove an address book change callbackcb: AddressBookChangeCbsvoid
getAddressBookListGet the buyer's saved addressesIAddressBookItem[]
applyAddressFill the shipping address from a saved addressid: string
setBilling?: boolean
void

Address utilities

MethodPurposeParametersReturns
getAddressTemplateGet the address template for a country, province and preset; the template decides which fields that country collectsparams: GetAddressTemplateParamsAddressTemplate
getAllCountriesGet every country the platform supportsAddressCountry[]
getAvailableCountriesGet the countries the store has made availableAddressCountry[]
getDefaultAddressValuesGet an empty set of address values, usable as the initial value of a formAddressValues
getSchemaManagerCreate a schema manager for an address form, which builds and validates each field from the current values and the address templatecontext: AddressSchemaManagerContext
config: SchemaManagerConfig
AddressSchemaManager
hasCountryCheck whether a country code is in the store's available country listcountryCode: stringboolean
isMiddleEastCountryCheck whether a country is one of the Middle East countries that need special address handlingcountryCode: stringboolean
isMultiLevelCountryCheck whether a country uses multi-level administrative divisionscountryCode: 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

MethodPurposeParametersReturns
getLoadingStatusGet the global loading stateLoadingStatus
onLoadingStatusChangeRegister a callback for the loading state changingcb: OnLoadingStatusChangeCallbackvoid
removeLoadingStatusChangeCbRemove a loading state callbackcb: OnLoadingStatusChangeCallbackvoid
setLoadingStatusUpdate the loading statestatus: Partial<LoadingStatus>void
getPendingGet the pending state of each modulePending
onPendingChangeRegister a callback for the pending state changingpending: OnSubmitPendingChangeCallbackvoid
removePendingChangeCbRemove a pending state callbackcb: OnSubmitPendingChangeCallbackvoid
resetAllPendingReset every pending flagvoid
setPricePendingSet the pending flag for price calculationpending: booleanvoid
setPickupLocationPendingSet the pending flag for the pickup location listpending: booleanvoid
getPickupLocationPendingGet the pending flag for the pickup location listboolean
setShippingLinesPendingSet the pending flag for the shipping line listpending: booleanvoid
getShippingLinesPendingGet the pending flag for the shipping line listboolean
setPaymentPendingSet the pending flag for loading the payment scriptpending: booleanvoid

Phone number formatting

MethodPurposeParametersReturns
getPhoneAreaListGet the list of phone country codesCountry[]
getDefaultPhoneKeyGet the default phone country code, resolved from the buyer's IP first and from the browser language as a fallbackstring
getPhoneAreaResolve the country or region a phone number belongs tophone: string
phoneKey?: string
Country | undefined
formatPhoneFormat a phone number for a countryphone: string
countryCode: string
string
isValidPhoneCheck whether a phone number is valid for a countryphone: string
countryCode?: string
boolean
initPhoneInitialize 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 countryphone: string
_phoneAreaCode: string
isPhoneRequired: boolean
InitPhoneResult | null

Localization

MethodPurposeParametersReturns
getLocaleGet the current language, for example enstring
formatMessageLook up a message for the current language by key, falling back to defaultMessage when the key is missing; context fills the placeholders in the messageid: string
defaultMessage?: string
context?: Record<string, string | number>
string
formatPriceFormat an amount into a display string with its currency symbolprice: number | string
symbolStr?: string
string
isRtlLocaleWhether the current language is written right to left, such as Arabicboolean
registerLocaleMapRegister your extension's own messages, grouped by languagelocales: LocaleMapvoid
getFullLocaleGet the full locale tag, for example en-USLocale

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(); // 'en'
CheckoutAPI.base.getFullLocale(); // 'en-US'

CheckoutAPI.base.formatMessage('audit.greet', '', { name: 'Audit' }); // 'Hi Audit'
CheckoutAPI.base.formatMessage('audit2.deep', '', { name: 'Audit' }); // 'deep Audit'

// Without defaultMessage a missing key comes back as the key itself
CheckoutAPI.base.formatMessage('probe.not_exist'); // 'probe.not_exist'
CheckoutAPI.base.formatMessage('probe.not_exist', 'FALLBACK TEXT'); // 'FALLBACK TEXT'

CheckoutAPI.base.formatPrice(10); // '$10.00'
CheckoutAPI.base.formatPrice('10.5'); // '$10.50'
CheckoutAPI.base.formatPrice(10, '€'); // '€10.00'

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

MethodPurposeParametersReturns
getSpecialInstructionVisibleWhether the order note input is shownboolean
getBillingVisibleWhether the billing address is shownboolean
getVirtualBillingVisibleWhether the billing address for virtual products is shownboolean
getBillingSelectorVisibleWhether the "use the shipping address as the billing address" selector is shownboolean
getPickupAddressVisibleWhether the pickup location list is shownboolean
getPickupInformationVisibleWhether the pickup information module is shownboolean
getAddressCardVisibleWhether the filled-in information card is shownboolean
getDeliveryMethodVisibleWhether the delivery method module is shownboolean
getExpressCheckoutVisibleWhether express checkout is shownboolean
getDeliveryVisibleWhether the shipping line list is shownboolean
getMobileCouponVisibleWhether the discount code input is shown on mobileboolean
getSummaryCouponVisibleWhether the discount code input is shown on desktopboolean
getAddressBookVisibleWhether the address book is shownboolean
getShippingAddressVisibleWhether the shipping address is shownboolean
getContactInformationVisibleWhether the contact information module is shownboolean
setIsExpandedManuallyRecord that the buyer expanded the filled-in information card by handval: booleanvoid
getIsExpandedManuallyWhether the buyer expanded the filled-in information card by handboolean
getVisibleConfigGet the visibility state of every module at onceVisibleConfig
onVisibleConfigChangeRegister a callback for module visibility changingcb: VisibleConfigChangeCbvoid
removeVisibleConfigChangeCbRemove a module visibility callbackcb: VisibleConfigChangeCbvoid
getShowDetailsThe card-collapse configuration provided by the platformShowDetails
getGiftCardBillingVisibleCheck whether the billing form of a gift card order is shownboolean

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.

MethodPurposeParametersReturns
getFeatureConfigGet the checkout feature flagsCheckoutFeatures
getThemeConfigGet the checkout theme configurationCheckoutThemeConfig
getAppConfigGet the checkout app configurationCheckoutAppConfig
getMarketConfigGet the market configurationMarketInfo
getShopConfigGet the store configurationShopConfig
getRootUrlGet the API root URLstring
getPolicyTitlesGet the titles of the policy links in the page footerstring[]
isThankyouPageWhether the current page is the thank-you pageboolean
isCheckoutPageWhether the current page is the checkout pageboolean
getCSettingsGet the page-level checkout settingsCSettings
isMobileLayoutWhether the mobile layout is in use, which happens when the window is narrower than 768pxboolean
onThemeConfigChangeRegister a callback for the theme configuration changingcb: ThemeConfigChangeCbvoid
removeThemeConfigChangeRemove a theme configuration callbackcb: ThemeConfigChangeCbvoid
updateThemeConfigUpdate the theme configurationconfig: 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

MethodPurposeParametersReturns
applyCouponApply a couponcode: stringPromise<any>
cancelCouponRemove a coupon that has been appliedcode: stringPromise<any>
getAvailableCouponDataGet the coupons that can be used on this orderCouponData
getSelectedDiscountCouponGet the coupon currently appliedDiscountApplication | undefined
getUnavailableCouponDataGet the coupons that cannot be used on this orderCouponData
isShowDiscountCouponCheck whether the coupon entry is shownboolean
onAvailableCouponDataChangeRegister a callback for the available coupon list changingcb: CouponListChangeCbvoid
onCouponChangeRegister a callback for the applied coupon changingcb: CouponChangeCbvoid
onUnavailableCouponDataChangeRegister a callback for the unavailable coupon list changingcb: CouponListChangeCbvoid
removeAvailableCouponDataChangeCbRemove an available coupon list callbackcb: CouponListChangeCbvoid
removeCouponChangeCbRemove an applied coupon callbackcb: CouponChangeCbvoid
removeUnavailableCouponDataChangeCbRemove an unavailable coupon list callbackcb: CouponListChangeCbvoid
requestCouponListFetch the coupon list for the given availability statusstatus: CouponAvailStatusPromise<void>

Gift cards and discount codes

MethodPurposeParametersReturns
registerGiftCardTagChangeRegister a rewrite callback for one discount code or gift card tag, used to customize how that tag rendersid: string
cb: GiftCardTagChange
void
getGiftCardTagsGet the discount code and gift card tagsGiftCardTagItem[]
onDiscountChangeRegister a callback for the tag list changingcb: GiftCardTagsChangeCbvoid
removeDiscountChangeCbRemove a tag list callbackcb: GiftCardTagsChangeCbvoid
getGiftCardsGet the gift cards applied to this orderGiftCard[]
getDiscountCodesGet the discount codes applied to this orderDiscountApplication[]
getDiscountApplicationsGet every discount applied to this order, both codes and automatic promotionsDiscountApplication[]
applyGiftCardOrDiscountCodeApply a discount code or gift card; position records which input it came from and is used for tracking onlycode: string
position?: 'coupon-pc' | 'coupon-mobile'
Promise<any>
cancelGiftCardOrDiscountCodeRemove an applied discount code or gift cardparasm: CancelCouponParamsPromise<any>
applyDiscountApply one or more discount codescodes: string[]Promise<PriceResult | undefined>
cancelDiscountCodeRemove one or more discount codes that have been appliedcodes: string[]Promise<PriceResult | undefined>
isCurrentStepShowDiscountCodeCheck whether the discount code and gift card inputs are shown on the current step, per the store's settingsstep?: CheckoutStepboolean
registerGiftCardTagsFilterRegister a filter callback for the gift card and discount code tags, deciding which tags rendercb: GiftCardTagsFiltervoid

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.

MethodPurposeParametersReturns
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 messageexception?: ExceptNotificationboolean
onExceptionChangeRegister a callback for the stored business error changing, fired both when one is stored and when it is clearedcb: ExceptionChangeCbsvoid
removeExceptionChangeCbRemove a business error callbackcb: ExceptionChangeCbsvoid
unsetExceptionClear the stored business errorvoid
getSubmitErrorInfoGet the current submit errorSubmitError | undefined
setSubmitErrorInfoSet the submit error code. The platform already sets it when the order is submitted, so this is mostly used to clear itcode: IExceptionCode | ''void
onSubmitErrorChangeRegister a callback for the submit error changingcb: SubmitErrorChangeCbsvoid
removeSubmitErrorChangeCbRemove a submit error callbackcb: SubmitErrorChangeCbsvoid
getExceptionInfoGet the stored business errorExceptionInfo
getExceptionGet the business error currently storedIException | undefined
handleExceptionOkRun the handler behind the confirm button of the business error dialogPromise<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.

MethodPurposeParametersReturns
generateRealDynamicPointTurn a dynamic extension point template containing {id} into the real extension point namepoint: ExtensionPoint
id?: string
string
getExtensionComponentsReturn the extension component of the point, which carries more than getExtensionContent; an id means the point is dynamicpoint: ExtensionPoint
id?: string
ExtensionComponent[]
getExtensionContentReturn the extension string of the point, empty when there is none; an id means the point is dynamicpoint: ExtensionPoint
id?: string
string
getExtensionListGet the list of extensionsExtension[]
getPlaceholderContentReturn the placeholder content of the point, which the UI layer inserts with innerHTMLpoint: ExtensionPointstring
isHideExtensionTargetWhether an extension target is hidden; the UI layer reads it to decide whether to hide that native moduletarget: ExtensionTargetboolean
onAllExtensionLoadedRegister a callback for all extensions having finished loadingcb: AllExtensionLoadedCbvoid
onExtensionLoadRegister a callback that runs when the extension of a point has finished loadingcb: ExtensionLoadCbvoid
onHideExtensionTargetRegister a callback for the result of isHideExtensionTarget changingcb: HideExtensionTargetCbvoid
registerExtensionRegister an extension; extension developers call this function to complete the registrationparams: RenderParamsPromise<void>
removeAllExtensionLoadedCbRemove a callback registered for all extensions having finished loadingcb: AllExtensionLoadedCbvoid
removeHideExtensionTargetRemove the callbackcb: HideExtensionTargetCbvoid

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

MethodPurposeParametersReturns
getDeliveryMethodListGet the delivery methods this checkout offers, such as shipping and in-store pickupDeliveryMethodItem[]
getSelectedDeliveryMethodGet the delivery method the buyer has selectedDeliveryMethodItem
updateDeliveryMethodSwitch the selected delivery method and return the recalculated pricestype: CheckoutBusinessTypePromise<PriceResult | undefined>
onDeliveryMethodChangeRegister a callback for the selected delivery method changingcb: DeliveryMethodChangeCbvoid
removeDeliveryMethodChangeCbRemove a delivery method change callbackcb: DeliveryMethodChangeCbvoid
onDeliveryMethodListChangeRegister a callback for the delivery method list changingcb: DeliveryListChangeCbvoid
removeDeliveryMethodListChangeRemove a delivery method list callbackcb: DeliveryListChangeCbvoid
unregisterDeliveryMethodListChangeUnregister the delivery method list rewrite callbackcb: DeliveryMethodListChangeCbvoid
registerDeliveryMethodListChangeRegister 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 listcb: DeliveryMethodListChangeCbvoid

Line items

MethodPurposeParametersReturns
addLineItemsAdd line items to the current order; the prices are recalculated automaticallyparams: AddLineItemsInputPromise<LineMutationResult>
removeLineItemsRemove line items from the current order; the prices are recalculated automaticallyparams: RemoveLineItemsInputPromise<LineMutationResult>

Submit and validation

MethodPurposeParametersReturns
couldSubmitWhether the current step can be submitted, for driving the disabled state of a custom submit buttonboolean
onSubmitChangeRegister a callback for the submittable state changingcb: SubmitChangeCbvoid
removeSubmitChangeCbRemove a submittable state callbackcb: SubmitChangeCbvoid
preSaveAddressPre-save the address currently entered in the form to the orderPromise<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 layoutsPromise<ValidateResult[] | undefined>
registerBuyerJourneyInterceptRegister a checkout interception rule: returning block from the callback stops the buyer and opens a dialog, returning allow lets the submission throughcb: BuyerJourneyInterceptCbvoid
addBeforeSubmitCbAdd a validation callback that runs before the address is submitted; the platform's own two cover email and addresscb: BeforeSubmitCbvoid
removeBeforeSubmitCbRemove a validation callback that runs before the address is submittedcb: BeforeSubmitCbvoid
submitAddressAndShippingLinesSubmit the address together with the selected shipping linePromise<Res<SubmitSuccessData>>
submitShippingLinesAndNavigateSubmit the shipping line and move to the next step; only the three-step layout uses thisPromise<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 failsPromise<ValidateResult[]>
unregisterBuyerJourneyInterceptUnregister a checkout interception rulecb: BuyerJourneyInterceptCbvoid

Tipping

MethodPurposeParametersReturns
getTippingOptionsGet the preset tip options offered on this checkoutTippingOption[]
onTippingChangeRegister a callback for the tip changingcb: TippingChangeCbvoid
removeTippingChangeCbRemove a tip change callbackcb: TippingChangeCbvoid
handleTippingSubmit a tip, where type tells a preset option (select) from a buyer-entered amount (input)value: number
type: '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 excludedTippingInfo

Shipping lines

MethodPurposeParametersReturns
getShippingLinesGet the shipping lines available for the current addressFormatShippingLineType[]
getSelectedShippingLineGet the shipping line the buyer has selected, or null when none is selectedFormatShippingLineType | null
updateSelectedShippingLineSwitch the selected shipping lineshippingLine: ShippingLineTypePromise<void>
shouldCalculateShippingLineWhether shipping lines should be requested at this point; in the three-step layout it returns false on the information stepboolean
onShippingChangeRegister a callback for the selected shipping line changingcb: ShippingChangeCbvoid
removeShippingChangeCbRemove a shipping line change callbackcb: ShippingChangeCbvoid
isShippingMethodAutoSelectWhether the store is configured to auto-select a shipping lineboolean
isSupportShippingLinesCollapseWhether the shipping line list can be collapsed, which only the single-page and two-step layouts supportboolean
getShippingPromptMessageGet the prompt currently shown on the shipping line list, or null when there is nonePromptMessage | null
onShippingPromptMessageChangeRegister a callback for the shipping line prompt changingcb: ShippingPromptMessageChangeCbvoid
removeShippingPromptMessageChangeRemove a shipping line prompt callbackcb: ShippingPromptMessageChangeCbvoid
dispatchShippingChangeManually notify listeners that the shipping line changedvoid
getShippingLinesErrorInfoGet the error information of the shipping line listShippingLinesErrorInfo
getUiShippingLinesGet the shipping lines the page finally renders, which an extension may have rewrittenFormatShippingLineType[]
unregisterUiShippingLinesChangeUnregister the shipping line list rewrite callbackcb: UiShippingLinesChangeCbvoid
registerUiShippingLinesChangeRegister a rewrite callback for the shipping line list, deciding which lines the page finally renders; the callback must return the full listcb: UiShippingLinesChangeCbvoid

Shipping protection

MethodPurposeParametersReturns
getChargeQuotesGet the shipping protection offersChargeQuote[]
onShippingProtectionChangeRegister a callback for the shipping protection selection changingcb: ShippingProtectionChangeCbvoid
removeShippingProtectionChangeCbRemove a shipping protection callbackcb: ShippingProtectionChangeCbvoid
switchShippingProtectionSelect or clear one shipping protection offerquoteId: string
selected: boolean
Promise<SwitchShippingProtectionResult>

Order note

MethodPurposeParametersReturns
getSpecialInstructionNoteGet the order note the buyer has enteredstring
updateSpecialInstructionNoteWrite the order note, and persist it to the order when saveToBackend is truenote: string
saveToBackend?: boolean
Promise<any>
onChangeSpecialInstructionRegister a callback for the order note changingcb: (info: string) => voidvoid
removeSpecialInstructionChangeCbRemove an order note change callbackcb: (info: string) => voidvoid
expendSpecialInstructionExpand the order note inputvoid
isInstructionCollapseWhether the order note input is currently collapsedboolean
onInstructionCollapseChangeRegister a callback for the order note input collapsing or expandingcb: IsSpecialInstructionCollapseChangevoid
removeInstructionCollapseChangeRemove an order note collapse callbackcb: IsSpecialInstructionCollapseChangevoid

Filled-in information card

MethodPurposeParametersReturns
getCollapseInfoGet the contents of the filled-in information card: contact, shipping address, delivery method, shipping line, and whether the new-address button is shownCollapseInfo
onCollapseInfoChangeRegister a callback for the filled-in information card changingcb: CollapseInfoChangeCbvoid
removeCollapseInfoChangeCbRemove a filled-in information card callbackcb: CollapseInfoChangeCbvoid

Order data and price refresh

MethodPurposeParametersReturns
updateDataByPriceApiCall the price API again and refresh the prices held by the checkoutparams?: UpdateDataByPriceApiParamsPromise<PriceResult | undefined>
updateDataByOrderAndPriceApiCall the order and price APIs in parallel and refresh both, typically to recover after an errorparams?: UpdateDataByPriceApiParamsPromise<UpdateDataByOrderAndPriceApiResult>
updateDataByOrderApiCall the order API again and refresh the order dataPromise<OrderResult | undefined>
calculatePriceCalculate prices from the given parameters and return the result without writing it back to the checkout dataparams?: UpdateDataByPriceApiParamsPromise<PriceResult | undefined>

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.

MethodPurposeParametersReturns
paymentPayStart the payment after the buyer submitsPromise<void>
getPaymentLinesGet every payment method in the listPaymentUpdateParams['paymentLines']
getSelectedPaymentLineGet the payment method the buyer has selectedPaymentLine | null | undefined
onAfterPayRegister a callback that runs after payment completescb: AfterPayCbvoid
onPayAttemptRegister a callback for a payment attempt; it fires before form validation, so a failed validation that never reaches the gateway still counts as an attemptcb: PayAttemptCbvoid
onPayFailedRegister a handler for a failed payment; several can be registered, they run in order, and the first one that returns a value decides the outcomehandler: PayFailedHandlervoid
removePayAttemptCbRemove a payment attempt callbackcb: PayAttemptCbvoid

pickup

The pickup namespace covers in-store pickup: the pickup locations, the one the buyer selected, the pickup information form, and pickup validation.

MethodPurposeParametersReturns
getPickupLocationsGet the pickup locationsPickupLocation[]
getPickupLocationValidateResultGet the validation result for the pickup locationValidateResult | undefined
onPickupLocationValidateResultChangeRegister a callback for the pickup location validation result changingcb: ValidatePickupResultChangeCbvoid
removePickupLocationValidateResultChangeRemove a pickup location validation callbackcb: ValidatePickupResultChangeCbvoid
validatePickupLocationValidate that a pickup location has been chosenPromise<ValidateResult | undefined>
getSelectedPickupLocationGet the pickup location the buyer has selectedPickupLocation | undefined
updatePickupLocationSwitch the selected pickup location and return the recalculated priceslocation: PickupLocationPromise<PriceResult | undefined>
onPickupLocationsChangeRegister a callback for the pickup location list changingcb: PickupLocationsChangeCbvoid
removePickupLocationsChangeCbRemove a pickup location list callbackcb: PickupLocationsChangeCbvoid
onSelectedPickupLocationChangeRegister a callback for the selected pickup location changingcb: SelectedPickupLocationChangeCbvoid
removeSelectedPickupLocationChangeCbRemove a selected pickup location callbackcb: SelectedPickupLocationChangeCbvoid
onPickupInformationChangeRegister a callback for the pickup information changingcb: PickupInformationChangeCbvoid
removePickupInformationChangeCbRemove a pickup information callbackcb: PickupInformationChangeCbvoid
getPickupInformationSchemaGet the schema of the pickup information formAddressItemSchema[]
validatePickupInfoValidate the pickup information formPromise<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.

MethodPurposeParametersReturns
getStepGet the step the buyer is onCheckoutStep
isInformationStepWhether the buyer is on the information stepboolean
isShippingStepWhether the buyer is on the shipping step, which only exists as the second page of the three-step layoutboolean
isPaymentStepWhether the buyer is on the payment step, the last page of the three-step and two-step layoutsboolean
stepNavToInformationNavigate to the information steptype?: EventTypePromise<void>
stepNavToShippingNavigate to the shipping steptype?: EventTypePromise<void>
stepNavToPaymentNavigate to the payment stepPromise<void>
stepNavToNextNavigate to the next step, whatever the layout and checkout modePromise<void>
stepNavToPreviousNavigate back to the previous stepvoid
hasShippingMethodStepWhether this order has a shipping step, which needs pickup to be unselected and the products to be physicalboolean
getNavigateLinksGet the configuration of the step breadcrumbNavigateLink[]
onNavigateLinksChangeRegister a callback for the step breadcrumb changingcb: NavigateLinksChangeCbvoid
removeNavigateLinksChangeRemove a step breadcrumb callbackcb: NavigateLinksChangeCbvoid
onStepChangeRegister a callback for the step changingcb: StepChangeCbvoid
removeStepChangeCbRemove a step change callbackcb: StepChangeCbvoid
navigateClickNavigate to a step the way clicking the breadcrumb doesid: CheckoutStepPromise<void>
couldNavToWhether the breadcrumb can jump to a step. The breadcrumb only goes backwards; moving forward means submitting the current stepid: CheckoutStepboolean
stepNavToNavigate to a given stepid: CheckoutStep
location?: EventType
Promise<any>
navToReferrerPageNavigate back to the page the buyer came from before checkoutvoid
goToOrderInfoPageNavigate to the order details pagevoid
goToHomePageNavigate to the store home pagevoid
disableJumpBlock step navigation, optionally only for the given ways of navigatingway?: JumpWay[]Promise<void>
getReturnBtnTextGet the text of the return button; an empty string means the button is not shownstring
goToThankyouPageRedirect to the thank-you pagevoid
isDisableJumpCheck whether step navigation is currently blockedboolean
locationHrefNavigate to a given URLurl: stringvoid
stepNavToWithoutSubmitMove to the given step without submitting the current step's dataid: CheckoutStepvoid

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.

MethodPurposeParametersReturns
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 latercb: PricesChangeCbvoid
removePricesChangeCbRemove a price change callbackcb: PricesChangeCbvoid
getOrderStatusGet the status of the orderOrderStatus
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 methodscb: OnStoreDataChangeCbvoid
removeOrderChangeCbRemove an order refresh callbackcb: OnStoreDataChangeCbvoid
getPricesGet the prices of the orderCheckoutPrices
getOrderInfoGet the basic order informationOrderInfo
getOrderConfigGet the order attributes, such as the checkout layout and the order business typeOrderConfig
getBusinessTypeGet the business type of the orderCheckoutBusinessType
getCheckoutSettingsGet the checkout settings of the storeCheckoutSettings
getInstructionTypeGet the collapse mode configured for the order note inputInstructionType
getCustomerAuthorityGet who is allowed to place the order; login means only signed-in buyers canCustomerAuthority
setBusinessTypeSet the business type of the order, which the pickup layout usestype: CheckoutBusinessTypevoid
onBusinessTypeChangeRegister a callback for the order business type changingcb: CheckoutBusinessTypeChangeCbvoid
removeBusinessTypeChangeCbRemove an order business type callbackcb: CheckoutBusinessTypeChangeCbvoid
getPageTypeGet the checkout layout, which does not change while the page is openCheckoutPageType
isThreeStepPageWhether this is the three-step checkout layoutboolean
isTwoStepPageWhether this is the two-step checkout layoutboolean
isOneStepPageWhether this is the single-page checkout layoutboolean
getContactTypeGet how the store collects contact detailsContactType
getAddressSettingsGet the address form settingsCheckoutAddressSettings
isPageTypeSupportFirstStepCollapseWhether this layout can collapse the address into a card on the first step, which only the single-page and two-step layouts supportboolean
isStandardTemplateWhether this is the shipped-goods checkout templateboolean
isVirtualTemplateWhether this is the virtual-goods checkout template, used when every product in the order is virtualboolean
isStandardBusinessWhether the order business type is shippingboolean
isVirtualBusinessWhether the order business type is virtual goodsboolean
isPickupTemplateWhether this is the pickup checkout template, which it becomes as soon as the merchant has pickup locations. Whether the buyer actually picks up is isSelectedPickupboolean
isSelectedPickupWhether this order is a pickup order, true only when this is the pickup template and the buyer selected pickupboolean
isDirectPaymentWhether the order was created from the merchant admin, in which case the buyer lands straight on the payment stepboolean
isShippingInInformationStepWhether 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 thereboolean
isCartOrderWhether the order was placed from the cartboolean
isBuyNowOrderWhether the order was placed with buy-now on a product pageboolean
getReferInfoGet where the order came fromReferInfo
getTaxLinesGet the tax breakdownTaxLines
isGiftCardOrderCheck whether this is a gift card orderboolean
isOrderIdEmptyCheck whether the order id is emptyboolean
onPageTypeChangeRegister a callback for the checkout layout changingcb: PageTypeChangeCbvoid
removePageTypeChangeRemove a checkout layout callbackcb: PageTypeChangeCbvoid
setOrderIdSet the order idid: stringvoid
setPageTypeSet the checkout layouttype: CheckoutPageTypevoid

summary

The summary namespace covers the order summary column: the line items, the price breakdown, and the text shown for the shipping cost.

MethodPurposeParametersReturns
getProductListGet the line items, including the custom properties fieldProductItem[]
onProductListChangeRegister a callback for the line item list changingcb: ProductListChangeCbvoid
removeProductListChangeCbRemove a line item list callbackcb: ProductListChangeCbvoid
getPriceListGet the grouped price breakdown computed by the platformPriceGroupDetail[]
onPriceListChangeRegister a callback for the price breakdown changingcb: PriceListChangeCbvoid
removePriceListChangeCbRemove a price breakdown callbackcb: PriceListChangeCbvoid
getShippingPriceDisplayGet the text shown for the shipping coststring
onShippingPriceDisplayChangeRegister a callback for the shipping cost text changingcb: ShippingPriceDisplayChangeCbvoid
removeShippingPriceDisplayChangeRemove a shipping cost text callbackcb: ShippingPriceDisplayChangeCbvoid
registerUiProductListChangeRegister a rewrite callback for the line item list, deciding which lines the page finally renders; the callback must return the full listcb: UiProductListChangeCbvoid
getGiftCardPriceGet the gift card line of the price breakdownPriceGroupDetail | undefined
dispatchPriceListChangeManually notify the UI to re-render the price breakdownvoid
dispatchProductListChangeManually trigger a refresh of the line item list in the UIvoid
getUiProductListGet the line items the order summary finally renders, which an extension may have rewrittenUIProduct[]
unregisterUiProductListChangeUnregister the line item list rewrite callbackcb: UiProductListChangeCbvoid

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.

MethodPurposeParametersReturns
trackReport a tracking eventevent: string
data?: Record<string, any>
void
getAssemblyOrderGet the order payload used for analytics reportingCheckoutOrder
registerTrackExtraInfoAttach extra fields to one analytics event, which are then included every time that event is reportedeventName: string
data: Record<string, unknown>
void
trackAddPaymentInfoReport the add payment info eventextra?: Record<string, any>void
trackAddShippingMethodReport the add shipping method eventvoid
trackAddressFillReport an address autofill eventdata: TrackAddressFillParamsvoid
trackAddressFormExpandReport the address form expand eventreason: AddressExpandReasonvoid
trackAioBeforePayReport the event fired before an aggregated payment startsvoid
trackBeforePayReport the event fired before a payment startsextra?: Record<string, any>void
trackCompleteOrderClickReport a click on the place order buttonvoid
trackCompleteOrderErrorReport a failed order submissiondata: stringvoid
trackContinueToPaymentReport the continue to payment eventvoid
trackCouponChangeTabReport a tab switch in the coupon panelstatus: stringvoid
trackEnterCheckoutReport entering the checkout pagevoid
trackGiftCardReport a gift card eventtype: TrackGiftCardProps
info: Record<string, string | number>
void
trackInitialAddressFillReport the first address fillvoid
trackInitiateCheckoutReport the initiate checkout eventvoid
trackLogoutReport a sign-outvoid
trackPaymentRedirectReport a payment redirect, taking the load time of the redirect pageloadTime: numbervoid
trackShippingAddressSubmitErrorsReport a shipping address submission failurecode: stringvoid
trackShippingMethodsCardExposeReport that the shipping method card was shownvoid
trackShippingMethodsRenderReport that the shipping methods renderedvoid
trackShippingMethodsRequestReport a shipping methods fetchtriggerSource: ShippingMethodsFetchTriggerSourcevoid
trackSubmitAddressReport an address submissionoptions?: TrackSubmitAddressParamsvoid
trackTippingReport a tipping eventtype: 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

MethodPurposeParametersReturns
isLoginWhether the buyer is signed inboolean
getIPAddressGet the buyer's IP address informationCheckoutIpAddress
doLoginRedirect to the sign-in page; the parameters passed in are appended to the return URLreturnUrlSearchParams?: Record<string, string>void
doRegisterRedirect to the sign-up pagevoid
doLogoutSign the buyer outPromise<void>
getUserInfoGet the account information of the signed-in buyerUserInfo
getCustomerInfoGet the customer information that is submitted with the orderCheckoutCustomerInfo
updateCustomerInfoUpdate the customer information that is submitted with the orderdata: Partial<CheckoutCustomerInfo>void
onUserInfoChangeRegister a callback for the account information changingcb: UserInfoChangeCbvoid
removeUserInfoChangeCbRemove an account information callbackcb: UserInfoChangeCbvoid

Contact details

MethodPurposeParametersReturns
getEmailGet the contact email the buyer enteredstring
getPhoneGet the contact phone number the buyer enteredstring
getPhoneAreaCodeGet the phone country code the buyer enteredstring
getEmailOrPhoneWhen the store collects either an email or a phone number, get whichever the buyer enteredstring
getContactInformationGet the contact details: email, phone, phone country code, and the combined email-or-phone fieldContactInformation
onContactInformationChangeRegister a callback for the contact details changingcb: ContactInformationChangeCbvoid
removeContactInformationChangeCbRemove a contact details callbackcb: ContactInformationChangeCbvoid
setNewsletterSet the marketing email subscription checkboxval: NewsLetterStatusvoid
getNewsletterGet the marketing email subscription checkboxNewsLetterStatus

utils

The utils namespace provides the checkout page's own dialog and drawer, plus three lodash functions passed straight through.

MethodPurposeParametersReturns
debouncelodash debounce, passed through unchangedunknown
getlodash get, passed through unchangedunknown
throttlelodash throttle, passed through unchangedunknown
createDialogCreate a dialog, a modal confirmation boxcontent: DialogContent
options?: DialogOptions
IDialog
createDrawerCreate a drawer, a panel that slides in from the edge of the screencontent: 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(); // true after the buyer clicks OK

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) => {
// type is 'true_btn' when the buyer confirms
});
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.

MethodPurposeParametersReturns
emitEmit an eventname: string
...rest: any[]
void
onListen for an eventname: string
cb: Function
void
onceListen for an event oncename: string
cb: Function
void
offStop listening for an eventname: string
cb: Function
void

Types

The types named in the method tables above. CountryCode comes from the libphonenumber-js package and is not redefined here.

AdditionalPrice

FieldTypeDescription
name?stringName of the add-on charge
price?stringAmount of the add-on charge

AdditionalProperty

FieldTypeDescription
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

FieldTypeDescription
[key: string]{ name: string; val: string; }Any other key, keyed by name

AddLineItemsInput

FieldTypeDescription
lineItemsAddProductInput[]The line items of the order
mutationSourceMutationSourceA tag of your own naming what made this change

AddProductInput

FieldTypeDescription
variantIdstringId of the variant
quantitynumberQuantity
properties?ProductPropertiesCustom properties to put on the new line, as a JSON string

AddressBookChangeCbs

export type AddressBookChangeCbs = () => void;

AddressBookItem

FieldTypeDescription
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

AddressChangeByInputCb

export type AddressChangeByInputCb = (
changeValue: Partial<AddressValues>,
fullAddress: AddressValues,
config: ChangeValuesConfig,
) => void;

AddressChangeCb

export type AddressChangeCb = () => void;

AddressCountry

FieldTypeDescription
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
presetstring
format?AddressFormatAddress format template

AddressCountryProvince

FieldTypeDescription
cnNamestringChinese name
codestringProvince or state code
namestringProvince or state name
oldCodestring
provinceIdstringId of the province or state
preset?string
format?AddressFormatFormat rules of this field

AddressExpandReason

ValueDescription
'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

AddressFormat

FieldTypeDescription
fieldsAddressFormatField[]The fields this template contains
[k: string]anyAny other key, keyed by name

AddressFormatField

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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.

FieldTypeDescription
typeFieldType.PhoneField type, always the phone type
phoneInfoPhoneInfoDialling 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

FieldTypeDescription
typeFieldType.EnumField type, always the select type
selectTypeSelectTypeWhether the option list is fixed or fetched, as a SelectType value
optionsOptionValue[]The options in the dropdown

AddressItemStringSchema

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
addressValuesAddressValuesCurrent values of the address form
addressTemplateAddressTemplateAddress template of the current country or region

AddressTemplate

FieldTypeDescription
fieldsAddressTemplateField[]The address fields this template collects
stringifystring
presetstring
addressLevelnumberNumber of address levels

AddressTemplateField

FieldTypeDescription
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
typeFieldTypeType 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

FieldTypeDescription
idstringUnique id of this item
messagestringMessage shown when the check fails
regexpstringRegular expression the value has to match

AddressValues

FieldTypeDescription
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?string
gender?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

FieldTypeDescription
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.

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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
eventBusEventBusThe 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?PlaceTypeWhich 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?ValidateResultResult 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

FieldTypeDescription
key?stringIdentifier of this breakdown row
dataRobot?string
title?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

FieldTypeDescription
okbooleanWhether the request succeeded
configReqConfigConfiguration carried with this request or order

BeforeSubmitCb

export type BeforeSubmitCb = (params: BeforeSubmitCbParams) => Promise<boolean>;

BeforeSubmitCbParams

FieldTypeDescription
pageTypeCheckoutPageTypeCheckout layout, as a CheckoutPageType value
stepCheckoutStepCheckout step this applies to

BillingAddress

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
supportCardsArray<PlayCardCards>Card types this payment method accepts

ChangedLineItem

FieldTypeDescription
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

FieldTypeDescription
format?booleanWhether the value is reformatted as it is written
changeByInput?booleanWhether the change came from the buyer typing

ChangeValuesConfig

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
nameNameSettingSettings for the name field
nameRequirementNmeRequirementSettingWhether the name field is required
contactDetailsContactDetailsSettingSettings for the contact details field
phoneSimplesSettingSettings for the phone field
emailSimplesSettingSettings for the email field
companySimplesSettingSettings for the company field
addressSimplesSettingSettings for the address field
address1SimplesSettingSettings for the second address line field

CheckoutAppConfig

FieldTypeDescription
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
marketMarketInfoMarket information

CheckoutBusinessType

Checkout type: standard products, virtual products, or in-store pickup.

MemberValueDescription
STANDARD0Ordinary physical products
VIRTUAL_PRODUCT1Virtual products, which need no shipping
PICKUP2In-store pickup

CheckoutBusinessTypeChangeCb

export type CheckoutBusinessTypeChangeCb = (type: CheckoutBusinessType) => void;

CheckoutCustomerInfo

FieldTypeDescription
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

FieldTypeDescription
familystringFont family name
fallbackFamiliesstringFallback font families
stylestringFont style
weightstringFont weight
fontFacestringThe @font-face rule for this font

CheckoutIpAddress

FieldTypeDescription
countryCodestringCountry code
provinceNamestringProvince or state name
countryNamestringCountry name
citystringCity
ipstringIP address
FieldTypeDescription
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

FieldTypeDescription
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
alreadyPaymentLinesAlreadyPaymentLinesPayments already made
cancelReasonstring | nullCancellation reason
currencyCodestringCurrency code
currencySymbolstringCurrency symbol
discountApplicationsArray<DiscountApplication>Discounts applied to the order
lineItemsArray<LineItem>Order line items
shippingAddressShippingAddressShipping address
billingAddressBillingAddressBilling address
pickupLocation?PickupLocationPickup 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
pricesCheckoutPricesPrice 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
customerCustomerBuyer information
referInfoReferInfoReferrer information
paymentLine?PaymentLineThe 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
taxLinesTaxLinesTax breakdown
checkoutId?stringCheckout id
checkoutUrl?stringCheckout page URL
createTime?stringCreation time
identifierExtra?string
installmentFee?stringInstallment fee
orderKey?string
orderStatusUrl?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.

MemberValueDescription
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.

FieldTypeDescription
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

FieldTypeDescription
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
shippingCpfShippingCpfCPF field settings used for shipping
zipCheckV2string
zipCheckConfigV2Record<CountryCode, number>Postal code check setting per country or region
zipFormatCheckSwitchSettingWhether the postal code format is validated
doorplateFormatCheckSwitchSettingWhether 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
autoCompleteSwitchSettingWhether address autocomplete is on
autoCompleteCollapseMode?SwitchSettingWhether 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.

ValueDescription
'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.

FieldTypeDescription
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
checkoutHeadingFontfamilycheckoutFontfamilyFont of the headings
checkoutBodyFontfamilycheckoutFontfamilyFont of the body text
checkoutButtonFontfamilycheckoutFontfamilyFont 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?'' | CheckoutMenuPolicyLinkLink target of the first policy menu item
checkoutMenuPolicyLink2?'' | CheckoutMenuPolicyLinkLink target of the second policy menu item
checkoutMenuPolicyLink3?'' | CheckoutMenuPolicyLinkLink 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

ValueDescription
'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

FieldTypeDescription
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;

ContactDetailsSetting

ValueDescription
'single'One contact field is collected
'multiple'More than one contact field is collected

ContactInformation

FieldTypeDescription
emailstringEmail
phonestringPhone number
emailOrPhonestringValue of the combined email-or-phone field
phoneAreaCodestringPhone area code

ContactInformationChangeCb

export type ContactInformationChangeCb = (contactInformation: Partial<ContactInformation>) => void;

ContactSchemaConfig

FieldTypeDescription
type'address' | 'contact'Type of this item
showWhenOptional?booleanWhether the field is still shown when it is optional

ContactType

How contact details are collected: email only, phone only, or either one.

MemberValueDescription
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

FieldTypeDescription
cnNamestringChinese name
namestringCountry name
flagstringFlag
phoneCodestringPhone country code
phoneKeystringKey of the dialling code for this country or region
isoCode2stringTwo-letter country code

CouponAvailStatus

MemberValueDescription
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

FieldTypeDescription
pagenumberPage number
limitnumberPage size
dataCouponItem[]The coupons on this page
totalnumberTotal count

CouponItem

FieldTypeDescription
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

FieldTypeDescription
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
slugstring
clientSentryDsnstringSentry 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

FieldTypeDescription
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.

ValueDescription
'all'Anyone can check out
'login'Only signed-in buyers can check out

DayConfigOfPickupTime

FieldTypeDescription
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

FieldTypeDescription
iconTypestringWhich icon to use for this delivery method
checkoutBusinessTypeCheckoutBusinessTypeThe checkout type this delivery method belongs to
textstringDisplay text

DeliveryMethodListChangeCb

export type DeliveryMethodListChangeCb = (items: DeliveryMethodItem[]) => DeliveryMethodItem[];

DialogContent

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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

MemberValueDescription
DISCOUNT_CODE'discountCode'The code is a discount code
GIFT_CARD'giftCard'The code is a gift card

DiscountTypeEnum

MemberValueDescription
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

FieldTypeDescription
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

FieldTypeDescription
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 {
// One member per dynamic extension point template, listed in full on the extension points page
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.

FieldTypeDescription
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

ValueDescription
'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

FieldTypeDescription
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

FieldTypeDescription
codestringError code of the exception
message?stringError message of the exception
nextAction?NextActionWhat 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

FieldTypeDescription
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

FieldTypeDescription
extensionIdstringExtension id
contentstringThe HTML that gets rendered
pointstringThe extension point it renders at

ExtensionList

FieldTypeDescription
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 {
// One member per native module that can be hidden, listed in full in the checkout extension reference
shippingList = 'shippingList',
couponDrawer = 'couponDrawer',
// ...
}

FailPriceResult

FieldTypeDescription
datanullPayload of the result
messagestringError message
statestringState of the result, success when it worked

FieldFnValidate

FieldTypeDescription
idstringId of this validation rule
messagestringMessage shown when the check fails
validate(value)booleanReturns whether the value passes

FieldRegExpValidate

FieldTypeDescription
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

MemberValueDescription
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;

FormatShippingLineType

FieldTypeDescription
formatDiscountShippingPricestringDiscounted shipping cost with the currency symbol
formatShippingPricestringShipping cost with the currency symbol
isFreebooleanWhether shipping is free

GetAddressTemplateParams

FieldTypeDescription
countryCodestringCountry or region code
provinceCodestringProvince or state code

GiftCard

FieldTypeDescription
typeDiscountCodeTypeCode 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

FieldTypeDescription
disable?booleanWhether it is disabled
hideIcon?booleanWhether the icon is hidden

GiftCardTagsChangeCb

export type GiftCardTagsChangeCb = (tags: GiftCardTagItem[]) => void;

GiftCardTagsFilter

export type GiftCardTagsFilter = (tags: GiftCardTagItem[]) => GiftCardTagItem[];

HideExtensionTargetCb

export type HideExtensionTargetCb = () => void;

HttpCompleteResponse

FieldTypeDescription
statusnumberHTTP status code
statusTextstringHTTP status text
headersRecord<string, string>Request or response headers
dataPayloadBody of the response

HttpFailResponse

FieldTypeDescription
okfalseWhether the request succeeded

HttpSuccessResponse

FieldTypeDescription
oktrueWhether the request succeeded

IAddressBookItem

FieldTypeDescription
showEmailbooleanWhether the email is shown
showPhonebooleanWhether the phone number is shown

IdentificationConfig

FieldTypeDescription
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

FieldTypeDescription
show()Promise<boolean>Whether this item is shown
hide()voidCloses the dialog or drawer

IDrawer

FieldTypeDescription
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

FieldTypeDescription
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?NextActionWhat the page should do next
thirdPartyErrorDetails?ThirdPartyErrorDetailsError details returned by a third party

IExceptionCode

ValueDescription
'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.

FieldTypeDescription
phoneAreaCodestringInternational dialling code of the phone number
phonestringPhone number

InstructionType

How the order instructions box is shown: unfolded, folded or hidden.

MemberValueDescription
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

FieldTypeDescription
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

FieldTypeDescription
productTitlestringTitle of the product
image{ src: string; }Image of the product
optionsArray<{ name: string; value: string | number; }>The options available on this item

isShowCountries

FieldTypeDescription
[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

ValueDescription
'a'Follow an &lt;a&gt; 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

FieldTypeDescription
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

FieldTypeDescription
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

ValueDescription
'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

FieldTypeDescription
state'success' | stringState of the result, success when it worked
data?LineMutationResultDataPayload of the result
code?LineMutationErrorCode | stringError code when the change failed
message?stringError message

LineMutationResultData

FieldTypeDescription
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

FieldTypeDescription
globalLoadingbooleanWhether the whole page is loading

Locale

The language tags the checkout page supports.

ValueDescription
'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

FieldTypeDescription
'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

FieldTypeDescription
checkoutLogoImagestringLogo image of the checkout page
checkoutLogoSize'large' | 'medium' | 'small'Size preset of the logo
checkoutLogoPositionstringWhere the logo sits

MarketInfo

FieldTypeDescription
marketIdstringMarket id
marketPriceSettingMarketPriceSettingPrice settings for this market

MarketPriceSetting

FieldTypeDescription
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

MenuPolicyConfig

FieldTypeDescription
checkoutMenuPolicyLink1?'' | CheckoutMenuPolicyLinkLink target of the first policy menu item
checkoutMenuPolicyLink2?'' | CheckoutMenuPolicyLinkLink target of the second policy menu item
checkoutMenuPolicyLink3?'' | CheckoutMenuPolicyLinkLink 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

ValueDescription
'separate'First name and last name are two fields
'normal'The name is one single field
FieldTypeDescription
idCheckoutStepThe 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.

MemberValueDescription
NO_SUBSCRIPTION0Not subscribed to marketing email
SUBSCRIBED1Subscribed to marketing email

NextAction

FieldTypeDescription
redirectToUrl{ url: string; }The URL to send the buyer to
type'redirect_to_url'Type of this item

NmeRequirementSetting

ValueDescription
'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

FieldTypeDescription
sysCodeGroupstring | null
paymentKeystringKey identifying the payment method

OnPayFailedResult

FieldTypeDescription
handledbooleanWhether your callback has already handled the failure

OnStoreDataChangeCb

export type OnStoreDataChangeCb = () => void;

OnSubmitPendingChangeCallback

export type OnSubmitPendingChangeCallback = (val: Pending, change: Partial<Pending>) => void;

OptionValue

FieldTypeDescription
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.

FieldTypeDescription
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

FieldTypeDescription
currencyCodestringCheckout currency, for example USD
currencySymbolstringCurrency symbol, for example $
alreadyPaymentLinesAlreadyPaymentLinesPayments already made
failCodestring | nullFailure code, empty when nothing failed
idstringOrder id
statusOrderStatusOrder 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

FieldTypeDescription
data?OrderResultDataPayload of the response
statestringState of the result, success when it worked
errorsstring[]Error messages

OrderResultData

FieldTypeDescription
exceptNotificationExceptNotificationThe exception the platform is reporting
addressSettingsCheckoutAddressSettingsAddress form settings of the store
checkoutSettingsCheckoutSettingsCheckout settings of the store
customerInfoCheckoutCustomerInfoContact details the buyer entered
ipAddressCheckoutIpAddressIP address the order was placed from
orderCheckoutOrderThe order itself
paymentSettingsPaymentSettingsPayment settings of the store
showDetailsShowDetailsWhich blocks of the page are shown
stepCheckoutStepCheckout step this applies to

OrderStatus

Order status.

ValueDescription
'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

FieldTypeDescription
paymentKeystringKey identifying the payment method
iconstringIcon shown with this row

PaymentLine

FieldTypeDescription
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
publicKeyany
statusstringStatus
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

ValueDescription
'destroy'The previous payment line was torn down
'verificationError'Payment verification failed
'api'The payment lines came back from a request

PaymentResources

FieldTypeDescription
[key: string]CardsAny other key, keyed by name

PaymentSettings

FieldTypeDescription
supportChannelsstring[]Payment channels the store has turned on
paymentResourcesPaymentResourcesStatic resources the payment methods need
paymentIconResources?PaymentIconResource[]Icons of the available payment methods
paypalExpressEnabledstringWhether PayPal Express is turned on

PaymentUpdateParams

FieldTypeDescription
paymentLinePaymentLineThe 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?PaymentLinesSourceWhat 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

FieldTypeDescription
pricebooleanPrice API call in flight
shippingLinesbooleanShipping line list loading
paymentbooleanPayment script loading, not the payment method list
pickupLocationbooleanPickup location list loading

PhoneInfo

FieldTypeDescription
phonestringPhone number
phoneAreaCodestringInternational dialling code of the phone number

PickupInformationChangeCb

export type PickupInformationChangeCb = (pickupInformation?: string) => void;

PickupLocation

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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.

FieldTypeDescription
key?stringIdentifier of this breakdown row
dataRobot?string
title?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

FieldTypeDescription
keyPriceGroupDetailKeyGroup key
list?PriceDetail[]Price entries in this group
desc?stringDescription
descLangId?stringTranslation key of the description

PriceGroupDetailKey

ValueDescription
'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

FieldTypeDescription
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?DiscountTypeEnumKind 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

FieldTypeDescription
exceptNotificationExceptNotificationThe exception the platform is reporting
discountApplicationsCheckoutOrder['discountApplications']The individual discounts applied
lineItemsCheckoutOrder['lineItems']The line items of the order
pricesCheckoutPricesThe price breakdown of the order
shippingInfo{ requiresShipping: boolean; shippingLine: ShippingLineType; shippingLines: Array<ShippingLineType>; }Shipping method and whether shipping is needed
appliedGiftCardsArray<AppliedGiftCard>Gift cards applied to this order
alreadyPaymentLinesAlreadyPaymentLinesPayments already taken on this order
pickupLocationsPickupLocation[]The pickup locations available
pickupLocationPickupLocationThe pickup location chosen on the order
checkoutPriceList?PriceGroupDetail[]Grouped price breakdown
taxLines?TaxLinesThe taxes worked out for this order

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.

FieldTypeDescription
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

FieldTypeDescription
_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

FieldTypeDescription
typestringPrompt type
dataRobotstring
errorMessage?stringError message
localesstring[]Locales this message has text for

ReferInfo

FieldTypeDescription
clientIdstringClient id of the app
countrystringCountry
domainstringDomain
fbcstring
fbpstring
ipstringIP 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

RemoveLineItemsInput

FieldTypeDescription
lineItemIdsstring[]Ids of the line items to act on
mutationSourceMutationSourceA tag of your own naming what made this change

RenderParams

FieldTypeDescription
idstringUnique id of this item
extensionPointExtensionPointName of the extension point the content renders at
componentPromise<string> | stringHTML the extension renders, or a promise resolving to it

ReqConfig

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
[k: string]SchemaChangeValidateRuleValueAny other key, keyed by name

SchemaChangeValidateRuleCB

export type SchemaChangeValidateRuleCB = () => SchemaChangeValidateRule;

SchemaChangeValidateRuleValue

FieldTypeDescription
requiredtrueWhether the buyer must fill this in
validatesFieldValidate[]The validation rules that apply

SchemaItemVisibilityCb

export type SchemaItemVisibilityCb = () => Record<string, boolean>;

SchemaManagerConfig

FieldTypeDescription
focusIdPrefixstringPrefix put in front of every generated focus id

SchemaManagerConfigFn

FieldTypeDescription
getAddressVisible()booleanReturns whether the address form is currently visible
getCustomLabels?() => Record<string, string>Returns the labels the merchant customised, keyed by field id
getCustomValidateRules?() => SchemaChangeValidateRuleReturns 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

ValueDescription
'static'The option list is fixed
'dynamic'The option list is fetched as the buyer types

ShippingAddress

FieldTypeDescription
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

FieldTypeDescription
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
isShowCountriesisShowCountriesCountries or regions the CPF field is shown in

ShippingLinesErrorInfo

FieldTypeDescription
message?stringError message

ShippingLineType

FieldTypeDescription
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

ValueDescription
'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

FieldTypeDescription
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

FieldTypeDescription
isAddressAvailable?booleanWhether the address is usable

SimplesSetting

ValueDescription
'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

FieldTypeDescription
idstringUnique id of this item
rownumberRow this field sits in within the form grid

StaticExtensionPoint

enum StaticExtensionPoint {
// One member per static extension point, listed in full on the extension points page
PAGE_BEFORE = 'Checkout::RenderBefore',
MAIN_AFTER = 'Checkout::Main::RenderAfter',
// ...
}

StepChangeCb

export type StepChangeCb = () => void;

SubmitChangeCb

export type SubmitChangeCb = () => void;

SubmitError

FieldTypeDescription
codestringError code
messagestringError message

SubmitErrorChangeCbs

export type SubmitErrorChangeCbs = (tags: { code: string; message: string }) => void;

SubmitSuccessData

FieldTypeDescription
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.

FieldTypeDescription
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

FieldTypeDescription
dataPriceResultDataPayload of the result
messagestringMessage text
state'success'State of the result, success when it worked

Suggestion

FieldTypeDescription
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

FieldTypeDescription
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

ValueDescription
'idle'No search is running
'empty'The search finished with no results

SwitchSetting

ValueDescription
'disabled'Off
'enabled'On

SwitchShippingProtectionResult

FieldTypeDescription
successbooleanWhether the call worked
messagestringMessage text
dataanyPayload of the result

TaxLines

FieldTypeDescription
salesTaxLines?SaleTaxLine[]Sales tax breakdown

ThemeConfigChangeCb

export type ThemeConfigChangeCb = () => void;

ThemeStyleConfig

FieldTypeDescription
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
checkoutHeadingFontfamilycheckoutFontfamilyFont of the headings
checkoutBodyFontfamilycheckoutFontfamilyFont of the body text
checkoutButtonFontfamilycheckoutFontfamilyFont 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

FieldTypeDescription
productTotalPricenumberProduct total
isShowTippingbooleanWhether the tipping block is shown
isSupportTippingbooleanWhether tipping is supported
currencySymbolstringCurrency symbol
totalTipReceivedstringTip total

TippingOption

FieldTypeDescription
percentnumber | 'none' | 'custom'Percentage; none is no tip, custom is the amount the buyer types in
valuenumberAmount
formatValuestringAmount with the currency symbol

TipSchema

FieldTypeDescription
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.

FieldTypeDescription
dataPartial<AddressBookItem>Payload of the result
fillTypenumber

TrackGiftCardProps

ValueDescription
'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.

FieldTypeDescription
skipSetShippingAddress?booleanWhether the shipping address step is skipped

TrackTippingData

FieldTypeDescription
total?stringTip amount reported with the event
rate?numberTip rate the buyer picked
keyword?string

TrackTippingType

ValueDescription
'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

FieldTypeDescription
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.

FieldTypeDescription
price?PriceResultAmount of this row
order?OrderResultThe order itself

UpdateDataByPriceApiParams

The fields of PriceParams, all optional here: pass only the ones you want to change.

FieldTypeDescription
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?DiscountTypeEnumType 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.

FieldTypeDescription
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

FieldTypeDescription
updateUi?booleanWhether the validation result is shown on screen

ValidatePickupResultChangeCb

export type ValidatePickupResultChangeCb = (result: ValidateResult | undefined) => void;

ValidateResult

FieldTypeDescription
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

FieldTypeDescription
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

FieldTypeDescription
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;