@wix/auto_sdk_ecom_cart-v-2 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +120 -105
  2. package/build/cjs/index.js +41 -51
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +34 -44
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +103 -98
  8. package/build/cjs/meta.js +20 -20
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +120 -105
  11. package/build/es/index.mjs +39 -48
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +32 -41
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +103 -98
  17. package/build/es/meta.mjs +18 -18
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +24 -28
  20. package/build/internal/cjs/index.js +41 -51
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +139 -128
  23. package/build/internal/cjs/index.typings.js +34 -44
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +103 -98
  26. package/build/internal/cjs/meta.js +20 -20
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +24 -28
  29. package/build/internal/es/index.mjs +39 -48
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +139 -128
  32. package/build/internal/es/index.typings.mjs +32 -41
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +103 -98
  35. package/build/internal/es/meta.mjs +18 -18
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -37,13 +37,11 @@ interface Cart {
37
37
  */
38
38
  note?: string | null;
39
39
  /**
40
- * The discounts of the Cart.
41
- * Automatic discounts are removed from the Cart entirely when they are no longer valid.
42
- * Coupon discounts are not removed from the Cart, but are marked as invalid.
43
- * @maxSize 100
44
- * @readonly
40
+ * List of coupons added to the Cart.
41
+ * Currently, only one coupon code is supported.
42
+ * @maxSize 1
45
43
  */
46
- discounts?: Discount[];
44
+ coupons?: Coupon[];
47
45
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
48
46
  source?: CartSource;
49
47
  /** Information about the site from which the Cart's line items were added. */
@@ -138,6 +136,11 @@ interface V2LineItem {
138
136
  * @maxSize 25
139
137
  */
140
138
  modifierGroups?: ModifierGroup[];
139
+ /**
140
+ * List of discounts applied to this line item.
141
+ * @maxSize 100
142
+ */
143
+ discounts?: ItemDiscount[];
141
144
  /**
142
145
  * Whether the line item is a custom line item.
143
146
  * Custom line items don't trigger the Catalog service plugin.
@@ -842,6 +845,16 @@ interface ItemModifier {
842
845
  /** The price of the modifier. */
843
846
  price?: MultiCurrencyPrice;
844
847
  }
848
+ /**
849
+ * Currently, only automatic discounts are applied to line items.
850
+ * In the future, coupon discounts will be supported as well.
851
+ */
852
+ interface ItemDiscount {
853
+ /** The display name of the discount. */
854
+ name?: TranslatableString;
855
+ /** The amount discounted from the item's sale price (per unit). */
856
+ amountOff?: MultiCurrencyPrice;
857
+ }
845
858
  interface Scope {
846
859
  /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
847
860
  namespace?: string;
@@ -854,95 +867,19 @@ interface Group {
854
867
  /** Item ID (when the coupon scope is limited to just one item). */
855
868
  entityId?: string | null;
856
869
  }
857
- interface Discount {
870
+ interface Coupon {
858
871
  /**
859
- * A unique identifier of the discount within the Cart.
872
+ * ID of the coupon in the Cart.
860
873
  * @format GUID
861
874
  */
862
875
  _id?: string;
863
- /** The display name of the discount. */
864
- name?: TranslatableString;
865
- /** The source of the discount, indicating how it was applied. */
866
- source?: DiscountSource;
867
- /** The component in the Cart that the discount applies to. */
868
- scope?: DiscountScopeWithLiterals;
869
- /**
870
- * List of benefits provided by the discount.
871
- * @minSize 1
872
- * @maxSize 100
873
- */
874
- benefits?: DiscountBenefit[];
875
- /**
876
- * The current status of the discount.
877
- * TODO: remodel.
878
- */
879
- status?: DiscountStatusWithLiterals;
880
- /**
881
- * Number of subscription cycles this discount applies to.
882
- * If unset, the discount applies to all billing cycles.
883
- * @min 1
884
- * @max 1000
885
- */
886
- subscriptionCycles?: number | null;
887
- }
888
- interface DiscountSource {
889
- /** The type of the discount source. */
890
- sourceType?: DiscountSourceTypeWithLiterals;
891
876
  /**
892
- * Coupon code that triggered the discount.
893
- * Relevant for coupon discounts only.
877
+ * Coupon code.
878
+ * @minLength 1
894
879
  * @maxLength 50
895
880
  */
896
- couponCode?: string | null;
897
- }
898
- declare enum DiscountSourceType {
899
- UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
900
- /** The discount was applied automatically by a rule. */
901
- AUTOMATIC_RULE = "AUTOMATIC_RULE",
902
- /** The discount was applied by a coupon code. */
903
- COUPON = "COUPON"
904
- }
905
- /** @enumType */
906
- type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
907
- declare enum DiscountScope {
908
- UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
909
- /** The discount applies to the cart's subtotal. */
910
- CART_SUBTOTAL = "CART_SUBTOTAL",
911
- /** The discount applies to a specific line item. */
912
- LINE_ITEM = "LINE_ITEM",
913
- /** The discount applies to the delivery price. */
914
- DELIVERY = "DELIVERY"
915
- }
916
- /** @enumType */
917
- type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
918
- interface DiscountBenefit extends DiscountBenefitValueOneOf {
919
- /** A specific monetary value deducted from the total cost. */
920
- amountOff?: MultiCurrencyPrice;
921
- /**
922
- * The ID of line item that the discount applies to.
923
- * Relevant for item-level discounts only.
924
- * @format GUID
925
- */
926
- lineItemId?: string | null;
927
- }
928
- /** @oneof */
929
- interface DiscountBenefitValueOneOf {
930
- /** A specific monetary value deducted from the total cost. */
931
- amountOff?: MultiCurrencyPrice;
932
- }
933
- declare enum DiscountStatus {
934
- UNKNOWN_DISCOUNT_STATUS = "UNKNOWN_DISCOUNT_STATUS",
935
- /** The discount is active and valid. */
936
- ACTIVE = "ACTIVE",
937
- /** The discount has expired. */
938
- EXPIRED = "EXPIRED",
939
- /** The discount was deleted from the system. */
940
- DELETED = "DELETED",
941
- /** The discount reached the maximum number of uses. */
942
- MAX_USAGE_REACHED = "MAX_USAGE_REACHED"
881
+ code?: string;
943
882
  }
944
- /** @enumType */
945
- type DiscountStatusWithLiterals = DiscountStatus | 'UNKNOWN_DISCOUNT_STATUS' | 'ACTIVE' | 'EXPIRED' | 'DELETED' | 'MAX_USAGE_REACHED';
946
883
  interface CartSource {
947
884
  /**
948
885
  * Sales channel that created the Cart.
@@ -1443,6 +1380,84 @@ interface CustomField {
1443
1380
  */
1444
1381
  translatedTitle?: string | null;
1445
1382
  }
1383
+ interface LegacyFields {
1384
+ /**
1385
+ * The applied discounts of the Cart.
1386
+ * Discounts that are no longer applied are not included in this list.
1387
+ * @maxSize 100
1388
+ */
1389
+ appliedDiscounts?: Discount[];
1390
+ /** The coupon discount amount. */
1391
+ couponDiscount?: MultiCurrencyPrice;
1392
+ /** The sum of all line items after applying all discounts. */
1393
+ subtotalAfterCouponDiscount?: MultiCurrencyPrice;
1394
+ }
1395
+ interface Discount {
1396
+ /** The display name of the discount. */
1397
+ name?: TranslatableString;
1398
+ /** The source of the discount, indicating how it was applied. */
1399
+ source?: DiscountSource;
1400
+ /** The component in the Cart that the discount applies to. */
1401
+ scope?: DiscountScopeWithLiterals;
1402
+ /**
1403
+ * List of benefits provided by the discount.
1404
+ * @minSize 1
1405
+ * @maxSize 100
1406
+ */
1407
+ benefits?: DiscountBenefit[];
1408
+ /**
1409
+ * Number of subscription cycles this discount applies to.
1410
+ * If unset, the discount applies to all billing cycles.
1411
+ * @min 1
1412
+ * @max 1000
1413
+ */
1414
+ subscriptionCycles?: number | null;
1415
+ }
1416
+ interface DiscountSource {
1417
+ /** The type of the discount source. */
1418
+ sourceType?: DiscountSourceTypeWithLiterals;
1419
+ /**
1420
+ * Coupon code that triggered the discount.
1421
+ * Relevant for coupon discounts only.
1422
+ * @maxLength 50
1423
+ */
1424
+ couponCode?: string | null;
1425
+ }
1426
+ declare enum DiscountSourceType {
1427
+ UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
1428
+ /** The discount was applied automatically by a rule. */
1429
+ AUTOMATIC_RULE = "AUTOMATIC_RULE",
1430
+ /** The discount was applied by a coupon code. */
1431
+ COUPON = "COUPON"
1432
+ }
1433
+ /** @enumType */
1434
+ type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
1435
+ declare enum DiscountScope {
1436
+ UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
1437
+ /** The discount applies to the cart's subtotal. */
1438
+ CART_SUBTOTAL = "CART_SUBTOTAL",
1439
+ /** The discount applies to a specific line item. */
1440
+ LINE_ITEM = "LINE_ITEM",
1441
+ /** The discount applies to the delivery price. */
1442
+ DELIVERY = "DELIVERY"
1443
+ }
1444
+ /** @enumType */
1445
+ type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
1446
+ interface DiscountBenefit extends DiscountBenefitValueOneOf {
1447
+ /** A specific monetary value deducted from the total cost. */
1448
+ amountOff?: MultiCurrencyPrice;
1449
+ /**
1450
+ * The ID of line item that the discount applies to.
1451
+ * Relevant for item-level discounts only.
1452
+ * @format GUID
1453
+ */
1454
+ lineItemId?: string | null;
1455
+ }
1456
+ /** @oneof */
1457
+ interface DiscountBenefitValueOneOf {
1458
+ /** A specific monetary value deducted from the total cost. */
1459
+ amountOff?: MultiCurrencyPrice;
1460
+ }
1446
1461
  interface CartSummary {
1447
1462
  /**
1448
1463
  * The Cart ID.
@@ -1605,6 +1620,8 @@ interface Tax {
1605
1620
  rate?: string | null;
1606
1621
  /** Calculated tax, based on `taxable_amount` and `rate`. */
1607
1622
  totalTax?: MultiCurrencyPrice;
1623
+ /** Amount that is exempt from tax. */
1624
+ totalExemptAmount?: MultiCurrencyPrice;
1608
1625
  }
1609
1626
  interface LineItemTax {
1610
1627
  /**
@@ -2284,7 +2301,7 @@ interface UpdateLineItemsInCurrentCartResponse {
2284
2301
  /** Updated Cart. */
2285
2302
  cart?: Cart;
2286
2303
  }
2287
- interface AddDiscountToCurrentCartRequest {
2304
+ interface AddCouponToCurrentCartRequest {
2288
2305
  /**
2289
2306
  * Coupon to apply.
2290
2307
  *
@@ -2294,18 +2311,18 @@ interface AddDiscountToCurrentCartRequest {
2294
2311
  */
2295
2312
  couponCode?: string;
2296
2313
  }
2297
- interface AddDiscountToCurrentCartResponse {
2314
+ interface AddCouponToCurrentCartResponse {
2298
2315
  /** Updated Cart. */
2299
2316
  cart?: Cart;
2300
2317
  }
2301
- interface RemoveDiscountFromCurrentCartRequest {
2318
+ interface RemoveCouponFromCurrentCartRequest {
2302
2319
  /**
2303
- * Discount ID.
2320
+ * Coupon ID.
2304
2321
  * @format GUID
2305
2322
  */
2306
- discountId?: string;
2323
+ couponId?: string;
2307
2324
  }
2308
- interface RemoveDiscountFromCurrentCartResponse {
2325
+ interface RemoveCouponFromCurrentCartResponse {
2309
2326
  /** Updated Cart. */
2310
2327
  cart?: Cart;
2311
2328
  }
@@ -2709,7 +2726,7 @@ interface UpdateLineItemsResponse {
2709
2726
  /** Updated Cart. */
2710
2727
  cart?: Cart;
2711
2728
  }
2712
- interface AddDiscountRequest {
2729
+ interface AddCouponRequest {
2713
2730
  /**
2714
2731
  * Cart ID.
2715
2732
  * @format GUID
@@ -2724,11 +2741,11 @@ interface AddDiscountRequest {
2724
2741
  */
2725
2742
  couponCode: string;
2726
2743
  }
2727
- interface AddDiscountResponse {
2744
+ interface AddCouponResponse {
2728
2745
  /** Updated Cart. */
2729
2746
  cart?: Cart;
2730
2747
  }
2731
- interface RemoveDiscountRequest {
2748
+ interface RemoveCouponRequest {
2732
2749
  /**
2733
2750
  * Cart ID.
2734
2751
  * @format GUID
@@ -2738,9 +2755,9 @@ interface RemoveDiscountRequest {
2738
2755
  * Discount ID.
2739
2756
  * @format GUID
2740
2757
  */
2741
- discountId: string;
2758
+ couponId: string;
2742
2759
  }
2743
- interface RemoveDiscountResponse {
2760
+ interface RemoveCouponResponse {
2744
2761
  /** Updated Cart. */
2745
2762
  cart?: Cart;
2746
2763
  }
@@ -2887,13 +2904,11 @@ interface UpdateCart {
2887
2904
  */
2888
2905
  note?: string | null;
2889
2906
  /**
2890
- * The discounts of the Cart.
2891
- * Automatic discounts are removed from the Cart entirely when they are no longer valid.
2892
- * Coupon discounts are not removed from the Cart, but are marked as invalid.
2893
- * @maxSize 100
2894
- * @readonly
2907
+ * List of coupons added to the Cart.
2908
+ * Currently, only one coupon code is supported.
2909
+ * @maxSize 1
2895
2910
  */
2896
- discounts?: Discount[];
2911
+ coupons?: Coupon[];
2897
2912
  /** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
2898
2913
  source?: CartSource;
2899
2914
  /** Information about the site from which the Cart's line items were added. */
@@ -3010,4 +3025,4 @@ interface MarkCartAsCompletedOptions {
3010
3025
  orderId?: string | null;
3011
3026
  }
3012
3027
 
3013
- export { type ActionEvent, type AddDiscountRequest, type AddDiscountResponse, type AddDiscountToCurrentCartRequest, type AddDiscountToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, CalculationComponent, type CalculationComponentWithLiterals, type CalculationConfig, type CalculationError, type Cart, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, type Color, type CreateCartOptions, type CreateCartRequest, type CreateCartResponse, 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 DeliveryInfo, type DeliveryMethod, type DeliverySummary, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountStatus, type DiscountStatusWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, ErrorCode, type ErrorCodeWithLiterals, type ExtendedFields, type ExternalReference, type FieldViolation, FileType, type FileTypeWithLiterals, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCheckoutUrlOptions, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ItemAttributes, type ItemDeliveryConfig, type ItemModifier, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedOptions, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type Membership, type MessageEnvelope, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PlaceOrderOptions, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type RemoveDiscountFromCurrentCartRequest, type RemoveDiscountFromCurrentCartResponse, type RemoveDiscountRequest, type RemoveDiscountResponse, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedMembership, type SelectedMembershipUpdate, type ServiceProperties, Severity, type SeverityWithLiterals, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxDetails, type TaxInfo, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UpdateCart, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V2AdditionalFee, type V2LineItem, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
3028
+ export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, CalculationComponent, type CalculationComponentWithLiterals, type CalculationConfig, type CalculationError, type Cart, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Charge, type Color, type Coupon, type CreateCartOptions, type CreateCartRequest, type CreateCartResponse, 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 DeliveryInfo, type DeliveryMethod, type DeliverySummary, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, ErrorCode, type ErrorCodeWithLiterals, type ExtendedFields, type ExternalReference, type FieldViolation, FileType, type FileTypeWithLiterals, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCheckoutUrlOptions, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ItemAttributes, type ItemDeliveryConfig, type ItemDiscount, type ItemModifier, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, type LegacyFields, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedOptions, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type Membership, type MessageEnvelope, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PlaceOrderOptions, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedMembership, type SelectedMembershipUpdate, type ServiceProperties, Severity, type SeverityWithLiterals, type StreetAddress, type SubscriptionCharges, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxDetails, type TaxInfo, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UpdateCart, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V2AdditionalFee, type V2LineItem, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
@@ -662,15 +662,15 @@ function updateLineItems(payload) {
662
662
  }
663
663
  return __updateLineItems;
664
664
  }
665
- function addDiscount(payload) {
666
- function __addDiscount({ host }) {
665
+ function addCoupon(payload) {
666
+ function __addCoupon({ host }) {
667
667
  const metadata = {
668
668
  entityFqdn: "wix.ecom.v2.cart",
669
669
  method: "POST",
670
- methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
670
+ methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
671
671
  packageName: PACKAGE_NAME,
672
672
  url: resolveWixEcomCartV2CartServiceUrl({
673
- protoPath: "/v2/carts/{cartId}/add-discount",
673
+ protoPath: "/v2/carts/{cartId}/add-coupon",
674
674
  data: payload,
675
675
  host
676
676
  }),
@@ -710,17 +710,17 @@ function addDiscount(payload) {
710
710
  };
711
711
  return metadata;
712
712
  }
713
- return __addDiscount;
713
+ return __addCoupon;
714
714
  }
715
- function removeDiscount(payload) {
716
- function __removeDiscount({ host }) {
715
+ function removeCoupon(payload) {
716
+ function __removeCoupon({ host }) {
717
717
  const metadata = {
718
718
  entityFqdn: "wix.ecom.v2.cart",
719
719
  method: "POST",
720
- methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
720
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
721
721
  packageName: PACKAGE_NAME,
722
722
  url: resolveWixEcomCartV2CartServiceUrl({
723
- protoPath: "/v2/carts/{cartId}/remove-discount",
723
+ protoPath: "/v2/carts/{cartId}/remove-coupon",
724
724
  data: payload,
725
725
  host
726
726
  }),
@@ -760,7 +760,7 @@ function removeDiscount(payload) {
760
760
  };
761
761
  return metadata;
762
762
  }
763
- return __removeDiscount;
763
+ return __removeCoupon;
764
764
  }
765
765
  function addGiftCard(payload) {
766
766
  function __addGiftCard({ host }) {
@@ -1000,27 +1000,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
1000
1000
  ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
1001
1001
  return ItemStatus2;
1002
1002
  })(ItemStatus || {});
1003
- var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
1004
- DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
1005
- DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
1006
- DiscountSourceType2["COUPON"] = "COUPON";
1007
- return DiscountSourceType2;
1008
- })(DiscountSourceType || {});
1009
- var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1010
- DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
1011
- DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
1012
- DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
1013
- DiscountScope2["DELIVERY"] = "DELIVERY";
1014
- return DiscountScope2;
1015
- })(DiscountScope || {});
1016
- var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
1017
- DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
1018
- DiscountStatus2["ACTIVE"] = "ACTIVE";
1019
- DiscountStatus2["EXPIRED"] = "EXPIRED";
1020
- DiscountStatus2["DELETED"] = "DELETED";
1021
- DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
1022
- return DiscountStatus2;
1023
- })(DiscountStatus || {});
1024
1003
  var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
1025
1004
  ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
1026
1005
  ChannelType2["WEB"] = "WEB";
@@ -1053,6 +1032,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
1053
1032
  WeightUnit2["LB"] = "LB";
1054
1033
  return WeightUnit2;
1055
1034
  })(WeightUnit || {});
1035
+ var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
1036
+ DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
1037
+ DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
1038
+ DiscountSourceType2["COUPON"] = "COUPON";
1039
+ return DiscountSourceType2;
1040
+ })(DiscountSourceType || {});
1041
+ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1042
+ DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
1043
+ DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
1044
+ DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
1045
+ DiscountScope2["DELIVERY"] = "DELIVERY";
1046
+ return DiscountScope2;
1047
+ })(DiscountScope || {});
1056
1048
  var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
1057
1049
  CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
1058
1050
  CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
@@ -1662,13 +1654,13 @@ async function updateLineItems2(cartId, options) {
1662
1654
  throw transformedError;
1663
1655
  }
1664
1656
  }
1665
- async function addDiscount2(cartId, couponCode) {
1657
+ async function addCoupon2(cartId, couponCode) {
1666
1658
  const { httpClient, sideEffects } = arguments[2];
1667
1659
  const payload = renameKeysFromSDKRequestToRESTRequest({
1668
1660
  cartId,
1669
1661
  couponCode
1670
1662
  });
1671
- const reqOpts = addDiscount(payload);
1663
+ const reqOpts = addCoupon(payload);
1672
1664
  sideEffects?.onSiteCall?.();
1673
1665
  try {
1674
1666
  const result = await httpClient.request(reqOpts);
@@ -1709,13 +1701,13 @@ async function addDiscount2(cartId, couponCode) {
1709
1701
  throw transformedError;
1710
1702
  }
1711
1703
  }
1712
- async function removeDiscount2(cartId, discountId) {
1704
+ async function removeCoupon2(cartId, couponId) {
1713
1705
  const { httpClient, sideEffects } = arguments[2];
1714
1706
  const payload = renameKeysFromSDKRequestToRESTRequest({
1715
1707
  cartId,
1716
- discountId
1708
+ couponId
1717
1709
  });
1718
- const reqOpts = removeDiscount(payload);
1710
+ const reqOpts = removeCoupon(payload);
1719
1711
  sideEffects?.onSiteCall?.();
1720
1712
  try {
1721
1713
  const result = await httpClient.request(reqOpts);
@@ -1747,10 +1739,10 @@ async function removeDiscount2(cartId, discountId) {
1747
1739
  err,
1748
1740
  {
1749
1741
  spreadPathsToArguments: {},
1750
- explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
1742
+ explicitPathsToArguments: { cartId: "$[0]", couponId: "$[1]" },
1751
1743
  singleArgumentUnchanged: false
1752
1744
  },
1753
- ["cartId", "discountId"]
1745
+ ["cartId", "couponId"]
1754
1746
  );
1755
1747
  sideEffects?.onError?.(err);
1756
1748
  throw transformedError;
@@ -2006,18 +1998,18 @@ function updateLineItems3(httpClient) {
2006
1998
  { httpClient }
2007
1999
  );
2008
2000
  }
2009
- function addDiscount3(httpClient) {
2010
- return (cartId, couponCode) => addDiscount2(
2001
+ function addCoupon3(httpClient) {
2002
+ return (cartId, couponCode) => addCoupon2(
2011
2003
  cartId,
2012
2004
  couponCode,
2013
2005
  // @ts-ignore
2014
2006
  { httpClient }
2015
2007
  );
2016
2008
  }
2017
- function removeDiscount3(httpClient) {
2018
- return (cartId, discountId) => removeDiscount2(
2009
+ function removeCoupon3(httpClient) {
2010
+ return (cartId, couponId) => removeCoupon2(
2019
2011
  cartId,
2020
- discountId,
2012
+ couponId,
2021
2013
  // @ts-ignore
2022
2014
  { httpClient }
2023
2015
  );
@@ -2067,8 +2059,8 @@ var placeOrder4 = /* @__PURE__ */ createRESTModule(placeOrder3);
2067
2059
  var addLineItems4 = /* @__PURE__ */ createRESTModule(addLineItems3);
2068
2060
  var removeLineItems4 = /* @__PURE__ */ createRESTModule(removeLineItems3);
2069
2061
  var updateLineItems4 = /* @__PURE__ */ createRESTModule(updateLineItems3);
2070
- var addDiscount4 = /* @__PURE__ */ createRESTModule(addDiscount3);
2071
- var removeDiscount4 = /* @__PURE__ */ createRESTModule(removeDiscount3);
2062
+ var addCoupon4 = /* @__PURE__ */ createRESTModule(addCoupon3);
2063
+ var removeCoupon4 = /* @__PURE__ */ createRESTModule(removeCoupon3);
2072
2064
  var addGiftCard4 = /* @__PURE__ */ createRESTModule(addGiftCard3);
2073
2065
  var removeGiftCard4 = /* @__PURE__ */ createRESTModule(removeGiftCard3);
2074
2066
  var markCartAsCompleted4 = /* @__PURE__ */ createRESTModule(markCartAsCompleted3);
@@ -2079,7 +2071,6 @@ export {
2079
2071
  DescriptionLineType,
2080
2072
  DiscountScope,
2081
2073
  DiscountSourceType,
2082
- DiscountStatus,
2083
2074
  ErrorCode,
2084
2075
  FileType,
2085
2076
  ItemStatus,
@@ -2096,7 +2087,7 @@ export {
2096
2087
  VatType,
2097
2088
  WebhookIdentityType,
2098
2089
  WeightUnit,
2099
- addDiscount4 as addDiscount,
2090
+ addCoupon4 as addCoupon,
2100
2091
  addGiftCard4 as addGiftCard,
2101
2092
  addLineItems4 as addLineItems,
2102
2093
  calculateCart4 as calculateCart,
@@ -2108,7 +2099,7 @@ export {
2108
2099
  markCartAsCompleted4 as markCartAsCompleted,
2109
2100
  placeOrder4 as placeOrder,
2110
2101
  refreshCart4 as refreshCart,
2111
- removeDiscount4 as removeDiscount,
2102
+ removeCoupon4 as removeCoupon,
2112
2103
  removeGiftCard4 as removeGiftCard,
2113
2104
  removeLineItems4 as removeLineItems,
2114
2105
  updateCart4 as updateCart,