@wix/auto_sdk_ecom_current-cart-v-2 1.0.63 → 1.0.64

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 (37) hide show
  1. package/build/cjs/index.d.ts +25 -3
  2. package/build/cjs/index.js +125 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +149 -1
  5. package/build/cjs/index.typings.js +117 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +94 -2
  8. package/build/cjs/meta.js +77 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +25 -3
  11. package/build/es/index.mjs +124 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +149 -1
  14. package/build/es/index.typings.mjs +116 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +94 -2
  17. package/build/es/meta.mjs +76 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +25 -3
  20. package/build/internal/cjs/index.js +125 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +149 -1
  23. package/build/internal/cjs/index.typings.js +117 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +94 -2
  26. package/build/internal/cjs/meta.js +77 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +25 -3
  29. package/build/internal/es/index.mjs +124 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +149 -1
  32. package/build/internal/es/index.typings.mjs +116 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +94 -2
  35. package/build/internal/es/meta.mjs +76 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -2565,6 +2565,46 @@ interface CalculateCurrentCartResponse {
2565
2565
  /** The calculation summary. */
2566
2566
  summary?: CartSummary;
2567
2567
  }
2568
+ interface EstimateCurrentCartRequest {
2569
+ /**
2570
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
2571
+ *
2572
+ * Default: `false`
2573
+ */
2574
+ refreshCart?: boolean;
2575
+ /**
2576
+ * Specifies the level of **business validation** to perform during cart calculation,
2577
+ * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
2578
+ */
2579
+ validationConfig?: ValidationsConfigWithLiterals;
2580
+ /**
2581
+ * Whether to calculate delivery costs.
2582
+ * Default: false
2583
+ */
2584
+ calculateDelivery?: boolean;
2585
+ /**
2586
+ * Whether to calculate any additional fees.
2587
+ * Default: false
2588
+ */
2589
+ calculateAdditionalFees?: boolean;
2590
+ /**
2591
+ * Whether to include tax calculation.
2592
+ * Default: false
2593
+ */
2594
+ calculateTax?: boolean;
2595
+ /**
2596
+ * Whether to calculate the effect of gift card balances on the cart total.
2597
+ * Gift cards are not redeemed - only reflected for estimation purposes.
2598
+ * Default: false
2599
+ */
2600
+ calculateGiftCards?: boolean;
2601
+ }
2602
+ interface EstimateCurrentCartResponse {
2603
+ /** The Cart that was calculated. */
2604
+ cart?: Cart;
2605
+ /** The calculation summary. */
2606
+ summary?: CartSummary;
2607
+ }
2568
2608
  interface AddLineItemsToCurrentCartRequest {
2569
2609
  /**
2570
2610
  * A list of catalog items to add to the cart.
@@ -2972,6 +3012,51 @@ interface RefreshCartResponse {
2972
3012
  /** Synchronized Cart. */
2973
3013
  cart?: Cart;
2974
3014
  }
3015
+ interface EstimateCartRequest {
3016
+ /**
3017
+ * ID of the Cart to calculate.
3018
+ * @format GUID
3019
+ */
3020
+ cartId?: string;
3021
+ /**
3022
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
3023
+ *
3024
+ * Default: `false`
3025
+ */
3026
+ refreshCart?: boolean;
3027
+ /**
3028
+ * Specifies the level of **business validation** to perform during cart calculation,
3029
+ * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
3030
+ */
3031
+ validationConfig?: ValidationsConfigWithLiterals;
3032
+ /**
3033
+ * Whether to calculate delivery costs.
3034
+ * Default: false
3035
+ */
3036
+ calculateDelivery?: boolean;
3037
+ /**
3038
+ * Whether to calculate any additional fees.
3039
+ * Default: false
3040
+ */
3041
+ calculateAdditionalFees?: boolean;
3042
+ /**
3043
+ * Whether to include tax calculation.
3044
+ * Default: false
3045
+ */
3046
+ calculateTax?: boolean;
3047
+ /**
3048
+ * Whether to calculate the effect of gift card balances on the cart total.
3049
+ * Gift cards are not redeemed - only reflected for estimation purposes.
3050
+ * Default: false
3051
+ */
3052
+ calculateGiftCards?: boolean;
3053
+ }
3054
+ interface EstimateCartResponse {
3055
+ /** The Cart that was calculated. */
3056
+ cart?: Cart;
3057
+ /** The calculation summary. */
3058
+ summary?: CartSummary;
3059
+ }
2975
3060
  interface CalculateCartRequest {
2976
3061
  /**
2977
3062
  * ID of the Cart to calculate.
@@ -4522,6 +4607,12 @@ type CalculateCurrentCartApplicationErrors = {
4522
4607
  data?: CartAlreadyOrderedErrorData;
4523
4608
  };
4524
4609
  /** @docsIgnore */
4610
+ type EstimateCurrentCartApplicationErrors = {
4611
+ code?: 'CART_ALREADY_ORDERED';
4612
+ description?: string;
4613
+ data?: CartAlreadyOrderedErrorData;
4614
+ };
4615
+ /** @docsIgnore */
4525
4616
  type AddLineItemsToCurrentCartApplicationErrors = {
4526
4617
  code?: 'ITEM_NOT_FOUND_IN_CATALOG';
4527
4618
  description?: string;
@@ -4858,6 +4949,63 @@ interface CalculateCurrentCartOptions {
4858
4949
  */
4859
4950
  customCalculationConfig?: CalculationConfig;
4860
4951
  }
4952
+ /**
4953
+ * Estimates the cart totals based on its current state and the selected
4954
+ * calculation components.
4955
+ *
4956
+ * This API provides a partial, component-based estimation of the cart and is
4957
+ * intended for preview purposes (e.g. showing partial estimated totals).
4958
+ *
4959
+ * The estimation is controlled by boolean flags that indicate which components
4960
+ * should be included (delivery costs, additional fees, taxes, gift cards).
4961
+ * Components that are not explicitly enabled are excluded from the calculation.
4962
+ *
4963
+ * This is NOT a full cart calculation.
4964
+ *
4965
+ * Note that line items discounts are already pre-computed and applied to the Cart.
4966
+ * @public
4967
+ * @documentationMaturity preview
4968
+ * @permissionId ecom:v2:cart:estimate_cart
4969
+ * @applicableIdentity APP
4970
+ * @fqn wix.ecom.cart.v2.CurrentCartService.EstimateCurrentCart
4971
+ */
4972
+ declare function estimateCurrentCart(options?: EstimateCurrentCartOptions): Promise<NonNullablePaths<EstimateCurrentCartResponse, `cart._id` | `cart.revision` | `cart.lineItems` | `cart.lineItems.${number}._id` | `cart.lineItems.${number}.name.original` | `cart.lineItems.${number}.quantityInfo.confirmedQuantity` | `cart.lineItems.${number}.quantityInfo.requestedQuantity` | `cart.lineItems.${number}.quantityInfo.fixedQuantity` | `cart.lineItems.${number}.pricing.unitPrice.amount` | `cart.lineItems.${number}.pricing.unitPrice.convertedAmount` | `cart.lineItems.${number}.pricing.priceDescription.original` | `cart.lineItems.${number}.pricing.priceUndetermined` | `cart.lineItems.${number}.source.catalogReference.catalogItemId` | `cart.lineItems.${number}.source.catalogReference.appId` | `cart.lineItems.${number}.attributes.itemType.preset` | `cart.lineItems.${number}.attributes.itemType.custom` | `cart.lineItems.${number}.attributes.physicalProperties.shippable` | `cart.lineItems.${number}.attributes.membersOnly` | `cart.lineItems.${number}.taxConfig.taxableAddress.addressType` | `cart.lineItems.${number}.paymentConfig.savePaymentMethod` | `cart.lineItems.${number}.paymentConfig.selectedMembership._id` | `cart.lineItems.${number}.paymentConfig.selectedMembership.appId` | `cart.lineItems.${number}.paymentConfig.paymentOption` | `cart.lineItems.${number}.status` | `cart.lineItems.${number}.customLineItem` | `cart.coupons` | `cart.coupons.${number}._id` | `cart.coupons.${number}.code` | `cart.source.channelType` | `cart.source.externalReferences` | `cart.source.externalReferences.${number}.appId` | `cart.source.createdBy.visitorId` | `cart.source.createdBy.memberId` | `cart.source.createdBy.userId` | `cart.source.createdBy.appId` | `cart.source.customContentReference.appId` | `cart.source.customContentReference.componentId` | `cart.businessInfo.languageCode` | `cart.businessInfo.currencyCode` | `cart.customerInfo.visitorId` | `cart.customerInfo.memberId` | `cart.customerInfo.userId` | `cart.customerInfo.vatId._id` | `cart.customerInfo.vatId.type` | `cart.customerInfo.languageCode` | `cart.customerInfo.currencyCode` | `cart.deliveryInfo.address.streetAddress.number` | `cart.deliveryInfo.address.streetAddress.name` | `cart.deliveryInfo.method.code` | `cart.deliveryInfo.method.pickup` | `cart.deliveryInfo.weightUnit` | `cart.taxInfo.pricesIncludeTax` | `cart.paymentInfo.giftCards` | `cart.paymentInfo.giftCards.${number}._id` | `cart.paymentInfo.giftCards.${number}.obfuscatedCode` | `cart.paymentInfo.giftCards.${number}.appId` | `cart.paymentInfo.currencyCode` | `cart.orderPlaced` | `cart.currentCart` | `summary.cartId` | `summary.cartRevision` | `summary.calculationId` | `summary.lineItems` | `summary.lineItems.${number}.lineItemId` | `summary.lineItems.${number}.quantity` | `summary.lineItems.${number}.unitPrice.amount` | `summary.lineItems.${number}.unitPrice.convertedAmount` | `summary.discounts` | `summary.discounts.${number}.name.original` | `summary.discounts.${number}.source.sourceType` | `summary.discounts.${number}.scope` | `summary.deliverySummary.method.code` | `summary.deliverySummary.method.pickup` | `summary.additionalFees` | `summary.taxSummary.taxes` | `summary.taxSummary.pricesIncludeTax` | `summary.taxSummary.lineItemTaxes` | `summary.taxSummary.lineItemTaxes.${number}.lineItemId` | `summary.taxSummary.additionalFeeTaxes` | `summary.taxSummary.additionalFeeTaxes.${number}.additionalFeeCode` | `summary.paymentSummary.giftCards` | `summary.paymentSummary.giftCards.${number}.giftCardId` | `summary.paymentSummary.memberships` | `summary.paymentSummary.memberships.${number}._id` | `summary.paymentSummary.memberships.${number}.appId` | `summary.paymentSummary.subscriptionCharges` | `summary.paymentSummary.requiresPaymentAfterGiftCard` | `summary.calculationErrors.generalShippingCalculationError.applicationError.code` | `summary.calculationErrors.generalShippingCalculationError.applicationError.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `summary.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `summary.calculationErrors.carrierErrors.errors` | `summary.calculationErrors.carrierErrors.errors.${number}.carrierId` | `summary.calculationErrors.orderValidationErrors` | `summary.spiViolations` | `summary.spiViolations.${number}.severity` | `summary.spiViolations.${number}.target.other.name` | `summary.spiViolations.${number}.target.lineItem.name`, 8> & {
4973
+ __applicationErrorsType?: EstimateCurrentCartApplicationErrors;
4974
+ }>;
4975
+ interface EstimateCurrentCartOptions {
4976
+ /**
4977
+ * Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
4978
+ *
4979
+ * Default: `false`
4980
+ */
4981
+ refreshCart?: boolean;
4982
+ /**
4983
+ * Specifies the level of **business validation** to perform during cart calculation,
4984
+ * by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
4985
+ */
4986
+ validationConfig?: ValidationsConfigWithLiterals;
4987
+ /**
4988
+ * Whether to calculate delivery costs.
4989
+ * Default: false
4990
+ */
4991
+ calculateDelivery?: boolean;
4992
+ /**
4993
+ * Whether to calculate any additional fees.
4994
+ * Default: false
4995
+ */
4996
+ calculateAdditionalFees?: boolean;
4997
+ /**
4998
+ * Whether to include tax calculation.
4999
+ * Default: false
5000
+ */
5001
+ calculateTax?: boolean;
5002
+ /**
5003
+ * Whether to calculate the effect of gift card balances on the cart total.
5004
+ * Gift cards are not redeemed - only reflected for estimation purposes.
5005
+ * Default: false
5006
+ */
5007
+ calculateGiftCards?: boolean;
5008
+ }
4861
5009
  /**
4862
5010
  * Adds line items to the Cart.
4863
5011
  * If a Current Cart is not already existing, it will be created.
@@ -5016,4 +5164,4 @@ interface UpdateFormSubmissionsInCurrentCartOptions {
5016
5164
  formSubmissions?: FormSubmission[];
5017
5165
  }
5018
5166
 
5019
- export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartApplicationErrors, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartApplicationErrors, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartApplicationErrors, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, AdditionalFeeSource, type AdditionalFeeSourceWithLiterals, type AdditionalFeeTax, type Address, type AddressLocation, type AggregatedTaxBreakdown, type AllLineItemsOutOfStockErrorData, type ApplicableLineItems, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type AutoTaxFallbackCalculationDetails, BalanceType, type BalanceTypeWithLiterals, type BusinessInfo, type CalculateCartForV1Request, type CalculateCartForV1Response, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartApplicationErrors, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculateTotalsResponse, type CalculatedItemModifier, type CalculatedLineItem, type CalculatedPlatformFee, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CalculationOverrides, type Carrier, type CarrierError, type CarrierErrors, type CarrierServiceOption, type Cart, type CartAlreadyOrderedErrorData, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, ChargeType, type ChargeTypeWithLiterals, CheckoutStage, type CheckoutStageWithLiterals, type Color, type ConvertedMoney, type Coupon, type CouponAdded, type CouponAlreadyExistsErrorData, type CouponInput, type CouponNotFoundInCartErrorData, type CouponRemoved, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartApplicationErrors, type CreateCurrentCartOptions, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryAllocation, type DeliveryInfo, type DeliveryLogistics, type DeliveryMethod, type DeliveryMethodInput, type DeliveryMethodNotFoundErrorData, type DeliverySummary, type DeliveryTimeSlot, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, type DiscountRule, type DiscountRuleName, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type DuplicateItemModifierIdsErrorData, type DuplicateLineItemUpdatesErrorData, type DuplicateModifierGroupIdsErrorData, type Empty, type EmptyLineItemUpdatesErrorData, type EmptyPaymentTokenErrorData, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type ExternalReference, FallbackReason, type FallbackReasonWithLiterals, type FieldViolation, FileType, type FileTypeWithLiterals, type FixedQuantityItemErrorData, type FormIdentifier, type FormInfo, type FormSubmission, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardAdded, type GiftCardAlreadyExistsErrorData, type GiftCardInput, type GiftCardNotFoundInCartErrorData, type GiftCardRedeemErrorData, type GiftCardRemoved, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type InsufficientInventoryEntry, type InsufficientInventoryErrorData, type InvalidCouponCodeErrorData, InvalidCouponReason, type InvalidCouponReasonWithLiterals, type InvalidCouponStatusErrorData, type InvalidCouponStatusErrorDataDetailsOneOf, type InvalidGiftCardCodeErrorData, InvalidGiftCardReason, type InvalidGiftCardReasonWithLiterals, type InvalidGiftCardStatusErrorData, type InvalidMembership, type InvalidMembershipEntry, type InvalidMembershipErrorData, type InvalidMembershipPaymentOptionErrorData, type InvalidPaymentStatusErrorData, type InvalidPriceVerificationTokenErrorData, type InvalidThirdPartyCheckoutTokenErrorData, type ItemAttributes, type ItemCombination, type ItemCombinationLineItem, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemNotFoundInCatalogErrorData, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemTaxFullDetails, type ItemType, type ItemTypeItemTypeDataOneOf, ItemTypePreset, type ItemTypePresetWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LegacyFields, type LineItem, type LineItemAdded, type LineItemDiscount, type LineItemIdentifier, type LineItemIdentifierIdOneOf, type LineItemNotFoundInCartErrorData, type LineItemPriceConflictErrorData, type LineItemPricesData, type LineItemSummary, type LineItemTax, type LineItemUpdate, ManualCalculationReason, type ManualCalculationReasonWithLiterals, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type MaxItemModifiersExceededErrorData, type MaxLineItemsExceededErrorData, type MembersOnlyItemErrorData, type Membership, type MembershipName, type MembershipOptions, type MembershipPaymentCredits, type MerchantDiscount, type MessageEnvelope, type MinLineItemQuantityNotReachedDetails, type MinSubtotalNotReachedDetails, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type OtherCharge, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, PlatformFeeChargeType, type PlatformFeeChargeTypeWithLiterals, type PlatformFeeSummary, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, RateType, type RateTypeWithLiterals, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartApplicationErrors, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type Region, type RemoveCouponFromCurrentCartApplicationErrors, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardFromCurrentCartApplicationErrors, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartApplicationErrors, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedCarrierServiceOption, type SelectedCarrierServiceOptionOtherCharge, type SelectedCarrierServiceOptionPrices, type SelectedMembership, type SelectedMembershipUpdate, type SelectedMemberships, type ServiceProperties, type SetDeliveryMethodForCurrentCartApplicationErrors, type SetDeliveryMethodForCurrentCartRequest, type SetDeliveryMethodForCurrentCartResponse, type SetDeliveryMethodRequest, type SetDeliveryMethodResponse, Severity, type SeverityWithLiterals, type ShippingInformation, type ShippingOption, type ShippingPrice, type ShippingRegion, type SomeLineItemsOutOfStockErrorData, type Stage, type StageStagesOneOf, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxBreakdown, type TaxCalculationDetails, type TaxCalculationDetailsCalculationDetailsOneOf, type TaxDetails, type TaxInfo, type TaxRateBreakdown, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UnmarkAsCurrentCartRequest, type UnmarkAsCurrentCartResponse, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartApplicationErrors, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateFormSubmissionsInCurrentCartOptions, type UpdateFormSubmissionsInCurrentCartRequest, type UpdateFormSubmissionsInCurrentCartResponse, type UpdateFormSubmissionsRequest, type UpdateFormSubmissionsResponse, type UpdateLineItemsInCurrentCartApplicationErrors, type UpdateLineItemsInCurrentCartOptions, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V1AdditionalFee, type V2AdditionalFee, type V2CalculationErrors, type V2CalculationErrorsShippingCalculationErrorOneOf, type V2CarrierError, type V2CarrierErrors, type V2Coupon, type V2GiftCard, type V2LineItem, type V2Membership, type V2PriceSummary, type V2SelectedMembership, type V2TaxSummary, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, type ViolationWithErrorSeverityErrorData, type ViolationsList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, addCouponToCurrentCart, addGiftCardToCurrentCart, addLineItemsToCurrentCart, calculateCurrentCart, createCurrentCart, deleteCurrentCart, getCurrentCart, refreshCurrentCart, removeCouponFromCurrentCart, removeGiftCardFromCurrentCart, removeLineItemsFromCurrentCart, setDeliveryMethodForCurrentCart, updateCurrentCart, updateFormSubmissionsInCurrentCart, updateLineItemsInCurrentCart };
5167
+ export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartApplicationErrors, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartApplicationErrors, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartApplicationErrors, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, AdditionalFeeSource, type AdditionalFeeSourceWithLiterals, type AdditionalFeeTax, type Address, type AddressLocation, type AggregatedTaxBreakdown, type AllLineItemsOutOfStockErrorData, type ApplicableLineItems, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type AutoTaxFallbackCalculationDetails, BalanceType, type BalanceTypeWithLiterals, type BusinessInfo, type CalculateCartForV1Request, type CalculateCartForV1Response, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartApplicationErrors, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, type CalculateTotalsResponse, type CalculatedItemModifier, type CalculatedLineItem, type CalculatedPlatformFee, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CalculationOverrides, type Carrier, type CarrierError, type CarrierErrors, type CarrierServiceOption, type Cart, type CartAlreadyOrderedErrorData, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, ChargeType, type ChargeTypeWithLiterals, CheckoutStage, type CheckoutStageWithLiterals, type Color, type ConvertedMoney, type Coupon, type CouponAdded, type CouponAlreadyExistsErrorData, type CouponInput, type CouponNotFoundInCartErrorData, type CouponRemoved, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartApplicationErrors, type CreateCurrentCartOptions, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryAllocation, type DeliveryInfo, type DeliveryLogistics, type DeliveryMethod, type DeliveryMethodInput, type DeliveryMethodNotFoundErrorData, type DeliverySummary, type DeliveryTimeSlot, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, type DiscountRule, type DiscountRuleName, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type DuplicateItemModifierIdsErrorData, type DuplicateLineItemUpdatesErrorData, type DuplicateModifierGroupIdsErrorData, type Empty, type EmptyLineItemUpdatesErrorData, type EmptyPaymentTokenErrorData, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EstimateCartRequest, type EstimateCartResponse, type EstimateCurrentCartApplicationErrors, type EstimateCurrentCartOptions, type EstimateCurrentCartRequest, type EstimateCurrentCartResponse, type ExtendedFields, type ExternalReference, FallbackReason, type FallbackReasonWithLiterals, type FieldViolation, FileType, type FileTypeWithLiterals, type FixedQuantityItemErrorData, type FormIdentifier, type FormInfo, type FormSubmission, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardAdded, type GiftCardAlreadyExistsErrorData, type GiftCardInput, type GiftCardNotFoundInCartErrorData, type GiftCardRedeemErrorData, type GiftCardRemoved, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type InsufficientInventoryEntry, type InsufficientInventoryErrorData, type InvalidCouponCodeErrorData, InvalidCouponReason, type InvalidCouponReasonWithLiterals, type InvalidCouponStatusErrorData, type InvalidCouponStatusErrorDataDetailsOneOf, type InvalidGiftCardCodeErrorData, InvalidGiftCardReason, type InvalidGiftCardReasonWithLiterals, type InvalidGiftCardStatusErrorData, type InvalidMembership, type InvalidMembershipEntry, type InvalidMembershipErrorData, type InvalidMembershipPaymentOptionErrorData, type InvalidPaymentStatusErrorData, type InvalidPriceVerificationTokenErrorData, type InvalidThirdPartyCheckoutTokenErrorData, type ItemAttributes, type ItemCombination, type ItemCombinationLineItem, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemNotFoundInCatalogErrorData, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemTaxFullDetails, type ItemType, type ItemTypeItemTypeDataOneOf, ItemTypePreset, type ItemTypePresetWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LegacyFields, type LineItem, type LineItemAdded, type LineItemDiscount, type LineItemIdentifier, type LineItemIdentifierIdOneOf, type LineItemNotFoundInCartErrorData, type LineItemPriceConflictErrorData, type LineItemPricesData, type LineItemSummary, type LineItemTax, type LineItemUpdate, ManualCalculationReason, type ManualCalculationReasonWithLiterals, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type MaxItemModifiersExceededErrorData, type MaxLineItemsExceededErrorData, type MembersOnlyItemErrorData, type Membership, type MembershipName, type MembershipOptions, type MembershipPaymentCredits, type MerchantDiscount, type MessageEnvelope, type MinLineItemQuantityNotReachedDetails, type MinSubtotalNotReachedDetails, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type OtherCharge, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, PlatformFeeChargeType, type PlatformFeeChargeTypeWithLiterals, type PlatformFeeSummary, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, RateType, type RateTypeWithLiterals, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartApplicationErrors, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type Region, type RemoveCouponFromCurrentCartApplicationErrors, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardFromCurrentCartApplicationErrors, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartApplicationErrors, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedCarrierServiceOption, type SelectedCarrierServiceOptionOtherCharge, type SelectedCarrierServiceOptionPrices, type SelectedMembership, type SelectedMembershipUpdate, type SelectedMemberships, type ServiceProperties, type SetDeliveryMethodForCurrentCartApplicationErrors, type SetDeliveryMethodForCurrentCartRequest, type SetDeliveryMethodForCurrentCartResponse, type SetDeliveryMethodRequest, type SetDeliveryMethodResponse, Severity, type SeverityWithLiterals, type ShippingInformation, type ShippingOption, type ShippingPrice, type ShippingRegion, type SomeLineItemsOutOfStockErrorData, type Stage, type StageStagesOneOf, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxBreakdown, type TaxCalculationDetails, type TaxCalculationDetailsCalculationDetailsOneOf, type TaxDetails, type TaxInfo, type TaxRateBreakdown, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UnmarkAsCurrentCartRequest, type UnmarkAsCurrentCartResponse, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartApplicationErrors, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateFormSubmissionsInCurrentCartOptions, type UpdateFormSubmissionsInCurrentCartRequest, type UpdateFormSubmissionsInCurrentCartResponse, type UpdateFormSubmissionsRequest, type UpdateFormSubmissionsResponse, type UpdateLineItemsInCurrentCartApplicationErrors, type UpdateLineItemsInCurrentCartOptions, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V1AdditionalFee, type V2AdditionalFee, type V2CalculationErrors, type V2CalculationErrorsShippingCalculationErrorOneOf, type V2CarrierError, type V2CarrierErrors, type V2Coupon, type V2GiftCard, type V2LineItem, type V2Membership, type V2PriceSummary, type V2SelectedMembership, type V2TaxSummary, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, type ViolationWithErrorSeverityErrorData, type ViolationsList, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, addCouponToCurrentCart, addGiftCardToCurrentCart, addLineItemsToCurrentCart, calculateCurrentCart, createCurrentCart, deleteCurrentCart, estimateCurrentCart, getCurrentCart, refreshCurrentCart, removeCouponFromCurrentCart, removeGiftCardFromCurrentCart, removeLineItemsFromCurrentCart, setDeliveryMethodForCurrentCart, updateCurrentCart, updateFormSubmissionsInCurrentCart, updateLineItemsInCurrentCart };
@@ -477,6 +477,63 @@ function calculateCurrentCart(payload) {
477
477
  }
478
478
  return __calculateCurrentCart;
479
479
  }
480
+ function estimateCurrentCart(payload) {
481
+ function __estimateCurrentCart({ host }) {
482
+ const metadata = {
483
+ entityFqdn: "wix.ecom.v2.cart",
484
+ method: "POST",
485
+ methodFqn: "wix.ecom.cart.v2.CurrentCartService.EstimateCurrentCart",
486
+ packageName: PACKAGE_NAME,
487
+ migrationOptions: {
488
+ optInTransformResponse: true
489
+ },
490
+ url: resolveWixEcomCartV2CurrentCartServiceUrl({
491
+ protoPath: "/v2/carts/current/estimate",
492
+ data: payload,
493
+ host
494
+ }),
495
+ data: payload,
496
+ transformResponse: (payload2) => transformPaths(payload2, [
497
+ {
498
+ transformFn: transformRESTTimestampToSDKTimestamp,
499
+ paths: [
500
+ { path: "cart.createdDate" },
501
+ { path: "cart.updatedDate" },
502
+ {
503
+ path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
504
+ },
505
+ { path: "cart.lineItems.attributes.image.urlExpirationDate" },
506
+ {
507
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
508
+ },
509
+ {
510
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
511
+ },
512
+ { path: "cart.lineItems.attributes.serviceProperties.endDate" },
513
+ {
514
+ path: "summary.paymentSummary.subscriptionCharges.charges.cycleBillingDate"
515
+ }
516
+ ]
517
+ },
518
+ {
519
+ transformFn: transformRESTFloatToSDKFloat,
520
+ paths: [
521
+ {
522
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
523
+ },
524
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
525
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
526
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
527
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
528
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
529
+ ]
530
+ }
531
+ ])
532
+ };
533
+ return metadata;
534
+ }
535
+ return __estimateCurrentCart;
536
+ }
480
537
  function addLineItemsToCurrentCart(payload) {
481
538
  function __addLineItemsToCurrentCart({ host }) {
482
539
  const serializedData = transformPaths(payload, [
@@ -1557,6 +1614,64 @@ async function calculateCurrentCart2(options) {
1557
1614
  throw transformedError;
1558
1615
  }
1559
1616
  }
1617
+ async function estimateCurrentCart2(options) {
1618
+ const { httpClient, sideEffects } = arguments[1];
1619
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1620
+ refreshCart: options?.refreshCart,
1621
+ validationConfig: options?.validationConfig,
1622
+ calculateDelivery: options?.calculateDelivery,
1623
+ calculateAdditionalFees: options?.calculateAdditionalFees,
1624
+ calculateTax: options?.calculateTax,
1625
+ calculateGiftCards: options?.calculateGiftCards
1626
+ });
1627
+ const reqOpts = estimateCurrentCart(payload);
1628
+ sideEffects?.onSiteCall?.();
1629
+ try {
1630
+ const result = await httpClient.request(reqOpts);
1631
+ sideEffects?.onSuccess?.(result);
1632
+ return renameKeysFromRESTResponseToSDKResponse(
1633
+ transformPaths2(result.data, [
1634
+ {
1635
+ transformFn: transformRESTImageToSDKImage,
1636
+ paths: [
1637
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1638
+ { path: "cart.lineItems.attributes.image" }
1639
+ ]
1640
+ },
1641
+ {
1642
+ transformFn: transformRESTPageURLV2ToSDKPageURLV2,
1643
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1644
+ },
1645
+ {
1646
+ transformFn: transformRESTAddressToSDKAddress,
1647
+ paths: [
1648
+ { path: "cart.deliveryInfo.address" },
1649
+ { path: "cart.paymentInfo.billingAddress" }
1650
+ ]
1651
+ }
1652
+ ])
1653
+ );
1654
+ } catch (err) {
1655
+ const transformedError = sdkTransformError(
1656
+ err,
1657
+ {
1658
+ spreadPathsToArguments: {},
1659
+ explicitPathsToArguments: {
1660
+ refreshCart: "$[0].refreshCart",
1661
+ validationConfig: "$[0].validationConfig",
1662
+ calculateDelivery: "$[0].calculateDelivery",
1663
+ calculateAdditionalFees: "$[0].calculateAdditionalFees",
1664
+ calculateTax: "$[0].calculateTax",
1665
+ calculateGiftCards: "$[0].calculateGiftCards"
1666
+ },
1667
+ singleArgumentUnchanged: false
1668
+ },
1669
+ ["options"]
1670
+ );
1671
+ sideEffects?.onError?.(err);
1672
+ throw transformedError;
1673
+ }
1674
+ }
1560
1675
  async function addLineItemsToCurrentCart2(options) {
1561
1676
  const { httpClient, sideEffects } = arguments[1];
1562
1677
  const payload = transformPaths2(
@@ -2023,6 +2138,7 @@ export {
2023
2138
  calculateCurrentCart2 as calculateCurrentCart,
2024
2139
  createCurrentCart2 as createCurrentCart,
2025
2140
  deleteCurrentCart2 as deleteCurrentCart,
2141
+ estimateCurrentCart2 as estimateCurrentCart,
2026
2142
  getCurrentCart2 as getCurrentCart,
2027
2143
  refreshCurrentCart2 as refreshCurrentCart,
2028
2144
  removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,