> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Package: purchaseFlow

# Namespace: cartV2

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/cart-calculated.md

# Webhook Permissions Scopes IDs:
Read Orders: SCOPE.DC-STORES.READ-ORDERS

## Introduction

Triggered when a cart is calculated.

---

## REST API

### Schema

```
Webhook: Cart Calculated
Description: Triggered when a cart is calculated.
Event body:
 - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events.
 - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event.
 - name: slug | type: string | description: Event name.
 - name: entityId | type: string | description: ID of the entity associated with the event.
 - name: eventTime | type: string (date-time) | description: Event timestamp.
 - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR.
 - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
 - name: actionEvent | type: object | description: Custom action event details.
    - name: body | type: CartSummary | description: The event body.
        - name: cartId | type: string | description: Cart GUID.
        - name: cartRevision | type: string | description: Cart revision.
        - name: calculationId | type: string | description: Unique identifier for this cart calculation.
        - name: lineItems | type: array<LineItemSummary> | description: Summarized details for each line item in the cart.
           - name: lineItemId | type: string | description: Line item GUID.
           - name: quantity | type: integer | description: Line item quantity.
           - name: unitPrice | type: ConvertedMoney | description: Final unit price after discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
              - name: amount | type: string | description: Monetary amount in the original currency, as specified in `businessInfo.currencyCode`.
              - name: convertedAmount | type: string | description: Monetary amount in the converted currency, as specified in `customerInfo.currencyCode`.  Default: `amount`.
           - name: totalPrice | type: ConvertedMoney | description: Line total (unit price × quantity). Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: discounts | type: array<Discount> | description: Discounts applied to the cart.
           - name: name | type: TranslatableString | description: Display name of the discount.
              - name: original | type: string | description: __Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.
              - name: translated | type: string | description: String translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.
           - name: source | type: DiscountSource | description: Source of the discount; how it was applied.
              - name: sourceType | type: DiscountSourceType | description: Discount source type.
                   - enum:
                   -     AUTOMATIC_RULE: Discount applied automatically by a rule.
                   -     COUPON: Discount applied by a coupon code.
              - name: couponCode | type: string | description: Coupon code that triggered the discount. Only relevant for coupon discounts.
           - name: scope | type: DiscountScope | description: Part of the cart the discount applies to.
               - enum:
               -     UNKNOWN_DISCOUNT_SCOPE: Unknown discount scope.
               -     CART_SUBTOTAL: Discount applies to the cart subtotal.
               -     LINE_ITEM: Discount applies to a specific line item.
               -     DELIVERY: Discount applies to the delivery price.
           - name: subscriptionCycles | type: integer | description: Number of subscription billing cycles this discount applies to. If unset, it applies to all cycles.
           - name: total | type: ConvertedMoney | description: Total amount discounted across all of this discount's benefits.
           - name: lineItemDiscounts | type: array<LineItemDiscount> | description: Per-line-item discount amounts for item-level discounts.
              - name: lineItemId | type: string | description: Line item GUID the discount applies to.
              - name: amountOff | type: ConvertedMoney | description: Total amount discounted on this line item.
        - name: deliverySummary | type: DeliverySummary | description: Summary of delivery costs.
           - name: method | type: DeliveryMethod | description: Calculated delivery method.
              - name: code | type: string | description: Shipping rate code. Example: `"usps_std_overnight"`.
              - name: appId | type: string | description: Carrier app GUID.
              - name: title | type: TranslatableString | description: Delivery rate title. Examples: `"USPS Standard Overnight Delivery"`, `"Standard"`, `"First-Class Package International"`.
              - name: pickup | type: boolean | description: Whether this method is pickup.
           - name: price | type: ConvertedMoney | description: Delivery price before discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: additionalFees | type: array<AdditionalFee> | description: Additional fees applied to the cart.
           - name: code | type: string | description: Additional fee code.
           - name: name | type: TranslatableString | description: Additional fee display name.
           - name: providerAppId | type: string | description: App GUID of the fee provider.
           - name: lineItemIds | type: array<string> | description: Line items this fee applies to. When empty, the fee applies to the whole cart.
           - name: price | type: ConvertedMoney | description: Additional fee amount. Includes tax when `taxSummary.pricesIncludeTax` is true.
           - name: subscriptionCycles | type: integer | description: Number of subscription cycles this fee applies to. When unset and a discount is tied to a subscription line item, it applies to all cycles.
           - name: source | type: Source | description: Where the additional fee came from.
               - enum:
               -     UNKNOWN_ADDITIONAL_FEE_SOURCE: Unknown fee source.
               -     SERVICE_PLUGIN: Added by an additional fee service plugin.
               -     LINE_ITEM: Added on the item from the catalog or as a custom line item.
               -     DELIVERY: Added by the delivery provider.
               -     PLATFORM: Added by a Wix vertical as a platform fee.
        - name: taxSummary | type: TaxSummary | description: Tax calculation summary for the cart.
           - name: taxes | type: array<Tax> | description: Taxes applied to the cart. Multiple entries can appear when advanced tax rates are set, or one entry for the total. See [advanced tax rates](https://support.wix.com/en/article/setting-up-tax-calculation-using-the-manual-method#step-3-optional-customize-advanced-mode-settings).
              - name: name | type: TranslatableString | description: Tax name.
              - name: taxableAmount | type: ConvertedMoney | description: Amount tax is calculated on.
              - name: exemptAmount | type: ConvertedMoney | description: Amount exempt from tax.
              - name: amount | type: ConvertedMoney | description: Calculated tax from `taxableAmount`.
           - name: totalExempt | type: ConvertedMoney | description: Amount exempt from tax.
           - name: pricesIncludeTax | type: boolean | description: Whether tax is included in prices for line items, discounts, delivery, and additional fees.
           - name: lineItemTaxes | type: array<LineItemTax> | description: Per line item tax amounts.
              - name: lineItemId | type: string | description: Line item GUID.
              - name: tax | type: ConvertedMoney | description: Tax amount for the line item.
              - name: rate | type: string | description: Tax rate as a decimal between 0 and 1.
           - name: deliveryTax | type: ConvertedMoney | description: Tax on the delivery method.
           - name: additionalFeeTaxes | type: array<AdditionalFeeTax> | description: Tax on additional fees.
              - name: additionalFeeCode | type: string | description: Additional fee code.
              - name: tax | type: ConvertedMoney | description: Tax amount for the additional fee.
        - name: priceSummary | type: PriceSummary | description: Summary of calculated price components for the cart.
           - name: subtotal | type: ConvertedMoney | description: Total for all line items after item-level discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
           - name: discount | type: ConvertedMoney | description: Cart subtotal discount amount, deducted from the subtotal. Item-level discounts are already reflected in the subtotal. Returns 0 when no cart subtotal discount is applied. For details of all applied discounts (including delivery discounts), see `cartSummary.discounts`. Currently, only a single coupon is supported.
           - name: delivery | type: ConvertedMoney | description: Delivery price after discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
           - name: additionalFees | type: ConvertedMoney | description: Total of additional fees. Includes tax when `taxSummary.pricesIncludeTax` is true.
           - name: tax | type: ConvertedMoney | description: Tax charged on top of the prices, summed across items, discounts, delivery, and fees. When `taxSummary.pricesIncludeTax` is true, tax is already embedded in the prices, so this field is `0`. For the full tax breakdown in either case, see `taxSummary.taxes`.
           - name: total | type: ConvertedMoney | description: Amount to pay.
        - name: paymentSummary | type: PaymentSummary | description: How the customer pays for the order.
           - name: giftCards | type: array<GiftCardSummary> | description: Per-gift card deduction amounts. Only one gift card is supported today.
              - name: giftCardId | type: string | description: Gift card GUID assigned by the cart.
              - name: redeemAmount | type: ConvertedMoney | description: Amount to redeem from the gift card balance.
           - name: memberships | type: array<MembershipSummary> | description: Memberships charged with the order.
              - name: id | type: string | description: Membership GUID.
              - name: appId | type: string | description: App GUID for this payment option.
              - name: lineItemIds | type: array<string> | description: Line item GUIDs this membership applies to.
           - name: subscriptionCharges | type: array<SubscriptionCharges> | description: Subscription charge details for checkout.
              - name: lineItemIds | type: array<string> | description: Line items covered by the subscription.
              - name: description | type: string | description: Human-readable schedule and amounts for upcoming charges. Localized to the buyer's language for subscription orders, or the site language if none is set.
              - name: charges | type: array<Charge> | description: Scheduled charges.
                 - name: cycleFrom | type: integer | description: First billing cycle for this charge.
                 - name: cycleCount | type: integer | description: Number of cycles this charge covers, when set.
                 - name: cycleBillingDate | type: string | description: Billing period start.
           - name: requiresPaymentAfterGiftCard | type: boolean | description: Whether additional payment is required to create the order after gift cards.
           - name: totalAfterGiftCards | type: ConvertedMoney | description: Total due after gift cards.
           - name: payNow | type: ConvertedMoney | description: Amount charged when the order is placed, after gift cards.
           - name: payLater | type: ConvertedMoney | description: Amount collected later.
           - name: payAfterFreeTrial | type: ConvertedMoney | description: Amount charged after a free trial, often for subscriptions.
        - name: priceVerificationToken | type: string | description: Opaque token for the cart's calculated prices.  Pass this token when placing an order so the prices the customer saw match checkout.  If provided, the server validates it by recalculating the cart and comparing the pricing token. If validation fails, checkout is rejected.  This limits unexpected price changes or tampering between cart calculation and order placement.  Don't parse or modify the token on the client.
        - name: violations | type: array<Violation> | description: All business violations for the cart.
           - ONE-OF:
              - name: customValidationData | type: CustomValidationErrorData | description: Payload for Validations service plugin violations.
                 - name: target | type: Target | description: Where to show the violation on the cart or checkout page.
                    - ONE-OF:
                       - name: other | type: Other | description: General (other) violation.
                          - name: name | type: NameInOther | description: Location on a checkout or a cart page where a general (other) violation will be displayed.
                                   - enum:
                                   -     OTHER_DEFAULT: Default location, in case no specific location is specified.
                       - name: lineItem | type: LineItem | description: Specific line item violation.
                          - name: name | type: NameInLineItem | description: Location on a checkout or a cart page where the specific line item violation will be displayed.
                                   - enum:
                                   -     LINE_ITEM_DEFAULT: Default location, in case no specific location is specified.
                          - name: id | type: string | description: GUID of the line item containing the violation.
              - name: invalidCouponStatusData | type: InvalidCouponStatusErrorData | description: Payload when a coupon's status is invalid.
                 - ONE-OF:
                    - name: minLineItemQuantityNotReachedDetails | type: MinLineItemQuantityNotReachedDetails | description: 
                       - name: requiredMinimumQuantity | type: integer | description: Minimum line item quantity required.
                    - name: minSubtotalNotReachedDetails | type: MinSubtotalNotReachedDetails | description: 
                       - name: requiredMinimumSubtotal | type: ConvertedMoney | description: Minimum subtotal required.
                       - name: originalDescription | type: string | description: Original wording for the minimum subtotal rule.
                 - name: couponCode | type: string | description: Coupon code with an invalid status.
                 - name: reason | type: InvalidCouponReason | description: Why the coupon status is invalid.
                       - enum:
                       -     UNKNOWN_INVALID_COUPON_REASON: Unspecified status.
                       -     EXPIRED: Coupon has expired.
                       -     DISABLED: Coupon is disabled.
                       -     INACTIVE: Coupon isn't active yet.
                       -     MAX_USAGE_EXCEEDED: Coupon hit its usage limit.
                       -     MAX_USAGE_PER_CUSTOMER_EXCEEDED: Coupon hit its per-customer usage limit.
                       -     NOT_APPLICABLE_TO_SUBSCRIPTIONS: Coupon doesn't apply to subscriptions.
                       -     NOT_APPLICABLE_TO_SELECTED_LINE_ITEMS: Coupon doesn't apply to the cart's selected line items.
                       -     MIN_LINE_ITEM_QUANTITY_NOT_REACHED: Coupon needs a higher line item quantity than the cart has.
                       -     MIN_SUBTOTAL_NOT_REACHED: Coupon needs a higher subtotal than the cart has.
              - name: invalidCouponCodeData | type: InvalidCouponCodeErrorData | description: Payload when a coupon code is invalid.
                 - name: couponCode | type: string | description: Invalid coupon code.
              - name: invalidGiftCardCodeData | type: InvalidGiftCardCodeErrorData | description: Payload when a gift card code is invalid.
                 - name: giftCardCode | type: string | description: Invalid gift card code.
                 - name: giftCardId | type: string | description: Gift card GUID. Available when the gift card was found but failed validation.
              - name: invalidGiftCardStatusData | type: InvalidGiftCardStatusErrorData | description: Payload when a gift card's status is invalid.
                 - name: giftCardCode | type: string | description: Gift card code with an invalid status.
                 - name: reason | type: InvalidGiftCardReason | description: Why the gift card status is invalid.
                       - enum:
                       -     UNKNOWN_INVALID_GIFT_CARD_REASON: Unspecified status.
                       -     EXPIRED: Gift card has expired.
                       -     DISABLED: Gift card is disabled.
                       -     EMPTY_BALANCE: Gift card has no balance left.
                 - name: giftCardId | type: string | description: Gift card GUID. Available when the gift card was found but failed validation.
              - name: lineItemsOutOfStockData | type: LineItemsOutOfStockErrorData | description: Payload when line items are out of stock.
                 - name: lineItemIds | type: array<string> | description: Out-of-stock line item GUIDs.
                 - name: allLineItemsOutOfStock | type: boolean | description: Whether every line item in the cart is out of stock.
              - name: membersOnlyItemData | type: MembersOnlyItemErrorData | description: Payload for members-only items.
                 - name: lineItemIds | type: array<string> | description: Members-only line item GUIDs.
              - name: subtotalBelowOrderMinimumData | type: SubtotalBelowOrderMinimumErrorData | description: Payload when the cart's subtotal is below the minimum order subtotal.
                 - name: minimumOrderSubtotal | type: ConvertedMoney | description: Minimum subtotal required to place an order.
                 - name: remainingAmount | type: ConvertedMoney | description: Amount that needs to be added to the current order to reach the minimum subtotal amount.
              - name: invalidMembershipStatusData | type: InvalidMembershipStatusErrorData | description: Payload when a selected membership has an invalid status.
                 - name: membershipId | type: string | description: Membership GUID with an invalid status. Absent when the offending membership can't be identified.
                 - name: reason | type: InvalidMembershipReason | description: Why the membership status is invalid.
                       - enum:
                       -     UNKNOWN_INVALID_MEMBERSHIP_REASON: Unspecified status.
                       -     INSUFFICIENT_FUNDS: The membership doesn't have sufficient funds to pay for the cart.
           - name: scope | type: ViolationScope | description: Violation scope.
               - enum:
               -     GLOBAL: Violation applies to the cart as a whole.
               -     LINE_ITEM: Violation is tied to a specific line item.
               -     DISCOUNT: Violation is tied to a discount.
               -     DELIVERY: Violation is tied to the delivery method or address.
               -     TAX: Violation is tied to tax calculation.
               -     MEMBERSHIP: Violation is tied to a membership payment.
               -     GIFT_CARD: Violation is tied to a gift card.
           - name: code | type: ViolationCode | description: Violation type code.
               - enum:
               -     GENERAL_CODE: A general violation not covered by more specific codes.
               -     CUSTOM_VALIDATION: Custom violation (e.g., violations from Validation Service Plugin).
               -     EMPTY_CART: The cart doesn't contain any line items.
               -     LINE_ITEMS_OUT_OF_STOCK: One or more line items are out of stock.
               -     MEMBERS_ONLY_ITEM: One or more line items can be purchased only by members and the customer isn't a member.
               -     INVALID_COUPON_CODE: No coupon exists with the provided code.
               -     INVALID_COUPON_STATUS: The coupon status isn't valid for use (e.g., expired, usage limit reached, etc.).
               -     CANNOT_APPLY_COUPON_DISCOUNT_WHEN_PURCHASING_GIFT_CARD: A coupon discount can't be applied when purchasing a gift card.
               -     MISSING_DELIVERY_ADDRESS: The cart is missing a delivery address.
               -     MISSING_DELIVERY_METHOD: The cart is missing a delivery method.
               -     DELIVERY_METHOD_NO_LONGER_AVAILABLE: The selected delivery method is no longer available.
               -     DELIVERY_METHOD_NOT_APPLIED_TO_ALL_LINE_ITEMS: The selected delivery method doesn't apply to all line items in the cart.
               -     INVALID_GIFT_CARD_CODE: No gift card exists with the provided code.
               -     INVALID_GIFT_CARD_STATUS: The gift card status isn't valid for use (e.g., expired, fully redeemed, etc.).
               -     CANNOT_PAY_FOR_GIFT_CARD_WITH_GIFT_CARD: Can't pay for a gift card with another gift card.
               -     SUBTOTAL_BELOW_ORDER_MINIMUM: The cart's subtotal is below the minimum order subtotal.
               -     INVALID_MEMBERSHIP_STATUS: A selected membership has an invalid status (e.g., insufficient funds).
               -     INVALID_POSTAL_CODE: The address's postal code is missing or invalid.
               -     INVALID_SUBDIVISION: The address's subdivision is missing or invalid.
           - name: description | type: string | description: Human-readable violation message.
           - name: severity | type: ViolationSeverity | description: How serious the violation is; errors block placing an order.
               - enum:
               -     WARNING: Informational or advisory violation. Doesn't block placing an order.
               -     ERROR: Blocking violation. Must be resolved before an order can be placed.

```

---

## JavaScript SDK

### Schema

```
Webhook: onCartCalculated
Description: Triggered when a cart is calculated.
Payload: CartCalculatedEnvelope
  - name: data | type: CartSummary | description: none
     - name: cartId | type: string | description: Cart GUID.
     - name: cartRevision | type: string | description: Cart revision.
     - name: calculationId | type: string | description: Unique identifier for this cart calculation.
     - name: lineItems | type: array<LineItemSummary> | description: Summarized details for each line item in the cart.
        - name: lineItemId | type: string | description: Line item GUID.
        - name: quantity | type: integer | description: Line item quantity.
        - name: unitPrice | type: ConvertedMoney | description: Final unit price after discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
           - name: amount | type: string | description: Monetary amount in the original currency, as specified in `businessInfo.currencyCode`.
           - name: convertedAmount | type: string | description: Monetary amount in the converted currency, as specified in `customerInfo.currencyCode`.  Default: `amount`.
        - name: totalPrice | type: ConvertedMoney | description: Line total (unit price × quantity). Includes tax when `taxSummary.pricesIncludeTax` is true.
     - name: discounts | type: array<Discount> | description: Discounts applied to the cart.
        - name: name | type: TranslatableString | description: Display name of the discount.
           - name: original | type: string | description: __Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.
           - name: translated | type: string | description: String translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.
        - name: source | type: DiscountSource | description: Source of the discount; how it was applied.
           - name: sourceType | type: DiscountSourceType | description: Discount source type.
                 - enum:
                 -     AUTOMATIC_RULE: Discount applied automatically by a rule.
                 -     COUPON: Discount applied by a coupon code.
           - name: couponCode | type: string | description: Coupon code that triggered the discount. Only relevant for coupon discounts.
        - name: scope | type: DiscountScope | description: Part of the cart the discount applies to.
             - enum:
             -     UNKNOWN_DISCOUNT_SCOPE: Unknown discount scope.
             -     CART_SUBTOTAL: Discount applies to the cart subtotal.
             -     LINE_ITEM: Discount applies to a specific line item.
             -     DELIVERY: Discount applies to the delivery price.
        - name: subscriptionCycles | type: integer | description: Number of subscription billing cycles this discount applies to. If unset, it applies to all cycles.
        - name: total | type: ConvertedMoney | description: Total amount discounted across all of this discount's benefits.
        - name: lineItemDiscounts | type: array<LineItemDiscount> | description: Per-line-item discount amounts for item-level discounts.
           - name: lineItemId | type: string | description: Line item GUID the discount applies to.
           - name: amountOff | type: ConvertedMoney | description: Total amount discounted on this line item.
     - name: deliverySummary | type: DeliverySummary | description: Summary of delivery costs.
        - name: method | type: DeliveryMethod | description: Calculated delivery method.
           - name: code | type: string | description: Shipping rate code. Example: `"usps_std_overnight"`.
           - name: appId | type: string | description: Carrier app GUID.
           - name: title | type: TranslatableString | description: Delivery rate title. Examples: `"USPS Standard Overnight Delivery"`, `"Standard"`, `"First-Class Package International"`.
           - name: pickup | type: boolean | description: Whether this method is pickup.
        - name: price | type: ConvertedMoney | description: Delivery price before discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
     - name: additionalFees | type: array<AdditionalFee> | description: Additional fees applied to the cart.
        - name: code | type: string | description: Additional fee code.
        - name: name | type: TranslatableString | description: Additional fee display name.
        - name: providerAppId | type: string | description: App GUID of the fee provider.
        - name: lineItemIds | type: array<string> | description: Line items this fee applies to. When empty, the fee applies to the whole cart.
        - name: price | type: ConvertedMoney | description: Additional fee amount. Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: subscriptionCycles | type: integer | description: Number of subscription cycles this fee applies to. When unset and a discount is tied to a subscription line item, it applies to all cycles.
        - name: source | type: Source | description: Where the additional fee came from.
             - enum:
             -     UNKNOWN_ADDITIONAL_FEE_SOURCE: Unknown fee source.
             -     SERVICE_PLUGIN: Added by an additional fee service plugin.
             -     LINE_ITEM: Added on the item from the catalog or as a custom line item.
             -     DELIVERY: Added by the delivery provider.
             -     PLATFORM: Added by a Wix vertical as a platform fee.
     - name: taxSummary | type: TaxSummary | description: Tax calculation summary for the cart.
        - name: taxes | type: array<Tax> | description: Taxes applied to the cart. Multiple entries can appear when advanced tax rates are set, or one entry for the total. See [advanced tax rates](https://support.wix.com/en/article/setting-up-tax-calculation-using-the-manual-method#step-3-optional-customize-advanced-mode-settings).
           - name: name | type: TranslatableString | description: Tax name.
           - name: taxableAmount | type: ConvertedMoney | description: Amount tax is calculated on.
           - name: exemptAmount | type: ConvertedMoney | description: Amount exempt from tax.
           - name: amount | type: ConvertedMoney | description: Calculated tax from `taxableAmount`.
        - name: totalExempt | type: ConvertedMoney | description: Amount exempt from tax.
        - name: pricesIncludeTax | type: boolean | description: Whether tax is included in prices for line items, discounts, delivery, and additional fees.
        - name: lineItemTaxes | type: array<LineItemTax> | description: Per line item tax amounts.
           - name: lineItemId | type: string | description: Line item GUID.
           - name: tax | type: ConvertedMoney | description: Tax amount for the line item.
           - name: rate | type: string | description: Tax rate as a decimal between 0 and 1.
        - name: deliveryTax | type: ConvertedMoney | description: Tax on the delivery method.
        - name: additionalFeeTaxes | type: array<AdditionalFeeTax> | description: Tax on additional fees.
           - name: additionalFeeCode | type: string | description: Additional fee code.
           - name: tax | type: ConvertedMoney | description: Tax amount for the additional fee.
     - name: priceSummary | type: PriceSummary | description: Summary of calculated price components for the cart.
        - name: subtotal | type: ConvertedMoney | description: Total for all line items after item-level discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: discount | type: ConvertedMoney | description: Cart subtotal discount amount, deducted from the subtotal. Item-level discounts are already reflected in the subtotal. Returns 0 when no cart subtotal discount is applied. For details of all applied discounts (including delivery discounts), see `cartSummary.discounts`. Currently, only a single coupon is supported.
        - name: delivery | type: ConvertedMoney | description: Delivery price after discounts. Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: additionalFees | type: ConvertedMoney | description: Total of additional fees. Includes tax when `taxSummary.pricesIncludeTax` is true.
        - name: tax | type: ConvertedMoney | description: Tax charged on top of the prices, summed across items, discounts, delivery, and fees. When `taxSummary.pricesIncludeTax` is true, tax is already embedded in the prices, so this field is `0`. For the full tax breakdown in either case, see `taxSummary.taxes`.
        - name: total | type: ConvertedMoney | description: Amount to pay.
     - name: paymentSummary | type: PaymentSummary | description: How the customer pays for the order.
        - name: giftCards | type: array<GiftCardSummary> | description: Per-gift card deduction amounts. Only one gift card is supported today.
           - name: giftCardId | type: string | description: Gift card GUID assigned by the cart.
           - name: redeemAmount | type: ConvertedMoney | description: Amount to redeem from the gift card balance.
        - name: memberships | type: array<MembershipSummary> | description: Memberships charged with the order.
           - name: _id | type: string | description: Membership GUID.
           - name: appId | type: string | description: App GUID for this payment option.
           - name: lineItemIds | type: array<string> | description: Line item GUIDs this membership applies to.
        - name: subscriptionCharges | type: array<SubscriptionCharges> | description: Subscription charge details for checkout.
           - name: lineItemIds | type: array<string> | description: Line items covered by the subscription.
           - name: description | type: string | description: Human-readable schedule and amounts for upcoming charges. Localized to the buyer's language for subscription orders, or the site language if none is set.
           - name: charges | type: array<Charge> | description: Scheduled charges.
              - name: cycleFrom | type: integer | description: First billing cycle for this charge.
              - name: cycleCount | type: integer | description: Number of cycles this charge covers, when set.
              - name: cycleBillingDate | type: Date | description: Billing period start.
        - name: requiresPaymentAfterGiftCard | type: boolean | description: Whether additional payment is required to create the order after gift cards.
        - name: totalAfterGiftCards | type: ConvertedMoney | description: Total due after gift cards.
        - name: payNow | type: ConvertedMoney | description: Amount charged when the order is placed, after gift cards.
        - name: payLater | type: ConvertedMoney | description: Amount collected later.
        - name: payAfterFreeTrial | type: ConvertedMoney | description: Amount charged after a free trial, often for subscriptions.
     - name: priceVerificationToken | type: string | description: Opaque token for the cart's calculated prices.  Pass this token when placing an order so the prices the customer saw match checkout.  If provided, the server validates it by recalculating the cart and comparing the pricing token. If validation fails, checkout is rejected.  This limits unexpected price changes or tampering between cart calculation and order placement.  Don't parse or modify the token on the client.
     - name: violations | type: array<Violation> | description: All business violations for the cart.
        - ONE-OF:
           - name: customValidationData | type: CustomValidationErrorData | description: Payload for Validations service plugin violations.
              - name: target | type: Target | description: Where to show the violation on the cart or checkout page.
                 - ONE-OF:
                    - name: other | type: Other | description: General (other) violation.
                       - name: name | type: NameInOther | description: Location on a checkout or a cart page where a general (other) violation will be displayed.
                                 - enum:
                                 -     OTHER_DEFAULT: Default location, in case no specific location is specified.
                    - name: lineItem | type: LineItem | description: Specific line item violation.
                       - name: name | type: NameInLineItem | description: Location on a checkout or a cart page where the specific line item violation will be displayed.
                                 - enum:
                                 -     LINE_ITEM_DEFAULT: Default location, in case no specific location is specified.
                       - name: _id | type: string | description: GUID of the line item containing the violation.
           - name: invalidCouponStatusData | type: InvalidCouponStatusErrorData | description: Payload when a coupon's status is invalid.
              - ONE-OF:
                 - name: minLineItemQuantityNotReachedDetails | type: MinLineItemQuantityNotReachedDetails | description: 
                    - name: requiredMinimumQuantity | type: integer | description: Minimum line item quantity required.
                 - name: minSubtotalNotReachedDetails | type: MinSubtotalNotReachedDetails | description: 
                    - name: requiredMinimumSubtotal | type: ConvertedMoney | description: Minimum subtotal required.
                    - name: originalDescription | type: string | description: Original wording for the minimum subtotal rule.
              - name: couponCode | type: string | description: Coupon code with an invalid status.
              - name: reason | type: InvalidCouponReason | description: Why the coupon status is invalid.
                     - enum:
                     -     UNKNOWN_INVALID_COUPON_REASON: Unspecified status.
                     -     EXPIRED: Coupon has expired.
                     -     DISABLED: Coupon is disabled.
                     -     INACTIVE: Coupon isn't active yet.
                     -     MAX_USAGE_EXCEEDED: Coupon hit its usage limit.
                     -     MAX_USAGE_PER_CUSTOMER_EXCEEDED: Coupon hit its per-customer usage limit.
                     -     NOT_APPLICABLE_TO_SUBSCRIPTIONS: Coupon doesn't apply to subscriptions.
                     -     NOT_APPLICABLE_TO_SELECTED_LINE_ITEMS: Coupon doesn't apply to the cart's selected line items.
                     -     MIN_LINE_ITEM_QUANTITY_NOT_REACHED: Coupon needs a higher line item quantity than the cart has.
                     -     MIN_SUBTOTAL_NOT_REACHED: Coupon needs a higher subtotal than the cart has.
           - name: invalidCouponCodeData | type: InvalidCouponCodeErrorData | description: Payload when a coupon code is invalid.
              - name: couponCode | type: string | description: Invalid coupon code.
           - name: invalidGiftCardCodeData | type: InvalidGiftCardCodeErrorData | description: Payload when a gift card code is invalid.
              - name: giftCardCode | type: string | description: Invalid gift card code.
              - name: giftCardId | type: string | description: Gift card GUID. Available when the gift card was found but failed validation.
           - name: invalidGiftCardStatusData | type: InvalidGiftCardStatusErrorData | description: Payload when a gift card's status is invalid.
              - name: giftCardCode | type: string | description: Gift card code with an invalid status.
              - name: reason | type: InvalidGiftCardReason | description: Why the gift card status is invalid.
                     - enum:
                     -     UNKNOWN_INVALID_GIFT_CARD_REASON: Unspecified status.
                     -     EXPIRED: Gift card has expired.
                     -     DISABLED: Gift card is disabled.
                     -     EMPTY_BALANCE: Gift card has no balance left.
              - name: giftCardId | type: string | description: Gift card GUID. Available when the gift card was found but failed validation.
           - name: lineItemsOutOfStockData | type: LineItemsOutOfStockErrorData | description: Payload when line items are out of stock.
              - name: lineItemIds | type: array<string> | description: Out-of-stock line item GUIDs.
              - name: allLineItemsOutOfStock | type: boolean | description: Whether every line item in the cart is out of stock.
           - name: membersOnlyItemData | type: MembersOnlyItemErrorData | description: Payload for members-only items.
              - name: lineItemIds | type: array<string> | description: Members-only line item GUIDs.
           - name: subtotalBelowOrderMinimumData | type: SubtotalBelowOrderMinimumErrorData | description: Payload when the cart's subtotal is below the minimum order subtotal.
              - name: minimumOrderSubtotal | type: ConvertedMoney | description: Minimum subtotal required to place an order.
              - name: remainingAmount | type: ConvertedMoney | description: Amount that needs to be added to the current order to reach the minimum subtotal amount.
           - name: invalidMembershipStatusData | type: InvalidMembershipStatusErrorData | description: Payload when a selected membership has an invalid status.
              - name: membershipId | type: string | description: Membership GUID with an invalid status. Absent when the offending membership can't be identified.
              - name: reason | type: InvalidMembershipReason | description: Why the membership status is invalid.
                     - enum:
                     -     UNKNOWN_INVALID_MEMBERSHIP_REASON: Unspecified status.
                     -     INSUFFICIENT_FUNDS: The membership doesn't have sufficient funds to pay for the cart.
        - name: scope | type: ViolationScope | description: Violation scope.
             - enum:
             -     GLOBAL: Violation applies to the cart as a whole.
             -     LINE_ITEM: Violation is tied to a specific line item.
             -     DISCOUNT: Violation is tied to a discount.
             -     DELIVERY: Violation is tied to the delivery method or address.
             -     TAX: Violation is tied to tax calculation.
             -     MEMBERSHIP: Violation is tied to a membership payment.
             -     GIFT_CARD: Violation is tied to a gift card.
        - name: code | type: ViolationCode | description: Violation type code.
             - enum:
             -     GENERAL_CODE: A general violation not covered by more specific codes.
             -     CUSTOM_VALIDATION: Custom violation (e.g., violations from Validation Service Plugin).
             -     EMPTY_CART: The cart doesn't contain any line items.
             -     LINE_ITEMS_OUT_OF_STOCK: One or more line items are out of stock.
             -     MEMBERS_ONLY_ITEM: One or more line items can be purchased only by members and the customer isn't a member.
             -     INVALID_COUPON_CODE: No coupon exists with the provided code.
             -     INVALID_COUPON_STATUS: The coupon status isn't valid for use (e.g., expired, usage limit reached, etc.).
             -     CANNOT_APPLY_COUPON_DISCOUNT_WHEN_PURCHASING_GIFT_CARD: A coupon discount can't be applied when purchasing a gift card.
             -     MISSING_DELIVERY_ADDRESS: The cart is missing a delivery address.
             -     MISSING_DELIVERY_METHOD: The cart is missing a delivery method.
             -     DELIVERY_METHOD_NO_LONGER_AVAILABLE: The selected delivery method is no longer available.
             -     DELIVERY_METHOD_NOT_APPLIED_TO_ALL_LINE_ITEMS: The selected delivery method doesn't apply to all line items in the cart.
             -     INVALID_GIFT_CARD_CODE: No gift card exists with the provided code.
             -     INVALID_GIFT_CARD_STATUS: The gift card status isn't valid for use (e.g., expired, fully redeemed, etc.).
             -     CANNOT_PAY_FOR_GIFT_CARD_WITH_GIFT_CARD: Can't pay for a gift card with another gift card.
             -     SUBTOTAL_BELOW_ORDER_MINIMUM: The cart's subtotal is below the minimum order subtotal.
             -     INVALID_MEMBERSHIP_STATUS: A selected membership has an invalid status (e.g., insufficient funds).
             -     INVALID_POSTAL_CODE: The address's postal code is missing or invalid.
             -     INVALID_SUBDIVISION: The address's subdivision is missing or invalid.
        - name: description | type: string | description: Human-readable violation message.
        - name: severity | type: ViolationSeverity | description: How serious the violation is; errors block placing an order.
             - enum:
             -     WARNING: Informational or advisory violation. Doesn't block placing an order.
             -     ERROR: Blocking violation. Must be resolved before an order can be placed.
  - name: metadata | type: EventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them.
     - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     - name: entityId | type: string | description: GUID of the entity associated with the event.
     - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
     - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event.
     - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.

```

### Examples


```javascript
import { cartV2 } from '@wix/ecom';

cartV2.onCartCalculated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { cartV2 } from '@wix/ecom';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      cartV2,
    },
});

wixClient.cartV2.onCartCalculated((event) => {
    // handle your event here
});
```

---