@liquidcommerce/elements-sdk 2.6.0-beta.12 → 2.6.0-beta.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +100 -2518
  2. package/dist/index.checkout.esm.js +19988 -0
  3. package/dist/index.esm.js +27974 -20438
  4. package/dist/ssr-stub.checkout.esm.js +17 -0
  5. package/dist/ssr-stub.esm.js +275 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +51 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +16 -2
  9. package/dist/types/clients/builder.d.ts +3 -0
  10. package/dist/types/clients/checkout.d.ts +6 -0
  11. package/dist/types/clients/helpers.d.ts +8 -0
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +13 -18
  14. package/dist/types/constants/index.d.ts +1 -0
  15. package/dist/types/constants/prop65.constant.d.ts +8 -0
  16. package/dist/types/core/a11y/announcer.service.d.ts +16 -0
  17. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  18. package/dist/types/core/a11y/focusable.d.ts +5 -0
  19. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  20. package/dist/types/core/a11y/index.d.ts +6 -0
  21. package/dist/types/core/a11y/required.d.ts +1 -0
  22. package/dist/types/core/a11y/single-select.d.ts +20 -0
  23. package/dist/types/core/api/api-client.service.d.ts +22 -18
  24. package/dist/types/core/api/api-result.d.ts +19 -0
  25. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  26. package/dist/types/core/api/http-client.service.d.ts +0 -8
  27. package/dist/types/core/base-component.service.d.ts +4 -1
  28. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  29. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  30. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  31. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +75 -0
  32. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  33. package/dist/types/core/client/client-action.service.d.ts +6 -74
  34. package/dist/types/core/client/client-config.service.d.ts +10 -5
  35. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
  36. package/dist/types/core/google-tag-manager.service.d.ts +10 -1
  37. package/dist/types/core/logger/logger.service.d.ts +1 -1
  38. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  39. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +6 -1
  40. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +39 -49
  41. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +14 -7
  42. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  43. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  44. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  45. package/dist/types/core/store/interfaces/checkout.interface.d.ts +28 -107
  46. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  47. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  48. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  49. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  50. package/dist/types/core/store/store.constant.d.ts +5 -0
  51. package/dist/types/core/store/store.service.d.ts +1 -0
  52. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  53. package/dist/types/enums/core.enum.d.ts +45 -2
  54. package/dist/types/enums/index.d.ts +0 -1
  55. package/dist/types/index.checkout.d.ts +9 -0
  56. package/dist/types/index.checkout.umd.d.ts +4 -0
  57. package/dist/types/index.d.ts +8 -3
  58. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  59. package/dist/types/interfaces/api/checkout.interface.d.ts +246 -0
  60. package/dist/types/interfaces/api/index.d.ts +5 -0
  61. package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
  62. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  63. package/dist/types/interfaces/client.interface.d.ts +74 -0
  64. package/dist/types/interfaces/component.interface.d.ts +7 -0
  65. package/dist/types/interfaces/config.interface.d.ts +44 -0
  66. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  67. package/dist/types/interfaces/configs/cart.interface.d.ts +2 -1
  68. package/dist/types/interfaces/configs/checkout.interface.d.ts +3 -1
  69. package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
  70. package/dist/types/interfaces/configs/index.d.ts +1 -0
  71. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  72. package/dist/types/interfaces/configs/product.interface.d.ts +7 -1
  73. package/dist/types/interfaces/injection.interface.d.ts +56 -0
  74. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  75. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  76. package/dist/types/modules/address/address.command.d.ts +2 -1
  77. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  78. package/dist/types/modules/cart/cart.commands.d.ts +9 -5
  79. package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
  80. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +1 -1
  81. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  82. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  83. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  84. package/dist/types/modules/checkout/checkout.commands.d.ts +84 -12
  85. package/dist/types/modules/checkout/checkout.component.d.ts +6 -1
  86. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
  87. package/dist/types/modules/checkout/components/checkout-buyer.component.d.ts +1 -0
  88. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  89. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +1 -0
  90. package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +61 -0
  91. package/dist/types/modules/checkout/components/checkout-express-completion.component.d.ts +21 -0
  92. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  93. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  94. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  95. package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +3 -0
  96. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +6 -1
  97. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  98. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
  99. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  100. package/dist/types/modules/checkout/components/checkout-prop65-warning.component.d.ts +8 -0
  101. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
  102. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +7 -2
  103. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
  104. package/dist/types/modules/checkout/components/index.d.ts +3 -0
  105. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  106. package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
  107. package/dist/types/modules/checkout/constant.d.ts +5 -0
  108. package/dist/types/modules/checkout/customer-prefill.d.ts +5 -0
  109. package/dist/types/modules/checkout/express-wallet.d.ts +12 -0
  110. package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
  111. package/dist/types/modules/checkout/styles/express-checkout.style.d.ts +1 -0
  112. package/dist/types/modules/checkout/styles/express-completion.style.d.ts +1 -0
  113. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  114. package/dist/types/modules/product/components/components.d.ts +26 -2
  115. package/dist/types/modules/product/components/index.d.ts +1 -0
  116. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +8 -1
  117. package/dist/types/modules/product/components/product-delivery-estimate.component.d.ts +11 -0
  118. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  119. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  120. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  121. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  122. package/dist/types/modules/product/components/product-prop65-warning.d.ts +1 -0
  123. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
  124. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
  125. package/dist/types/modules/product/components/product-retailers-popup.component.d.ts +1 -0
  126. package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
  127. package/dist/types/modules/product/product.commands.d.ts +5 -5
  128. package/dist/types/modules/product/product.component.d.ts +3 -0
  129. package/dist/types/modules/product/styles/prop65-warning.style.d.ts +1 -0
  130. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  131. package/dist/types/modules/product-list/components/card-components/index.d.ts +6 -0
  132. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  133. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  134. package/dist/types/modules/product-list/components/card-components/product-fulfillment-text.d.ts +2 -0
  135. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  136. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  137. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  138. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  139. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  140. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +1 -0
  141. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  142. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  143. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  144. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +2 -1
  145. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  146. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  147. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  148. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +39 -31
  149. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  150. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
  151. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  152. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +54 -0
  153. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  154. package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
  155. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
  156. package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
  157. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  158. package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
  159. package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
  160. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  161. package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
  162. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  163. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  164. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  165. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  166. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  167. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  168. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  169. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  170. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  171. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  172. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  173. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  174. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +9 -1
  175. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  176. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  177. package/dist/types/modules/ui-components/input/input.component.d.ts +15 -2
  178. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  179. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  180. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  181. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  182. package/dist/types/ssr/stub.d.ts +10 -0
  183. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  184. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  185. package/dist/types/static/icon/check.icon.d.ts +2 -0
  186. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  187. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  188. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  189. package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
  190. package/dist/types/static/icon/close.icon.d.ts +1 -1
  191. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  192. package/dist/types/static/icon/filter.icon.d.ts +1 -1
  193. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  194. package/dist/types/static/icon/icon.types.d.ts +1 -0
  195. package/dist/types/static/icon/index.d.ts +2 -0
  196. package/dist/types/static/icon/info.icon.d.ts +1 -1
  197. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  198. package/dist/types/static/icon/search.icon.d.ts +1 -1
  199. package/dist/types/static/icon/success.icon.d.ts +1 -1
  200. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  201. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  202. package/dist/types/utils/dom-compat.d.ts +2 -0
  203. package/dist/types/utils/format.d.ts +9 -14
  204. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  205. package/dist/types/utils/product-selection.d.ts +16 -0
  206. package/dist/types/utils/product.d.ts +21 -0
  207. package/dist/types/utils/timezone.d.ts +6 -0
  208. package/docs/v1/README.md +213 -0
  209. package/docs/v1/api/actions/address-actions.md +286 -0
  210. package/docs/v1/api/actions/cart-actions.md +364 -0
  211. package/docs/v1/api/actions/checkout-actions.md +586 -0
  212. package/docs/v1/api/actions/product-actions.md +204 -0
  213. package/docs/v1/api/client.md +664 -0
  214. package/docs/v1/api/configuration.md +583 -0
  215. package/docs/v1/api/injection-methods.md +331 -0
  216. package/docs/v1/api/typescript-types.md +501 -0
  217. package/docs/v1/api/ui-helpers.md +200 -0
  218. package/docs/v1/examples/advanced-patterns.md +199 -0
  219. package/docs/v1/examples/checkout-flow.md +90 -0
  220. package/docs/v1/examples/custom-theming.md +76 -0
  221. package/docs/v1/examples/multi-product-page.md +90 -0
  222. package/docs/v1/examples/simple-product-page.md +89 -0
  223. package/docs/v1/getting-started/concepts.md +521 -0
  224. package/docs/v1/getting-started/installation.md +351 -0
  225. package/docs/v1/getting-started/quick-start.md +410 -0
  226. package/docs/v1/guides/accessibility.md +280 -0
  227. package/docs/v1/guides/address-component.md +435 -0
  228. package/docs/v1/guides/best-practices.md +365 -0
  229. package/docs/v1/guides/cart-component.md +800 -0
  230. package/docs/v1/guides/checkout-component.md +806 -0
  231. package/docs/v1/guides/events.md +988 -0
  232. package/docs/v1/guides/product-component.md +761 -0
  233. package/docs/v1/guides/product-list-component.md +730 -0
  234. package/docs/v1/guides/theming.md +243 -0
  235. package/docs/v1/integration/angular.md +39 -0
  236. package/docs/v1/integration/laravel.md +41 -0
  237. package/docs/v1/integration/nextjs.md +69 -0
  238. package/docs/v1/integration/proxy-setup.md +106 -0
  239. package/docs/v1/integration/react.md +64 -0
  240. package/docs/v1/integration/vanilla-js.md +84 -0
  241. package/docs/v1/integration/vue.md +58 -0
  242. package/docs/v1/reference/analytics.md +133 -0
  243. package/docs/v1/reference/browser-support.md +47 -0
  244. package/docs/v1/reference/error-handling.md +83 -0
  245. package/docs/v1/reference/performance.md +52 -0
  246. package/docs/v1/reference/telemetry.md +85 -0
  247. package/docs/v1/reference/troubleshooting.md +135 -0
  248. package/package.json +75 -45
  249. package/dist/types/elements-builder-client.d.ts +0 -2
  250. package/dist/types/elements-client-helper.d.ts +0 -4
  251. package/dist/types/elements-client.d.ts +0 -2
  252. package/dist/types/enums/cloud.enum.d.ts +0 -97
  253. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  254. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  255. package/dist/types/interfaces/cloud/index.d.ts +0 -3
  256. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  257. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  258. package/dist/types/interfaces/core.interface.d.ts +0 -111
  259. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  260. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  261. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  262. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  263. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  264. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  265. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  266. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  267. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  268. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  269. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  270. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  271. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  272. package/dist/types/utils/helper.d.ts +0 -28
  273. package/docs/ACTIONS.md +0 -1300
  274. package/docs/BROWSER_SUPPORT.md +0 -279
  275. package/docs/CONFIGURATION.md +0 -853
  276. package/docs/DOCUMENTATION_INDEX.md +0 -311
  277. package/docs/EVENTS.md +0 -798
  278. package/docs/PROXY.md +0 -228
  279. package/docs/THEMING.md +0 -592
  280. package/docs/TROUBLESHOOTING.md +0 -793
  281. package/umd/elements.js +0 -1
  282. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  283. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  284. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  285. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  286. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  287. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  288. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  289. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  290. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  291. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  292. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,806 @@
1
+ # Checkout Component
2
+
3
+ The Checkout component provides a complete purchase flow including customer information collection, payment processing, and order confirmation.
4
+
5
+ ## Overview
6
+
7
+ The Checkout component handles:
8
+ - Customer information (email, phone, address)
9
+ - Gift recipient details (optional)
10
+ - Payment processing (Stripe integration)
11
+ - Billing address
12
+ - Promo codes and gift cards
13
+ - Order summary and totals
14
+ - Marketing preferences
15
+ - Tip options
16
+ - Order confirmation
17
+
18
+ ## Basic Usage
19
+
20
+ ### Checkout Drawer (Default)
21
+
22
+ The checkout drawer opens automatically when users click "Checkout" from the cart. No additional setup required.
23
+
24
+ ### Hosted Checkout Page
25
+
26
+ For a full-page checkout experience, inject checkout into a dedicated container:
27
+
28
+ ```javascript
29
+ const client = await Elements('YOUR_API_KEY', { env: 'production' });
30
+
31
+ await client.injectCheckoutElement({
32
+ containerId: 'checkout-container',
33
+ checkoutId: 'optional_checkout_id', // Optional: load specific checkout
34
+ hideHeader: false // Optional: hide checkout header
35
+ });
36
+ ```
37
+
38
+ #### With URL Parameter
39
+
40
+ Configure checkout to load from URL parameter:
41
+
42
+ ```html
43
+ <script
44
+ defer
45
+ data-liquid-commerce-elements
46
+ data-token="YOUR_API_KEY"
47
+ data-env="production"
48
+ data-checkout-param="lce_checkout"
49
+ type="text/javascript"
50
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
51
+ ></script>
52
+
53
+ <div data-lce-checkout></div>
54
+ ```
55
+
56
+ Visit `https://yoursite.com/checkout?lce_checkout=checkout_abc123` to load that checkout.
57
+
58
+ ### Redirect to Custom Checkout Page
59
+
60
+ Configure the cart to redirect to your checkout page instead of opening the drawer:
61
+
62
+ ```javascript
63
+ const client = await Elements('YOUR_API_KEY', {
64
+ env: 'production',
65
+ checkout: {
66
+ pageUrl: 'https://yoursite.com/checkout?lce_checkout={token}'
67
+ }
68
+ });
69
+ ```
70
+
71
+ Or with data attributes:
72
+
73
+ ```html
74
+ <script
75
+ defer
76
+ data-liquid-commerce-elements
77
+ data-token="YOUR_API_KEY"
78
+ data-env="production"
79
+ data-checkout-url="https://yoursite.com/checkout?lce_checkout={token}"
80
+ type="text/javascript"
81
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
82
+ ></script>
83
+ ```
84
+
85
+ The `{token}` placeholder is replaced with the checkout token.
86
+
87
+ ## Checkout Actions
88
+
89
+ ### Open Checkout
90
+
91
+ ```javascript
92
+ window.LiquidCommerce.elements.actions.checkout.openCheckout();
93
+ ```
94
+
95
+ ### Close Checkout
96
+
97
+ ```javascript
98
+ window.LiquidCommerce.elements.actions.checkout.closeCheckout();
99
+ ```
100
+
101
+ ### Toggle Checkout
102
+
103
+ ```javascript
104
+ window.LiquidCommerce.elements.actions.checkout.toggleCheckout();
105
+ ```
106
+
107
+ ### Exit Checkout
108
+
109
+ Navigate away from checkout (requires `exitUrl` configuration):
110
+
111
+ ```javascript
112
+ window.LiquidCommerce.elements.actions.checkout.exitCheckout();
113
+ ```
114
+
115
+ Configure exit URL:
116
+
117
+ ```javascript
118
+ customTheme: {
119
+ checkout: {
120
+ layout: {
121
+ exitUrl: 'https://yoursite.com/shop'
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ ### Add Product to Checkout
128
+
129
+ Skip the cart and go directly to checkout:
130
+
131
+ ```javascript
132
+ await window.LiquidCommerce.elements.actions.checkout.addProduct([
133
+ {
134
+ identifier: '00619947000020',
135
+ fulfillmentType: 'shipping',
136
+ quantity: 1
137
+ }
138
+ ], true); // true = open checkout after adding
139
+ ```
140
+
141
+ ### Apply Promo Code
142
+
143
+ ```javascript
144
+ await window.LiquidCommerce.elements.actions.checkout.applyPromoCode('WELCOME10');
145
+ ```
146
+
147
+ ### Remove Promo Code
148
+
149
+ ```javascript
150
+ await window.LiquidCommerce.elements.actions.checkout.removePromoCode();
151
+ ```
152
+
153
+ ### Apply Gift Card
154
+
155
+ ```javascript
156
+ await window.LiquidCommerce.elements.actions.checkout.applyGiftCard('GIFT-1234-5678');
157
+ ```
158
+
159
+ ### Remove Gift Card
160
+
161
+ ```javascript
162
+ await window.LiquidCommerce.elements.actions.checkout.removeGiftCard('GIFT-1234-5678');
163
+ ```
164
+
165
+ ### Toggle Gift Mode
166
+
167
+ Enable/disable "Send as Gift" mode:
168
+
169
+ ```javascript
170
+ // Enable gift mode
171
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(true);
172
+
173
+ // Disable gift mode
174
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(false);
175
+
176
+ // Toggle current state
177
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift();
178
+ ```
179
+
180
+ ### Toggle Billing Same As Shipping
181
+
182
+ ```javascript
183
+ // Use shipping address for billing
184
+ await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(true);
185
+
186
+ // Use different billing address
187
+ await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(false);
188
+ ```
189
+
190
+ ### Toggle Marketing Preferences
191
+
192
+ ```javascript
193
+ // Opt into email marketing
194
+ await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canEmail', true);
195
+
196
+ // Opt into SMS marketing
197
+ await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canSms', true);
198
+ ```
199
+
200
+ ### Update Customer Information
201
+
202
+ Pre-fill customer information:
203
+
204
+ ```javascript
205
+ window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
206
+ firstName: 'John',
207
+ lastName: 'Doe',
208
+ email: 'john@example.com',
209
+ phone: '+15551234567',
210
+ birthDate: '1990-01-15',
211
+ addressTwo: 'Apt 4',
212
+ company: 'Acme Corp'
213
+ });
214
+ ```
215
+
216
+ **Available fields:**
217
+ - `firstName`, `lastName`
218
+ - `email`, `phone`
219
+ - `birthDate`, `addressTwo`
220
+ - `company`
221
+
222
+ ### Update Gift Information
223
+
224
+ Pre-fill gift recipient information:
225
+
226
+ ```javascript
227
+ window.LiquidCommerce.elements.actions.checkout.updateGiftInfo({
228
+ firstName: 'Jane',
229
+ lastName: 'Smith',
230
+ email: 'jane@example.com',
231
+ phone: '+15559876543',
232
+ message: 'Happy Birthday!',
233
+ addressTwo: 'Suite 5B'
234
+ });
235
+ ```
236
+
237
+ **Available fields:**
238
+ - `firstName`, `lastName`
239
+ - `email`, `phone`
240
+ - `message`
241
+ - `addressTwo`
242
+
243
+ ### Update Billing Information
244
+
245
+ Pre-fill billing address:
246
+
247
+ ```javascript
248
+ window.LiquidCommerce.elements.actions.checkout.updateBillingInfo({
249
+ firstName: 'John',
250
+ lastName: 'Doe',
251
+ email: 'john@example.com',
252
+ phone: '+15551234567',
253
+ addressOne: '789 Elm St',
254
+ addressTwo: 'Floor 2',
255
+ city: 'Chicago',
256
+ state: 'IL',
257
+ zipCode: '60601'
258
+ });
259
+ ```
260
+
261
+ **Available fields:**
262
+ - `firstName`, `lastName`
263
+ - `email`, `phone`, `company`
264
+ - `addressOne`, `addressTwo`
265
+ - `city`, `state`, `zipCode`
266
+
267
+ ### Get Checkout Details
268
+
269
+ ```javascript
270
+ const checkoutData = window.LiquidCommerce.elements.actions.checkout.getDetails();
271
+
272
+ console.log(checkoutData);
273
+ // {
274
+ // token: 'abc123xyz',
275
+ // cartId: 'cart_abc123',
276
+ // items: { 'cart_item_id': { ... } },
277
+ // amounts: {
278
+ // subtotal: 9998,
279
+ // tax: 800,
280
+ // shipping: 500,
281
+ // tip: 200,
282
+ // total: 11498
283
+ // },
284
+ // isGift: false,
285
+ // ...
286
+ // }
287
+ ```
288
+
289
+ ## Events
290
+
291
+ ### Checkout Lifecycle
292
+
293
+ ```javascript
294
+ window.addEventListener('lce:actions.checkout_loaded', (event) => {
295
+ console.log('Checkout loaded');
296
+ });
297
+
298
+ window.addEventListener('lce:actions.checkout_opened', (event) => {
299
+ console.log('Checkout opened');
300
+ });
301
+
302
+ window.addEventListener('lce:actions.checkout_closed', (event) => {
303
+ console.log('Checkout closed');
304
+ });
305
+
306
+ window.addEventListener('lce:actions.checkout_failed', (event) => {
307
+ console.error('Checkout failed:', event.detail.data.message);
308
+ });
309
+ ```
310
+
311
+ ### Customer Information
312
+
313
+ ```javascript
314
+ window.addEventListener('lce:actions.checkout_customer_information_updated', (event) => {
315
+ const { cartId } = event.detail.data;
316
+ console.log('Customer info updated for cart:', cartId);
317
+ });
318
+ ```
319
+
320
+ ### Gift Information
321
+
322
+ ```javascript
323
+ window.addEventListener('lce:actions.checkout_is_gift_toggled', (event) => {
324
+ const { isActive } = event.detail.data;
325
+ console.log('Gift mode:', isActive ? 'enabled' : 'disabled');
326
+ });
327
+
328
+ window.addEventListener('lce:actions.checkout_gift_information_updated', (event) => {
329
+ console.log('Gift recipient updated');
330
+ });
331
+ ```
332
+
333
+ ### Billing Information
334
+
335
+ ```javascript
336
+ window.addEventListener('lce:actions.checkout_billing_same_as_shipping_toggled', (event) => {
337
+ const { isActive } = event.detail.data;
338
+ console.log('Billing same as shipping:', isActive);
339
+ });
340
+
341
+ window.addEventListener('lce:actions.checkout_billing_information_updated', (event) => {
342
+ console.log('Billing address updated');
343
+ });
344
+ ```
345
+
346
+ ### Marketing Preferences
347
+
348
+ ```javascript
349
+ window.addEventListener('lce:actions.checkout_marketing_preferences_toggled', (event) => {
350
+ const { fieldName, isActive } = event.detail.data;
351
+ console.log(`Marketing ${fieldName}:`, isActive);
352
+ });
353
+ ```
354
+
355
+ ### Items Management
356
+
357
+ ```javascript
358
+ window.addEventListener('lce:actions.checkout_item_removed', (event) => {
359
+ const { cartItemId } = event.detail.data;
360
+ console.log('Item removed:', cartItemId);
361
+ });
362
+
363
+ window.addEventListener('lce:actions.checkout_item_quantity_increase', (event) => {
364
+ const { cartItemId, quantity } = event.detail.data;
365
+ console.log(`Item ${cartItemId} quantity: ${quantity}`);
366
+ });
367
+
368
+ window.addEventListener('lce:actions.checkout_item_quantity_decrease', (event) => {
369
+ const { cartItemId, quantity } = event.detail.data;
370
+ console.log(`Item ${cartItemId} quantity: ${quantity}`);
371
+ });
372
+ ```
373
+
374
+ ### Tips
375
+
376
+ ```javascript
377
+ window.addEventListener('lce:actions.checkout_tip_updated', (event) => {
378
+ const { deliveryTips } = event.detail.data;
379
+ const total = deliveryTips.reduce((sum, t) => sum + t.tip, 0);
380
+ console.log('Tip amount:', total / 100);
381
+ });
382
+ ```
383
+
384
+ ### Payment & Submission
385
+
386
+ ```javascript
387
+ window.addEventListener('lce:actions.checkout_submit_started', (event) => {
388
+ console.log('Processing payment...');
389
+ // Show loading state
390
+ });
391
+
392
+ window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
393
+ const { orderNumber } = event.detail.data;
394
+ console.log('Order completed:', orderNumber);
395
+ // Redirect to confirmation page
396
+ });
397
+
398
+ window.addEventListener('lce:actions.checkout_submit_failed', (event) => {
399
+ const { message } = event.detail.data;
400
+ console.error('Payment failed:', message);
401
+ // Show error message
402
+ });
403
+ ```
404
+
405
+ ### Express Checkout
406
+
407
+ ```javascript
408
+ // Wallet availability settled or changed (always fires at least once per block)
409
+ window.addEventListener('lce:actions.checkout_express_checkout_availability', (event) => {
410
+ const { data } = event.detail;
411
+ console.log(data.available ? `Wallets: ${data.wallets.join(', ')}` : 'No wallets available');
412
+ });
413
+ ```
414
+
415
+ ### Promo Codes
416
+
417
+ ```javascript
418
+ window.addEventListener('lce:actions.checkout_promo_code_applied', (event) => {
419
+ const { discount, newTotal } = event.detail.data;
420
+ console.log(`Promo applied: $${discount / 100} off`);
421
+ });
422
+
423
+ window.addEventListener('lce:actions.checkout_promo_code_removed', (event) => {
424
+ console.log('Promo code removed');
425
+ });
426
+
427
+ window.addEventListener('lce:actions.checkout_promo_code_failed', (event) => {
428
+ const { error } = event.detail.data;
429
+ console.error('Promo code failed:', error);
430
+ });
431
+ ```
432
+
433
+ ### Gift Cards
434
+
435
+ ```javascript
436
+ window.addEventListener('lce:actions.checkout_gift_card_applied', (event) => {
437
+ const { newTotal } = event.detail.data;
438
+ console.log('Gift card applied, new total:', newTotal / 100);
439
+ });
440
+
441
+ window.addEventListener('lce:actions.checkout_gift_card_removed', (event) => {
442
+ console.log('Gift card removed');
443
+ });
444
+
445
+ window.addEventListener('lce:actions.checkout_gift_card_failed', (event) => {
446
+ const { error } = event.detail.data;
447
+ console.error('Gift card failed:', error);
448
+ });
449
+ ```
450
+
451
+ ### Product Add to Checkout
452
+
453
+ ```javascript
454
+ window.addEventListener('lce:actions.checkout_product_add_success', (event) => {
455
+ const { itemsAdded, identifiers } = event.detail.data;
456
+ console.log(`Added ${itemsAdded} items to checkout`);
457
+ });
458
+
459
+ window.addEventListener('lce:actions.checkout_product_add_failed', (event) => {
460
+ const { error } = event.detail.data;
461
+ console.error('Failed to add to checkout:', error);
462
+ });
463
+ ```
464
+
465
+ ## California Proposition 65 Warning
466
+
467
+ When the shipping address is in California, the order summary shows a panel directly above the
468
+ place-order button reading **Adult signature (21+) required at delivery.** followed by
469
+ **CA WARNING · California Proposition 65 information for these products**, so the warning is
470
+ presented before the purchase completes. The text links to the OEHHA alcohol page,
471
+ [www.P65Warnings.ca.gov/alcohol](https://www.p65warnings.ca.gov/alcohol), in a new tab. The full
472
+ 27 CCR § 25607.4 text is on the product element.
473
+
474
+ The panel appears in the drawer checkout, the hosted checkout and the checkout-only build. The
475
+ whole panel, adult-signature notice included, is shown only for a California shipping address; it
476
+ appears or disappears when the address changes, and nothing renders in its place otherwise. Neither can be turned off or reworded by configuration. Its colours follow `global.layout.poweredByMode` — the same
477
+ light/dark switch the Stripe payment form uses — as a fixed pair so the copy is always legible:
478
+ `light` is `#18181B` on `#F5F3EE`, `dark` is `#F5F3EE` on `#2A2824`. The font and corner radius come
479
+ from your theme. If your checkout is dark, set `poweredByMode: 'dark'`.
480
+
481
+ ## Customization
482
+
483
+ ### Theme Configuration
484
+
485
+ ```javascript
486
+ const client = await Elements('YOUR_API_KEY', {
487
+ env: 'production',
488
+ customTheme: {
489
+ checkout: {
490
+ theme: {
491
+ backgroundColor: '#ffffff'
492
+ },
493
+ layout: {
494
+ allowGiftCards: true,
495
+ exitUrl: 'https://yoursite.com/shop',
496
+ continueShoppingUrl: 'https://yoursite.com/shop',
497
+ drawerHeaderText: 'Checkout',
498
+ placeOrderButtonText: 'Complete Purchase'
499
+ }
500
+ }
501
+ }
502
+ });
503
+ ```
504
+
505
+ ## Payment Integration
506
+
507
+ The SDK uses Stripe for payment processing. Payment form is embedded and handles:
508
+ - Credit/debit cards
509
+ - PCI compliance
510
+ - 3D Secure authentication
511
+
512
+ No additional Stripe integration code needed - it's built-in.
513
+
514
+ ### Express checkout (Apple Pay and Google Pay)
515
+
516
+ Apple Pay and Google Pay are offered as express checkout buttons at the top of the checkout, above
517
+ the gift toggle. Tapping one collects the shopper's contact and billing details from the wallet and
518
+ places the order without them completing the checkout forms.
519
+
520
+ Express checkout is offered to every shopper whose platform can show a wallet. Each wallet is
521
+ requested with Stripe's `always` policy, so the button renders wherever the device supports it rather
522
+ than only where Stripe judges it good for conversion. The block hides itself entirely — heading,
523
+ buttons and divider — in four cases: the device or browser offers no wallet, the order is a
524
+ gift, a payment method is already bound to the checkout, or Stripe.js fails to load. Subscribe to
525
+ [`lce:actions.checkout_express_checkout_availability`](./events.md) to know which state you are in.
526
+
527
+ Two things are required outside the SDK:
528
+
529
+ - **The page must be served over HTTPS.** Stripe requires this in development as well as production;
530
+ the wallet buttons do not render on a plain-HTTP page.
531
+ - **Every domain that serves the buttons must be registered with Stripe** for the account issuing the
532
+ publishable key, in both sandbox and live mode. Stripe requires this for Apple Pay and Google Pay
533
+ alike, and it covers subdomains: `shop.example.com` is registered separately from `example.com`.
534
+ Registering in live mode registers the sandbox too. This applies per partner domain.
535
+
536
+ Approving the wallet sheet hands the order to the **express completion view**, which replaces the
537
+ checkout form the moment the sheet closes. The view saves the shopper's name, email and phone from
538
+ the wallet as the checkout's customer and binds the approved payment method; the wallet's billing
539
+ address goes to Stripe with that payment method, and the order's own billing address stays the one
540
+ the checkout already holds. Then it asks for the one thing no wallet returns — the shopper's **date
541
+ of birth** — with the same 21+ validation as the form, and places the order from its **Complete
542
+ order** button. A date the shopper already typed into the form is used instead, and the view goes
543
+ straight to placing the order. When the partner has turned off **Require date of birth** in the
544
+ builder (`checkout.layout.requireBirthDate: false`), the view skips the step and places the order as
545
+ soon as the payment method is bound. A shopper can step **back to checkout** from the view; the
546
+ payment method stays bound, and the form asks for the date of birth itself when one is required.
547
+
548
+ If the wallet sheet itself fails — a declined authorisation, or a total that changed while it was
549
+ open — the sheet reports the reason and nothing is handed on. Anything that fails after the sheet
550
+ has closed is reported on the view, with a retry. The order is placed only for the checkout and the
551
+ total the sheet was opened for: the server verifies both against the wallet's intent at completion,
552
+ so a total that moved in between is refused there as well and the shopper approves again.
553
+
554
+ The wallet tap is also refused, with nothing charged, when a cart is below a retailer's minimum
555
+ purchase amount — the same condition that keeps the Place Order button disabled. Presale checkouts
556
+ are exempt from it, as they are there.
557
+
558
+ Express checkout is not offered on a gift order: a gift needs the recipient's name, email, phone and
559
+ message, and no wallet returns any of them. Turning on "Send as a gift" hides the block, and turning
560
+ it back off restores it.
561
+
562
+ The buttons are not confined to the checkout element. Inject them anywhere on the page with
563
+ `injectExpressCheckoutElement()` on the full client, or `injectExpressCheckout()` on the
564
+ checkout-only client.
565
+
566
+ ## Checkout Flow
567
+
568
+ ### Standard Flow
569
+
570
+ 1. Customer opens checkout (from cart or direct)
571
+ 2. Reviews order summary
572
+ 3. Enters shipping information
573
+ 4. Enters payment information
574
+ 5. Optionally enters billing address
575
+ 6. Reviews total (with promo codes, gift cards, tips)
576
+ 7. Places order
577
+ 8. Sees order confirmation
578
+
579
+ ### Gift Flow
580
+
581
+ 1. Customer enables "Send as Gift"
582
+ 2. Enters their billing/payment information
583
+ 3. Enters recipient's shipping information
584
+ 4. Adds gift message (optional)
585
+ 5. Places order
586
+ 6. Confirmation shows gift delivery details
587
+
588
+ ## Presale Products
589
+
590
+ Checkouts with presale items show:
591
+ - Countdown timer for presale expiration
592
+ - Expected delivery date
593
+ - Special handling for presale orders
594
+
595
+ When presale expires:
596
+ - Shows expiration notice
597
+ - Disables checkout submission
598
+
599
+ ## Best Practices
600
+
601
+ ### Pre-fill Known Information
602
+
603
+ If you have customer data, pre-fill it:
604
+
605
+ ```javascript
606
+ // After user logs in
607
+ if (userIsLoggedIn) {
608
+ window.addEventListener('lce:actions.checkout_opened', () => {
609
+ window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
610
+ firstName: currentUser.firstName,
611
+ lastName: currentUser.lastName,
612
+ email: currentUser.email,
613
+ phone: currentUser.phone
614
+ });
615
+ });
616
+ }
617
+ ```
618
+
619
+ ### Track Conversion Funnel
620
+
621
+ ```javascript
622
+ const checkoutFunnel = {
623
+ loaded: false,
624
+ infoEntered: false,
625
+ paymentEntered: false,
626
+ submitted: false
627
+ };
628
+
629
+ window.addEventListener('lce:actions.checkout_loaded', () => {
630
+ checkoutFunnel.loaded = true;
631
+ gtag('event', 'begin_checkout');
632
+ });
633
+
634
+ window.addEventListener('lce:actions.checkout_customer_information_updated', () => {
635
+ if (!checkoutFunnel.infoEntered) {
636
+ checkoutFunnel.infoEntered = true;
637
+ gtag('event', 'checkout_progress', { step: 'customer_info' });
638
+ }
639
+ });
640
+
641
+ window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
642
+ gtag('event', 'purchase', {
643
+ transaction_id: event.detail.data.orderNumber,
644
+ value: event.detail.data.orderTotal / 100,
645
+ currency: 'USD'
646
+ });
647
+ });
648
+ ```
649
+
650
+ ### Handle Submission States
651
+
652
+ ```javascript
653
+ window.addEventListener('lce:actions.checkout_submit_started', () => {
654
+ // Disable navigation
655
+ window.onbeforeunload = () => 'Payment in progress...';
656
+
657
+ // Show loading overlay
658
+ showGlobalLoadingOverlay('Processing your order...');
659
+ });
660
+
661
+ window.addEventListener('lce:actions.checkout_submit_completed', () => {
662
+ // Re-enable navigation
663
+ window.onbeforeunload = null;
664
+
665
+ // Redirect to confirmation
666
+ window.location.href = '/order-confirmation';
667
+ });
668
+
669
+ window.addEventListener('lce:actions.checkout_submit_failed', () => {
670
+ // Re-enable navigation
671
+ window.onbeforeunload = null;
672
+
673
+ // Hide loading
674
+ hideGlobalLoadingOverlay();
675
+ });
676
+ ```
677
+
678
+ ## Configuration Options
679
+
680
+ ### Enable/Disable Features
681
+
682
+ ```javascript
683
+ checkout: {
684
+ layout: {
685
+ allowGiftCards: true, // Show gift card input
686
+ requireBirthDate: true, // Require a date of birth to place an order
687
+ emailOptIn: {
688
+ show: true, // Show email opt-in checkbox
689
+ checked: false, // Default unchecked
690
+ text: 'Subscribe to our newsletter'
691
+ },
692
+ smsOptIn: {
693
+ show: false, // Hide SMS opt-in checkbox
694
+ checked: false, // Default unchecked
695
+ text: 'Receive SMS updates'
696
+ }
697
+ }
698
+ }
699
+ ```
700
+
701
+ ### Button Text
702
+
703
+ ```javascript
704
+ checkout: {
705
+ layout: {
706
+ placeOrderButtonText: 'Complete Purchase'
707
+ }
708
+ }
709
+ ```
710
+
711
+ ## Troubleshooting
712
+
713
+ ### Checkout Not Opening
714
+
715
+ 1. Verify cart has items: `window.LiquidCommerce.elements.actions.cart.getDetails()`
716
+ 2. Check for JavaScript errors in console
717
+ 3. Ensure SDK is initialized: `window.LiquidCommerce.elements`
718
+ 4. Try manually: `window.LiquidCommerce.elements.actions.checkout.openCheckout()`
719
+
720
+ ### Payment Form Not Loading
721
+
722
+ 1. Check internet connection (Stripe requires network)
723
+ 2. Verify Stripe is not blocked by ad blockers
724
+ 3. Check browser console for Stripe errors
725
+ 4. Ensure your API key is valid
726
+
727
+ ### Customer Info Not Pre-filling
728
+
729
+ 1. Verify you're calling `updateCustomerInfo()` after checkout loads
730
+ 2. Check field names match exactly (case-sensitive)
731
+ 3. Ensure values are strings, not other types
732
+ 4. Listen for checkout_opened event before updating
733
+
734
+ ### Order Submission Failing
735
+
736
+ 1. Check all required fields are filled
737
+ 2. Verify payment information is valid
738
+ 3. Look for validation errors in UI
739
+ 4. Check console for detailed error messages
740
+ 5. Ensure products are still available
741
+
742
+ ## See Also
743
+
744
+ - [Cart Component](./cart-component.md) - Shopping cart functionality
745
+ - [Actions API](../api/actions/checkout-actions.md) - Checkout actions reference
746
+ - [Events](./events.md) - All available events
747
+ - [Theming](./theming.md) - Customize appearance
748
+
749
+ ### Preparing complete account delivery details
750
+
751
+ After `lce:actions.checkout_loaded`, call
752
+ `await elements.actions.checkout.updateCustomerInfo(fields, { saveIfValid: true })`
753
+ to validate and prepare complete account details, then show their editable summary.
754
+ Supply names, email, a US phone number, and a real `birthDate` in `MM/DD/YYYY` format
755
+ (age 21+, year 1930 or later). The `birthDate` may be blank when the partner does not require a
756
+ date of birth (`checkout.layout.requireBirthDate: false`); a supplied one is still validated.
757
+ A shipping street must already be selected.
758
+ Omitted apartment and delivery instructions retain their existing checkout values.
759
+ Partial or invalid details stay in the form; backend validation failures reject the
760
+ promise, show the checkout error, and keep details editable. The host should handle that rejection.
761
+
762
+ The option skips gifts, saved forms, in-flight saves, and customer forms the shopper
763
+ has edited during the current checkout. It does not overwrite those forms. Edits or
764
+ address/checkout changes during preparation prevent a stale response from closing
765
+ the form. Without the option, this action only prefills fields, as before.
766
+
767
+ Apple Pay and Google Pay selection displays **Continue with Apple Pay** or
768
+ **Continue with Google Pay**. This opens the wallet to save a payment method; the
769
+ shopper still reviews and places the order afterward. It is not express checkout.
770
+
771
+ After wallet cancellation, the same Continue action remains available. If authorization
772
+ succeeded but saving the method failed, **Retry saving Apple Pay/Google Pay** reuses
773
+ the existing authorization rather than opening the wallet again.
774
+
775
+ ### Saved account marketing preferences
776
+
777
+ ```ts
778
+ setSavedMarketingPreferences(preferences: { canEmail?: boolean; canSms?: boolean }): Promise<void>
779
+ clearSavedMarketingPreferences(): void
780
+ ```
781
+
782
+ Call `actions.checkout.setSavedMarketingPreferences()` with known recorded account
783
+ choices, including `false`, before checkout loads. Only boolean values are used;
784
+ missing/null/unrecognized values remain unknown. The first checkout prepare uses
785
+ saved values instead of tenant defaults. Each channel's prompt is hidden only
786
+ after the server confirms that saved choice. Unknown channels retain their normal
787
+ checkout prompts. The actions are available in both full and checkout-only clients.
788
+
789
+ Calling the setter during an active checkout prepares untouched channels and
790
+ preserves shopper checkbox edits. Backend failure rejects the promise, displays
791
+ an error, and leaves prompts available; the host should catch the rejection.
792
+ The same call can retry. Applying values does not call a subscription service.
793
+ It supplies the account's recorded choices to this checkout.
794
+
795
+ Saved choices persist across cart resets in the same SDK session. Call
796
+ `clearSavedMarketingPreferences()` on sign-out, account change, and host cleanup.
797
+ Clearing reveals the prompts and restores configured guest defaults. It invalidates
798
+ stale responses while draining outstanding preference requests; checkout completion
799
+ prepares the current choices before submitting the checkout token. A load already
800
+ in progress still finishes and reconciles the current account's values. Bind a new
801
+ account only to its own checkout; the host remains responsible for account/cart
802
+ ownership and for reloading checkout when identity changes.
803
+
804
+ Order completion waits for queued preference work. It cannot race a late saved
805
+ opt-out or proceed with an unconfirmed saved choice. If applying a known choice
806
+ fails, the shopper can retry or explicitly choose the visible channel preference.