@bigcommerce/checkout-sdk 1.308.1 → 1.308.2

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 (345) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/checkout-button.js +1 -1
  3. package/dist/checkout-button.umd.js +1 -1
  4. package/dist/checkout-sdk.js +1 -1
  5. package/dist/checkout-sdk.js.map +1 -1
  6. package/dist/checkout-sdk.umd.js +1 -1
  7. package/dist/checkout-sdk.umd.js.map +1 -1
  8. package/docs/README.md +158 -16
  9. package/docs/classes/internal_.CartChangedError.md +62 -0
  10. package/docs/classes/internal_.CheckoutService.md +1528 -0
  11. package/docs/classes/internal_.CurrencyService.md +56 -0
  12. package/docs/classes/internal_.EmbeddedCheckout.md +42 -0
  13. package/docs/classes/internal_.LanguageService.md +103 -0
  14. package/docs/classes/internal_.RequestError.md +108 -0
  15. package/docs/classes/internal_.StandardError.md +4 -0
  16. package/docs/enums/internal_.AdyenV2CardFields.md +31 -0
  17. package/docs/enums/internal_.AdyenV3CardFields.md +31 -0
  18. package/docs/enums/internal_.CheckoutIncludes.md +31 -0
  19. package/docs/enums/internal_.HostedFieldType.md +52 -0
  20. package/docs/enums/internal_.IconStyle.md +24 -0
  21. package/docs/enums/internal_.RadiusUnit.md +24 -0
  22. package/docs/interfaces/internal_.Address.md +4 -0
  23. package/docs/interfaces/internal_.AddressRequestBody.md +2 -0
  24. package/docs/interfaces/internal_.AdyenAdditionalActionCallbacks.md +70 -0
  25. package/docs/interfaces/internal_.AdyenAdditionalActionCallbacks_2.md +68 -0
  26. package/docs/interfaces/internal_.AdyenAdditionalActionOptions.md +108 -0
  27. package/docs/interfaces/internal_.AdyenAdditionalActionOptions_2.md +108 -0
  28. package/docs/interfaces/internal_.AdyenBaseCardComponentOptions.md +35 -0
  29. package/docs/interfaces/internal_.AdyenBaseCardComponentOptions_2.md +42 -0
  30. package/docs/interfaces/internal_.AdyenComponent.md +74 -0
  31. package/docs/interfaces/internal_.AdyenComponentEvents.md +76 -0
  32. package/docs/interfaces/internal_.AdyenComponentEvents_2.md +76 -0
  33. package/docs/interfaces/internal_.AdyenComponent_2.md +74 -0
  34. package/docs/interfaces/internal_.AdyenCreditCardComponentOptions.md +187 -0
  35. package/docs/interfaces/internal_.AdyenIdealComponentOptions.md +19 -0
  36. package/docs/interfaces/internal_.AdyenPaymentMethodState.md +23 -0
  37. package/docs/interfaces/internal_.AdyenPaymentMethodState_2.md +17 -0
  38. package/docs/interfaces/internal_.AdyenPlaceholderData.md +35 -0
  39. package/docs/interfaces/internal_.AdyenPlaceholderData_2.md +35 -0
  40. package/docs/interfaces/internal_.AdyenThreeDS2Options.md +99 -0
  41. package/docs/interfaces/internal_.AdyenV2PaymentInitializeOptions.md +162 -0
  42. package/docs/interfaces/internal_.AdyenV2ValidationState.md +59 -0
  43. package/docs/interfaces/internal_.AdyenV3CreditCardComponentOptions.md +198 -0
  44. package/docs/interfaces/internal_.AdyenV3PaymentInitializeOptions.md +137 -0
  45. package/docs/interfaces/internal_.AdyenV3ValidationState.md +59 -0
  46. package/docs/interfaces/internal_.AmazonPayCustomerInitializeOptions.md +67 -0
  47. package/docs/interfaces/internal_.AmazonPayOrderReference.md +32 -0
  48. package/docs/interfaces/internal_.AmazonPayPaymentInitializeOptions.md +102 -0
  49. package/docs/interfaces/internal_.AmazonPayShippingInitializeOptions.md +87 -0
  50. package/docs/interfaces/internal_.AmazonPayV2CustomerInitializeOptions.md +26 -0
  51. package/docs/interfaces/internal_.AmazonPayV2PaymentInitializeOptions.md +42 -0
  52. package/docs/interfaces/internal_.AmazonPayV2ShippingInitializeOptions.md +28 -0
  53. package/docs/interfaces/internal_.AmazonPayWidgetError.md +27 -0
  54. package/docs/interfaces/internal_.ApplePayCustomerInitializeOptions.md +79 -0
  55. package/docs/interfaces/internal_.ApplePayPaymentInitializeOptions.md +42 -0
  56. package/docs/interfaces/internal_.BankInstrument.md +114 -0
  57. package/docs/interfaces/internal_.Banner.md +24 -0
  58. package/docs/interfaces/internal_.BaseAccountInstrument.md +93 -0
  59. package/docs/interfaces/internal_.BaseCustomerInitializeOptions.md +237 -0
  60. package/docs/interfaces/internal_.BaseElementOptions.md +28 -0
  61. package/docs/interfaces/internal_.BaseElementOptions_2.md +50 -0
  62. package/docs/interfaces/internal_.BaseIndividualElementOptions.md +69 -0
  63. package/docs/interfaces/internal_.BaseInstrument.md +60 -0
  64. package/docs/interfaces/internal_.BasePaymentInitializeOptions.md +376 -0
  65. package/docs/interfaces/internal_.BillingAddress.md +184 -0
  66. package/docs/interfaces/internal_.BillingAddressRequestBody.md +155 -0
  67. package/docs/interfaces/internal_.BlockElementStyles.md +107 -0
  68. package/docs/interfaces/internal_.BlueSnapV2PaymentInitializeOptions.md +75 -0
  69. package/docs/interfaces/internal_.BlueSnapV2StyleProps.md +31 -0
  70. package/docs/interfaces/internal_.BodlEventsPayload.md +9 -0
  71. package/docs/interfaces/internal_.BodlService.md +172 -0
  72. package/docs/interfaces/internal_.BodyStyles.md +17 -0
  73. package/docs/interfaces/internal_.BoltCustomerInitializeOptions.md +32 -0
  74. package/docs/interfaces/internal_.BoltPaymentInitializeOptions.md +96 -0
  75. package/docs/interfaces/internal_.BraintreePaymentInitializeOptions.md +91 -0
  76. package/docs/interfaces/internal_.BraintreeThreeDSecureOptions.md +53 -0
  77. package/docs/interfaces/internal_.BraintreeVerifyPayload.md +53 -0
  78. package/docs/interfaces/internal_.BraintreeVisaCheckoutCustomerInitializeOptions.md +37 -0
  79. package/docs/interfaces/internal_.BraintreeVisaCheckoutPaymentInitializeOptions.md +72 -0
  80. package/docs/interfaces/internal_.BrowserInfo.md +52 -0
  81. package/docs/interfaces/internal_.ButtonResponse.md +21 -0
  82. package/docs/interfaces/internal_.ButtonStyles.md +143 -0
  83. package/docs/interfaces/internal_.CardCvcElementOptions.md +74 -0
  84. package/docs/interfaces/internal_.CardDataPaymentMethodState.md +17 -0
  85. package/docs/interfaces/internal_.CardDataPaymentMethodState_2.md +17 -0
  86. package/docs/interfaces/internal_.CardElementOptions.md +93 -0
  87. package/docs/interfaces/internal_.CardExpiryElementOptions.md +74 -0
  88. package/docs/interfaces/internal_.CardInstrument.md +117 -0
  89. package/docs/interfaces/internal_.CardNumberElementOptions.md +90 -0
  90. package/docs/interfaces/internal_.CardPaymentMethodState.md +62 -0
  91. package/docs/interfaces/internal_.CardPaymentMethodState_2.md +45 -0
  92. package/docs/interfaces/internal_.CardState.md +42 -0
  93. package/docs/interfaces/internal_.CardStateErrors.md +9 -0
  94. package/docs/interfaces/internal_.CardStateErrors_2.md +9 -0
  95. package/docs/interfaces/internal_.CardState_2.md +42 -0
  96. package/docs/interfaces/internal_.Cart.md +108 -0
  97. package/docs/interfaces/internal_.ChasePayCustomerInitializeOptions.md +17 -0
  98. package/docs/interfaces/internal_.ChasePayInitializeOptions.md +100 -0
  99. package/docs/interfaces/internal_.CheckableInputStyles.md +177 -0
  100. package/docs/interfaces/internal_.ChecklistStyles.md +129 -0
  101. package/docs/interfaces/internal_.Checkout.md +204 -0
  102. package/docs/interfaces/internal_.CheckoutParams.md +17 -0
  103. package/docs/interfaces/internal_.CheckoutPayment.md +44 -0
  104. package/docs/interfaces/internal_.CheckoutPaymentMethodExecutedOptions.md +17 -0
  105. package/docs/interfaces/internal_.CheckoutRequestBody.md +17 -0
  106. package/docs/interfaces/internal_.CheckoutSelectors.md +31 -0
  107. package/docs/interfaces/internal_.CheckoutServiceOptions.md +38 -0
  108. package/docs/interfaces/internal_.CheckoutSettings.md +203 -0
  109. package/docs/interfaces/internal_.CheckoutStoreErrorSelector.md +638 -0
  110. package/docs/interfaces/internal_.CheckoutStoreSelector.md +503 -0
  111. package/docs/interfaces/internal_.CheckoutStoreStatusSelector.md +760 -0
  112. package/docs/interfaces/internal_.Consignment.md +73 -0
  113. package/docs/interfaces/internal_.ConsignmentAssignmentBaseRequestBodyWithAddress.md +31 -0
  114. package/docs/interfaces/internal_.ConsignmentAssignmentBaseRequestBodyWithShippingAddress.md +31 -0
  115. package/docs/interfaces/internal_.ConsignmentCreateRequestBody.md +38 -0
  116. package/docs/interfaces/internal_.ConsignmentLineItem.md +24 -0
  117. package/docs/interfaces/internal_.ConsignmentPickupOption.md +17 -0
  118. package/docs/interfaces/internal_.ConsignmentUpdateRequestBody.md +45 -0
  119. package/docs/interfaces/internal_.Coordinates.md +24 -0
  120. package/docs/interfaces/internal_.Country.md +45 -0
  121. package/docs/interfaces/internal_.Coupon.md +45 -0
  122. package/docs/interfaces/internal_.CreditCardInstrument.md +87 -0
  123. package/docs/interfaces/internal_.CreditCardPlaceHolder.md +31 -0
  124. package/docs/interfaces/internal_.CreditCardPlaceHolder_2.md +31 -0
  125. package/docs/interfaces/internal_.CssProperties.md +213 -0
  126. package/docs/interfaces/internal_.CssProperties_2.md +213 -0
  127. package/docs/interfaces/internal_.Currency.md +38 -0
  128. package/docs/interfaces/internal_.CustomItem.md +52 -0
  129. package/docs/interfaces/internal_.Customer.md +93 -0
  130. package/docs/interfaces/internal_.CustomerAddress.md +184 -0
  131. package/docs/interfaces/internal_.CustomerCredentials.md +24 -0
  132. package/docs/interfaces/internal_.CustomerGroup.md +24 -0
  133. package/docs/interfaces/internal_.CustomerPasswordRequirements.md +38 -0
  134. package/docs/interfaces/internal_.CustomerRequestOptions.md +62 -0
  135. package/docs/interfaces/internal_.DigitalItem.md +312 -0
  136. package/docs/interfaces/internal_.DigitalRiverElementClasses.md +69 -0
  137. package/docs/interfaces/internal_.DigitalRiverPaymentInitializeOptions.md +148 -0
  138. package/docs/interfaces/internal_.Discount.md +24 -0
  139. package/docs/interfaces/internal_.DisplaySettings.md +17 -0
  140. package/docs/interfaces/internal_.EmbeddedCheckoutCompleteEvent.md +17 -0
  141. package/docs/interfaces/internal_.EmbeddedCheckoutError.md +31 -0
  142. package/docs/interfaces/internal_.EmbeddedCheckoutErrorEvent.md +24 -0
  143. package/docs/interfaces/internal_.EmbeddedCheckoutFrameErrorEvent.md +24 -0
  144. package/docs/interfaces/internal_.EmbeddedCheckoutFrameLoadedEvent.md +24 -0
  145. package/docs/interfaces/internal_.EmbeddedCheckoutLoadedEvent.md +17 -0
  146. package/docs/interfaces/internal_.EmbeddedCheckoutOptions.md +136 -0
  147. package/docs/interfaces/internal_.EmbeddedCheckoutSignedOutEvent.md +17 -0
  148. package/docs/interfaces/internal_.EmbeddedCheckoutStyles.md +143 -0
  149. package/docs/interfaces/internal_.EmbeddedContentOptions.md +17 -0
  150. package/docs/interfaces/internal_.ExecutePaymentMethodCheckoutOptions.md +95 -0
  151. package/docs/interfaces/internal_.FlashMessage.md +31 -0
  152. package/docs/interfaces/internal_.FormField.md +115 -0
  153. package/docs/interfaces/internal_.FormFieldItem.md +24 -0
  154. package/docs/interfaces/internal_.FormFieldOptions.md +31 -0
  155. package/docs/interfaces/internal_.FormFields.md +31 -0
  156. package/docs/interfaces/internal_.GatewayOrderPayment.md +110 -0
  157. package/docs/interfaces/internal_.GiftCertificate.md +45 -0
  158. package/docs/interfaces/internal_.GiftCertificateItem.md +80 -0
  159. package/docs/interfaces/internal_.GiftCertificateOrderPayment.md +96 -0
  160. package/docs/interfaces/{internal_.GooglePayButtonInitializeOptions.md → internal_.GooglePayCustomerInitializeOptions.md} +16 -5
  161. package/docs/interfaces/internal_.GooglePayPaymentInitializeOptions.md +95 -0
  162. package/docs/interfaces/internal_.HostedCardFieldOptions.md +37 -0
  163. package/docs/interfaces/internal_.HostedCardFieldOptionsMap.md +38 -0
  164. package/docs/interfaces/internal_.HostedFieldStylesMap.md +31 -0
  165. package/docs/interfaces/internal_.HostedFormOptions.md +116 -0
  166. package/docs/interfaces/internal_.HostedInputValidateErrorData.md +31 -0
  167. package/docs/interfaces/internal_.HostedInputValidateErrorDataMap.md +52 -0
  168. package/docs/interfaces/internal_.HostedInputValidateResults.md +24 -0
  169. package/docs/interfaces/internal_.HostedInstrument.md +24 -0
  170. package/docs/interfaces/internal_.HostedStoredCardFieldOptions.md +56 -0
  171. package/docs/interfaces/internal_.HostedStoredCardFieldOptionsMap.md +24 -0
  172. package/docs/interfaces/internal_.IbanElementOptions.md +84 -0
  173. package/docs/interfaces/internal_.IdealElementOptions.md +72 -0
  174. package/docs/interfaces/internal_.IndividualCardElementOptions.md +38 -0
  175. package/docs/interfaces/internal_.InitializationStrategy.md +23 -0
  176. package/docs/interfaces/internal_.InlineElementStyles.md +55 -0
  177. package/docs/interfaces/internal_.InputDetail.md +82 -0
  178. package/docs/interfaces/internal_.InputDetail_2.md +82 -0
  179. package/docs/interfaces/internal_.InputStyles.md +154 -0
  180. package/docs/interfaces/internal_.Item.md +24 -0
  181. package/docs/interfaces/internal_.Item_2.md +28 -0
  182. package/docs/interfaces/internal_.Item_3.md +28 -0
  183. package/docs/interfaces/internal_.KlarnaLoadResponse.md +30 -0
  184. package/docs/interfaces/internal_.KlarnaLoadResponse_2.md +30 -0
  185. package/docs/interfaces/internal_.KlarnaPaymentInitializeOptions.md +75 -0
  186. package/docs/interfaces/internal_.KlarnaV2PaymentInitializeOptions.md +75 -0
  187. package/docs/interfaces/internal_.LabelStyles.md +78 -0
  188. package/docs/interfaces/internal_.LanguageConfig.md +59 -0
  189. package/docs/interfaces/internal_.LineItem.md +163 -8
  190. package/docs/interfaces/internal_.LineItemCategory.md +17 -0
  191. package/docs/interfaces/internal_.LineItemMap.md +38 -0
  192. package/docs/interfaces/internal_.LineItemOption.md +38 -0
  193. package/docs/interfaces/internal_.LineItemSocialData.md +38 -0
  194. package/docs/interfaces/internal_.LinkStyles.md +92 -0
  195. package/docs/interfaces/internal_.LoadingIndicatorStyles.md +31 -0
  196. package/docs/interfaces/internal_.Locales.md +9 -0
  197. package/docs/interfaces/internal_.MasterpassCustomerInitializeOptions.md +19 -0
  198. package/docs/interfaces/internal_.MasterpassPaymentInitializeOptions.md +37 -0
  199. package/docs/interfaces/internal_.MolliePaymentInitializeOptions.md +126 -0
  200. package/docs/interfaces/internal_.MonerisPaymentInitializeOptions.md +59 -0
  201. package/docs/interfaces/internal_.MonerisStylingProps.md +82 -0
  202. package/docs/interfaces/internal_.NonceGenerationError.md +31 -0
  203. package/docs/interfaces/internal_.NonceInstrument.md +38 -0
  204. package/docs/interfaces/internal_.Option_2.md +24 -0
  205. package/docs/interfaces/internal_.OptionsResponse.md +79 -0
  206. package/docs/interfaces/internal_.OpyPaymentInitializeOptions.md +40 -0
  207. package/docs/interfaces/internal_.Order.md +199 -0
  208. package/docs/interfaces/internal_.OrderConsignment.md +17 -0
  209. package/docs/interfaces/internal_.OrderPayment.md +60 -0
  210. package/docs/interfaces/internal_.OrderPaymentRequestBody.md +41 -0
  211. package/docs/interfaces/internal_.OrderRequestBody.md +35 -0
  212. package/docs/interfaces/internal_.OrderShippingConsignment.md +220 -0
  213. package/docs/interfaces/internal_.PasswordRequirements.md +38 -0
  214. package/docs/interfaces/internal_.PayPalInstrument.md +93 -0
  215. package/docs/interfaces/internal_.PaymentMethod.md +100 -0
  216. package/docs/interfaces/internal_.PaymentMethodConfig.md +122 -0
  217. package/docs/interfaces/internal_.PaymentRequestOptions.md +69 -0
  218. package/docs/interfaces/internal_.PaymentSettings.md +24 -0
  219. package/docs/interfaces/internal_.PaypalCommerceCreditCardPaymentInitializeOptions.md +92 -0
  220. package/docs/interfaces/internal_.PaypalCommerceFormFieldCardTypeChangeEventData.md +17 -0
  221. package/docs/interfaces/internal_.PaypalCommerceFormFieldKeyboardEventData.md +17 -0
  222. package/docs/interfaces/internal_.PaypalCommerceFormFieldOptions.md +30 -0
  223. package/docs/interfaces/internal_.PaypalCommerceFormFieldStylesMap.md +31 -0
  224. package/docs/interfaces/internal_.PaypalCommerceFormFieldValidateErrorData.md +31 -0
  225. package/docs/interfaces/internal_.PaypalCommerceFormFieldValidateEventData.md +35 -0
  226. package/docs/interfaces/internal_.PaypalCommerceFormFieldsMap.md +38 -0
  227. package/docs/interfaces/internal_.PaypalCommerceFormOptions.md +150 -0
  228. package/docs/interfaces/internal_.PaypalCommercePaymentInitializeOptions.md +188 -0
  229. package/docs/interfaces/internal_.PaypalCommerceStoredCardFieldOptions.md +45 -0
  230. package/docs/interfaces/internal_.PaypalCommerceStoredCardFieldsMap.md +24 -0
  231. package/docs/interfaces/internal_.PaypalExpressPaymentInitializeOptions.md +38 -0
  232. package/docs/interfaces/internal_.PaypalFieldsStyleOptions.md +48 -0
  233. package/docs/interfaces/internal_.PhysicalItem.md +313 -0
  234. package/docs/interfaces/internal_.PickupMethod.md +45 -0
  235. package/docs/interfaces/internal_.PickupOptionResult.md +17 -0
  236. package/docs/interfaces/internal_.Promotion.md +17 -0
  237. package/docs/interfaces/internal_.Radius.md +24 -0
  238. package/docs/interfaces/internal_.Region.md +24 -0
  239. package/docs/interfaces/internal_.RequestOptions.md +5 -1
  240. package/docs/interfaces/internal_.SearchArea.md +24 -0
  241. package/docs/interfaces/internal_.SepaPlaceHolder.md +24 -0
  242. package/docs/interfaces/internal_.SepaPlaceHolder_2.md +24 -0
  243. package/docs/interfaces/internal_.ShippingInitializeOptions.md +100 -0
  244. package/docs/interfaces/internal_.ShippingOption.md +66 -0
  245. package/docs/interfaces/internal_.ShippingRequestOptions.md +67 -0
  246. package/docs/interfaces/internal_.ShopperConfig.md +31 -0
  247. package/docs/interfaces/internal_.ShopperCurrency.md +96 -0
  248. package/docs/interfaces/internal_.SignInEmail.md +24 -0
  249. package/docs/interfaces/internal_.SignInEmailRequestBody.md +24 -0
  250. package/docs/interfaces/internal_.SpamProtectionOptions.md +27 -0
  251. package/docs/interfaces/internal_.SquareFormElement.md +30 -0
  252. package/docs/interfaces/internal_.SquarePaymentInitializeOptions.md +133 -0
  253. package/docs/interfaces/internal_.StepStyles.md +122 -0
  254. package/docs/interfaces/internal_.StepTracker.md +66 -0
  255. package/docs/interfaces/internal_.StepTrackerConfig.md +17 -0
  256. package/docs/interfaces/internal_.StoreConfig.md +117 -0
  257. package/docs/interfaces/internal_.StoreCurrency.md +58 -0
  258. package/docs/interfaces/internal_.StoreLinks.md +59 -0
  259. package/docs/interfaces/internal_.StoreProfile.md +73 -0
  260. package/docs/interfaces/internal_.StripeCustomerEvent.md +76 -0
  261. package/docs/interfaces/internal_.StripeElementCSSProperties.md +172 -0
  262. package/docs/interfaces/internal_.StripeElementClasses.md +65 -0
  263. package/docs/interfaces/internal_.StripeElementStyle.md +46 -0
  264. package/docs/interfaces/internal_.StripeElementStyleVariant.md +289 -0
  265. package/docs/interfaces/internal_.StripeEvent.md +39 -0
  266. package/docs/interfaces/internal_.StripeShippingEvent.md +76 -0
  267. package/docs/interfaces/internal_.StripeUPECustomerInitializeOptions.md +94 -0
  268. package/docs/interfaces/internal_.StripeUPEPaymentInitializeOptions.md +72 -0
  269. package/docs/interfaces/internal_.StripeUPEShippingInitializeOptions.md +109 -0
  270. package/docs/interfaces/internal_.StripeV3PaymentInitializeOptions.md +78 -0
  271. package/docs/interfaces/internal_.StyleOptions.md +46 -0
  272. package/docs/interfaces/internal_.StyleOptions_2.md +46 -0
  273. package/docs/interfaces/internal_.SubInputDetail.md +64 -0
  274. package/docs/interfaces/internal_.SubInputDetail_2.md +64 -0
  275. package/docs/interfaces/internal_.Subscriptions.md +31 -0
  276. package/docs/interfaces/internal_.Tax.md +24 -0
  277. package/docs/interfaces/internal_.TextInputStyles.md +177 -0
  278. package/docs/interfaces/internal_.ThreeDSecure.md +52 -0
  279. package/docs/interfaces/internal_.ThreeDSecureToken.md +17 -0
  280. package/docs/interfaces/internal_.TranslationData.md +9 -0
  281. package/docs/interfaces/internal_.Translations.md +9 -0
  282. package/docs/interfaces/internal_.UnknownObject.md +9 -0
  283. package/docs/interfaces/internal_.VaultedInstrument.md +31 -0
  284. package/docs/interfaces/internal_.WechatDataPaymentMethodState.md +17 -0
  285. package/docs/interfaces/internal_.WechatDataPaymentMethodState_2.md +17 -0
  286. package/docs/interfaces/internal_.WechatState.md +17 -0
  287. package/docs/interfaces/internal_.WechatState_2.md +17 -0
  288. package/docs/interfaces/internal_.WithAccountCreation.md +17 -0
  289. package/docs/interfaces/internal_.WithAdyenV2PaymentInitializeOptions.md +20 -0
  290. package/docs/interfaces/internal_.WithAdyenV3PaymentInitializeOptions.md +20 -0
  291. package/docs/interfaces/internal_.WithApplePayCustomerInitializeOptions.md +20 -0
  292. package/docs/interfaces/internal_.WithApplePayPaymentInitializeOptions.md +20 -0
  293. package/docs/interfaces/internal_.WithCheckoutcomFawryInstrument.md +24 -0
  294. package/docs/interfaces/internal_.WithCheckoutcomSEPAInstrument.md +24 -0
  295. package/docs/interfaces/internal_.WithCheckoutcomiDealInstrument.md +17 -0
  296. package/docs/interfaces/internal_.WithDocumentInstrument.md +17 -0
  297. package/docs/interfaces/internal_.WithMollieIssuerInstrument.md +24 -0
  298. package/docs/interfaces/internal_.WorldpayAccessPaymentInitializeOptions.md +32 -0
  299. package/docs/interfaces/internal_.ZipCodeElementOptions.md +17 -0
  300. package/docs/modules/internal_.md +515 -51
  301. package/package.json +1 -1
  302. package/docs/classes/internal_.CheckoutButtonErrorSelector.md +0 -54
  303. package/docs/classes/internal_.CheckoutButtonInitializer.md +0 -179
  304. package/docs/classes/internal_.CheckoutButtonStatusSelector.md +0 -54
  305. package/docs/enums/internal_.AmazonPayV2ButtonColor.md +0 -31
  306. package/docs/enums/internal_.AmazonPayV2CheckoutLanguage.md +0 -59
  307. package/docs/enums/internal_.AmazonPayV2LedgerCurrency.md +0 -38
  308. package/docs/enums/internal_.AmazonPayV2PayOptions.md +0 -28
  309. package/docs/enums/internal_.AmazonPayV2Placement.md +0 -55
  310. package/docs/enums/internal_.CheckoutButtonMethodType.md +0 -164
  311. package/docs/enums/internal_.PaypalButtonStyleColorOption.md +0 -38
  312. package/docs/enums/internal_.PaypalButtonStyleLabelOption.md +0 -45
  313. package/docs/enums/internal_.PaypalButtonStyleLayoutOption.md +0 -24
  314. package/docs/enums/internal_.PaypalButtonStyleShapeOption.md +0 -24
  315. package/docs/enums/internal_.PaypalButtonStyleSizeOption.md +0 -38
  316. package/docs/enums/internal_.StyleButtonColor.md +0 -45
  317. package/docs/enums/internal_.StyleButtonLabel.md +0 -45
  318. package/docs/enums/internal_.StyleButtonLayout.md +0 -24
  319. package/docs/enums/internal_.StyleButtonShape.md +0 -24
  320. package/docs/interfaces/internal_.AmazonPayV2ButtonConfig.md +0 -82
  321. package/docs/interfaces/internal_.AmazonPayV2ButtonParams.md +0 -117
  322. package/docs/interfaces/internal_.AmazonPayV2CheckoutSession.md +0 -37
  323. package/docs/interfaces/internal_.AmazonPayV2CheckoutSessionConfig.md +0 -38
  324. package/docs/interfaces/internal_.AmazonPayV2NewButtonParams.md +0 -139
  325. package/docs/interfaces/internal_.AmazonPayV2Price.md +0 -28
  326. package/docs/interfaces/internal_.ApplePayButtonInitializeOptions.md +0 -40
  327. package/docs/interfaces/internal_.ApplePayButtonInitializeOptions_2.md +0 -40
  328. package/docs/interfaces/internal_.BaseCheckoutButtonInitializeOptions.md +0 -291
  329. package/docs/interfaces/internal_.BraintreeError.md +0 -37
  330. package/docs/interfaces/internal_.BraintreePaypalButtonInitializeOptions.md +0 -122
  331. package/docs/interfaces/internal_.BraintreePaypalCreditButtonInitializeOptions.md +0 -113
  332. package/docs/interfaces/internal_.BraintreeVenmoButtonInitializeOptions.md +0 -56
  333. package/docs/interfaces/internal_.BuyNowCartRequestBody.md +0 -26
  334. package/docs/interfaces/internal_.CheckoutButtonInitializerOptions.md +0 -24
  335. package/docs/interfaces/internal_.CheckoutButtonOptions.md +0 -57
  336. package/docs/interfaces/internal_.CheckoutButtonSelectors.md +0 -24
  337. package/docs/interfaces/internal_.PaypalButtonInitializeOptions.md +0 -78
  338. package/docs/interfaces/internal_.PaypalButtonStyleOptions.md +0 -66
  339. package/docs/interfaces/internal_.PaypalButtonStyleOptions_2.md +0 -69
  340. package/docs/interfaces/internal_.PaypalCommerceAlternativeMethodsButtonOptions.md +0 -61
  341. package/docs/interfaces/internal_.PaypalCommerceButtonInitializeOptions.md +0 -68
  342. package/docs/interfaces/internal_.PaypalCommerceCreditButtonInitializeOptions.md +0 -77
  343. package/docs/interfaces/internal_.PaypalCommerceInlineCheckoutButtonInitializeOptions.md +0 -58
  344. package/docs/interfaces/internal_.PaypalCommerceVenmoButtonInitializeOptions.md +0 -52
  345. package/docs/interfaces/internal_.WithApplePayButtonInitializeOptions.md +0 -17
@@ -0,0 +1,1528 @@
1
+ [@bigcommerce/checkout-sdk](../README.md) / [<internal\>](../modules/internal_.md) / CheckoutService
2
+
3
+ # Class: CheckoutService
4
+
5
+ [<internal>](../modules/internal_.md).CheckoutService
6
+
7
+ Responsible for completing the checkout process for the current customer.
8
+
9
+ This object can be used to collect all information that is required for
10
+ checkout, such as shipping and billing information. It can also be used to
11
+ retrieve the current checkout state and subscribe to its changes.
12
+
13
+ ## Table of contents
14
+
15
+ ### Constructors
16
+
17
+ - [constructor](internal_.CheckoutService.md#constructor)
18
+
19
+ ### Methods
20
+
21
+ - [applyCoupon](internal_.CheckoutService.md#applycoupon)
22
+ - [applyGiftCertificate](internal_.CheckoutService.md#applygiftcertificate)
23
+ - [applyStoreCredit](internal_.CheckoutService.md#applystorecredit)
24
+ - [assignItemsToAddress](internal_.CheckoutService.md#assignitemstoaddress)
25
+ - [clearError](internal_.CheckoutService.md#clearerror)
26
+ - [continueAsGuest](internal_.CheckoutService.md#continueasguest)
27
+ - [createConsignments](internal_.CheckoutService.md#createconsignments)
28
+ - [deinitializeCustomer](internal_.CheckoutService.md#deinitializecustomer)
29
+ - [deinitializePayment](internal_.CheckoutService.md#deinitializepayment)
30
+ - [deinitializeShipping](internal_.CheckoutService.md#deinitializeshipping)
31
+ - [deleteConsignment](internal_.CheckoutService.md#deleteconsignment)
32
+ - [deleteInstrument](internal_.CheckoutService.md#deleteinstrument)
33
+ - [executePaymentMethodCheckout](internal_.CheckoutService.md#executepaymentmethodcheckout)
34
+ - [executeSpamCheck](internal_.CheckoutService.md#executespamcheck)
35
+ - [finalizeOrderIfNeeded](internal_.CheckoutService.md#finalizeorderifneeded)
36
+ - [getState](internal_.CheckoutService.md#getstate)
37
+ - [initializeCustomer](internal_.CheckoutService.md#initializecustomer)
38
+ - [initializePayment](internal_.CheckoutService.md#initializepayment)
39
+ - [initializeShipping](internal_.CheckoutService.md#initializeshipping)
40
+ - [initializeSpamProtection](internal_.CheckoutService.md#initializespamprotection)
41
+ - [loadBillingAddressFields](internal_.CheckoutService.md#loadbillingaddressfields)
42
+ - [loadBillingCountries](internal_.CheckoutService.md#loadbillingcountries)
43
+ - [loadCheckout](internal_.CheckoutService.md#loadcheckout)
44
+ - [loadInstruments](internal_.CheckoutService.md#loadinstruments)
45
+ - [loadOrder](internal_.CheckoutService.md#loadorder)
46
+ - [loadPaymentMethods](internal_.CheckoutService.md#loadpaymentmethods)
47
+ - [loadShippingAddressFields](internal_.CheckoutService.md#loadshippingaddressfields)
48
+ - [loadShippingCountries](internal_.CheckoutService.md#loadshippingcountries)
49
+ - [loadShippingOptions](internal_.CheckoutService.md#loadshippingoptions)
50
+ - [notifyState](internal_.CheckoutService.md#notifystate)
51
+ - [removeCoupon](internal_.CheckoutService.md#removecoupon)
52
+ - [removeGiftCertificate](internal_.CheckoutService.md#removegiftcertificate)
53
+ - [selectConsignmentShippingOption](internal_.CheckoutService.md#selectconsignmentshippingoption)
54
+ - [selectShippingOption](internal_.CheckoutService.md#selectshippingoption)
55
+ - [sendSignInEmail](internal_.CheckoutService.md#sendsigninemail)
56
+ - [signInCustomer](internal_.CheckoutService.md#signincustomer)
57
+ - [signOutCustomer](internal_.CheckoutService.md#signoutcustomer)
58
+ - [submitOrder](internal_.CheckoutService.md#submitorder)
59
+ - [subscribe](internal_.CheckoutService.md#subscribe)
60
+ - [unassignItemsToAddress](internal_.CheckoutService.md#unassignitemstoaddress)
61
+ - [updateBillingAddress](internal_.CheckoutService.md#updatebillingaddress)
62
+ - [updateCheckout](internal_.CheckoutService.md#updatecheckout)
63
+ - [updateConsignment](internal_.CheckoutService.md#updateconsignment)
64
+ - [updateShippingAddress](internal_.CheckoutService.md#updateshippingaddress)
65
+ - [updateSubscriptions](internal_.CheckoutService.md#updatesubscriptions)
66
+
67
+ ## Constructors
68
+
69
+ ### constructor
70
+
71
+ • **new CheckoutService**()
72
+
73
+ ## Methods
74
+
75
+ ### applyCoupon
76
+
77
+ ▸ **applyCoupon**(`code`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
78
+
79
+ Applies a coupon code to the current checkout.
80
+
81
+ Once the coupon code gets applied, the quote for the current checkout will
82
+ be adjusted accordingly. The same coupon code cannot be applied more than
83
+ once.
84
+
85
+ ```js
86
+ await service.applyCoupon('COUPON');
87
+ ```
88
+
89
+ #### Parameters
90
+
91
+ | Name | Type | Description |
92
+ | :------ | :------ | :------ |
93
+ | `code` | `string` | The coupon code to apply to the current checkout. |
94
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for applying the coupon code. |
95
+
96
+ #### Returns
97
+
98
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
99
+
100
+ A promise that resolves to the current state.
101
+
102
+ ___
103
+
104
+ ### applyGiftCertificate
105
+
106
+ ▸ **applyGiftCertificate**(`code`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
107
+
108
+ Applies a gift certificate to the current checkout.
109
+
110
+ Once the gift certificate gets applied, the quote for the current
111
+ checkout will be adjusted accordingly.
112
+
113
+ ```js
114
+ await service.applyGiftCertificate('GIFT_CERTIFICATE');
115
+ ```
116
+
117
+ #### Parameters
118
+
119
+ | Name | Type | Description |
120
+ | :------ | :------ | :------ |
121
+ | `code` | `string` | The gift certificate to apply to the current checkout. |
122
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for applying the gift certificate. |
123
+
124
+ #### Returns
125
+
126
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
127
+
128
+ A promise that resolves to the current state.
129
+
130
+ ___
131
+
132
+ ### applyStoreCredit
133
+
134
+ ▸ **applyStoreCredit**(`useStoreCredit`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
135
+
136
+ Applies or removes customer's store credit code to the current checkout.
137
+
138
+ Once the store credit gets applied, the outstanding balance will be adjusted accordingly.
139
+
140
+ ```js
141
+ const state = await service.applyStoreCredit(true);
142
+
143
+ console.log(state.data.getCheckout().outstandingBalance);
144
+ ```
145
+
146
+ #### Parameters
147
+
148
+ | Name | Type | Description |
149
+ | :------ | :------ | :------ |
150
+ | `useStoreCredit` | `boolean` | - |
151
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for applying store credit. |
152
+
153
+ #### Returns
154
+
155
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
156
+
157
+ A promise that resolves to the current state.
158
+
159
+ ___
160
+
161
+ ### assignItemsToAddress
162
+
163
+ ▸ **assignItemsToAddress**(`consignment`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
164
+
165
+ Convenience method that assigns items to be shipped to a specific address.
166
+
167
+ Note: this method finds an existing consignment that matches the provided address
168
+ and assigns the provided items. If no consignment matches the address, a new one
169
+ will be created.
170
+
171
+ #### Parameters
172
+
173
+ | Name | Type | Description |
174
+ | :------ | :------ | :------ |
175
+ | `consignment` | [`ConsignmentAssignmentRequestBody`](../modules/internal_.md#consignmentassignmentrequestbody) | The consignment data that will be used. |
176
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for the request |
177
+
178
+ #### Returns
179
+
180
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
181
+
182
+ A promise that resolves to the current state.
183
+
184
+ ___
185
+
186
+ ### clearError
187
+
188
+ ▸ **clearError**(`error`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
189
+
190
+ Clear errors that have been collected from previous calls.
191
+
192
+ ```js
193
+ const state = await service.clearError(error);
194
+
195
+ console.log(state.errors.getError());
196
+ ```
197
+
198
+ #### Parameters
199
+
200
+ | Name | Type | Description |
201
+ | :------ | :------ | :------ |
202
+ | `error` | `Error` | Specific error object to clear |
203
+
204
+ #### Returns
205
+
206
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
207
+
208
+ A promise that resolves to the current state.
209
+
210
+ ___
211
+
212
+ ### continueAsGuest
213
+
214
+ ▸ **continueAsGuest**(`credentials`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
215
+
216
+ Continues to check out as a guest.
217
+
218
+ If your Checkout Settings allow it, your customers could continue the checkout as guests (without signing in).
219
+ If you have enabled the checkout setting "Prompt existing accounts to sign in", this information is
220
+ exposed as part of the [Customer](../interfaces/customer.md) object.
221
+
222
+ Once they provide their email address, it will be stored as
223
+ part of their [billing address](../interfaces/billingaddress.md).
224
+
225
+ #### Parameters
226
+
227
+ | Name | Type | Description |
228
+ | :------ | :------ | :------ |
229
+ | `credentials` | [`GuestCredentials`](../modules/internal_.md#guestcredentials) | The guest credentials to use, with optional subscriptions. |
230
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for continuing as a guest. |
231
+
232
+ #### Returns
233
+
234
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
235
+
236
+ A promise that resolves to the current state.
237
+
238
+ ___
239
+
240
+ ### createConsignments
241
+
242
+ ▸ **createConsignments**(`consignments`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
243
+
244
+ Creates consignments given a list.
245
+
246
+ Note: this is used when items need to be shipped to multiple addresses,
247
+ for single shipping address, use `CheckoutService#updateShippingAddress`.
248
+
249
+ When consignments are created, an updated list of shipping options will
250
+ become available for each consignment, unless no options are available.
251
+ If the update is successful, you can call
252
+ `CheckoutStoreSelector#getConsignments` to retrieve the updated list of
253
+ consignments.'
254
+
255
+ Beware that if a consignment includes all line items from another
256
+ consignment, that consignment will be deleted as a valid consignment must
257
+ include at least one valid line item.
258
+
259
+ You can submit an address that is partially complete. The address does
260
+ not get validated until you submit the order.
261
+
262
+ ```js
263
+ const state = await service.createConsignments(consignments);
264
+
265
+ console.log(state.data.getConsignments());
266
+ ```
267
+
268
+ #### Parameters
269
+
270
+ | Name | Type | Description |
271
+ | :------ | :------ | :------ |
272
+ | `consignments` | [`ConsignmentsRequestBody`](../modules/internal_.md#consignmentsrequestbody) | The list of consignments to be created. |
273
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for updating the shipping address. |
274
+
275
+ #### Returns
276
+
277
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
278
+
279
+ A promise that resolves to the current state.
280
+
281
+ ___
282
+
283
+ ### deinitializeCustomer
284
+
285
+ ▸ **deinitializeCustomer**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
286
+
287
+ De-initializes the sign-in step of a checkout process.
288
+
289
+ It should be called once you no longer want to prompt customers to sign
290
+ in. It can perform any necessary clean-up behind the scene, i.e.: remove
291
+ DOM nodes or event handlers that are attached as a result of customer
292
+ initialization.
293
+
294
+ ```js
295
+ await service.deinitializeCustomer({
296
+ methodId: 'amazon',
297
+ });
298
+ ```
299
+
300
+ #### Parameters
301
+
302
+ | Name | Type | Description |
303
+ | :------ | :------ | :------ |
304
+ | `options?` | [`CustomerRequestOptions`](../interfaces/internal_.CustomerRequestOptions.md) | Options for deinitializing the customer step of checkout. |
305
+
306
+ #### Returns
307
+
308
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
309
+
310
+ A promise that resolves to the current state.
311
+
312
+ ___
313
+
314
+ ### deinitializePayment
315
+
316
+ ▸ **deinitializePayment**(`options`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
317
+
318
+ De-initializes the payment step of a checkout process.
319
+
320
+ The method should be called once you no longer require a payment method
321
+ to be initialized. It can perform any necessary clean-up behind the
322
+ scene, i.e.: remove DOM nodes or event handlers that are attached as a
323
+ result of payment initialization.
324
+
325
+ ```js
326
+ await service.deinitializePayment({
327
+ methodId: 'amazon',
328
+ });
329
+ ```
330
+
331
+ #### Parameters
332
+
333
+ | Name | Type | Description |
334
+ | :------ | :------ | :------ |
335
+ | `options` | [`PaymentRequestOptions`](../interfaces/internal_.PaymentRequestOptions.md) | Options for deinitializing the payment step of checkout. |
336
+
337
+ #### Returns
338
+
339
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
340
+
341
+ A promise that resolves to the current state.
342
+
343
+ ___
344
+
345
+ ### deinitializeShipping
346
+
347
+ ▸ **deinitializeShipping**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
348
+
349
+ De-initializes the shipping step of a checkout process.
350
+
351
+ It should be called once you no longer need to collect shipping details.
352
+ It can perform any necessary clean-up behind the scene, i.e.: remove DOM
353
+ nodes or event handlers that are attached as a result of shipping
354
+ initialization.
355
+
356
+ ```js
357
+ await service.deinitializeShipping({
358
+ methodId: 'amazon',
359
+ });
360
+ ```
361
+
362
+ #### Parameters
363
+
364
+ | Name | Type | Description |
365
+ | :------ | :------ | :------ |
366
+ | `options?` | [`ShippingRequestOptions`](../interfaces/internal_.ShippingRequestOptions.md)<{}\> | Options for deinitializing the shipping step of checkout. |
367
+
368
+ #### Returns
369
+
370
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
371
+
372
+ A promise that resolves to the current state.
373
+
374
+ ___
375
+
376
+ ### deleteConsignment
377
+
378
+ ▸ **deleteConsignment**(`consignmentId`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
379
+
380
+ Deletes a consignment
381
+
382
+ ```js
383
+ const state = await service.deleteConsignment('55c96cda6f04c');
384
+
385
+ console.log(state.data.getConsignments());
386
+ ```
387
+
388
+ #### Parameters
389
+
390
+ | Name | Type | Description |
391
+ | :------ | :------ | :------ |
392
+ | `consignmentId` | `string` | The ID of the consignment to be deleted |
393
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for the consignment delete request |
394
+
395
+ #### Returns
396
+
397
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
398
+
399
+ A promise that resolves to the current state.
400
+
401
+ ___
402
+
403
+ ### deleteInstrument
404
+
405
+ ▸ **deleteInstrument**(`instrumentId`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
406
+
407
+ Deletes a payment instrument by an id.
408
+
409
+ Once an instrument gets removed, it can no longer be retrieved using
410
+ `CheckoutStoreSelector#getInstruments`.
411
+
412
+ ```js
413
+ const state = service.deleteInstrument('123');
414
+
415
+ console.log(state.data.getInstruments());
416
+ ```
417
+
418
+ #### Parameters
419
+
420
+ | Name | Type | Description |
421
+ | :------ | :------ | :------ |
422
+ | `instrumentId` | `string` | The identifier of the payment instrument to delete. |
423
+
424
+ #### Returns
425
+
426
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
427
+
428
+ A promise that resolves to the current state.
429
+
430
+ ___
431
+
432
+ ### executePaymentMethodCheckout
433
+
434
+ ▸ **executePaymentMethodCheckout**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
435
+
436
+ Executes custom checkout of the priority payment method.
437
+
438
+ Some payment methods, such as Bolt, can use their own checkout
439
+ with autofilled customers data, to make checkout passing process
440
+ easier and faster for customers with Bolt account.
441
+
442
+ ```js
443
+ await service.executePaymentMethodCheckout({
444
+ methodId: 'bolt',
445
+ fallback: () => {},
446
+ });
447
+ ```
448
+
449
+ #### Parameters
450
+
451
+ | Name | Type | Description |
452
+ | :------ | :------ | :------ |
453
+ | `options?` | [`ExecutePaymentMethodCheckoutOptions`](../interfaces/internal_.ExecutePaymentMethodCheckoutOptions.md) | Options for executing payment method checkout. |
454
+
455
+ #### Returns
456
+
457
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
458
+
459
+ A promise that resolves to the current state.
460
+
461
+ ___
462
+
463
+ ### executeSpamCheck
464
+
465
+ ▸ **executeSpamCheck**(): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
466
+
467
+ Verifies whether the current checkout is created by a human.
468
+
469
+ Note: this method will do the initialization, therefore you do not
470
+ need to call `CheckoutService#initializeSpamProtection`
471
+ before calling this method.
472
+
473
+ With spam protection enabled, the customer has to be verified as
474
+ a human. The order creation will fail if spam protection
475
+ is enabled but verification fails. You should call this method before
476
+ `submitOrder` method is called (i.e.: when the shopper
477
+ first gets to the payment step).
478
+
479
+ **Note**: You need to enable Google ReCAPTCHA bot protection in your Checkout Settings.
480
+
481
+ ```js
482
+ await service.executeSpamCheck();
483
+ ```
484
+
485
+ #### Returns
486
+
487
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
488
+
489
+ A promise that resolves to the current state.
490
+
491
+ ___
492
+
493
+ ### finalizeOrderIfNeeded
494
+
495
+ ▸ **finalizeOrderIfNeeded**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
496
+
497
+ Finalizes the submission process for an order.
498
+
499
+ This method is only required for certain hosted payment methods that
500
+ require a customer to enter their credit card details on their website.
501
+ You need to call this method once the customer has redirected back to
502
+ checkout in order to complete the checkout process.
503
+
504
+ If the method is called before order finalization is required or for a
505
+ payment method that does not require order finalization, an error will be
506
+ thrown. Conversely, if the method is called successfully, you should
507
+ immediately redirect the customer to the order confirmation page.
508
+
509
+ ```js
510
+ try {
511
+ await service.finalizeOrderIfNeeded();
512
+
513
+ window.location.assign('/order-confirmation');
514
+ } catch (error) {
515
+ if (error.type !== 'order_finalization_not_required') {
516
+ throw error;
517
+ }
518
+ }
519
+ ```
520
+
521
+ **`throws`** `OrderFinalizationNotRequiredError` error if order finalization
522
+ is not required for the current order at the time of execution.
523
+
524
+ #### Parameters
525
+
526
+ | Name | Type | Description |
527
+ | :------ | :------ | :------ |
528
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for finalizing the current order. |
529
+
530
+ #### Returns
531
+
532
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
533
+
534
+ A promise that resolves to the current state.
535
+
536
+ ___
537
+
538
+ ### getState
539
+
540
+ ▸ **getState**(): [`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)
541
+
542
+ Returns a snapshot of the current checkout state.
543
+
544
+ The method returns a new instance every time there is a change in the
545
+ checkout state. You can query the state by calling any of its getter
546
+ methods.
547
+
548
+ ```js
549
+ const state = service.getState();
550
+
551
+ console.log(state.data.getOrder());
552
+ console.log(state.errors.getSubmitOrderError());
553
+ console.log(state.statuses.isSubmittingOrder());
554
+ ```
555
+
556
+ #### Returns
557
+
558
+ [`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)
559
+
560
+ The current customer's checkout state
561
+
562
+ ___
563
+
564
+ ### initializeCustomer
565
+
566
+ ▸ **initializeCustomer**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
567
+
568
+ Initializes the sign-in step of a checkout process.
569
+
570
+ Some payment methods, such as Amazon, have their own sign-in flow. In
571
+ order to support them, this method must be called.
572
+
573
+ ```js
574
+ await service.initializeCustomer({
575
+ methodId: 'amazon',
576
+ amazon: {
577
+ container: 'signInButton',
578
+ },
579
+ });
580
+ ```
581
+
582
+ #### Parameters
583
+
584
+ | Name | Type | Description |
585
+ | :------ | :------ | :------ |
586
+ | `options?` | [`CustomerInitializeOptions`](../modules/internal_.md#customerinitializeoptions) | Options for initializing the customer step of checkout. |
587
+
588
+ #### Returns
589
+
590
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
591
+
592
+ A promise that resolves to the current state.
593
+
594
+ ___
595
+
596
+ ### initializePayment
597
+
598
+ ▸ **initializePayment**(`options`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
599
+
600
+ Initializes the payment step of a checkout process.
601
+
602
+ Before a payment method can accept payment details, it must first be
603
+ initialized. Some payment methods require you to provide additional
604
+ initialization options. For example, Amazon requires a container ID in
605
+ order to initialize their payment widget.
606
+
607
+ ```js
608
+ await service.initializePayment({
609
+ methodId: 'amazon',
610
+ amazon: {
611
+ container: 'walletWidget',
612
+ },
613
+ });
614
+ ```
615
+
616
+ #### Parameters
617
+
618
+ | Name | Type | Description |
619
+ | :------ | :------ | :------ |
620
+ | `options` | [`PaymentInitializeOptions`](../modules/internal_.md#paymentinitializeoptions) | Options for initializing the payment step of checkout. |
621
+
622
+ #### Returns
623
+
624
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
625
+
626
+ A promise that resolves to the current state.
627
+
628
+ ___
629
+
630
+ ### initializeShipping
631
+
632
+ ▸ **initializeShipping**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
633
+
634
+ Initializes the shipping step of a checkout process.
635
+
636
+ Some payment methods, such as Amazon, can provide shipping information to
637
+ be used for checkout. In order to support them, this method must be
638
+ called.
639
+
640
+ ```js
641
+ await service.initializeShipping({
642
+ methodId: 'amazon',
643
+ amazon: {
644
+ container: 'addressBook',
645
+ },
646
+ });
647
+ ```
648
+
649
+ #### Parameters
650
+
651
+ | Name | Type | Description |
652
+ | :------ | :------ | :------ |
653
+ | `options?` | [`ShippingInitializeOptions`](../interfaces/internal_.ShippingInitializeOptions.md)<{}\> | Options for initializing the shipping step of checkout. |
654
+
655
+ #### Returns
656
+
657
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
658
+
659
+ A promise that resolves to the current state.
660
+
661
+ ___
662
+
663
+ ### initializeSpamProtection
664
+
665
+ ▸ **initializeSpamProtection**(`options`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
666
+
667
+ Initializes the spam protection for order creation.
668
+
669
+ Note: Use `CheckoutService#executeSpamCheck` instead.
670
+ You do not need to call this method before calling
671
+ `CheckoutService#executeSpamCheck`.
672
+
673
+ With spam protection enabled, the customer has to be verified as
674
+ a human. The order creation will fail if spam protection
675
+ is enabled but verification fails.
676
+
677
+ ```js
678
+ await service.initializeSpamProtection();
679
+ ```
680
+
681
+ **`deprecated`** - Use CheckoutService#executeSpamCheck instead.
682
+
683
+ #### Parameters
684
+
685
+ | Name | Type | Description |
686
+ | :------ | :------ | :------ |
687
+ | `options` | [`SpamProtectionOptions`](../interfaces/internal_.SpamProtectionOptions.md) | Options for initializing spam protection. |
688
+
689
+ #### Returns
690
+
691
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
692
+
693
+ A promise that resolves to the current state.
694
+
695
+ ___
696
+
697
+ ### loadBillingAddressFields
698
+
699
+ ▸ **loadBillingAddressFields**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
700
+
701
+ Loads a set of form fields that should be presented to customers in order
702
+ to capture their billing address.
703
+
704
+ Once the method has been executed successfully, you can call
705
+ `CheckoutStoreSelector#getBillingAddressFields` to retrieve the set of
706
+ form fields.
707
+
708
+ ```js
709
+ const state = service.loadBillingAddressFields();
710
+
711
+ console.log(state.data.getBillingAddressFields('US'));
712
+ ```
713
+
714
+ #### Parameters
715
+
716
+ | Name | Type | Description |
717
+ | :------ | :------ | :------ |
718
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the billing address form fields. |
719
+
720
+ #### Returns
721
+
722
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
723
+
724
+ A promise that resolves to the current state.
725
+
726
+ ___
727
+
728
+ ### loadBillingCountries
729
+
730
+ ▸ **loadBillingCountries**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
731
+
732
+ Loads a list of countries available for billing.
733
+
734
+ Once you make a successful request, you will be able to retrieve the list
735
+ of countries by calling `CheckoutStoreSelector#getBillingCountries`.
736
+
737
+ ```js
738
+ const state = await service.loadBillingCountries();
739
+
740
+ console.log(state.data.getBillingCountries());
741
+ ```
742
+
743
+ #### Parameters
744
+
745
+ | Name | Type | Description |
746
+ | :------ | :------ | :------ |
747
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the available billing countries. |
748
+
749
+ #### Returns
750
+
751
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
752
+
753
+ A promise that resolves to the current state.
754
+
755
+ ___
756
+
757
+ ### loadCheckout
758
+
759
+ ▸ **loadCheckout**(`id?`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
760
+
761
+ Loads the current checkout.
762
+
763
+ This method can only be called if there is an active checkout. Also, it
764
+ can only retrieve data that belongs to the current customer. When it is
765
+ successfully executed, you can retrieve the data by calling
766
+ `CheckoutStoreSelector#getCheckout`.
767
+
768
+ ```js
769
+ const state = await service.loadCheckout('0cfd6c06-57c3-4e29-8d7a-de55cc8a9052');
770
+
771
+ console.log(state.data.getCheckout());
772
+ ```
773
+
774
+ #### Parameters
775
+
776
+ | Name | Type | Description |
777
+ | :------ | :------ | :------ |
778
+ | `id?` | `string` | The identifier of the checkout to load, or the default checkout if not provided. |
779
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<[`CheckoutParams`](../interfaces/internal_.CheckoutParams.md)\> | Options for loading the current checkout. |
780
+
781
+ #### Returns
782
+
783
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
784
+
785
+ A promise that resolves to the current state.
786
+
787
+ ___
788
+
789
+ ### loadInstruments
790
+
791
+ ▸ **loadInstruments**(): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
792
+
793
+ Loads a list of payment instruments associated with a customer.
794
+
795
+ Once the method has been called successfully, you can retrieve the list
796
+ of payment instruments by calling `CheckoutStoreSelector#getInstruments`.
797
+ If the customer does not have any payment instruments on record, i.e.:
798
+ credit card, you will get an empty list instead.
799
+
800
+ ```js
801
+ const state = service.loadInstruments();
802
+
803
+ console.log(state.data.getInstruments());
804
+ ```
805
+
806
+ #### Returns
807
+
808
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
809
+
810
+ A promise that resolves to the current state.
811
+
812
+ ___
813
+
814
+ ### loadOrder
815
+
816
+ ▸ **loadOrder**(`orderId`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
817
+
818
+ Loads an order by an id.
819
+
820
+ The method can only retrieve an order if the order belongs to the current
821
+ customer. If it is successfully executed, the data can be retrieved by
822
+ calling `CheckoutStoreSelector#getOrder`.
823
+
824
+ ```js
825
+ const state = await service.loadOrder(123);
826
+
827
+ console.log(state.data.getOrder());
828
+ ```
829
+
830
+ #### Parameters
831
+
832
+ | Name | Type | Description |
833
+ | :------ | :------ | :------ |
834
+ | `orderId` | `number` | The identifier of the order to load. |
835
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the order. |
836
+
837
+ #### Returns
838
+
839
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
840
+
841
+ A promise that resolves to the current state.
842
+
843
+ ___
844
+
845
+ ### loadPaymentMethods
846
+
847
+ ▸ **loadPaymentMethods**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
848
+
849
+ Loads a list of payment methods available for checkout.
850
+
851
+ If a customer enters their payment details before navigating to the
852
+ checkout page (i.e.: using PayPal checkout button on the cart page), only
853
+ one payment method will be available for the customer - the selected
854
+ payment method. Otherwise, by default, all payment methods configured by
855
+ the merchant will be available for the customer.
856
+
857
+ Once the method is executed successfully, you can call
858
+ `CheckoutStoreSelector#getPaymentMethods` to retrieve the list of payment
859
+ methods.
860
+
861
+ ```js
862
+ const state = service.loadPaymentMethods();
863
+
864
+ console.log(state.data.getPaymentMethods());
865
+ ```
866
+
867
+ #### Parameters
868
+
869
+ | Name | Type | Description |
870
+ | :------ | :------ | :------ |
871
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the payment methods that are available to the current customer. |
872
+
873
+ #### Returns
874
+
875
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
876
+
877
+ A promise that resolves to the current state.
878
+
879
+ ___
880
+
881
+ ### loadShippingAddressFields
882
+
883
+ ▸ **loadShippingAddressFields**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
884
+
885
+ Loads a set of form fields that should be presented to customers in order
886
+ to capture their shipping address.
887
+
888
+ Once the method has been executed successfully, you can call
889
+ `CheckoutStoreSelector#getShippingAddressFields` to retrieve the set of
890
+ form fields.
891
+
892
+ ```js
893
+ const state = service.loadShippingAddressFields();
894
+
895
+ console.log(state.data.getShippingAddressFields('US'));
896
+ ```
897
+
898
+ #### Parameters
899
+
900
+ | Name | Type | Description |
901
+ | :------ | :------ | :------ |
902
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the shipping address form fields. |
903
+
904
+ #### Returns
905
+
906
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
907
+
908
+ A promise that resolves to the current state.
909
+
910
+ ___
911
+
912
+ ### loadShippingCountries
913
+
914
+ ▸ **loadShippingCountries**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
915
+
916
+ Loads a list of countries available for shipping.
917
+
918
+ The list is determined based on the shipping zones configured by a
919
+ merchant. Once you make a successful call, you will be able to retrieve
920
+ the list of available shipping countries by calling
921
+ `CheckoutStoreSelector#getShippingCountries`.
922
+
923
+ ```js
924
+ const state = await service.loadShippingCountries();
925
+
926
+ console.log(state.data.getShippingCountries());
927
+ ```
928
+
929
+ #### Parameters
930
+
931
+ | Name | Type | Description |
932
+ | :------ | :------ | :------ |
933
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the available shipping countries. |
934
+
935
+ #### Returns
936
+
937
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
938
+
939
+ A promise that resolves to the current state.
940
+
941
+ ___
942
+
943
+ ### loadShippingOptions
944
+
945
+ ▸ **loadShippingOptions**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
946
+
947
+ Loads a list of shipping options available for checkout.
948
+
949
+ Available shipping options can only be determined once a customer
950
+ provides their shipping address. If the method is executed successfully,
951
+ `CheckoutStoreSelector#getShippingOptions` can be called to retrieve the
952
+ list of shipping options.
953
+
954
+ ```js
955
+ const state = await service.loadShippingOptions();
956
+
957
+ console.log(state.data.getShippingOptions());
958
+ ```
959
+
960
+ #### Parameters
961
+
962
+ | Name | Type | Description |
963
+ | :------ | :------ | :------ |
964
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the available shipping options. |
965
+
966
+ #### Returns
967
+
968
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
969
+
970
+ A promise that resolves to the current state.
971
+
972
+ ___
973
+
974
+ ### notifyState
975
+
976
+ ▸ **notifyState**(): `void`
977
+
978
+ Notifies all subscribers with the current state.
979
+
980
+ When this method gets called, the subscribers get called regardless if
981
+ they have any filters applied.
982
+
983
+ #### Returns
984
+
985
+ `void`
986
+
987
+ ___
988
+
989
+ ### removeCoupon
990
+
991
+ ▸ **removeCoupon**(`code`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
992
+
993
+ Removes a coupon code from the current checkout.
994
+
995
+ Once the coupon code gets removed, the quote for the current checkout will
996
+ be adjusted accordingly.
997
+
998
+ ```js
999
+ await service.removeCoupon('COUPON');
1000
+ ```
1001
+
1002
+ #### Parameters
1003
+
1004
+ | Name | Type | Description |
1005
+ | :------ | :------ | :------ |
1006
+ | `code` | `string` | The coupon code to remove from the current checkout. |
1007
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for removing the coupon code. |
1008
+
1009
+ #### Returns
1010
+
1011
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1012
+
1013
+ A promise that resolves to the current state.
1014
+
1015
+ ___
1016
+
1017
+ ### removeGiftCertificate
1018
+
1019
+ ▸ **removeGiftCertificate**(`code`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1020
+
1021
+ Removes a gift certificate from an order.
1022
+
1023
+ Once the gift certificate gets removed, the quote for the current
1024
+ checkout will be adjusted accordingly.
1025
+
1026
+ ```js
1027
+ await service.removeGiftCertificate('GIFT_CERTIFICATE');
1028
+ ```
1029
+
1030
+ #### Parameters
1031
+
1032
+ | Name | Type | Description |
1033
+ | :------ | :------ | :------ |
1034
+ | `code` | `string` | The gift certificate to remove from the current checkout. |
1035
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for removing the gift certificate. |
1036
+
1037
+ #### Returns
1038
+
1039
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1040
+
1041
+ A promise that resolves to the current state.
1042
+
1043
+ ___
1044
+
1045
+ ### selectConsignmentShippingOption
1046
+
1047
+ ▸ **selectConsignmentShippingOption**(`consignmentId`, `shippingOptionId`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1048
+
1049
+ Selects a shipping option for a given consignment.
1050
+
1051
+ Note: this is used when items need to be shipped to multiple addresses,
1052
+ for single shipping address, use `CheckoutService#updateShippingAddress`.
1053
+
1054
+ If a shipping option has an additional cost, the quote for the current
1055
+ order will be adjusted once the option is selected.
1056
+
1057
+ ```js
1058
+ const state = await service.selectConsignmentShippingOption(consignmentId, optionId);
1059
+
1060
+ console.log(state.data.getConsignments());
1061
+ ```
1062
+
1063
+ #### Parameters
1064
+
1065
+ | Name | Type | Description |
1066
+ | :------ | :------ | :------ |
1067
+ | `consignmentId` | `string` | The identified of the consignment to be updated. |
1068
+ | `shippingOptionId` | `string` | The identifier of the shipping option to select. |
1069
+ | `options?` | [`ShippingRequestOptions`](../interfaces/internal_.ShippingRequestOptions.md)<{}\> | Options for selecting the shipping option. |
1070
+
1071
+ #### Returns
1072
+
1073
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1074
+
1075
+ A promise that resolves to the current state.
1076
+
1077
+ ___
1078
+
1079
+ ### selectShippingOption
1080
+
1081
+ ▸ **selectShippingOption**(`shippingOptionId`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1082
+
1083
+ Selects a shipping option for the current address.
1084
+
1085
+ If a shipping option has an additional cost, the quote for the current
1086
+ order will be adjusted once the option is selected.
1087
+
1088
+ ```js
1089
+ const state = await service.selectShippingOption('address-id', 'shipping-option-id');
1090
+
1091
+ console.log(state.data.getSelectedShippingOption());
1092
+ ```
1093
+
1094
+ #### Parameters
1095
+
1096
+ | Name | Type | Description |
1097
+ | :------ | :------ | :------ |
1098
+ | `shippingOptionId` | `string` | The identifier of the shipping option to select. |
1099
+ | `options?` | [`ShippingRequestOptions`](../interfaces/internal_.ShippingRequestOptions.md)<{}\> | Options for selecting the shipping option. |
1100
+
1101
+ #### Returns
1102
+
1103
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1104
+
1105
+ A promise that resolves to the current state.
1106
+
1107
+ ___
1108
+
1109
+ ### sendSignInEmail
1110
+
1111
+ ▸ **sendSignInEmail**(`signInEmailRequest`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1112
+
1113
+ Sends a email that contains a single-use sign-in link. When a valid links is clicked,
1114
+ signs in the customer without requiring any password, redirecting them to the account page if no redirectUrl is provided.
1115
+
1116
+ ```js
1117
+ checkoutService.sendSignInEmail({ email: 'foo@bar.com', redirectUrl: 'checkout' });
1118
+ ```
1119
+
1120
+ #### Parameters
1121
+
1122
+ | Name | Type | Description |
1123
+ | :------ | :------ | :------ |
1124
+ | `signInEmailRequest` | [`SignInEmailRequestBody`](../interfaces/internal_.SignInEmailRequestBody.md) | The sign-in email request values. |
1125
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for the send email request. |
1126
+
1127
+ #### Returns
1128
+
1129
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1130
+
1131
+ A promise that resolves to the current state.
1132
+
1133
+ ___
1134
+
1135
+ ### signInCustomer
1136
+
1137
+ ▸ **signInCustomer**(`credentials`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1138
+
1139
+ Signs into a customer's registered account.
1140
+
1141
+ Once the customer is signed in successfully, the checkout state will be
1142
+ populated with information associated with the customer, such as their
1143
+ saved addresses. You can call `CheckoutStoreSelector#getCustomer` to
1144
+ retrieve the data.
1145
+
1146
+ ```js
1147
+ const state = await service.signInCustomer({
1148
+ email: 'foo@bar.com',
1149
+ password: 'password123',
1150
+ });
1151
+
1152
+ console.log(state.data.getCustomer());
1153
+ ```
1154
+
1155
+ #### Parameters
1156
+
1157
+ | Name | Type | Description |
1158
+ | :------ | :------ | :------ |
1159
+ | `credentials` | [`CustomerCredentials`](../interfaces/internal_.CustomerCredentials.md) | The credentials to be used for signing in the customer. |
1160
+ | `options?` | [`CustomerRequestOptions`](../interfaces/internal_.CustomerRequestOptions.md) | Options for signing in the customer. |
1161
+
1162
+ #### Returns
1163
+
1164
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1165
+
1166
+ A promise that resolves to the current state.
1167
+
1168
+ ___
1169
+
1170
+ ### signOutCustomer
1171
+
1172
+ ▸ **signOutCustomer**(`options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1173
+
1174
+ Signs out the current customer if they are previously signed in.
1175
+
1176
+ Once the customer is successfully signed out, the checkout state will be
1177
+ reset automatically.
1178
+
1179
+ ```js
1180
+ const state = await service.signOutCustomer();
1181
+
1182
+ // The returned object should not contain information about the previously signed-in customer.
1183
+ console.log(state.data.getCustomer());
1184
+ ```
1185
+
1186
+ When a store has "Allow customers to access their cart across multiple devices" enabled, signing out
1187
+ will remove the cart/checkout data from the current session. An error with type="checkout_not_available" will be thrown.
1188
+
1189
+ ```js
1190
+ try {
1191
+ await service.signOutCustomer();
1192
+ } catch (error) {
1193
+ if (error.type === 'checkout_not_available') {
1194
+ window.top.location.assign('/');
1195
+ }
1196
+ }
1197
+ ```
1198
+
1199
+ #### Parameters
1200
+
1201
+ | Name | Type | Description |
1202
+ | :------ | :------ | :------ |
1203
+ | `options?` | [`CustomerRequestOptions`](../interfaces/internal_.CustomerRequestOptions.md) | Options for signing out the customer. |
1204
+
1205
+ #### Returns
1206
+
1207
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1208
+
1209
+ A promise that resolves to the current state.
1210
+
1211
+ ___
1212
+
1213
+ ### submitOrder
1214
+
1215
+ ▸ **submitOrder**(`payload`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1216
+
1217
+ Submits an order, thereby completing a checkout process.
1218
+
1219
+ Before you can submit an order, you must initialize the payment method
1220
+ chosen by the customer by calling `CheckoutService#initializePayment`.
1221
+
1222
+ ```js
1223
+ await service.initializePayment({ methodId: 'braintree' });
1224
+ await service.submitOrder({
1225
+ payment: {
1226
+ methodId: 'braintree',
1227
+ paymentData: {
1228
+ ccExpiry: { month: 10, year: 20 },
1229
+ ccName: 'BigCommerce',
1230
+ ccNumber: '4111111111111111',
1231
+ ccCvv: 123,
1232
+ },
1233
+ },
1234
+ });
1235
+ ```
1236
+
1237
+ You are not required to include `paymentData` if the order does not
1238
+ require additional payment details. For example, the customer has already
1239
+ entered their payment details on the cart page using one of the hosted
1240
+ payment methods, such as PayPal. Or the customer has applied a gift
1241
+ certificate that exceeds the grand total amount.
1242
+
1243
+ If the order is submitted successfully, you can retrieve the newly
1244
+ created order by calling `CheckoutStoreSelector#getOrder`.
1245
+
1246
+ ```js
1247
+ const state = await service.submitOrder(payload);
1248
+
1249
+ console.log(state.data.getOrder());
1250
+ ```
1251
+
1252
+ #### Parameters
1253
+
1254
+ | Name | Type | Description |
1255
+ | :------ | :------ | :------ |
1256
+ | `payload` | [`OrderRequestBody`](../interfaces/internal_.OrderRequestBody.md) | The request payload to submit for the current order. |
1257
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for submitting the current order. |
1258
+
1259
+ #### Returns
1260
+
1261
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1262
+
1263
+ A promise that resolves to the current state.
1264
+
1265
+ ___
1266
+
1267
+ ### subscribe
1268
+
1269
+ ▸ **subscribe**(`subscriber`, ...`filters`): () => `void`
1270
+
1271
+ Subscribes to any changes to the current state.
1272
+
1273
+ The method registers a callback function and executes it every time there
1274
+ is a change in the checkout state.
1275
+
1276
+ ```js
1277
+ service.subscribe(state => {
1278
+ console.log(state.data.getCart());
1279
+ });
1280
+ ```
1281
+
1282
+ The method can be configured to notify subscribers only regarding
1283
+ relevant changes, by providing a filter function.
1284
+
1285
+ ```js
1286
+ const filter = state => state.data.getCart();
1287
+
1288
+ // Only trigger the subscriber when the cart changes.
1289
+ service.subscribe(state => {
1290
+ console.log(state.data.getCart())
1291
+ }, filter);
1292
+ ```
1293
+
1294
+ #### Parameters
1295
+
1296
+ | Name | Type | Description |
1297
+ | :------ | :------ | :------ |
1298
+ | `subscriber` | (`state`: [`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)) => `void` | The function to subscribe to state changes. |
1299
+ | `...filters` | (`state`: [`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)) => `any`[] | One or more functions to filter out irrelevant state changes. If more than one function is provided, the subscriber will only be triggered if all conditions are met. |
1300
+
1301
+ #### Returns
1302
+
1303
+ `fn`
1304
+
1305
+ A function, if called, will unsubscribe the subscriber.
1306
+
1307
+ ▸ (): `void`
1308
+
1309
+ Subscribes to any changes to the current state.
1310
+
1311
+ The method registers a callback function and executes it every time there
1312
+ is a change in the checkout state.
1313
+
1314
+ ```js
1315
+ service.subscribe(state => {
1316
+ console.log(state.data.getCart());
1317
+ });
1318
+ ```
1319
+
1320
+ The method can be configured to notify subscribers only regarding
1321
+ relevant changes, by providing a filter function.
1322
+
1323
+ ```js
1324
+ const filter = state => state.data.getCart();
1325
+
1326
+ // Only trigger the subscriber when the cart changes.
1327
+ service.subscribe(state => {
1328
+ console.log(state.data.getCart())
1329
+ }, filter);
1330
+ ```
1331
+
1332
+ ##### Returns
1333
+
1334
+ `void`
1335
+
1336
+ A function, if called, will unsubscribe the subscriber.
1337
+
1338
+ ___
1339
+
1340
+ ### unassignItemsToAddress
1341
+
1342
+ ▸ **unassignItemsToAddress**(`consignment`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1343
+
1344
+ Convenience method that unassigns items from a specific shipping address.
1345
+
1346
+ Note: this method finds an existing consignment that matches the provided address
1347
+ and unassigns the specified items. If the consignment ends up with no line items
1348
+ after the unassignment, it will be deleted.
1349
+
1350
+ #### Parameters
1351
+
1352
+ | Name | Type | Description |
1353
+ | :------ | :------ | :------ |
1354
+ | `consignment` | [`ConsignmentAssignmentRequestBody`](../modules/internal_.md#consignmentassignmentrequestbody) | The consignment data that will be used. |
1355
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for the request |
1356
+
1357
+ #### Returns
1358
+
1359
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1360
+
1361
+ A promise that resolves to the current state.
1362
+
1363
+ ___
1364
+
1365
+ ### updateBillingAddress
1366
+
1367
+ ▸ **updateBillingAddress**(`address`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1368
+
1369
+ Updates the billing address for the current checkout.
1370
+
1371
+ A customer must provide their billing address before they can proceed to
1372
+ pay for their order.
1373
+
1374
+ You can submit an address that is partially complete. The address does
1375
+ not get validated until you submit the order.
1376
+
1377
+ ```js
1378
+ const state = await service.updateBillingAddress(address);
1379
+
1380
+ console.log(state.data.getBillingAddress());
1381
+ ```
1382
+
1383
+ #### Parameters
1384
+
1385
+ | Name | Type | Description |
1386
+ | :------ | :------ | :------ |
1387
+ | `address` | `Partial`<[`BillingAddressRequestBody`](../interfaces/internal_.BillingAddressRequestBody.md)\> | The address to be used for billing. |
1388
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for updating the billing address. |
1389
+
1390
+ #### Returns
1391
+
1392
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1393
+
1394
+ A promise that resolves to the current state.
1395
+
1396
+ ___
1397
+
1398
+ ### updateCheckout
1399
+
1400
+ ▸ **updateCheckout**(`payload`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1401
+
1402
+ Updates specific properties of the current checkout.
1403
+
1404
+ ```js
1405
+ const state = await service.updateCheckout(checkout);
1406
+
1407
+ console.log(state.data.getCheckout());
1408
+ ```
1409
+
1410
+ #### Parameters
1411
+
1412
+ | Name | Type | Description |
1413
+ | :------ | :------ | :------ |
1414
+ | `payload` | [`CheckoutRequestBody`](../interfaces/internal_.CheckoutRequestBody.md) | The checkout properties to be updated. |
1415
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for loading the current checkout. |
1416
+
1417
+ #### Returns
1418
+
1419
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1420
+
1421
+ A promise that resolves to the current state.
1422
+
1423
+ ___
1424
+
1425
+ ### updateConsignment
1426
+
1427
+ ▸ **updateConsignment**(`consignment`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1428
+
1429
+ Updates a specific consignment.
1430
+
1431
+ Note: this is used when items need to be shipped to multiple addresses,
1432
+ for single shipping address, use `CheckoutService#selectShippingOption`.
1433
+
1434
+ When a shipping address for a consignment is updated, an updated list of
1435
+ shipping options will become available for the consignment, unless no
1436
+ options are available. If the update is successful, you can call
1437
+ `CheckoutStoreSelector#getConsignments` to retrieve updated list of
1438
+ consignments.
1439
+
1440
+ Beware that if the updated consignment includes all line items from another
1441
+ consignment, that consignment will be deleted as a valid consignment must
1442
+ include at least one valid line item.
1443
+
1444
+ If the shipping address changes and the selected shipping option becomes
1445
+ unavailable for the updated address, the shipping option will be
1446
+ deselected.
1447
+
1448
+ You can submit an address that is partially complete. The address does
1449
+ not get validated until you submit the order.
1450
+
1451
+ ```js
1452
+ const state = await service.updateConsignment(consignment);
1453
+
1454
+ console.log(state.data.getConsignments());
1455
+ ```
1456
+
1457
+ #### Parameters
1458
+
1459
+ | Name | Type | Description |
1460
+ | :------ | :------ | :------ |
1461
+ | `consignment` | [`ConsignmentUpdateRequestBody`](../interfaces/internal_.ConsignmentUpdateRequestBody.md) | The consignment data that will be used. |
1462
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for updating the shipping address. |
1463
+
1464
+ #### Returns
1465
+
1466
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1467
+
1468
+ A promise that resolves to the current state.
1469
+
1470
+ ___
1471
+
1472
+ ### updateShippingAddress
1473
+
1474
+ ▸ **updateShippingAddress**(`address`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1475
+
1476
+ Updates the shipping address for the current checkout.
1477
+
1478
+ When a customer updates their shipping address for an order, they will
1479
+ see an updated list of shipping options and the cost for each option,
1480
+ unless no options are available. If the update is successful, you can
1481
+ call `CheckoutStoreSelector#getShippingAddress` to retrieve the address.
1482
+
1483
+ If the shipping address changes and the selected shipping option becomes
1484
+ unavailable for the updated address, the shipping option will be
1485
+ deselected.
1486
+
1487
+ You can submit an address that is partially complete. The address does
1488
+ not get validated until you submit the order.
1489
+
1490
+ ```js
1491
+ const state = await service.updateShippingAddress(address);
1492
+
1493
+ console.log(state.data.getShippingAddress());
1494
+ ```
1495
+
1496
+ #### Parameters
1497
+
1498
+ | Name | Type | Description |
1499
+ | :------ | :------ | :------ |
1500
+ | `address` | `Partial`<[`AddressRequestBody`](../interfaces/internal_.AddressRequestBody.md)\> | The address to be used for shipping. |
1501
+ | `options?` | [`ShippingRequestOptions`](../interfaces/internal_.ShippingRequestOptions.md)<[`CheckoutParams`](../interfaces/internal_.CheckoutParams.md)\> | Options for updating the shipping address. |
1502
+
1503
+ #### Returns
1504
+
1505
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1506
+
1507
+ A promise that resolves to the current state.
1508
+
1509
+ ___
1510
+
1511
+ ### updateSubscriptions
1512
+
1513
+ ▸ **updateSubscriptions**(`subscriptions`, `options?`): `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1514
+
1515
+ Updates the subscriptions associated to an email.
1516
+
1517
+ #### Parameters
1518
+
1519
+ | Name | Type | Description |
1520
+ | :------ | :------ | :------ |
1521
+ | `subscriptions` | [`Subscriptions`](../interfaces/internal_.Subscriptions.md) | The email and associated subscriptions to update. |
1522
+ | `options?` | [`RequestOptions`](../interfaces/internal_.RequestOptions.md)<{}\> | Options for continuing as a guest. |
1523
+
1524
+ #### Returns
1525
+
1526
+ `Promise`<[`CheckoutSelectors`](../interfaces/internal_.CheckoutSelectors.md)\>
1527
+
1528
+ A promise that resolves to the current state.