@wix/auto_sdk_ecom_current-cart-v-2 1.0.63 → 1.0.65
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.
- package/build/cjs/index.d.ts +26 -4
- package/build/cjs/index.js +135 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +165 -2
- package/build/cjs/index.typings.js +127 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +109 -2
- package/build/cjs/meta.js +87 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +26 -4
- package/build/es/index.mjs +133 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +165 -2
- package/build/es/index.typings.mjs +125 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +109 -2
- package/build/es/meta.mjs +85 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +26 -4
- package/build/internal/cjs/index.js +135 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +165 -2
- package/build/internal/cjs/index.typings.js +127 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +109 -2
- package/build/internal/cjs/meta.js +87 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +26 -4
- package/build/internal/es/index.mjs +133 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +165 -2
- package/build/internal/es/index.typings.mjs +125 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +109 -2
- package/build/internal/es/meta.mjs +85 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1654,7 +1654,22 @@ interface V2AdditionalFee {
|
|
|
1654
1654
|
* @max 999
|
|
1655
1655
|
*/
|
|
1656
1656
|
subscriptionCycles?: number | null;
|
|
1657
|
+
/** Additional fee's source. */
|
|
1658
|
+
source?: SourceWithLiterals;
|
|
1657
1659
|
}
|
|
1660
|
+
declare enum Source {
|
|
1661
|
+
UNKNOWN_ADDITIONAL_FEE_SOURCE = "UNKNOWN_ADDITIONAL_FEE_SOURCE",
|
|
1662
|
+
/** The additional fee was added by an additional fee service plugin. */
|
|
1663
|
+
SERVICE_PLUGIN = "SERVICE_PLUGIN",
|
|
1664
|
+
/** The additional fee was added on the item either via the catalog or on custom line item. */
|
|
1665
|
+
LINE_ITEM = "LINE_ITEM",
|
|
1666
|
+
/** The additional fee was added by the delivery provider. */
|
|
1667
|
+
DELIVERY = "DELIVERY",
|
|
1668
|
+
/** The additional fee was added by a Wix vertical and represents a Wix platform fee. */
|
|
1669
|
+
PLATFORM = "PLATFORM"
|
|
1670
|
+
}
|
|
1671
|
+
/** @enumType */
|
|
1672
|
+
type SourceWithLiterals = Source | 'UNKNOWN_ADDITIONAL_FEE_SOURCE' | 'SERVICE_PLUGIN' | 'LINE_ITEM' | 'DELIVERY' | 'PLATFORM';
|
|
1658
1673
|
interface V2TaxSummary {
|
|
1659
1674
|
/**
|
|
1660
1675
|
* List of taxes applied to the cart.
|
|
@@ -2604,6 +2619,46 @@ interface CalculateCurrentCartResponse {
|
|
|
2604
2619
|
/** The calculation summary. */
|
|
2605
2620
|
summary?: CartSummary;
|
|
2606
2621
|
}
|
|
2622
|
+
interface EstimateCurrentCartRequest {
|
|
2623
|
+
/**
|
|
2624
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
2625
|
+
*
|
|
2626
|
+
* Default: `false`
|
|
2627
|
+
*/
|
|
2628
|
+
refreshCart?: boolean;
|
|
2629
|
+
/**
|
|
2630
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
2631
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
2632
|
+
*/
|
|
2633
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
2634
|
+
/**
|
|
2635
|
+
* Whether to calculate delivery costs.
|
|
2636
|
+
* Default: false
|
|
2637
|
+
*/
|
|
2638
|
+
calculateDelivery?: boolean;
|
|
2639
|
+
/**
|
|
2640
|
+
* Whether to calculate any additional fees.
|
|
2641
|
+
* Default: false
|
|
2642
|
+
*/
|
|
2643
|
+
calculateAdditionalFees?: boolean;
|
|
2644
|
+
/**
|
|
2645
|
+
* Whether to include tax calculation.
|
|
2646
|
+
* Default: false
|
|
2647
|
+
*/
|
|
2648
|
+
calculateTax?: boolean;
|
|
2649
|
+
/**
|
|
2650
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
2651
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
2652
|
+
* Default: false
|
|
2653
|
+
*/
|
|
2654
|
+
calculateGiftCards?: boolean;
|
|
2655
|
+
}
|
|
2656
|
+
interface EstimateCurrentCartResponse {
|
|
2657
|
+
/** The Cart that was calculated. */
|
|
2658
|
+
cart?: Cart;
|
|
2659
|
+
/** The calculation summary. */
|
|
2660
|
+
summary?: CartSummary;
|
|
2661
|
+
}
|
|
2607
2662
|
interface AddLineItemsToCurrentCartRequest {
|
|
2608
2663
|
/**
|
|
2609
2664
|
* A list of catalog items to add to the cart.
|
|
@@ -3011,6 +3066,51 @@ interface RefreshCartResponse {
|
|
|
3011
3066
|
/** Synchronized Cart. */
|
|
3012
3067
|
cart?: Cart;
|
|
3013
3068
|
}
|
|
3069
|
+
interface EstimateCartRequest {
|
|
3070
|
+
/**
|
|
3071
|
+
* ID of the Cart to calculate.
|
|
3072
|
+
* @format GUID
|
|
3073
|
+
*/
|
|
3074
|
+
cartId?: string;
|
|
3075
|
+
/**
|
|
3076
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
3077
|
+
*
|
|
3078
|
+
* Default: `false`
|
|
3079
|
+
*/
|
|
3080
|
+
refreshCart?: boolean;
|
|
3081
|
+
/**
|
|
3082
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
3083
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
3084
|
+
*/
|
|
3085
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
3086
|
+
/**
|
|
3087
|
+
* Whether to calculate delivery costs.
|
|
3088
|
+
* Default: false
|
|
3089
|
+
*/
|
|
3090
|
+
calculateDelivery?: boolean;
|
|
3091
|
+
/**
|
|
3092
|
+
* Whether to calculate any additional fees.
|
|
3093
|
+
* Default: false
|
|
3094
|
+
*/
|
|
3095
|
+
calculateAdditionalFees?: boolean;
|
|
3096
|
+
/**
|
|
3097
|
+
* Whether to include tax calculation.
|
|
3098
|
+
* Default: false
|
|
3099
|
+
*/
|
|
3100
|
+
calculateTax?: boolean;
|
|
3101
|
+
/**
|
|
3102
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
3103
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
3104
|
+
* Default: false
|
|
3105
|
+
*/
|
|
3106
|
+
calculateGiftCards?: boolean;
|
|
3107
|
+
}
|
|
3108
|
+
interface EstimateCartResponse {
|
|
3109
|
+
/** The Cart that was calculated. */
|
|
3110
|
+
cart?: Cart;
|
|
3111
|
+
/** The calculation summary. */
|
|
3112
|
+
summary?: CartSummary;
|
|
3113
|
+
}
|
|
3014
3114
|
interface CalculateCartRequest {
|
|
3015
3115
|
/**
|
|
3016
3116
|
* ID of the Cart to calculate.
|
|
@@ -4646,6 +4746,12 @@ type CalculateCurrentCartApplicationErrors = {
|
|
|
4646
4746
|
data?: CartAlreadyOrderedErrorData;
|
|
4647
4747
|
};
|
|
4648
4748
|
/** @docsIgnore */
|
|
4749
|
+
type EstimateCurrentCartApplicationErrors = {
|
|
4750
|
+
code?: 'CART_ALREADY_ORDERED';
|
|
4751
|
+
description?: string;
|
|
4752
|
+
data?: CartAlreadyOrderedErrorData;
|
|
4753
|
+
};
|
|
4754
|
+
/** @docsIgnore */
|
|
4649
4755
|
type AddLineItemsToCurrentCartApplicationErrors = {
|
|
4650
4756
|
code?: 'ITEM_NOT_FOUND_IN_CATALOG';
|
|
4651
4757
|
description?: string;
|
|
@@ -4961,7 +5067,7 @@ declare function refreshCurrentCart(): Promise<NonNullablePaths<RefreshCurrentCa
|
|
|
4961
5067
|
* @applicableIdentity APP
|
|
4962
5068
|
* @fqn wix.ecom.cart.v2.CurrentCartService.CalculateCurrentCart
|
|
4963
5069
|
*/
|
|
4964
|
-
declare function calculateCurrentCart(options?: CalculateCurrentCartOptions): Promise<NonNullablePaths<CalculateCurrentCartResponse, `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> & {
|
|
5070
|
+
declare function calculateCurrentCart(options?: CalculateCurrentCartOptions): Promise<NonNullablePaths<CalculateCurrentCartResponse, `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.additionalFees.${number}.source` | `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> & {
|
|
4965
5071
|
__applicationErrorsType?: CalculateCurrentCartApplicationErrors;
|
|
4966
5072
|
}>;
|
|
4967
5073
|
interface CalculateCurrentCartOptions {
|
|
@@ -4982,6 +5088,63 @@ interface CalculateCurrentCartOptions {
|
|
|
4982
5088
|
*/
|
|
4983
5089
|
customCalculationConfig?: CalculationConfig;
|
|
4984
5090
|
}
|
|
5091
|
+
/**
|
|
5092
|
+
* Estimates the cart totals based on its current state and the selected
|
|
5093
|
+
* calculation components.
|
|
5094
|
+
*
|
|
5095
|
+
* This API provides a partial, component-based estimation of the cart and is
|
|
5096
|
+
* intended for preview purposes (e.g. showing partial estimated totals).
|
|
5097
|
+
*
|
|
5098
|
+
* The estimation is controlled by boolean flags that indicate which components
|
|
5099
|
+
* should be included (delivery costs, additional fees, taxes, gift cards).
|
|
5100
|
+
* Components that are not explicitly enabled are excluded from the calculation.
|
|
5101
|
+
*
|
|
5102
|
+
* This is NOT a full cart calculation.
|
|
5103
|
+
*
|
|
5104
|
+
* Note that line items discounts are already pre-computed and applied to the Cart.
|
|
5105
|
+
* @public
|
|
5106
|
+
* @documentationMaturity preview
|
|
5107
|
+
* @permissionId ecom:v2:cart:estimate_cart
|
|
5108
|
+
* @applicableIdentity APP
|
|
5109
|
+
* @fqn wix.ecom.cart.v2.CurrentCartService.EstimateCurrentCart
|
|
5110
|
+
*/
|
|
5111
|
+
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.additionalFees.${number}.source` | `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> & {
|
|
5112
|
+
__applicationErrorsType?: EstimateCurrentCartApplicationErrors;
|
|
5113
|
+
}>;
|
|
5114
|
+
interface EstimateCurrentCartOptions {
|
|
5115
|
+
/**
|
|
5116
|
+
* Whether to retrieve the latest item prices, discounts, and inventory data from the catalogs before estimating the cart.
|
|
5117
|
+
*
|
|
5118
|
+
* Default: `false`
|
|
5119
|
+
*/
|
|
5120
|
+
refreshCart?: boolean;
|
|
5121
|
+
/**
|
|
5122
|
+
* Specifies the level of **business validation** to perform during cart calculation,
|
|
5123
|
+
* by calling the [Validations service plugin](https://dev.wix.com/api/rest/wix-ecommerce/validations-integration-spi/introduction).
|
|
5124
|
+
*/
|
|
5125
|
+
validationConfig?: ValidationsConfigWithLiterals;
|
|
5126
|
+
/**
|
|
5127
|
+
* Whether to calculate delivery costs.
|
|
5128
|
+
* Default: false
|
|
5129
|
+
*/
|
|
5130
|
+
calculateDelivery?: boolean;
|
|
5131
|
+
/**
|
|
5132
|
+
* Whether to calculate any additional fees.
|
|
5133
|
+
* Default: false
|
|
5134
|
+
*/
|
|
5135
|
+
calculateAdditionalFees?: boolean;
|
|
5136
|
+
/**
|
|
5137
|
+
* Whether to include tax calculation.
|
|
5138
|
+
* Default: false
|
|
5139
|
+
*/
|
|
5140
|
+
calculateTax?: boolean;
|
|
5141
|
+
/**
|
|
5142
|
+
* Whether to calculate the effect of gift card balances on the cart total.
|
|
5143
|
+
* Gift cards are not redeemed - only reflected for estimation purposes.
|
|
5144
|
+
* Default: false
|
|
5145
|
+
*/
|
|
5146
|
+
calculateGiftCards?: boolean;
|
|
5147
|
+
}
|
|
4985
5148
|
/**
|
|
4986
5149
|
* Adds line items to the Cart.
|
|
4987
5150
|
* If a Current Cart is not already existing, it will be created.
|
|
@@ -5140,4 +5303,4 @@ interface UpdateFormSubmissionsInCurrentCartOptions {
|
|
|
5140
5303
|
formSubmissions?: FormSubmission[];
|
|
5141
5304
|
}
|
|
5142
5305
|
|
|
5143
|
-
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 };
|
|
5306
|
+
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, Source, type SourceWithLiterals, 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, [
|
|
@@ -1097,6 +1154,14 @@ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
|
1097
1154
|
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1098
1155
|
return DiscountScope2;
|
|
1099
1156
|
})(DiscountScope || {});
|
|
1157
|
+
var Source = /* @__PURE__ */ ((Source2) => {
|
|
1158
|
+
Source2["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
|
|
1159
|
+
Source2["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
|
|
1160
|
+
Source2["LINE_ITEM"] = "LINE_ITEM";
|
|
1161
|
+
Source2["DELIVERY"] = "DELIVERY";
|
|
1162
|
+
Source2["PLATFORM"] = "PLATFORM";
|
|
1163
|
+
return Source2;
|
|
1164
|
+
})(Source || {});
|
|
1100
1165
|
var RuleType = /* @__PURE__ */ ((RuleType2) => {
|
|
1101
1166
|
RuleType2["VALIDATION"] = "VALIDATION";
|
|
1102
1167
|
RuleType2["OTHER"] = "OTHER";
|
|
@@ -1557,6 +1622,64 @@ async function calculateCurrentCart2(options) {
|
|
|
1557
1622
|
throw transformedError;
|
|
1558
1623
|
}
|
|
1559
1624
|
}
|
|
1625
|
+
async function estimateCurrentCart2(options) {
|
|
1626
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1627
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1628
|
+
refreshCart: options?.refreshCart,
|
|
1629
|
+
validationConfig: options?.validationConfig,
|
|
1630
|
+
calculateDelivery: options?.calculateDelivery,
|
|
1631
|
+
calculateAdditionalFees: options?.calculateAdditionalFees,
|
|
1632
|
+
calculateTax: options?.calculateTax,
|
|
1633
|
+
calculateGiftCards: options?.calculateGiftCards
|
|
1634
|
+
});
|
|
1635
|
+
const reqOpts = estimateCurrentCart(payload);
|
|
1636
|
+
sideEffects?.onSiteCall?.();
|
|
1637
|
+
try {
|
|
1638
|
+
const result = await httpClient.request(reqOpts);
|
|
1639
|
+
sideEffects?.onSuccess?.(result);
|
|
1640
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1641
|
+
transformPaths2(result.data, [
|
|
1642
|
+
{
|
|
1643
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1644
|
+
paths: [
|
|
1645
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
1646
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
1647
|
+
]
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1651
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
transformFn: transformRESTAddressToSDKAddress,
|
|
1655
|
+
paths: [
|
|
1656
|
+
{ path: "cart.deliveryInfo.address" },
|
|
1657
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
1658
|
+
]
|
|
1659
|
+
}
|
|
1660
|
+
])
|
|
1661
|
+
);
|
|
1662
|
+
} catch (err) {
|
|
1663
|
+
const transformedError = sdkTransformError(
|
|
1664
|
+
err,
|
|
1665
|
+
{
|
|
1666
|
+
spreadPathsToArguments: {},
|
|
1667
|
+
explicitPathsToArguments: {
|
|
1668
|
+
refreshCart: "$[0].refreshCart",
|
|
1669
|
+
validationConfig: "$[0].validationConfig",
|
|
1670
|
+
calculateDelivery: "$[0].calculateDelivery",
|
|
1671
|
+
calculateAdditionalFees: "$[0].calculateAdditionalFees",
|
|
1672
|
+
calculateTax: "$[0].calculateTax",
|
|
1673
|
+
calculateGiftCards: "$[0].calculateGiftCards"
|
|
1674
|
+
},
|
|
1675
|
+
singleArgumentUnchanged: false
|
|
1676
|
+
},
|
|
1677
|
+
["options"]
|
|
1678
|
+
);
|
|
1679
|
+
sideEffects?.onError?.(err);
|
|
1680
|
+
throw transformedError;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1560
1683
|
async function addLineItemsToCurrentCart2(options) {
|
|
1561
1684
|
const { httpClient, sideEffects } = arguments[1];
|
|
1562
1685
|
const payload = transformPaths2(
|
|
@@ -2010,6 +2133,7 @@ export {
|
|
|
2010
2133
|
RateType,
|
|
2011
2134
|
RuleType,
|
|
2012
2135
|
Severity,
|
|
2136
|
+
Source,
|
|
2013
2137
|
SubscriptionFrequency,
|
|
2014
2138
|
SuggestedFix,
|
|
2015
2139
|
TaxableAddressType,
|
|
@@ -2023,6 +2147,7 @@ export {
|
|
|
2023
2147
|
calculateCurrentCart2 as calculateCurrentCart,
|
|
2024
2148
|
createCurrentCart2 as createCurrentCart,
|
|
2025
2149
|
deleteCurrentCart2 as deleteCurrentCart,
|
|
2150
|
+
estimateCurrentCart2 as estimateCurrentCart,
|
|
2026
2151
|
getCurrentCart2 as getCurrentCart,
|
|
2027
2152
|
refreshCurrentCart2 as refreshCurrentCart,
|
|
2028
2153
|
removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,
|