@liquidcommerce/elements-sdk 2.6.0-beta.11 → 2.6.0-beta.111

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 (270) hide show
  1. package/README.md +99 -2518
  2. package/dist/index.checkout.esm.js +18212 -0
  3. package/dist/index.esm.js +26222 -20637
  4. package/dist/ssr-stub.checkout.esm.js +17 -0
  5. package/dist/ssr-stub.esm.js +269 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -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/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
  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/core/a11y/announcer.service.d.ts +16 -0
  15. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  16. package/dist/types/core/a11y/focusable.d.ts +5 -0
  17. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  18. package/dist/types/core/a11y/index.d.ts +6 -0
  19. package/dist/types/core/a11y/required.d.ts +1 -0
  20. package/dist/types/core/a11y/single-select.d.ts +20 -0
  21. package/dist/types/core/api/api-client.service.d.ts +19 -18
  22. package/dist/types/core/api/api-result.d.ts +19 -0
  23. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  24. package/dist/types/core/api/http-client.service.d.ts +0 -8
  25. package/dist/types/core/base-component.service.d.ts +4 -1
  26. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  27. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  28. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  29. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
  30. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  31. package/dist/types/core/client/client-action.service.d.ts +6 -74
  32. package/dist/types/core/client/client-config.service.d.ts +8 -5
  33. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
  34. package/dist/types/core/google-tag-manager.service.d.ts +3 -1
  35. package/dist/types/core/logger/logger.service.d.ts +1 -1
  36. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  37. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
  38. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
  39. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  40. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  41. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  42. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  43. package/dist/types/core/store/interfaces/checkout.interface.d.ts +19 -108
  44. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  45. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  46. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  47. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  48. package/dist/types/core/store/store.constant.d.ts +5 -0
  49. package/dist/types/core/store/store.service.d.ts +1 -0
  50. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  51. package/dist/types/enums/core.enum.d.ts +39 -2
  52. package/dist/types/enums/index.d.ts +0 -1
  53. package/dist/types/index.checkout.d.ts +8 -0
  54. package/dist/types/index.checkout.umd.d.ts +4 -0
  55. package/dist/types/index.d.ts +8 -3
  56. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  57. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  58. package/dist/types/interfaces/api/index.d.ts +5 -0
  59. package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
  60. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  61. package/dist/types/interfaces/client.interface.d.ts +72 -0
  62. package/dist/types/interfaces/component.interface.d.ts +7 -0
  63. package/dist/types/interfaces/config.interface.d.ts +40 -0
  64. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  65. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  66. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  67. package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
  68. package/dist/types/interfaces/configs/index.d.ts +1 -0
  69. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  70. package/dist/types/interfaces/configs/product.interface.d.ts +5 -1
  71. package/dist/types/interfaces/injection.interface.d.ts +50 -0
  72. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  73. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  74. package/dist/types/modules/address/address.command.d.ts +2 -1
  75. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  76. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  77. package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
  78. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  79. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  80. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  81. package/dist/types/modules/checkout/checkout.commands.d.ts +34 -11
  82. package/dist/types/modules/checkout/checkout.component.d.ts +6 -1
  83. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
  84. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  85. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  86. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  87. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  88. package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +2 -0
  89. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
  90. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  91. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
  92. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  93. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
  94. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +4 -2
  95. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
  96. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  97. package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
  98. package/dist/types/modules/checkout/constant.d.ts +3 -0
  99. package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
  100. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  101. package/dist/types/modules/product/components/components.d.ts +26 -2
  102. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
  103. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  104. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  105. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  106. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  107. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
  108. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
  109. package/dist/types/modules/product/product.commands.d.ts +5 -5
  110. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  111. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  112. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  113. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  114. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  115. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  116. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  117. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  118. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  119. 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
  120. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  121. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  122. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  123. 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
  124. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  125. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  126. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  127. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +37 -31
  128. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  129. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
  130. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  131. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
  132. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  133. package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
  134. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
  135. package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
  136. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  137. package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
  138. package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
  139. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  140. package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
  141. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  142. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  143. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  144. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  145. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  146. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  147. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  148. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  149. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  150. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  151. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  152. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  153. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
  154. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  155. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  156. package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
  157. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  158. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  159. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  160. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  161. package/dist/types/ssr/stub.d.ts +10 -0
  162. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  163. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  164. package/dist/types/static/icon/check.icon.d.ts +2 -0
  165. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  166. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  167. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  168. package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
  169. package/dist/types/static/icon/close.icon.d.ts +1 -1
  170. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  171. package/dist/types/static/icon/filter.icon.d.ts +1 -1
  172. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  173. package/dist/types/static/icon/icon.types.d.ts +1 -0
  174. package/dist/types/static/icon/index.d.ts +2 -0
  175. package/dist/types/static/icon/info.icon.d.ts +1 -1
  176. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  177. package/dist/types/static/icon/search.icon.d.ts +1 -1
  178. package/dist/types/static/icon/success.icon.d.ts +1 -1
  179. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  180. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  181. package/dist/types/utils/dom-compat.d.ts +2 -0
  182. package/dist/types/utils/format.d.ts +5 -14
  183. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  184. package/dist/types/utils/product-selection.d.ts +16 -0
  185. package/dist/types/utils/product.d.ts +18 -0
  186. package/dist/types/utils/timezone.d.ts +6 -0
  187. package/docs/v1/README.md +213 -0
  188. package/docs/v1/api/actions/address-actions.md +286 -0
  189. package/docs/v1/api/actions/cart-actions.md +364 -0
  190. package/docs/v1/api/actions/checkout-actions.md +527 -0
  191. package/docs/v1/api/actions/product-actions.md +204 -0
  192. package/docs/v1/api/client.md +596 -0
  193. package/docs/v1/api/configuration.md +557 -0
  194. package/docs/v1/api/injection-methods.md +331 -0
  195. package/docs/v1/api/typescript-types.md +424 -0
  196. package/docs/v1/api/ui-helpers.md +200 -0
  197. package/docs/v1/examples/advanced-patterns.md +199 -0
  198. package/docs/v1/examples/checkout-flow.md +90 -0
  199. package/docs/v1/examples/custom-theming.md +63 -0
  200. package/docs/v1/examples/multi-product-page.md +90 -0
  201. package/docs/v1/examples/simple-product-page.md +89 -0
  202. package/docs/v1/getting-started/concepts.md +521 -0
  203. package/docs/v1/getting-started/installation.md +349 -0
  204. package/docs/v1/getting-started/quick-start.md +410 -0
  205. package/docs/v1/guides/accessibility.md +219 -0
  206. package/docs/v1/guides/address-component.md +435 -0
  207. package/docs/v1/guides/best-practices.md +365 -0
  208. package/docs/v1/guides/cart-component.md +757 -0
  209. package/docs/v1/guides/checkout-component.md +670 -0
  210. package/docs/v1/guides/events.md +939 -0
  211. package/docs/v1/guides/product-component.md +736 -0
  212. package/docs/v1/guides/product-list-component.md +730 -0
  213. package/docs/v1/guides/theming.md +229 -0
  214. package/docs/v1/integration/angular.md +39 -0
  215. package/docs/v1/integration/laravel.md +41 -0
  216. package/docs/v1/integration/nextjs.md +69 -0
  217. package/docs/v1/integration/proxy-setup.md +106 -0
  218. package/docs/v1/integration/react.md +64 -0
  219. package/docs/v1/integration/vanilla-js.md +84 -0
  220. package/docs/v1/integration/vue.md +58 -0
  221. package/docs/v1/reference/analytics.md +107 -0
  222. package/docs/v1/reference/browser-support.md +47 -0
  223. package/docs/v1/reference/error-handling.md +83 -0
  224. package/docs/v1/reference/performance.md +52 -0
  225. package/docs/v1/reference/telemetry.md +85 -0
  226. package/docs/v1/reference/troubleshooting.md +135 -0
  227. package/package.json +75 -45
  228. package/dist/types/elements-builder-client.d.ts +0 -2
  229. package/dist/types/elements-client.d.ts +0 -2
  230. package/dist/types/enums/cloud.enum.d.ts +0 -97
  231. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  232. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  233. package/dist/types/interfaces/cloud/index.d.ts +0 -3
  234. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  235. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  236. package/dist/types/interfaces/core.interface.d.ts +0 -111
  237. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  238. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  239. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  240. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  241. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  242. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  243. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  244. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  245. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  246. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  247. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  248. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  249. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  250. package/dist/types/utils/helper.d.ts +0 -28
  251. package/docs/ACTIONS.md +0 -1300
  252. package/docs/BROWSER_SUPPORT.md +0 -279
  253. package/docs/CONFIGURATION.md +0 -853
  254. package/docs/DOCUMENTATION_INDEX.md +0 -311
  255. package/docs/EVENTS.md +0 -798
  256. package/docs/PROXY.md +0 -228
  257. package/docs/THEMING.md +0 -592
  258. package/docs/TROUBLESHOOTING.md +0 -793
  259. package/umd/elements.js +0 -1
  260. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  261. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  262. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  263. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  264. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  265. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  266. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  267. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  268. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  269. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  270. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,527 @@
1
+ # Checkout Actions API
2
+
3
+ Checkout actions allow you to programmatically control the checkout flow.
4
+
5
+ ## Navigation Actions
6
+
7
+ > **Note:** `openCheckout()`, `closeCheckout()`, and `toggleCheckout()` are only available on the full `Elements()` client's `actions.checkout`. They are **not** present on the checkout-only client (`ElementsCheckout()`), whose `actions.checkout` is typed `IElementsCheckoutActions = Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'>`. The remaining checkout actions are available on both clients.
8
+
9
+ ### actions.checkout.openCheckout()
10
+
11
+ ```typescript
12
+ openCheckout(): void
13
+ ```
14
+
15
+ Opens the checkout drawer or navigates to checkout page.
16
+
17
+ ```javascript
18
+ window.LiquidCommerce.elements.actions.checkout.openCheckout();
19
+ ```
20
+
21
+ ### actions.checkout.closeCheckout()
22
+
23
+ ```typescript
24
+ closeCheckout(): void
25
+ ```
26
+
27
+ Closes the checkout drawer.
28
+
29
+ ```javascript
30
+ window.LiquidCommerce.elements.actions.checkout.closeCheckout();
31
+ ```
32
+
33
+ ### actions.checkout.toggleCheckout()
34
+
35
+ ```typescript
36
+ toggleCheckout(): void
37
+ ```
38
+
39
+ Toggles checkout open/closed.
40
+
41
+ ```javascript
42
+ window.LiquidCommerce.elements.actions.checkout.toggleCheckout();
43
+ ```
44
+
45
+ ### actions.checkout.exitCheckout()
46
+
47
+ ```typescript
48
+ exitCheckout(): void
49
+ ```
50
+
51
+ Navigates away from checkout (requires `exitUrl` configuration).
52
+
53
+ ```javascript
54
+ window.LiquidCommerce.elements.actions.checkout.exitCheckout();
55
+ ```
56
+
57
+ ## Product Actions
58
+
59
+ ### actions.checkout.addProduct()
60
+
61
+ ```typescript
62
+ addProduct(params: IAddProductParams[], openCheckout?: boolean): Promise<void>
63
+ ```
64
+
65
+ Add products and open checkout in one call. Products are added to the cart (via the cart action, or directly when none is wired up), then checkout is prepared and opened. For a checkout without a cart session, use `addAnonymousProduct`.
66
+
67
+ `IAddProductParams.engravingLines?: string[]` — optional engraving. Same rules as [`actions.cart.addProduct()`](./cart-actions.md#actionscartaddproduct): invalid input is ignored, blanks stripped, lines clamped to the product's `maxLines` / `maxCharsPerLine`, and engraving is dropped (without failing) when the product, variant, or fulfillment doesn't support it.
68
+
69
+ ```javascript
70
+ await window.LiquidCommerce.elements.actions.checkout.addProduct([
71
+ {
72
+ identifier: '00619947000020',
73
+ fulfillmentType: 'shipping',
74
+ quantity: 1
75
+ }
76
+ ], true); // Open checkout after adding
77
+
78
+ // With engraving
79
+ await window.LiquidCommerce.elements.actions.checkout.addProduct([
80
+ {
81
+ identifier: '00619947000020',
82
+ fulfillmentType: 'shipping',
83
+ quantity: 1,
84
+ engravingLines: ['For Dad']
85
+ }
86
+ ], true);
87
+ ```
88
+
89
+ ### actions.checkout.addAnonymousProduct()
90
+
91
+ ```typescript
92
+ addAnonymousProduct(
93
+ params: IAnonymousCheckoutAddProductParams
94
+ ): Promise<IAnonymousCheckoutAddProductResponse>
95
+ ```
96
+
97
+ Add a product to checkout without requiring a cart session. Used for direct-to-checkout flows.
98
+
99
+ **Parameters** (`IAnonymousCheckoutAddProductParams`):
100
+
101
+ | Field | Type | Required | Description |
102
+ |-------|------|----------|-------------|
103
+ | `location` | `ILocation` | Yes | `{ address: IAddressAddress; coordinates: IAddressCoordinates }` |
104
+ | `items` | `IAnonymousCheckoutAddProductItem[]` | No | Products to add: `{ identifier, fulfillmentType, quantity }`. Provide `items` **or** `cartItems`. |
105
+ | `cartItems` | `ICartUpdateItem[]` | No | Pre-resolved cart line items: `{ id?, partNumber, quantity, fulfillmentId, engravingLines? }` (alternative to `items`). |
106
+ | `promoCode` | `string` | No | Promo code applied while creating the anonymous checkout. |
107
+
108
+ ```javascript
109
+ const result = await window.LiquidCommerce.elements.actions.checkout
110
+ .addAnonymousProduct({
111
+ items: [
112
+ { identifier: '00619947000020', fulfillmentType: 'shipping', quantity: 1 }
113
+ ],
114
+ location: {
115
+ address: { one: '123 Main St', two: '', city: 'New York', state: 'NY', zip: '10001', country: 'US' },
116
+ coordinates: { latitude: 40.7128, longitude: -74.006 }
117
+ },
118
+ promoCode: 'WELCOME10' // optional
119
+ });
120
+ ```
121
+
122
+ **Returns** (`IAnonymousCheckoutAddProductResponse`):
123
+
124
+ ```typescript
125
+ interface IAnonymousCheckoutAddProductResponse {
126
+ checkout: ICheckoutPrepare | null; // the prepared checkout (see below), or null on failure
127
+ unavailableItems: IAnonymousCheckoutUnavailableItem[];
128
+ }
129
+
130
+ interface IAnonymousCheckoutUnavailableItem {
131
+ identifier: string;
132
+ productName: string | null;
133
+ fulfillmentType: FulfillmentType; // 'shipping' | 'onDemand'
134
+ reason: 'product_not_available' | 'fulfillment_not_available';
135
+ }
136
+
137
+ interface ICheckoutPrepare {
138
+ token: string;
139
+ cartId: string;
140
+ customer: ICheckoutCustomer;
141
+ isGift: boolean;
142
+ billingSameAsShipping: boolean;
143
+ payment?: string;
144
+ giftOptions: ICheckoutGiftRecipient;
145
+ marketingPreferences: ICheckoutMarketingPreferences;
146
+ shippingAddress: ICheckoutShippingAddress;
147
+ billingAddress: ICheckoutBilling;
148
+ promoCode: ICheckoutPromoCode | null;
149
+ amounts: ICheckoutAmounts;
150
+ giftCards: ICheckoutGiftCard[];
151
+ presale: ICheckoutPresale | null;
152
+ itemsQuantity: number;
153
+ items: Record<string /* cart item ID */, ICheckoutItem>;
154
+ retailers: Record<string /* retailer ID */, ICheckoutRetailer>;
155
+ events: ICheckoutEvent[];
156
+ }
157
+ ```
158
+
159
+ ## Promo & Gift Card Actions
160
+
161
+ ### actions.checkout.applyPromoCode()
162
+
163
+ ```typescript
164
+ applyPromoCode(promoCode: string): Promise<void>
165
+ ```
166
+
167
+ Apply a promo code during checkout.
168
+
169
+ ```javascript
170
+ await window.LiquidCommerce.elements.actions.checkout.applyPromoCode('WELCOME10');
171
+ ```
172
+
173
+ ### actions.checkout.removePromoCode()
174
+
175
+ ```typescript
176
+ removePromoCode(): Promise<void>
177
+ ```
178
+
179
+ Remove the active promo code.
180
+
181
+ ```javascript
182
+ await window.LiquidCommerce.elements.actions.checkout.removePromoCode();
183
+ ```
184
+
185
+ ### actions.checkout.applyGiftCard()
186
+
187
+ ```typescript
188
+ applyGiftCard(code: string): Promise<void>
189
+ ```
190
+
191
+ Apply a gift card.
192
+
193
+ ```javascript
194
+ await window.LiquidCommerce.elements.actions.checkout.applyGiftCard('GIFT-1234-5678-9012');
195
+ ```
196
+
197
+ ### actions.checkout.removeGiftCard()
198
+
199
+ ```typescript
200
+ removeGiftCard(code: string): Promise<void>
201
+ ```
202
+
203
+ Remove a gift card.
204
+
205
+ ```javascript
206
+ await window.LiquidCommerce.elements.actions.checkout.removeGiftCard('GIFT-1234-5678-9012');
207
+ ```
208
+
209
+ ## Toggle Actions
210
+
211
+ ### actions.checkout.toggleIsGift()
212
+
213
+ ```typescript
214
+ toggleIsGift(active?: boolean): Promise<void>
215
+ ```
216
+
217
+ Enable/disable gift mode.
218
+
219
+ ```javascript
220
+ // Enable
221
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(true);
222
+
223
+ // Disable
224
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(false);
225
+
226
+ // Toggle
227
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift();
228
+ ```
229
+
230
+ ### actions.checkout.toggleBillingSameAsShipping()
231
+
232
+ ```typescript
233
+ toggleBillingSameAsShipping(active?: boolean): Promise<void>
234
+ ```
235
+
236
+ Set whether billing address matches shipping.
237
+
238
+ ```javascript
239
+ // Use shipping address for billing
240
+ await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(true);
241
+
242
+ // Use different billing address
243
+ await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(false);
244
+ ```
245
+
246
+ ### actions.checkout.toggleMarketingPreferences()
247
+
248
+ ```typescript
249
+ toggleMarketingPreferences(field: 'canEmail' | 'canSms', active: boolean): Promise<void>
250
+ ```
251
+
252
+ Set marketing opt-in preferences.
253
+
254
+ ```javascript
255
+ // Opt into email marketing
256
+ await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canEmail', true);
257
+
258
+ // Opt into SMS marketing
259
+ await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canSms', true);
260
+ ```
261
+
262
+ ## Form Update Actions
263
+
264
+ ### actions.checkout.updateCustomerInfo()
265
+
266
+ ```typescript
267
+ updateCustomerInfo(params: Record<CustomerFieldName, string>): void
268
+ ```
269
+
270
+ Pre-fill customer information.
271
+
272
+ **Available fields:**
273
+ - `firstName`, `lastName`
274
+ - `email`, `phone`
275
+ - `birthDate`, `addressTwo`
276
+ - `company`
277
+
278
+ ```javascript
279
+ window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
280
+ firstName: 'John',
281
+ lastName: 'Doe',
282
+ email: 'john@example.com',
283
+ phone: '+15551234567',
284
+ birthDate: '1990-01-01',
285
+ addressTwo: 'Apt 4B',
286
+ company: 'Acme Corp'
287
+ });
288
+ ```
289
+
290
+ ### actions.checkout.updateBillingInfo()
291
+
292
+ ```typescript
293
+ updateBillingInfo(params: Record<BillingFieldName, string>): void
294
+ ```
295
+
296
+ Pre-fill billing address.
297
+
298
+ **Available fields:**
299
+ - `firstName`, `lastName`
300
+ - `email`, `phone`, `company`
301
+ - `addressOne`, `addressTwo`
302
+ - `city`, `state`, `zipCode`
303
+
304
+ ```javascript
305
+ window.LiquidCommerce.elements.actions.checkout.updateBillingInfo({
306
+ firstName: 'John',
307
+ lastName: 'Doe',
308
+ email: 'john@example.com',
309
+ phone: '+15551234567',
310
+ company: 'Acme Corp',
311
+ addressOne: '123 Main St',
312
+ addressTwo: 'Apt 4B',
313
+ city: 'New York',
314
+ state: 'NY',
315
+ zipCode: '10001'
316
+ });
317
+ ```
318
+
319
+ ### actions.checkout.updateGiftInfo()
320
+
321
+ ```typescript
322
+ updateGiftInfo(params: Record<GiftFieldName, string>): void
323
+ ```
324
+
325
+ Pre-fill gift recipient information.
326
+
327
+ **Available fields:**
328
+ - `firstName`, `lastName`
329
+ - `email`, `phone`
330
+ - `message`, `addressTwo`
331
+
332
+ ```javascript
333
+ window.LiquidCommerce.elements.actions.checkout.updateGiftInfo({
334
+ firstName: 'Jane',
335
+ lastName: 'Smith',
336
+ email: 'jane@example.com',
337
+ phone: '+15559876543',
338
+ addressTwo: 'Suite 200',
339
+ message: 'Happy Birthday!',
340
+ });
341
+ ```
342
+
343
+ ## Payment Method
344
+
345
+ ### actions.checkout.setSavedPaymentMethod()
346
+
347
+ ```typescript
348
+ setSavedPaymentMethod(params: {
349
+ id: string;
350
+ card: {
351
+ brand: string;
352
+ last4: string;
353
+ expMonth?: string | number;
354
+ expYear?: string | number;
355
+ };
356
+ }): void
357
+ ```
358
+
359
+ Pre-select a saved payment method for the checkout. When set, the payment step renders a read-only card summary (e.g. `Visa ending in 4242`) instead of the Stripe card form, and the shopper places the order without re-entering card details. The `id` is bound to the checkout when the payment form is saved.
360
+
361
+ `id` must be a payment method the backend already holds for the checkout's customer (for example, a card fetched server-side and handed to the page). If the backend does not recognize the `id` for this checkout's customer, saving the payment step fails with an error (`The selected payment method could not be applied to this checkout.`) and the order cannot be placed — pass only a payment method confirmed to belong to the customer. The `card` fields are used only to render the summary. It can be set at any time — before opening checkout, or while it is open — and the payment step updates accordingly. The selection persists across a cart reset within the session.
362
+
363
+ ```javascript
364
+ window.LiquidCommerce.elements.actions.checkout.setSavedPaymentMethod({
365
+ id: 'pm_123',
366
+ card: { brand: 'Visa', last4: '4242', expMonth: '12', expYear: '30' }
367
+ });
368
+ ```
369
+
370
+ ### actions.checkout.clearSavedPaymentMethod()
371
+
372
+ ```typescript
373
+ clearSavedPaymentMethod(): void
374
+ ```
375
+
376
+ Remove a previously set saved payment method, restoring the Stripe card-entry form.
377
+
378
+ ```javascript
379
+ window.LiquidCommerce.elements.actions.checkout.clearSavedPaymentMethod();
380
+ ```
381
+
382
+ ## Data Retrieval
383
+
384
+ ### actions.checkout.getDetails()
385
+
386
+ ```typescript
387
+ getDetails(): ICheckoutDetailsEventData
388
+ ```
389
+
390
+ Retrieve current checkout information.
391
+
392
+ ```javascript
393
+ const checkout = window.LiquidCommerce.elements.actions.checkout.getDetails();
394
+
395
+ console.log(`Cart ID: ${checkout.cartId}`);
396
+ console.log(`Total: $${checkout.amounts.total / 100}`);
397
+ console.log(`Items: ${checkout.itemCount}`);
398
+ console.log(`Is Gift: ${checkout.isGift}`);
399
+ ```
400
+
401
+ **Returns:**
402
+
403
+ ```typescript
404
+ interface ICheckoutDetailsEventData {
405
+ token: string;
406
+ cartId: string;
407
+ isGift: boolean;
408
+ billingSameAsShipping: boolean;
409
+ marketingPreferences: {
410
+ canEmail: boolean;
411
+ canSms: boolean;
412
+ };
413
+ hasPromoCode: boolean;
414
+ hasGiftCards: boolean;
415
+ amounts: ICheckoutAmounts;
416
+ itemCount: number;
417
+ items: Record<string, ICheckoutItem>;
418
+ }
419
+ ```
420
+
421
+ ### actions.checkout.getProductAvailabilityByState()
422
+
423
+ ```typescript
424
+ getProductAvailabilityByState(
425
+ identifiers: string[],
426
+ state?: string
427
+ ): Promise<IProductAvailabilityResponse>
428
+ ```
429
+
430
+ Check product availability across states from the checkout context.
431
+
432
+ ```javascript
433
+ const availability = await window.LiquidCommerce.elements.actions.checkout
434
+ .getProductAvailabilityByState(['00619947000020'], 'CA');
435
+ ```
436
+
437
+ | Parameter | Type | Required | Description |
438
+ |---------------|----------|----------|--------------------------------------|
439
+ | `identifiers` | string[] | Yes | Array of product UPCs, SKUs, or IDs |
440
+ | `state` | string | No | Two-letter state code (e.g., `'NY'`) |
441
+
442
+ ## Use Cases
443
+
444
+ ### Pre-fill for Logged-In Users
445
+
446
+ ```javascript
447
+ window.addEventListener('lce:actions.checkout_opened', () => {
448
+ if (userIsLoggedIn) {
449
+ window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
450
+ firstName: currentUser.firstName,
451
+ lastName: currentUser.lastName,
452
+ email: currentUser.email,
453
+ phone: currentUser.phone
454
+ });
455
+ }
456
+ });
457
+ ```
458
+
459
+ ### Track Checkout Progress
460
+
461
+ ```javascript
462
+ window.addEventListener('lce:actions.checkout_customer_information_updated', () => {
463
+ gtag('event', 'checkout_progress', { step: 'customer_info' });
464
+ });
465
+
466
+ window.addEventListener('lce:actions.checkout_submit_started', () => {
467
+ gtag('event', 'checkout_progress', { step: 'payment' });
468
+ });
469
+
470
+ window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
471
+ const { orderNumber, orderTotal } = event.detail.data;
472
+
473
+ gtag('event', 'purchase', {
474
+ transaction_id: orderNumber,
475
+ value: orderTotal / 100,
476
+ currency: 'USD'
477
+ });
478
+ });
479
+ ```
480
+
481
+ ### Gift Flow
482
+
483
+ ```javascript
484
+ document.getElementById('gift-checkbox').addEventListener('change', async (e) => {
485
+ await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(e.target.checked);
486
+
487
+ if (e.target.checked) {
488
+ showGiftForm();
489
+ } else {
490
+ hideGiftForm();
491
+ }
492
+ });
493
+ ```
494
+
495
+ ### Auto-Apply Campaign Codes
496
+
497
+ ```javascript
498
+ const params = new URLSearchParams(window.location.search);
499
+ const campaignCode = params.get('promo');
500
+
501
+ if (campaignCode) {
502
+ window.addEventListener('lce:actions.checkout_opened', async () => {
503
+ try {
504
+ await window.LiquidCommerce.elements.actions.checkout.applyPromoCode(campaignCode);
505
+ } catch (error) {
506
+ console.log('Invalid campaign code');
507
+ }
508
+ });
509
+ }
510
+ ```
511
+
512
+ ## Events
513
+
514
+ Checkout actions trigger numerous events. See [Checkout Events](../../guides/events.md#checkout-events) for complete list.
515
+
516
+ Key events:
517
+ - `checkout_opened`, `checkout_closed`
518
+ - `checkout_customer_information_updated`
519
+ - `checkout_submit_started`, `checkout_submit_completed`, `checkout_submit_failed`
520
+ - `checkout_promo_code_applied`, `checkout_promo_code_failed`
521
+ - `checkout_gift_card_applied`, `checkout_gift_card_failed`
522
+
523
+ ## See Also
524
+
525
+ - [Checkout Component Guide](../../guides/checkout-component.md)
526
+ - [Checkout Events](../../guides/events.md#checkout-events)
527
+ - [Cart Actions](./cart-actions.md)