@wix/auto_sdk_ecom_draft-orders 1.0.20 → 1.0.22

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 (73) hide show
  1. package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.d.ts +3 -2
  2. package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.js +3 -1
  3. package/build/cjs/src/ecom-v1-draft-order-draft-orders.context.js.map +1 -1
  4. package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.d.ts +40 -25
  5. package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.js +153 -26
  6. package/build/cjs/src/ecom-v1-draft-order-draft-orders.http.js.map +1 -1
  7. package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.d.ts +3 -0
  8. package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.js +20 -1
  9. package/build/cjs/src/ecom-v1-draft-order-draft-orders.meta.js.map +1 -1
  10. package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.d.ts +82 -52
  11. package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.js +16 -10
  12. package/build/cjs/src/ecom-v1-draft-order-draft-orders.public.js.map +1 -1
  13. package/build/cjs/src/ecom-v1-draft-order-draft-orders.types.d.ts +288 -102
  14. package/build/cjs/src/ecom-v1-draft-order-draft-orders.types.js +23 -9
  15. package/build/cjs/src/ecom-v1-draft-order-draft-orders.types.js.map +1 -1
  16. package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.d.ts +473 -213
  17. package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.js +581 -136
  18. package/build/cjs/src/ecom-v1-draft-order-draft-orders.universal.js.map +1 -1
  19. package/build/es/src/ecom-v1-draft-order-draft-orders.context.d.ts +3 -2
  20. package/build/es/src/ecom-v1-draft-order-draft-orders.context.js +2 -1
  21. package/build/es/src/ecom-v1-draft-order-draft-orders.context.js.map +1 -1
  22. package/build/es/src/ecom-v1-draft-order-draft-orders.http.d.ts +40 -25
  23. package/build/es/src/ecom-v1-draft-order-draft-orders.http.js +151 -25
  24. package/build/es/src/ecom-v1-draft-order-draft-orders.http.js.map +1 -1
  25. package/build/es/src/ecom-v1-draft-order-draft-orders.meta.d.ts +3 -0
  26. package/build/es/src/ecom-v1-draft-order-draft-orders.meta.js +18 -0
  27. package/build/es/src/ecom-v1-draft-order-draft-orders.meta.js.map +1 -1
  28. package/build/es/src/ecom-v1-draft-order-draft-orders.public.d.ts +82 -52
  29. package/build/es/src/ecom-v1-draft-order-draft-orders.public.js +14 -9
  30. package/build/es/src/ecom-v1-draft-order-draft-orders.public.js.map +1 -1
  31. package/build/es/src/ecom-v1-draft-order-draft-orders.types.d.ts +288 -102
  32. package/build/es/src/ecom-v1-draft-order-draft-orders.types.js +23 -9
  33. package/build/es/src/ecom-v1-draft-order-draft-orders.types.js.map +1 -1
  34. package/build/es/src/ecom-v1-draft-order-draft-orders.universal.d.ts +473 -213
  35. package/build/es/src/ecom-v1-draft-order-draft-orders.universal.js +578 -135
  36. package/build/es/src/ecom-v1-draft-order-draft-orders.universal.js.map +1 -1
  37. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.d.ts +3 -2
  38. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.js +3 -1
  39. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.context.js.map +1 -1
  40. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.d.ts +40 -25
  41. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.js +153 -26
  42. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.http.js.map +1 -1
  43. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.d.ts +3 -0
  44. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.js +20 -1
  45. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.meta.js.map +1 -1
  46. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.d.ts +82 -52
  47. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.js +16 -10
  48. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.public.js.map +1 -1
  49. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.types.d.ts +288 -102
  50. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.types.js +23 -9
  51. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.types.js.map +1 -1
  52. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.d.ts +369 -379
  53. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.js +581 -136
  54. package/build/internal/cjs/src/ecom-v1-draft-order-draft-orders.universal.js.map +1 -1
  55. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.d.ts +3 -2
  56. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.js +2 -1
  57. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.context.js.map +1 -1
  58. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.d.ts +40 -25
  59. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.js +151 -25
  60. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.http.js.map +1 -1
  61. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.d.ts +3 -0
  62. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.js +18 -0
  63. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.meta.js.map +1 -1
  64. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.d.ts +82 -52
  65. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.js +14 -9
  66. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.public.js.map +1 -1
  67. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.types.d.ts +288 -102
  68. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.types.js +23 -9
  69. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.types.js.map +1 -1
  70. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.d.ts +369 -379
  71. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.js +578 -135
  72. package/build/internal/es/src/ecom-v1-draft-order-draft-orders.universal.js.map +1 -1
  73. package/package.json +2 -2
@@ -27,14 +27,14 @@ export interface DraftOrder {
27
27
  /**
28
28
  * Buyer information.
29
29
  * @deprecated Buyer information.
30
- * @replacedBy buyer_info_details
30
+ * @replacedBy buyer_details
31
31
  * @targetRemovalDate 2024-08-30
32
32
  */
33
33
  buyerInfo?: BuyerInfo;
34
34
  /**
35
35
  * Billing address and contact details.
36
36
  * @deprecated Billing address and contact details.
37
- * @replacedBy billing_info_details
37
+ * @replacedBy billing_details
38
38
  * @targetRemovalDate 2024-08-30
39
39
  */
40
40
  billingInfo?: AddressWithContact;
@@ -111,7 +111,16 @@ export interface DraftOrder {
111
111
  * @format GUID
112
112
  */
113
113
  purchaseFlowId?: string | null;
114
+ /**
115
+ * Order recipient address and contact details.
116
+ *
117
+ * This field may differ from the address in `shippingInfo.logistics` when:
118
+ * + The chosen shipping option is pickup point or store pickup.
119
+ * + No shipping option is selected.
120
+ */
114
121
  recipientInfo?: RecipientInfoDetails;
122
+ /** Tax information. */
123
+ taxInfo?: OrderTaxInfo;
115
124
  /**
116
125
  * Custom field data for the draft order object.
117
126
  * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the [app dashboard](https://dev.wix.com/dc3/my-apps/) before they can be accessed with API calls.
@@ -120,13 +129,11 @@ export interface DraftOrder {
120
129
  /**
121
130
  * Buyer information.
122
131
  * Includes details about changes when relevant.
123
- * @internal
124
132
  */
125
133
  buyerDetails?: BuyerDetails;
126
134
  /**
127
135
  * Billing address and contact details.
128
136
  * Includes details about changes when relevant.
129
- * @internal
130
137
  */
131
138
  billingDetails?: BillingDetails;
132
139
  /**
@@ -1123,6 +1130,7 @@ export interface AdditionalFeeDetails {
1123
1130
  *
1124
1131
  * Supported values:
1125
1132
  * + `ORIGINAL_ORDER`: This additional fee is part of the original order.
1133
+ * + `AUTOMATIC`: User added a catalog item which is configured to have an additional fee.
1126
1134
  * + `CUSTOM`: This additional fee was created by the [Create Custom Additional Fees](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/draft-orders/create-custom-additional-fees) API.
1127
1135
  */
1128
1136
  source?: SourceType;
@@ -1186,11 +1194,11 @@ export interface TaxDetails {
1186
1194
  taxGroupId?: string | null;
1187
1195
  }
1188
1196
  export declare enum SourceType {
1189
- /** Part of the original order */
1197
+ /** Part of the original order. */
1190
1198
  ORIGINAL_ORDER = "ORIGINAL_ORDER",
1191
- /** Added by estimate * */
1199
+ /** Added automatically, as the result of recalculation caused by changes in draft order. */
1192
1200
  AUTOMATIC = "AUTOMATIC",
1193
- /** Added manually to current draft order */
1201
+ /** Added manually to draft order. */
1194
1202
  CUSTOM = "CUSTOM"
1195
1203
  }
1196
1204
  export interface DiscountDetails {
@@ -1371,9 +1379,9 @@ export interface CreatedByStringOneOf {
1371
1379
  appId?: string;
1372
1380
  }
1373
1381
  export declare enum EditingStatus {
1374
- /** DraftOrder is in draft state. */
1382
+ /** Draft order can be modified and committed. */
1375
1383
  DRAFT = "DRAFT",
1376
- /** DraftOrder is in committed state. */
1384
+ /** Draft order is already committed. No further modifications allowed. */
1377
1385
  COMMITTED = "COMMITTED"
1378
1386
  }
1379
1387
  export declare enum WeightUnit {
@@ -1411,6 +1419,18 @@ export interface BalanceSummary {
1411
1419
  * @readonly
1412
1420
  */
1413
1421
  balance?: Balance;
1422
+ /**
1423
+ * Sum of all approved and successful payments.
1424
+ *
1425
+ * The value includes payments that have subsequently been fully or partially refunded.
1426
+ * @readonly
1427
+ */
1428
+ paid?: Price;
1429
+ /**
1430
+ * Sum of all successfully refunded payments.
1431
+ * @readonly
1432
+ */
1433
+ refunded?: Price;
1414
1434
  /**
1415
1435
  * Sum of all authorized payments.
1416
1436
  * @readonly
@@ -1550,97 +1570,49 @@ export interface OrderTaxBreakdown {
1550
1570
  aggregatedTaxAmount?: Price;
1551
1571
  }
1552
1572
  export interface BuyerDetails extends BuyerDetailsChangeTypeOneOf {
1553
- /**
1554
- * Indicates that buyer information was added during draft.
1555
- * @internal
1556
- */
1573
+ /** Indicates that buyer information was added during draft. */
1557
1574
  added?: boolean;
1558
- /**
1559
- * Indicates that buyer information was changed. Contains billing information before draft.
1560
- * @internal
1561
- */
1575
+ /** Indicates that buyer information was changed. Contains billing information before draft. */
1562
1576
  changedDetails?: BuyerChangedDetails;
1563
- /**
1564
- * Indicates that buyer information was removed during draft.
1565
- * @internal
1566
- */
1577
+ /** Indicates that buyer information was removed during draft. */
1567
1578
  removed?: boolean;
1568
- /**
1569
- * Buyer information.
1570
- * @internal
1571
- */
1579
+ /** Buyer information. */
1572
1580
  buyerInfo?: BuyerInfo;
1573
1581
  }
1574
1582
  /** @oneof */
1575
1583
  export interface BuyerDetailsChangeTypeOneOf {
1576
- /**
1577
- * Indicates that buyer information was added during draft.
1578
- * @internal
1579
- */
1584
+ /** Indicates that buyer information was added during draft. */
1580
1585
  added?: boolean;
1581
- /**
1582
- * Indicates that buyer information was changed. Contains billing information before draft.
1583
- * @internal
1584
- */
1586
+ /** Indicates that buyer information was changed. Contains billing information before draft. */
1585
1587
  changedDetails?: BuyerChangedDetails;
1586
- /**
1587
- * Indicates that buyer information was removed during draft.
1588
- * @internal
1589
- */
1588
+ /** Indicates that buyer information was removed during draft. */
1590
1589
  removed?: boolean;
1591
1590
  }
1592
1591
  export interface BuyerChangedDetails {
1593
- /**
1594
- * Buyer information before draft.
1595
- * @internal
1596
- */
1592
+ /** Buyer information before draft. */
1597
1593
  buyerInfoBeforeChange?: BuyerInfo;
1598
1594
  }
1599
1595
  export interface BillingDetails extends BillingDetailsChangeTypeOneOf {
1600
- /**
1601
- * Indicates that billing information was added during draft.
1602
- * @internal
1603
- */
1596
+ /** Indicates that billing information was added during draft. */
1604
1597
  added?: boolean;
1605
- /**
1606
- * Indicates that billing information was changed. Contains billing information before draft.
1607
- * @internal
1608
- */
1598
+ /** Indicates that billing information was changed. Contains billing information before draft. */
1609
1599
  changedDetails?: BillingChangedDetails;
1610
- /**
1611
- * Indicates that billing information was removed during draft.
1612
- * @internal
1613
- */
1600
+ /** Indicates that billing information was removed during draft. */
1614
1601
  removed?: boolean;
1615
- /**
1616
- * Billing address and contact details.
1617
- * @internal
1618
- */
1602
+ /** Billing address and contact details. */
1619
1603
  billingInfo?: AddressWithContact;
1620
1604
  }
1621
1605
  /** @oneof */
1622
1606
  export interface BillingDetailsChangeTypeOneOf {
1623
- /**
1624
- * Indicates that billing information was added during draft.
1625
- * @internal
1626
- */
1607
+ /** Indicates that billing information was added during draft. */
1627
1608
  added?: boolean;
1628
- /**
1629
- * Indicates that billing information was changed. Contains billing information before draft.
1630
- * @internal
1631
- */
1609
+ /** Indicates that billing information was changed. Contains billing information before draft. */
1632
1610
  changedDetails?: BillingChangedDetails;
1633
- /**
1634
- * Indicates that billing information was removed during draft.
1635
- * @internal
1636
- */
1611
+ /** Indicates that billing information was removed during draft. */
1637
1612
  removed?: boolean;
1638
1613
  }
1639
1614
  export interface BillingChangedDetails {
1640
- /**
1641
- * Billing address and contact details before draft.
1642
- * @internal
1643
- */
1615
+ /** Billing address and contact details before draft. */
1644
1616
  billingInfoBeforeChange?: AddressWithContact;
1645
1617
  }
1646
1618
  export interface BusinessLocationDetails extends BusinessLocationDetailsChangeTypeOneOf {
@@ -1683,27 +1655,24 @@ export interface BusinessLocationChangedDetails {
1683
1655
  }
1684
1656
  export interface CreateDraftOrderRequest {
1685
1657
  /**
1686
- * To create a draft from existing order, provide its id. Otherwise, an empty draft will be created.
1658
+ * Existing order ID to create draft from.
1687
1659
  * @format GUID
1688
1660
  */
1689
1661
  orderId: string | null;
1690
1662
  }
1691
1663
  export interface CreateDraftOrderResponse {
1692
- /** The draft order details calculated with latest content */
1664
+ /** Draft order details calculated with latest content. */
1693
1665
  calculatedDraftOrder?: CalculatedDraftOrder;
1694
1666
  /**
1695
- * Whether the draft order already exists.
1696
- * @internal
1667
+ * Flag indicating whether response contains draft order that existed before request.
1668
+ * `False` - new draft order was created.
1697
1669
  */
1698
1670
  preexistingDraftOrder?: boolean | null;
1699
1671
  }
1700
1672
  export interface CalculatedDraftOrder {
1701
- /**
1702
- * The draft order full details with calculations based on it's content.
1703
- * Discount and additional fee options are also included.
1704
- */
1673
+ /** Draft order full details with calculations based on it's content. */
1705
1674
  draftOrder?: DraftOrder;
1706
- /** Shipping options for the order. */
1675
+ /** Order shipping options. */
1707
1676
  shippingOptions?: ShippingOption[];
1708
1677
  /** Errors that occurred during calculation. */
1709
1678
  calculationErrors?: CalculationErrors;
@@ -1736,18 +1705,14 @@ export interface DeliveryLogistics {
1736
1705
  export interface PickupDetails {
1737
1706
  /** Pickup address */
1738
1707
  address?: Address;
1739
- /**
1740
- * Pickup method.
1741
- *
1742
- * Supported values:
1743
- * + `"STORE_PICKUP"`
1744
- * + `"PICKUP_POINT"`
1745
- */
1708
+ /** Pickup method. */
1746
1709
  pickupMethod?: PickupMethod;
1747
1710
  }
1748
1711
  export declare enum PickupMethod {
1749
1712
  UNKNOWN_METHOD = "UNKNOWN_METHOD",
1713
+ /** Pickup is from the merchant's brick and mortar store. */
1750
1714
  STORE_PICKUP = "STORE_PICKUP",
1715
+ /** Item is shipped to a specified pickup point. */
1751
1716
  PICKUP_POINT = "PICKUP_POINT"
1752
1717
  }
1753
1718
  export interface DeliveryTimeSlot {
@@ -1889,12 +1854,12 @@ export interface CarrierError {
1889
1854
  export interface CreateEmptyDraftOrderRequest {
1890
1855
  }
1891
1856
  export interface CreateEmptyDraftOrderResponse {
1892
- /** The draft order details calculated with latest content */
1857
+ /** Draft order details calculated with latest content. */
1893
1858
  calculatedDraftOrder?: CalculatedDraftOrder;
1894
1859
  }
1895
1860
  export interface AddLineItemsToDraftOrderRequest {
1896
1861
  /**
1897
- * The draft order id
1862
+ * Draft order ID.
1898
1863
  * @format GUID
1899
1864
  */
1900
1865
  draftOrderId: string;
@@ -1910,7 +1875,10 @@ export interface AddLineItemsToDraftOrderRequest {
1910
1875
  customLineItems?: CustomLineItem[];
1911
1876
  }
1912
1877
  export interface CatalogReferenceLineItem {
1913
- /** Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin. */
1878
+ /**
1879
+ * Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info.
1880
+ * Optional for custom line items, which don't trigger the Catalog service plugin.
1881
+ */
1914
1882
  catalogReference?: CatalogReference;
1915
1883
  /**
1916
1884
  * Item quantity.
@@ -1920,6 +1888,12 @@ export interface CatalogReferenceLineItem {
1920
1888
  quantity?: number;
1921
1889
  /** Item price override. */
1922
1890
  price?: Price;
1891
+ /**
1892
+ * Whether the price is not yet defined, and will be updated after the order is created.
1893
+ *
1894
+ * Default: `false`
1895
+ */
1896
+ priceUndetermined?: boolean;
1923
1897
  /**
1924
1898
  * Line item locations.
1925
1899
  *
@@ -1943,7 +1917,10 @@ export interface CustomLineItem {
1943
1917
  * @max 100000
1944
1918
  */
1945
1919
  quantity?: number;
1946
- /** Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin. */
1920
+ /**
1921
+ * Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info.
1922
+ * Optional for custom line items, which don't trigger the Catalog service plugin.
1923
+ */
1947
1924
  catalogReference?: CatalogReference;
1948
1925
  /**
1949
1926
  * Item name.
@@ -2010,35 +1987,35 @@ export declare enum FileType {
2010
1987
  SECURE_ARCHIVE = "SECURE_ARCHIVE"
2011
1988
  }
2012
1989
  export interface AddLineItemsToDraftOrderResponse {
2013
- /** The draft order details calculated with latest content */
1990
+ /** Draft order details calculated with latest content. */
2014
1991
  calculatedDraftOrder?: CalculatedDraftOrder;
2015
1992
  }
2016
1993
  export interface UpdateLineItemsRequest {
2017
1994
  /**
2018
- * The draft order id
1995
+ * Draft order ID.
2019
1996
  * @format GUID
2020
1997
  */
2021
1998
  draftOrderId: string;
2022
1999
  /**
2023
- * Details of changes to apply per line item
2000
+ * Details of changes to apply per line item.
2024
2001
  * @minSize 1
2025
2002
  * @maxSize 300
2026
2003
  */
2027
- lineItemChanges?: LineItemChangeDetails[];
2004
+ lineItemChanges: LineItemChangeDetails[];
2028
2005
  }
2029
2006
  export interface LineItemChangeDetails {
2030
2007
  /**
2031
- * The line item id to change
2008
+ * Line item ID.
2032
2009
  * @format GUID
2033
2010
  */
2034
2011
  lineItemId?: string;
2035
2012
  /**
2036
- * The new quantity for the line item. quantity zero means to remove the line item.
2013
+ * The new quantity for the line item. Quantity zero removes the line item.
2037
2014
  * @max 1000000
2038
2015
  */
2039
2016
  newQuantity?: number | null;
2040
2017
  /**
2041
- * The new price for 1 unit of the line item
2018
+ * The new price for 1 unit of the line item.
2042
2019
  * @decimalValue options { gte:0, lte:1000000000000000 }
2043
2020
  */
2044
2021
  newPrice?: string | null;
@@ -2046,63 +2023,59 @@ export interface LineItemChangeDetails {
2046
2023
  newPriceDescription?: PriceDescription;
2047
2024
  }
2048
2025
  export interface UpdateLineItemsResponse {
2049
- /** The draft order details calculated with latest content */
2026
+ /** Draft order details calculated with latest content. */
2050
2027
  calculatedDraftOrder?: CalculatedDraftOrder;
2051
2028
  }
2052
2029
  export interface SetDiscountsRequest {
2053
2030
  /**
2054
- * The draft order id
2031
+ * Draft order ID.
2055
2032
  * @format GUID
2056
2033
  */
2057
2034
  draftOrderId: string;
2058
2035
  /**
2059
- * The discount ids to opt-in. all existing discounts not listed are to be opted-out.
2036
+ * Discount IDs to apply/unapply.
2037
+ * Existing discounts, not mentioned in request, will keep their current state.
2060
2038
  * @minSize 1
2039
+ * @maxSize 320
2061
2040
  */
2062
2041
  discounts: IdAndApplied[];
2063
2042
  }
2064
2043
  export interface IdAndApplied {
2065
- /** Discount ID. */
2044
+ /**
2045
+ * Entity ID. Depending on context, it's either discount or additional fee ID.
2046
+ * @format GUID
2047
+ */
2066
2048
  _id?: string;
2067
- /** Whether to apply the discount to the draft order. */
2049
+ /** Flag indicating whether entity (discount/additional fee) should be applied to a draft order. */
2068
2050
  applied?: boolean;
2069
2051
  }
2070
2052
  export interface SetDiscountsResponse {
2071
- /** The draft order details calculated with latest content */
2053
+ /** Draft order details calculated with latest content. */
2072
2054
  calculatedDraftOrder?: CalculatedDraftOrder;
2073
2055
  }
2074
2056
  export interface CreateCustomDiscountsRequest {
2075
2057
  /**
2076
- * The draft order id
2058
+ * Draft order ID.
2077
2059
  * @format GUID
2078
2060
  */
2079
2061
  draftOrderId: string;
2080
2062
  /**
2081
- * The discounts to add.
2063
+ * Discounts to create. Created discounts are unapplied by default.
2082
2064
  * @minSize 1
2083
2065
  * @maxSize 100
2084
2066
  */
2085
2067
  discounts?: DiscountOption[];
2086
2068
  }
2087
2069
  export interface DiscountOption extends DiscountOptionDiscountAmountOneOf {
2088
- /**
2089
- * Discount price amount.
2090
- * @internal
2091
- */
2070
+ /** Discount price amount. */
2092
2071
  priceAmount?: Price;
2093
2072
  /**
2094
2073
  * Discount percentage amount.
2095
- * @internal
2096
2074
  * @format DECIMAL_VALUE
2097
2075
  * @decimalValue options { gte:0, lte:100, maxScale:2 }
2098
2076
  */
2099
2077
  percentage?: string | null;
2100
- /**
2101
- * Discount type.
2102
- * * `"GLOBAL"` - discount applies to entire order.
2103
- * * `"SPECIFIC-ITEMS"` - discount applies to a specific item.
2104
- * * `"SHIPPING"` - discount applies to shipping. For example, free shipping.
2105
- */
2078
+ /** Discount type. */
2106
2079
  discountType?: DiscountType;
2107
2080
  /**
2108
2081
  * ID of line item discount applies to.
@@ -2126,20 +2099,21 @@ export interface DiscountOption extends DiscountOptionDiscountAmountOneOf {
2126
2099
  description?: string | null;
2127
2100
  /**
2128
2101
  * Should opt-in the added discount. default = false.
2129
- * if not set or false, then to opt-in them, please call SetDiscounts with the added discounts ids
2102
+ * if not set or false, then to opt-in them, please call SetDiscounts with the added discounts IDs.
2130
2103
  */
2131
2104
  applyToDraftOrder?: boolean | null;
2105
+ /**
2106
+ * Line items the discount applies to.
2107
+ * @maxSize 1
2108
+ */
2109
+ lineItemDiscounts?: LineItemDiscount[];
2132
2110
  }
2133
2111
  /** @oneof */
2134
2112
  export interface DiscountOptionDiscountAmountOneOf {
2135
- /**
2136
- * Discount price amount.
2137
- * @internal
2138
- */
2113
+ /** Discount price amount. */
2139
2114
  priceAmount?: Price;
2140
2115
  /**
2141
2116
  * Discount percentage amount.
2142
- * @internal
2143
2117
  * @format DECIMAL_VALUE
2144
2118
  * @decimalValue options { gte:0, lte:100, maxScale:2 }
2145
2119
  */
@@ -2147,22 +2121,25 @@ export interface DiscountOptionDiscountAmountOneOf {
2147
2121
  }
2148
2122
  export declare enum DiscountType {
2149
2123
  UNKNOWN_TYPE = "UNKNOWN_TYPE",
2124
+ /** Discount applies to entire order. */
2150
2125
  GLOBAL = "GLOBAL",
2126
+ /** Discount applies to specific items. */
2151
2127
  SPECIFIC_ITEMS = "SPECIFIC_ITEMS",
2128
+ /** Discount applies to shipping. For example, free shipping. */
2152
2129
  SHIPPING = "SHIPPING"
2153
2130
  }
2154
2131
  export interface CreateCustomDiscountsResponse {
2155
- /** The draft order details with the added discounts */
2132
+ /** Draft order details calculated with latest content. */
2156
2133
  calculatedDraftOrder?: CalculatedDraftOrder;
2157
2134
  }
2158
2135
  export interface DeleteCustomDiscountsRequest {
2159
2136
  /**
2160
- * The draft order id
2137
+ * Draft order ID.
2161
2138
  * @format GUID
2162
2139
  */
2163
2140
  draftOrderId: string;
2164
2141
  /**
2165
- * The discounts to remove
2142
+ * Ids of discounts to remove.
2166
2143
  * @format GUID
2167
2144
  * @minSize 1
2168
2145
  * @maxSize 100
@@ -2170,34 +2147,35 @@ export interface DeleteCustomDiscountsRequest {
2170
2147
  discountIds: string[];
2171
2148
  }
2172
2149
  export interface DeleteCustomDiscountsResponse {
2173
- /** The draft order details calculated with latest content */
2150
+ /** Draft order details calculated with latest content. */
2174
2151
  calculatedDraftOrder?: CalculatedDraftOrder;
2175
2152
  }
2176
2153
  export interface SetAdditionalFeesRequest {
2177
2154
  /**
2178
- * The draft order id
2155
+ * Draft order ID.
2179
2156
  * @format GUID
2180
2157
  */
2181
2158
  draftOrderId: string;
2182
2159
  /**
2183
- * The additional fees ids to opt-in. all existing additional fees not listed are to be opted-out
2160
+ * Additional fee IDs to apply/unapply.
2161
+ * Existing additional fees, not mentioned in this list, will keep their current state.
2184
2162
  * @minSize 1
2185
2163
  * @maxSize 100
2186
2164
  */
2187
2165
  additionalFees: IdAndApplied[];
2188
2166
  }
2189
2167
  export interface SetAdditionalFeesResponse {
2190
- /** The draft order details calculated with modified additional fees */
2168
+ /** Draft order details calculated with latest content. */
2191
2169
  calculatedDraftOrder?: CalculatedDraftOrder;
2192
2170
  }
2193
2171
  export interface CreateCustomAdditionalFeesRequest {
2194
2172
  /**
2195
- * The draft order id
2173
+ * Draft order ID.
2196
2174
  * @format GUID
2197
2175
  */
2198
2176
  draftOrderId: string;
2199
2177
  /**
2200
- * The additional fees to add. added with opted-out setting
2178
+ * The additional fees to create. Created fees are unapplied by default.
2201
2179
  * @minSize 1
2202
2180
  * @maxSize 100
2203
2181
  */
@@ -2216,7 +2194,7 @@ export interface AdditionalFeeOption {
2216
2194
  taxDetails?: TaxDetails;
2217
2195
  /**
2218
2196
  * Should apply the additional fee. default = false.
2219
- * if not set or false, then to apply them, please call ApplyAdditionalFees with the added additional fee ids
2197
+ * if not set or false, then to apply them, please call ApplyAdditionalFees with the added additional fee IDs.
2220
2198
  */
2221
2199
  applyToDraftOrder?: boolean | null;
2222
2200
  /**
@@ -2225,19 +2203,26 @@ export interface AdditionalFeeOption {
2225
2203
  * @maxLength 100
2226
2204
  */
2227
2205
  code?: string | null;
2206
+ /**
2207
+ * Optional - Line items associated with this additional fee.
2208
+ * If no `lineItemIds` are provided, the fee will be associated with the whole order.
2209
+ * @format GUID
2210
+ * @maxSize 300
2211
+ */
2212
+ lineItemIds?: string[];
2228
2213
  }
2229
2214
  export interface CreateCustomAdditionalFeesResponse {
2230
- /** The draft order details with added custom additional fees */
2215
+ /** Draft order details calculated with latest content. */
2231
2216
  calculatedDraftOrder?: CalculatedDraftOrder;
2232
2217
  }
2233
2218
  export interface DeleteCustomAdditionalFeesRequest {
2234
2219
  /**
2235
- * The draft order id
2220
+ * Draft order ID.
2236
2221
  * @format GUID
2237
2222
  */
2238
2223
  draftOrderId: string;
2239
2224
  /**
2240
- * The additional fees to remove
2225
+ * Ids of additional fees to remove.
2241
2226
  * @format GUID
2242
2227
  * @minSize 1
2243
2228
  * @maxSize 100
@@ -2245,157 +2230,138 @@ export interface DeleteCustomAdditionalFeesRequest {
2245
2230
  customAdditionalFees: string[];
2246
2231
  }
2247
2232
  export interface DeleteCustomAdditionalFeesResponse {
2248
- /** The draft order details calculated with latest content */
2233
+ /** Draft order details calculated with latest content. */
2249
2234
  calculatedDraftOrder?: CalculatedDraftOrder;
2250
2235
  }
2251
2236
  export interface SetShippingInfoRequest {
2252
2237
  /**
2253
- * The draft order id
2254
- * @internal
2238
+ * Draft order ID.
2255
2239
  * @format GUID
2256
2240
  */
2257
2241
  draftOrderId: string;
2258
- /**
2259
- * The shipping info to be set. If passed empty value - value will be reset
2260
- * @internal
2261
- */
2242
+ /** Shipping information. Empty value removes shipping information from draft. */
2262
2243
  shippingInfo?: V1ShippingInformation;
2263
2244
  }
2264
2245
  export interface SetShippingInfoResponse {
2265
- /**
2266
- * The draft order details calculated with updated shipping info
2267
- * @internal
2268
- */
2246
+ /** Draft order details calculated with latest content. */
2269
2247
  calculatedDraftOrder?: CalculatedDraftOrder;
2270
2248
  }
2271
2249
  export interface SetBuyerInfoRequest {
2272
2250
  /**
2273
- * The draft order id
2274
- * @internal
2251
+ * Draft order ID.
2275
2252
  * @format GUID
2276
2253
  */
2277
2254
  draftOrderId: string;
2278
- /**
2279
- * Buyer information. If passed empty value - value will be reset
2280
- * @internal
2281
- */
2255
+ /** Buyer information. Empty value removes buyer information from draft. */
2282
2256
  buyerInfo?: BuyerInfo;
2283
2257
  }
2284
2258
  export interface SetBuyerInfoResponse {
2285
- /**
2286
- * The draft order details calculated with updated buyer info
2287
- * @internal
2288
- */
2259
+ /** Draft order details calculated with latest content. */
2289
2260
  calculatedDraftOrder?: CalculatedDraftOrder;
2290
2261
  }
2291
2262
  export interface SetRecipientInfoRequest {
2292
2263
  /**
2293
- * The draft order id
2294
- * @internal
2264
+ * Draft order ID.
2295
2265
  * @format GUID
2296
2266
  */
2297
2267
  draftOrderId: string;
2298
- /**
2299
- * Order recipient address and contact details. If passed empty value - value will be reset
2300
- * @internal
2301
- */
2268
+ /** Order recipient address and contact details. Empty value removes recipient information from draft. */
2302
2269
  recipientInfo?: AddressWithContact;
2303
2270
  }
2304
2271
  export interface SetRecipientInfoResponse {
2305
- /**
2306
- * The draft order details calculated with updated recipient info
2307
- * @internal
2308
- */
2272
+ /** Draft order details calculated with latest content. */
2309
2273
  calculatedDraftOrder?: CalculatedDraftOrder;
2310
2274
  }
2311
2275
  export interface SetBillingInfoRequest {
2312
2276
  /**
2313
- * The draft order id
2314
- * @internal
2277
+ * Draft order ID.
2315
2278
  * @format GUID
2316
2279
  */
2317
2280
  draftOrderId: string;
2318
- /**
2319
- * Billing address and contact details. If passed empty value - value will be reset
2320
- * @internal
2321
- */
2281
+ /** Billing address and contact details. Empty value removes billing information from draft. */
2322
2282
  billingInfo?: AddressWithContact;
2323
2283
  }
2324
2284
  export interface SetBillingInfoResponse {
2325
- /**
2326
- * The draft order details calculated with updated billing info
2327
- * @internal
2328
- */
2285
+ /** Draft order details calculated with latest content. */
2329
2286
  calculatedDraftOrder?: CalculatedDraftOrder;
2330
2287
  }
2288
+ /** Deprecated */
2331
2289
  export interface UpdateShippingInfoRequest {
2332
2290
  /**
2333
- * The draft order id
2291
+ * Draft order ID.
2334
2292
  * @format GUID
2335
2293
  */
2336
2294
  draftOrderId?: string;
2337
- /** update the shipping option on the order. if not set then the selected shipping is removed */
2295
+ /** Update the shipping option on the order. If not set then the selected shipping is removed. */
2338
2296
  shippingOption?: ShippingOption;
2339
2297
  }
2298
+ /** Deprecated */
2340
2299
  export interface UpdateShippingInfoResponse {
2341
- /** The draft order details calculated with de/selected shipping info */
2300
+ /** Draft order details calculated with latest content. */
2342
2301
  calculatedDraftOrder?: CalculatedDraftOrder;
2343
2302
  }
2344
2303
  export interface GetDraftOrderRequest {
2345
2304
  /**
2346
- * The draft order id
2305
+ * Draft order ID.
2347
2306
  * @format GUID
2348
2307
  */
2349
2308
  draftOrderId: string;
2350
2309
  }
2351
2310
  export interface GetDraftOrderResponse {
2352
- /** The draft order details calculated with latest content */
2311
+ /** Draft order details calculated with latest content. */
2353
2312
  calculatedDraftOrder?: CalculatedDraftOrder;
2354
2313
  }
2355
2314
  export interface GetOrderDraftabilityStatusRequest {
2356
2315
  /**
2357
- * Order ID.
2358
- * @minLength 1
2359
- * @maxLength 100
2316
+ * Order Id.
2317
+ * @format GUID
2360
2318
  */
2361
2319
  orderId: string;
2362
2320
  }
2363
2321
  export interface GetOrderDraftabilityStatusResponse {
2364
2322
  /**
2365
- * Order ID.
2366
- * @minLength 1
2367
- * @maxLength 100
2323
+ * Order Id.
2324
+ * @format GUID
2368
2325
  */
2369
2326
  orderId?: string;
2370
- /** Whether a draft can be created from this order */
2327
+ /** Flag, indicating whether a draft can be created from this order. */
2371
2328
  orderDraftable?: boolean;
2372
2329
  /**
2373
- * Reasons why the order is not draftable
2330
+ * Reasons why the order is not draftable.
2374
2331
  * @maxSize 5
2375
2332
  */
2376
2333
  nonDraftableReasons?: NonDraftableReason[];
2377
2334
  }
2378
2335
  export declare enum NonDraftableReason {
2379
2336
  UNSPECIFIED = "UNSPECIFIED",
2337
+ /** Modifications of refunded orders are not supported. */
2380
2338
  PARTIALLY_OR_FULLY_REFUNDED = "PARTIALLY_OR_FULLY_REFUNDED",
2339
+ /**
2340
+ * Original order must be created via one of the following channel types:
2341
+ * + WEB
2342
+ * + POS
2343
+ * + BACKOFFICE_MERCHANT
2344
+ * + WIX_APP_STORE
2345
+ */
2381
2346
  UNSUPPORTED_CHANNEL_TYPE = "UNSUPPORTED_CHANNEL_TYPE",
2347
+ /** Order status is not APPROVED. */
2382
2348
  ORDER_STATUS_IS_NOT_SUPPORTED = "ORDER_STATUS_IS_NOT_SUPPORTED",
2349
+ /** Site and order currencies are different. */
2383
2350
  ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT = "ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT",
2351
+ /** Site and order weight units are different. */
2384
2352
  ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT = "ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT",
2385
- AMOUNTS_DO_NOT_ADD_UP = "AMOUNTS_DO_NOT_ADD_UP",
2386
- /** remove - this is not a reason, it's an error */
2353
+ /** Order not found. */
2387
2354
  ORDER_NOT_FOUND = "ORDER_NOT_FOUND",
2388
- SUBSCRIPTION_LINE_ITEM_EXISTS = "SUBSCRIPTION_LINE_ITEM_EXISTS",
2389
- UNSUPPORTED_CATALOG_ITEM = "UNSUPPORTED_CATALOG_ITEM",
2390
- TAXABLE_EXISTING_ADDITIONAL_FEE = "TAXABLE_EXISTING_ADDITIONAL_FEE"
2355
+ /** Modifications of orders with subscription items are not supported. */
2356
+ SUBSCRIPTION_LINE_ITEM_EXISTS = "SUBSCRIPTION_LINE_ITEM_EXISTS"
2391
2357
  }
2392
2358
  export interface CommitDraftOrderRequest {
2393
2359
  /**
2394
- * The draft order id
2360
+ * Draft order ID.
2395
2361
  * @format GUID
2396
2362
  */
2397
2363
  draftOrderId: string;
2398
- /** Optional side effects to trigger */
2364
+ /** Optional side effects to trigger. */
2399
2365
  commitSettings?: DraftOrderCommitSettings;
2400
2366
  /**
2401
2367
  * Reason for edit, given by user (optional).
@@ -2404,9 +2370,9 @@ export interface CommitDraftOrderRequest {
2404
2370
  reason?: string | null;
2405
2371
  }
2406
2372
  export interface CommitDraftOrderResponse {
2407
- /** The draft order after commit. */
2373
+ /** Draft order after commit. */
2408
2374
  committedDraftOrder?: DraftOrder;
2409
- /** The updated order after commit. */
2375
+ /** Updated order after commit. */
2410
2376
  orderAfterCommit?: Order;
2411
2377
  }
2412
2378
  export interface Order {
@@ -3582,33 +3548,22 @@ export interface TagList {
3582
3548
  }
3583
3549
  export interface CreateOrderFromDraftRequest {
3584
3550
  /**
3585
- * The draft order id
3586
- * @internal
3551
+ * Draft order ID.
3587
3552
  * @format GUID
3588
3553
  */
3589
3554
  draftOrderId: string;
3590
- /**
3591
- * Optional side effects to trigger
3592
- * @internal
3593
- */
3555
+ /** Optional side effects to trigger. */
3594
3556
  createSettings?: OrderCreateSettings;
3595
3557
  /**
3596
3558
  * Reason for order creation, given by user (optional).
3597
- * @internal
3598
3559
  * @maxLength 200
3599
3560
  */
3600
3561
  reason?: string | null;
3601
- /**
3602
- * Information about the sales channel that submitted this order
3603
- * @internal
3604
- */
3562
+ /** Information about the sales channel that submitted this order. */
3605
3563
  channelInfo?: ChannelInfo;
3606
3564
  }
3607
3565
  export interface OrderCreateSettings {
3608
- /**
3609
- * Notification settings to be applied on order creation
3610
- * @internal
3611
- */
3566
+ /** Notification settings to be applied on order creation */
3612
3567
  notifications?: OrderCreateNotifications;
3613
3568
  }
3614
3569
  export interface OrderCreateNotifications {
@@ -3616,32 +3571,24 @@ export interface OrderCreateNotifications {
3616
3571
  * Whether to send notification to the buyer.
3617
3572
  *
3618
3573
  * Default: `true`
3619
- * @internal
3620
3574
  */
3621
3575
  sendNotificationToBuyer?: boolean | null;
3622
3576
  /**
3623
3577
  * Whether to send notifications to the business.
3624
3578
  *
3625
3579
  * Default: `true`
3626
- * @internal
3627
3580
  */
3628
3581
  sendNotificationsToBusiness?: boolean | null;
3629
3582
  }
3630
3583
  export interface CreateOrderFromDraftResponse {
3631
- /**
3632
- * The draft order after commit.
3633
- * @internal
3634
- */
3584
+ /** The draft order after commit. */
3635
3585
  committedDraftOrder?: DraftOrder;
3636
- /**
3637
- * Created order
3638
- * @internal
3639
- */
3586
+ /** Created order. */
3640
3587
  createdOrder?: Order;
3641
3588
  }
3642
3589
  export interface DeleteDraftOrderRequest {
3643
3590
  /**
3644
- * The draft order id
3591
+ * Draft order ID.
3645
3592
  * @format GUID
3646
3593
  */
3647
3594
  draftOrderId: string;
@@ -3649,7 +3596,7 @@ export interface DeleteDraftOrderRequest {
3649
3596
  export interface DeleteDraftOrderResponse {
3650
3597
  }
3651
3598
  export interface QueryDraftOrdersRequest {
3652
- /** WQL expression */
3599
+ /** Query options. */
3653
3600
  query?: CursorQuery;
3654
3601
  }
3655
3602
  export interface CursorQuery extends CursorQueryPagingMethodOneOf {
@@ -3711,7 +3658,7 @@ export interface CursorPaging {
3711
3658
  cursor?: string | null;
3712
3659
  }
3713
3660
  export interface QueryDraftOrdersResponse {
3714
- /** list of edits per order */
3661
+ /** Draft orders, found by query. */
3715
3662
  draftOrders?: DraftOrder[];
3716
3663
  /** Paging metadata. */
3717
3664
  pagingMetadata?: CursorPagingMetadata;
@@ -3743,75 +3690,44 @@ export interface Cursors {
3743
3690
  }
3744
3691
  export interface UpdateExtendedFieldsRequest {
3745
3692
  /** ID of the entity to update. */
3746
- _id?: string;
3693
+ _id: string;
3747
3694
  /** Identifier for the app whose extended fields are being updated. */
3748
- namespace?: string;
3695
+ namespace: string;
3749
3696
  /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
3750
- namespaceData?: Record<string, any> | null;
3697
+ namespaceData: Record<string, any> | null;
3751
3698
  }
3752
3699
  export interface UpdateExtendedFieldsResponse {
3753
- /** Updated DraftOrder */
3700
+ /** Updated draft order. */
3754
3701
  draftOrder?: DraftOrder;
3755
3702
  }
3756
3703
  export interface SetTaxExemptionRequest {
3757
3704
  /**
3758
3705
  * Draft order ID.
3759
- * @internal
3760
3706
  * @format GUID
3761
3707
  */
3762
3708
  draftOrderId: string;
3763
3709
  /**
3764
- * Whether the draft order is exempt from tax calculations.
3710
+ * Flag, indicating whether the draft order is exempt from tax calculations.
3765
3711
  *
3766
3712
  * Default: `false`
3767
- * @internal
3768
3713
  */
3769
3714
  taxExempt: boolean | null;
3770
3715
  }
3771
3716
  export interface SetTaxExemptionResponse {
3772
- /**
3773
- * The draft order details calculated with updated tax exemption.
3774
- * @internal
3775
- */
3717
+ /** Draft order details calculated with latest content. */
3776
3718
  calculatedDraftOrder?: CalculatedDraftOrder;
3777
3719
  }
3778
- export interface GetDraftEditabilityStatusRequest {
3779
- /**
3780
- * Draft order ID.
3781
- * @format GUID
3782
- */
3783
- draftOrderId?: string | null;
3784
- }
3785
- export interface GetDraftEditabilityStatusResponse {
3786
- /**
3787
- * Draft order ID.
3788
- * @format GUID
3789
- */
3790
- draftOrderId?: string | null;
3791
- /**
3792
- * Draft order status.
3793
- * @readonly
3794
- */
3795
- status?: EditingStatus;
3796
- }
3797
3720
  export interface SetBusinessLocationRequest {
3798
3721
  /**
3799
3722
  * Draft order ID.
3800
- * @internal
3801
3723
  * @format GUID
3802
3724
  */
3803
3725
  draftOrderId: string;
3804
- /**
3805
- * Business location.
3806
- * @internal
3807
- */
3726
+ /** Business location. */
3808
3727
  businessLocation?: Location;
3809
3728
  }
3810
3729
  export interface SetBusinessLocationResponse {
3811
- /**
3812
- * The draft order details calculated with updated business location.
3813
- * @internal
3814
- */
3730
+ /** Draft order details calculated with latest content. */
3815
3731
  calculatedDraftOrder?: CalculatedDraftOrder;
3816
3732
  }
3817
3733
  export interface DomainEvent extends DomainEventBodyOneOf {
@@ -3954,13 +3870,13 @@ export declare enum WebhookIdentityType {
3954
3870
  WIX_USER = "WIX_USER",
3955
3871
  APP = "APP"
3956
3872
  }
3957
- type DraftOrderNonNullablePaths = `lineItems` | `lineItems.${number}.added` | `lineItems.${number}.changedDetails.priceBeforeChange.amount` | `lineItems.${number}.changedDetails.priceBeforeChange.formattedAmount` | `lineItems.${number}.changedDetails.priceDescriptionBeforeChange.original` | `lineItems.${number}.removed` | `lineItems.${number}.lineItem._id` | `lineItems.${number}.lineItem.productName.original` | `lineItems.${number}.lineItem.catalogReference.catalogItemId` | `lineItems.${number}.lineItem.catalogReference.appId` | `lineItems.${number}.lineItem.quantity` | `lineItems.${number}.lineItem.descriptionLines` | `lineItems.${number}.lineItem.descriptionLines.${number}.plainText.original` | `lineItems.${number}.lineItem.descriptionLines.${number}.colorInfo.original` | `lineItems.${number}.lineItem.descriptionLines.${number}.name.original` | `lineItems.${number}.lineItem.physicalProperties.shippable` | `lineItems.${number}.lineItem.itemType.preset` | `lineItems.${number}.lineItem.itemType.custom` | `lineItems.${number}.lineItem.paymentOption` | `lineItems.${number}.lineItem.taxDetails.taxRate` | `lineItems.${number}.lineItem.taxInfo.taxIncludedInPrice` | `lineItems.${number}.lineItem.taxInfo.taxBreakdown` | `lineItems.${number}.lineItem.taxInfo.taxBreakdown.${number}.jurisdictionType` | `lineItems.${number}.lineItem.digitalFile.fileId` | `lineItems.${number}.lineItem.subscriptionInfo.cycleNumber` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionOptionTitle` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionSettings.frequency` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionSettings.autoRenewal` | `lineItems.${number}.lineItem.locations` | `lineItems.${number}.lineItem.locations.${number}._id` | `lineItems.${number}.lineItem.locations.${number}.quantity` | `shippingInfo.added` | `shippingInfo.changedDetails.shippingInfoBeforeChange.title` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address.streetAddress.number` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address.streetAddress.name` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.contactDetails.vatId._id` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.contactDetails.vatId.type` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.pickupMethod` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.price.amount` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.price.formattedAmount` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.taxDetails.taxRate` | `shippingInfo.removed` | `buyerInfo.visitorId` | `buyerInfo.memberId` | `billingInfo.address.streetAddress.number` | `billingInfo.address.streetAddress.name` | `billingInfo.contactDetails.vatId._id` | `billingInfo.contactDetails.vatId.type` | `additionalFees` | `additionalFees.${number}.additionalFee.name` | `additionalFees.${number}.additionalFee.price.amount` | `additionalFees.${number}.additionalFee.price.formattedAmount` | `additionalFees.${number}.additionalFee.taxDetails.taxRate` | `additionalFees.${number}.additionalFee._id` | `additionalFees.${number}.additionalFee.lineItemIds` | `additionalFees.${number}.taxDetails.taxable` | `additionalFees.${number}.source` | `additionalFees.${number}.applied` | `discounts` | `discounts.${number}.discount.coupon._id` | `discounts.${number}.discount.coupon.code` | `discounts.${number}.discount.coupon.name` | `discounts.${number}.discount.coupon.amount.amount` | `discounts.${number}.discount.coupon.amount.formattedAmount` | `discounts.${number}.discount.merchantDiscount.discountReason` | `discounts.${number}.discount.discountRule._id` | `discounts.${number}.discount.discountRule.name.original` | `discounts.${number}.discount.discountType` | `discounts.${number}.discount.lineItemIds` | `discounts.${number}.source` | `discounts.${number}.applied` | `createdBy.userId` | `createdBy.appId` | `status` | `weightUnit` | `priceSummary.subtotal.amount` | `priceSummary.subtotal.formattedAmount` | `taxSummary.totalTax.amount` | `taxSummary.totalTax.formattedAmount` | `balanceSummary.balance.amount` | `balanceSummary.balance.formattedAmount` | `balanceSummary.authorized.amount` | `balanceSummary.authorized.formattedAmount` | `commitSettings.updateInventory` | `commitSettings.updateInventory.${number}.lineItemId` | `recipientInfo.added` | `recipientInfo.changedDetails.recipientInfoBeforeChange.address.streetAddress.number` | `recipientInfo.changedDetails.recipientInfoBeforeChange.address.streetAddress.name` | `recipientInfo.changedDetails.recipientInfoBeforeChange.contactDetails.vatId._id` | `recipientInfo.changedDetails.recipientInfoBeforeChange.contactDetails.vatId.type` | `recipientInfo.removed` | `businessLocationDetails.added` | `businessLocationDetails.changedDetails.businessLocationBeforeChange._id` | `businessLocationDetails.changedDetails.businessLocationBeforeChange.name` | `businessLocationDetails.removed`;
3873
+ type DraftOrderNonNullablePaths = `lineItems` | `lineItems.${number}.added` | `lineItems.${number}.changedDetails.priceBeforeChange.amount` | `lineItems.${number}.changedDetails.priceBeforeChange.formattedAmount` | `lineItems.${number}.changedDetails.priceDescriptionBeforeChange.original` | `lineItems.${number}.removed` | `lineItems.${number}.lineItem._id` | `lineItems.${number}.lineItem.productName.original` | `lineItems.${number}.lineItem.catalogReference.catalogItemId` | `lineItems.${number}.lineItem.catalogReference.appId` | `lineItems.${number}.lineItem.quantity` | `lineItems.${number}.lineItem.physicalProperties.shippable` | `lineItems.${number}.lineItem.itemType.preset` | `lineItems.${number}.lineItem.itemType.custom` | `lineItems.${number}.lineItem.paymentOption` | `lineItems.${number}.lineItem.taxDetails.taxRate` | `lineItems.${number}.lineItem.taxInfo.taxIncludedInPrice` | `lineItems.${number}.lineItem.digitalFile.fileId` | `lineItems.${number}.lineItem.subscriptionInfo.cycleNumber` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionOptionTitle` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionSettings.frequency` | `lineItems.${number}.lineItem.subscriptionInfo.subscriptionSettings.autoRenewal` | `shippingInfo.added` | `shippingInfo.changedDetails.shippingInfoBeforeChange.title` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address.streetAddress.number` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.address.streetAddress.name` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.contactDetails.vatId._id` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.shippingDestination.contactDetails.vatId.type` | `shippingInfo.changedDetails.shippingInfoBeforeChange.logistics.pickupDetails.pickupMethod` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.price.amount` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.price.formattedAmount` | `shippingInfo.changedDetails.shippingInfoBeforeChange.cost.taxDetails.taxRate` | `shippingInfo.removed` | `buyerInfo.visitorId` | `buyerInfo.memberId` | `billingInfo.address.streetAddress.number` | `billingInfo.address.streetAddress.name` | `billingInfo.contactDetails.vatId._id` | `billingInfo.contactDetails.vatId.type` | `additionalFees` | `additionalFees.${number}.additionalFee.name` | `additionalFees.${number}.additionalFee.price.amount` | `additionalFees.${number}.additionalFee.price.formattedAmount` | `additionalFees.${number}.additionalFee.taxDetails.taxRate` | `additionalFees.${number}.additionalFee._id` | `additionalFees.${number}.taxDetails.taxable` | `additionalFees.${number}.source` | `additionalFees.${number}.applied` | `discounts` | `discounts.${number}.discount.coupon._id` | `discounts.${number}.discount.coupon.code` | `discounts.${number}.discount.coupon.name` | `discounts.${number}.discount.coupon.amount.amount` | `discounts.${number}.discount.coupon.amount.formattedAmount` | `discounts.${number}.discount.merchantDiscount.discountReason` | `discounts.${number}.discount.discountRule._id` | `discounts.${number}.discount.discountRule.name.original` | `discounts.${number}.discount.discountType` | `discounts.${number}.source` | `discounts.${number}.applied` | `createdBy.userId` | `createdBy.appId` | `status` | `weightUnit` | `priceSummary.subtotal.amount` | `priceSummary.subtotal.formattedAmount` | `taxSummary.totalTax.amount` | `taxSummary.totalTax.formattedAmount` | `balanceSummary.balance.amount` | `balanceSummary.balance.formattedAmount` | `balanceSummary.paid.amount` | `balanceSummary.paid.formattedAmount` | `commitSettings.updateInventory` | `commitSettings.updateInventory.${number}.lineItemId` | `recipientInfo.added` | `recipientInfo.changedDetails.recipientInfoBeforeChange.address.streetAddress.number` | `recipientInfo.changedDetails.recipientInfoBeforeChange.address.streetAddress.name` | `recipientInfo.changedDetails.recipientInfoBeforeChange.contactDetails.vatId._id` | `recipientInfo.changedDetails.recipientInfoBeforeChange.contactDetails.vatId.type` | `recipientInfo.removed` | `taxInfo.totalTax.amount` | `taxInfo.totalTax.formattedAmount` | `taxInfo.taxBreakdown` | `taxInfo.taxBreakdown.${number}.taxName` | `taxInfo.taxBreakdown.${number}.taxType` | `taxInfo.taxBreakdown.${number}.jurisdiction` | `taxInfo.taxBreakdown.${number}.jurisdictionType` | `taxInfo.taxBreakdown.${number}.rate` | `buyerDetails.added` | `buyerDetails.changedDetails.buyerInfoBeforeChange.visitorId` | `buyerDetails.changedDetails.buyerInfoBeforeChange.memberId` | `buyerDetails.removed` | `billingDetails.added` | `billingDetails.changedDetails.billingInfoBeforeChange.address.streetAddress.number` | `billingDetails.changedDetails.billingInfoBeforeChange.address.streetAddress.name` | `billingDetails.changedDetails.billingInfoBeforeChange.contactDetails.vatId._id` | `billingDetails.changedDetails.billingInfoBeforeChange.contactDetails.vatId.type` | `billingDetails.removed` | `businessLocationDetails.added` | `businessLocationDetails.changedDetails.businessLocationBeforeChange._id` | `businessLocationDetails.changedDetails.businessLocationBeforeChange.name` | `businessLocationDetails.removed`;
3958
3874
  /**
3959
3875
  * Creates or gets a draft order.
3960
3876
  *
3961
3877
  * When passing the ID of an order that is already in draft, the existing draft order will be returned.
3962
- * To complete a draft and update the order, call [Commit Draft Order](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/draft-orders/commit-draft-order).
3963
- * @param orderId - To create a draft from existing order, provide its id. Otherwise, an empty draft will be created.
3878
+ * To complete a draft and update the order, call Commit Draft Order([REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/draft-orders/commit-draft-order) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/draft-orders/commit-draft-order)).
3879
+ * @param orderId - Existing order ID to create draft from.
3964
3880
  * @public
3965
3881
  * @documentationMaturity preview
3966
3882
  * @requiredField orderId
@@ -3973,8 +3889,6 @@ type DraftOrderNonNullablePaths = `lineItems` | `lineItems.${number}.added` | `l
3973
3889
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
3974
3890
  * @permissionScope Manage eCommerce - all permissions
3975
3891
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
3976
- * @permissionScope Picasso private app mega scope
3977
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
3978
3892
  * @applicableIdentity APP
3979
3893
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateDraftOrder
3980
3894
  */
@@ -3994,8 +3908,6 @@ export declare function createDraftOrder(orderId: string): Promise<NonNullablePa
3994
3908
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
3995
3909
  * @permissionScope Manage eCommerce - all permissions
3996
3910
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
3997
- * @permissionScope Picasso private app mega scope
3998
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
3999
3911
  * @applicableIdentity APP
4000
3912
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateEmptyDraftOrder
4001
3913
  */
@@ -4004,7 +3916,7 @@ export declare function createEmptyDraftOrder(): Promise<NonNullablePaths<Create
4004
3916
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4005
3917
  /**
4006
3918
  * Adds line items to a draft order.
4007
- * @param draftOrderId - The draft order id
3919
+ * @param draftOrderId - Draft order ID.
4008
3920
  * @public
4009
3921
  * @documentationMaturity preview
4010
3922
  * @requiredField draftOrderId
@@ -4016,8 +3928,6 @@ export declare function createEmptyDraftOrder(): Promise<NonNullablePaths<Create
4016
3928
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4017
3929
  * @permissionScope Manage eCommerce - all permissions
4018
3930
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4019
- * @permissionScope Picasso private app mega scope
4020
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4021
3931
  * @applicableIdentity APP
4022
3932
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.AddLineItemsToDraftOrder
4023
3933
  */
@@ -4044,10 +3954,13 @@ export interface AddLineItemsToDraftOrderOptions {
4044
3954
  * > + Passing a quantity of `0` will remove the line item.
4045
3955
  * > + Price cannot be updated for line items with `paymentOption: MEMBERSHIP`.
4046
3956
  * > + Quantity cannot be decreased fulfilled line items. To get fulfillment information, pass the order ID to [List Fulfillments For Single Order](https://dev.wix.com/docs/rest/api-reference/wix-e-commerce/order-fulfillments/list-fulfillments-for-single-order).
4047
- * @param draftOrderId - The draft order id
3957
+ * @param draftOrderId - Draft order ID.
3958
+ * @param lineItemChanges - Details of changes to apply per line item.
4048
3959
  * @public
4049
3960
  * @documentationMaturity preview
4050
3961
  * @requiredField draftOrderId
3962
+ * @requiredField lineItemChanges
3963
+ * @requiredField lineItemChanges.lineItemId
4051
3964
  * @permissionId ECOM.DRAFT_ORDERS_MODIFY_ITEMS
4052
3965
  * @permissionScope Manage Stores - all permissions
4053
3966
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4055,31 +3968,25 @@ export interface AddLineItemsToDraftOrderOptions {
4055
3968
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4056
3969
  * @permissionScope Manage eCommerce - all permissions
4057
3970
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4058
- * @permissionScope Picasso private app mega scope
4059
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4060
3971
  * @applicableIdentity APP
4061
3972
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.UpdateLineItems
4062
3973
  */
4063
- export declare function updateLineItems(draftOrderId: string, options?: UpdateLineItemsOptions): Promise<NonNullablePaths<UpdateLineItemsResponse, {
3974
+ export declare function updateLineItems(draftOrderId: string, lineItemChanges: NonNullablePaths<LineItemChangeDetails, `lineItemId`>[]): Promise<NonNullablePaths<UpdateLineItemsResponse, {
4064
3975
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4065
3976
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4066
- export interface UpdateLineItemsOptions {
4067
- /**
4068
- * Details of changes to apply per line item
4069
- * @minSize 1
4070
- * @maxSize 300
4071
- */
4072
- lineItemChanges?: LineItemChangeDetails[];
4073
- }
4074
3977
  /**
4075
- * Sets and enables or disables discounts on a draft order.
3978
+ * Applies or unapplies discounts on a draft order.
4076
3979
  *
4077
- * Any discounts not passed will not change.
4078
- * @param draftOrderId - The draft order id
4079
- * @param discounts - The discount ids to opt-in. all existing discounts not listed are to be opted-out.
3980
+ * Unapplied discounts are still part of draft order, but do not affect balance.
3981
+ * Existing discounts, not mentioned in request, will keep their current state.
3982
+ * @param draftOrderId - Draft order ID.
3983
+ * @param discounts - Discount IDs to apply/unapply.
3984
+ * Existing discounts, not mentioned in request, will keep their current state.
4080
3985
  * @public
4081
3986
  * @documentationMaturity preview
4082
3987
  * @requiredField discounts
3988
+ * @requiredField discounts._id
3989
+ * @requiredField discounts.applied
4083
3990
  * @requiredField draftOrderId
4084
3991
  * @permissionId ECOM.DRAFT_ORDERS_SET_DISCOUNTS
4085
3992
  * @permissionScope Manage Stores - all permissions
@@ -4088,23 +3995,24 @@ export interface UpdateLineItemsOptions {
4088
3995
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4089
3996
  * @permissionScope Manage eCommerce - all permissions
4090
3997
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4091
- * @permissionScope Picasso private app mega scope
4092
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4093
3998
  * @applicableIdentity APP
4094
3999
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetDiscounts
4095
4000
  */
4096
- export declare function setDiscounts(draftOrderId: string, discounts: IdAndApplied[]): Promise<NonNullablePaths<SetDiscountsResponse, {
4001
+ export declare function setDiscounts(draftOrderId: string, discounts: NonNullablePaths<IdAndApplied, `_id` | `applied`>[]): Promise<NonNullablePaths<SetDiscountsResponse, {
4097
4002
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4098
4003
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4099
4004
  /**
4100
- * Adds merchant discounts to the order.
4101
- * @param draftOrderId - The draft order id
4005
+ * Create custom discounts on a draft order.
4006
+ *
4007
+ * Newly added discounts are unapplied by default.
4008
+ * To apply them, use Set Discounts ([REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/draft-orders/set-discounts) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/draft-orders/set-discounts)).
4009
+ * @param draftOrderId - Draft order ID.
4102
4010
  * @public
4103
4011
  * @documentationMaturity preview
4104
4012
  * @requiredField draftOrderId
4105
- * @requiredField options.discounts.amount
4106
4013
  * @requiredField options.discounts.amount.amount
4107
4014
  * @requiredField options.discounts.discountType
4015
+ * @requiredField options.discounts.priceAmount.amount
4108
4016
  * @permissionId ECOM.DRAFT_ORDERS_ADD_DISCOUNTS
4109
4017
  * @permissionScope Manage Stores - all permissions
4110
4018
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4112,17 +4020,15 @@ export declare function setDiscounts(draftOrderId: string, discounts: IdAndAppli
4112
4020
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4113
4021
  * @permissionScope Manage eCommerce - all permissions
4114
4022
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4115
- * @permissionScope Picasso private app mega scope
4116
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4117
4023
  * @applicableIdentity APP
4118
4024
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateCustomDiscounts
4119
4025
  */
4120
- export declare function createCustomDiscounts(draftOrderId: string, options?: NonNullablePaths<CreateCustomDiscountsOptions, `discounts.${number}.amount` | `discounts.${number}.amount.amount` | `discounts.${number}.discountType`>): Promise<NonNullablePaths<CreateCustomDiscountsResponse, {
4026
+ export declare function createCustomDiscounts(draftOrderId: string, options?: NonNullablePaths<CreateCustomDiscountsOptions, `discounts.${number}.amount.amount` | `discounts.${number}.discountType` | `discounts.${number}.priceAmount.amount`>): Promise<NonNullablePaths<CreateCustomDiscountsResponse, {
4121
4027
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4122
4028
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4123
4029
  export interface CreateCustomDiscountsOptions {
4124
4030
  /**
4125
- * The discounts to add.
4031
+ * Discounts to create. Created discounts are unapplied by default.
4126
4032
  * @minSize 1
4127
4033
  * @maxSize 100
4128
4034
  */
@@ -4130,8 +4036,8 @@ export interface CreateCustomDiscountsOptions {
4130
4036
  }
4131
4037
  /**
4132
4038
  * Remove custom discounts from the order.
4133
- * @param draftOrderId - The draft order id
4134
- * @param discountIds - The discounts to remove
4039
+ * @param draftOrderId - Draft order ID.
4040
+ * @param discountIds - Ids of discounts to remove.
4135
4041
  * @public
4136
4042
  * @documentationMaturity preview
4137
4043
  * @requiredField discountIds
@@ -4143,8 +4049,6 @@ export interface CreateCustomDiscountsOptions {
4143
4049
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4144
4050
  * @permissionScope Manage eCommerce - all permissions
4145
4051
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4146
- * @permissionScope Picasso private app mega scope
4147
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4148
4052
  * @applicableIdentity APP
4149
4053
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteCustomDiscounts
4150
4054
  */
@@ -4152,13 +4056,18 @@ export declare function deleteCustomDiscounts(draftOrderId: string, discountIds:
4152
4056
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4153
4057
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4154
4058
  /**
4155
- * Set which additional fees existing on the draft order are to be opt-in.
4156
- * All existing additional fees not provided on the call are opted-out.
4157
- * @param draftOrderId - The draft order id
4158
- * @param additionalFees - The additional fees ids to opt-in. all existing additional fees not listed are to be opted-out
4059
+ * Applies or unapplies additional fees on a draft order.
4060
+ *
4061
+ * Unapplied fees are still part of draft order, but do not affect balance.
4062
+ * Existing additional fees, not mentioned in request, will keep their current state.
4063
+ * @param draftOrderId - Draft order ID.
4064
+ * @param additionalFees - Additional fee IDs to apply/unapply.
4065
+ * Existing additional fees, not mentioned in this list, will keep their current state.
4159
4066
  * @public
4160
4067
  * @documentationMaturity preview
4161
4068
  * @requiredField additionalFees
4069
+ * @requiredField additionalFees._id
4070
+ * @requiredField additionalFees.applied
4162
4071
  * @requiredField draftOrderId
4163
4072
  * @permissionId ECOM.DRAFT_ORDERS_SET_ADDITIONAL_FEES
4164
4073
  * @permissionScope Manage Stores - all permissions
@@ -4167,19 +4076,18 @@ export declare function deleteCustomDiscounts(draftOrderId: string, discountIds:
4167
4076
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4168
4077
  * @permissionScope Manage eCommerce - all permissions
4169
4078
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4170
- * @permissionScope Picasso private app mega scope
4171
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4172
4079
  * @applicableIdentity APP
4173
4080
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetAdditionalFees
4174
4081
  */
4175
- export declare function setAdditionalFees(draftOrderId: string, additionalFees: IdAndApplied[]): Promise<NonNullablePaths<SetAdditionalFeesResponse, {
4082
+ export declare function setAdditionalFees(draftOrderId: string, additionalFees: NonNullablePaths<IdAndApplied, `_id` | `applied`>[]): Promise<NonNullablePaths<SetAdditionalFeesResponse, {
4176
4083
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4177
4084
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4178
4085
  /**
4179
- * Create custom additional fees to the order.
4180
- * added additional fees are by default opted-out.
4181
- * To opt-in them, please call SetAdditionalFees with the added additional fee ids.
4182
- * @param draftOrderId - The draft order id
4086
+ * Creates custom additional fees on a draft order.
4087
+ *
4088
+ * Newly added additional fees are unapplied by default.
4089
+ * To apply them, use Set Additional Fees ([REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/draft-orders/set-additional-fees) | [SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/draft-orders/set-additional-fees)).
4090
+ * @param draftOrderId - Draft order ID.
4183
4091
  * @public
4184
4092
  * @documentationMaturity preview
4185
4093
  * @requiredField draftOrderId
@@ -4193,8 +4101,6 @@ export declare function setAdditionalFees(draftOrderId: string, additionalFees:
4193
4101
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4194
4102
  * @permissionScope Manage eCommerce - all permissions
4195
4103
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4196
- * @permissionScope Picasso private app mega scope
4197
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4198
4104
  * @applicableIdentity APP
4199
4105
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateCustomAdditionalFees
4200
4106
  */
@@ -4203,7 +4109,7 @@ export declare function createCustomAdditionalFees(draftOrderId: string, options
4203
4109
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4204
4110
  export interface CreateCustomAdditionalFeesOptions {
4205
4111
  /**
4206
- * The additional fees to add. added with opted-out setting
4112
+ * The additional fees to create. Created fees are unapplied by default.
4207
4113
  * @minSize 1
4208
4114
  * @maxSize 100
4209
4115
  */
@@ -4211,8 +4117,8 @@ export interface CreateCustomAdditionalFeesOptions {
4211
4117
  }
4212
4118
  /**
4213
4119
  * Remove custom additional fees from the order.
4214
- * @param draftOrderId - The draft order id
4215
- * @param customAdditionalFees - The additional fees to remove
4120
+ * @param draftOrderId - Draft order ID.
4121
+ * @param customAdditionalFees - Ids of additional fees to remove.
4216
4122
  * @public
4217
4123
  * @documentationMaturity preview
4218
4124
  * @requiredField customAdditionalFees
@@ -4224,8 +4130,6 @@ export interface CreateCustomAdditionalFeesOptions {
4224
4130
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4225
4131
  * @permissionScope Manage eCommerce - all permissions
4226
4132
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4227
- * @permissionScope Picasso private app mega scope
4228
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4229
4133
  * @applicableIdentity APP
4230
4134
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteCustomAdditionalFees
4231
4135
  */
@@ -4233,9 +4137,11 @@ export declare function deleteCustomAdditionalFees(draftOrderId: string, customA
4233
4137
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4234
4138
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4235
4139
  /**
4236
- * Sets shipping info to a draft order.
4140
+ * Sets shipping information on a draft order.
4141
+ * @param draftOrderId - Draft order ID.
4237
4142
  * @public
4238
4143
  * @documentationMaturity preview
4144
+ * @requiredField draftOrderId
4239
4145
  * @permissionId ECOM.DRAFT_ORDERS_SET_SHIPPING_INFO
4240
4146
  * @permissionScope Manage Stores - all permissions
4241
4147
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4243,16 +4149,22 @@ export declare function deleteCustomAdditionalFees(draftOrderId: string, customA
4243
4149
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4244
4150
  * @permissionScope Manage eCommerce - all permissions
4245
4151
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4246
- * @permissionScope Picasso private app mega scope
4247
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4248
4152
  * @applicableIdentity APP
4249
4153
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetShippingInfo
4250
4154
  */
4251
- export declare function setShippingInfo(): Promise<void>;
4155
+ export declare function setShippingInfo(draftOrderId: string, options?: SetShippingInfoOptions): Promise<NonNullablePaths<SetShippingInfoResponse, {
4156
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4157
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4158
+ export interface SetShippingInfoOptions {
4159
+ /** Shipping information. Empty value removes shipping information from draft. */
4160
+ shippingInfo?: V1ShippingInformation;
4161
+ }
4252
4162
  /**
4253
- * Sets buyer info to a draft order.
4163
+ * Sets buyer info on a draft order.
4164
+ * @param draftOrderId - Draft order ID.
4254
4165
  * @public
4255
4166
  * @documentationMaturity preview
4167
+ * @requiredField draftOrderId
4256
4168
  * @permissionId ECOM.DRAFT_ORDER_SET_BUYER_INFO
4257
4169
  * @permissionScope Manage Stores - all permissions
4258
4170
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4260,16 +4172,22 @@ export declare function setShippingInfo(): Promise<void>;
4260
4172
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4261
4173
  * @permissionScope Manage eCommerce - all permissions
4262
4174
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4263
- * @permissionScope Picasso private app mega scope
4264
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4265
4175
  * @applicableIdentity APP
4266
4176
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBuyerInfo
4267
4177
  */
4268
- export declare function setBuyerInfo(): Promise<void>;
4178
+ export declare function setBuyerInfo(draftOrderId: string, options?: SetBuyerInfoOptions): Promise<NonNullablePaths<SetBuyerInfoResponse, {
4179
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4180
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4181
+ export interface SetBuyerInfoOptions {
4182
+ /** Buyer information. Empty value removes buyer information from draft. */
4183
+ buyerInfo?: BuyerInfo;
4184
+ }
4269
4185
  /**
4270
- * Sets recipient info to a draft order.
4186
+ * Sets recipient info on a draft order.
4187
+ * @param draftOrderId - Draft order ID.
4271
4188
  * @public
4272
4189
  * @documentationMaturity preview
4190
+ * @requiredField draftOrderId
4273
4191
  * @permissionId ECOM.DRAFT_ORDER_SET_RECIPIENT_INFO
4274
4192
  * @permissionScope Manage Stores - all permissions
4275
4193
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4277,16 +4195,22 @@ export declare function setBuyerInfo(): Promise<void>;
4277
4195
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4278
4196
  * @permissionScope Manage eCommerce - all permissions
4279
4197
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4280
- * @permissionScope Picasso private app mega scope
4281
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4282
4198
  * @applicableIdentity APP
4283
4199
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetRecipientInfo
4284
4200
  */
4285
- export declare function setRecipientInfo(): Promise<void>;
4201
+ export declare function setRecipientInfo(draftOrderId: string, options?: SetRecipientInfoOptions): Promise<NonNullablePaths<SetRecipientInfoResponse, {
4202
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4203
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4204
+ export interface SetRecipientInfoOptions {
4205
+ /** Order recipient address and contact details. Empty value removes recipient information from draft. */
4206
+ recipientInfo?: AddressWithContact;
4207
+ }
4286
4208
  /**
4287
- * Sets billing info to a draft order.
4209
+ * Sets billing info on a draft order.
4210
+ * @param draftOrderId - Draft order ID.
4288
4211
  * @public
4289
4212
  * @documentationMaturity preview
4213
+ * @requiredField draftOrderId
4290
4214
  * @permissionId ECOM.DRAFT_ORDER_SET_BILLING_INFO
4291
4215
  * @permissionScope Manage Stores - all permissions
4292
4216
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4294,19 +4218,24 @@ export declare function setRecipientInfo(): Promise<void>;
4294
4218
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4295
4219
  * @permissionScope Manage eCommerce - all permissions
4296
4220
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4297
- * @permissionScope Picasso private app mega scope
4298
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4299
4221
  * @applicableIdentity APP
4300
4222
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBillingInfo
4301
4223
  */
4302
- export declare function setBillingInfo(): Promise<void>;
4224
+ export declare function setBillingInfo(draftOrderId: string, options?: SetBillingInfoOptions): Promise<NonNullablePaths<SetBillingInfoResponse, {
4225
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4226
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4227
+ export interface SetBillingInfoOptions {
4228
+ /** Billing address and contact details. Empty value removes billing information from draft. */
4229
+ billingInfo?: AddressWithContact;
4230
+ }
4303
4231
  /**
4304
- * Get an order.
4305
- * When order is in draft status, it's re-estimated and return with latest tax and totals
4232
+ * Gets a draft order.
4233
+ *
4234
+ * Draft order is recalculated and contains latest tax and totals (unless already committed).
4306
4235
  * Automatic discounts and automatic additional fees will reflect the latest prices and eligibility.
4307
4236
  * Calculation will be based on current draft order content - items, shipping info and eligible discounts and additional fees.
4308
- * When order is in committed status, it's returned with it's calculation at the moment it was committed.
4309
- * @param draftOrderId - The draft order id
4237
+ * When retrieving an already committed draft, it's not recalculated and contains data calculated during commit.
4238
+ * @param draftOrderId - Draft order ID.
4310
4239
  * @public
4311
4240
  * @documentationMaturity preview
4312
4241
  * @requiredField draftOrderId
@@ -4318,8 +4247,6 @@ export declare function setBillingInfo(): Promise<void>;
4318
4247
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4319
4248
  * @permissionScope Manage eCommerce - all permissions
4320
4249
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4321
- * @permissionScope Picasso private app mega scope
4322
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4323
4250
  * @applicableIdentity APP
4324
4251
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.GetDraftOrder
4325
4252
  */
@@ -4327,8 +4254,8 @@ export declare function getDraftOrder(draftOrderId: string): Promise<NonNullable
4327
4254
  [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4328
4255
  }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4329
4256
  /**
4330
- * Checks whether a draft can be created for this order
4331
- * @param orderId - Order ID.
4257
+ * Checks whether a draft can be created for this order.
4258
+ * @param orderId - Order Id.
4332
4259
  * @public
4333
4260
  * @documentationMaturity preview
4334
4261
  * @requiredField orderId
@@ -4339,17 +4266,16 @@ export declare function getDraftOrder(draftOrderId: string): Promise<NonNullable
4339
4266
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4340
4267
  * @permissionScope Manage eCommerce - all permissions
4341
4268
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4342
- * @permissionScope Picasso private app mega scope
4343
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4344
4269
  * @applicableIdentity APP
4345
4270
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.GetOrderDraftabilityStatus
4346
4271
  */
4347
4272
  export declare function getOrderDraftabilityStatus(orderId: string): Promise<NonNullablePaths<GetOrderDraftabilityStatusResponse, `orderId` | `orderDraftable` | `nonDraftableReasons`>>;
4348
4273
  /**
4349
- * Commit latest changes to the baseline order and control what side-effects will be applied.
4274
+ * Commit latest changes to the baseline order and control which side-effects are executed.
4275
+ *
4350
4276
  * Commit cannot be undone or reverted.
4351
- * Order-edit become closed for editing, however it's kept for reference and can be retrieved.
4352
- * @param draftOrderId - The draft order id
4277
+ * Committed draft will become closed for further modifications, however it's kept for reference and can be retrieved.
4278
+ * @param draftOrderId - Draft order ID.
4353
4279
  * @public
4354
4280
  * @documentationMaturity preview
4355
4281
  * @requiredField draftOrderId
@@ -4361,16 +4287,14 @@ export declare function getOrderDraftabilityStatus(orderId: string): Promise<Non
4361
4287
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4362
4288
  * @permissionScope Manage eCommerce - all permissions
4363
4289
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4364
- * @permissionScope Picasso private app mega scope
4365
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4366
4290
  * @applicableIdentity APP
4367
4291
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CommitDraftOrder
4368
4292
  */
4369
4293
  export declare function commitDraftOrder(draftOrderId: string, options?: CommitDraftOrderOptions): Promise<NonNullablePaths<CommitDraftOrderResponse, {
4370
4294
  [P in DraftOrderNonNullablePaths]: `committedDraftOrder.${P}`;
4371
- }[DraftOrderNonNullablePaths] | `orderAfterCommit.number` | `orderAfterCommit.lineItems` | `orderAfterCommit.lineItems.${number}._id` | `orderAfterCommit.lineItems.${number}.productName.original` | `orderAfterCommit.lineItems.${number}.catalogReference.catalogItemId` | `orderAfterCommit.lineItems.${number}.catalogReference.appId` | `orderAfterCommit.lineItems.${number}.quantity` | `orderAfterCommit.lineItems.${number}.totalDiscount.amount` | `orderAfterCommit.lineItems.${number}.totalDiscount.formattedAmount` | `orderAfterCommit.lineItems.${number}.descriptionLines` | `orderAfterCommit.lineItems.${number}.descriptionLines.${number}.plainText.original` | `orderAfterCommit.lineItems.${number}.descriptionLines.${number}.colorInfo.original` | `orderAfterCommit.lineItems.${number}.descriptionLines.${number}.name.original` | `orderAfterCommit.lineItems.${number}.physicalProperties.shippable` | `orderAfterCommit.lineItems.${number}.itemType.preset` | `orderAfterCommit.lineItems.${number}.itemType.custom` | `orderAfterCommit.lineItems.${number}.paymentOption` | `orderAfterCommit.lineItems.${number}.taxDetails.taxRate` | `orderAfterCommit.lineItems.${number}.taxInfo.taxIncludedInPrice` | `orderAfterCommit.lineItems.${number}.taxInfo.taxBreakdown` | `orderAfterCommit.lineItems.${number}.taxInfo.taxBreakdown.${number}.jurisdictionType` | `orderAfterCommit.lineItems.${number}.digitalFile.fileId` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.cycleNumber` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionOptionTitle` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionSettings.frequency` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionSettings.autoRenewal` | `orderAfterCommit.lineItems.${number}.priceDescription.original` | `orderAfterCommit.lineItems.${number}.locations` | `orderAfterCommit.lineItems.${number}.locations.${number}._id` | `orderAfterCommit.lineItems.${number}.locations.${number}.quantity` | `orderAfterCommit.buyerInfo.visitorId` | `orderAfterCommit.buyerInfo.memberId` | `orderAfterCommit.paymentStatus` | `orderAfterCommit.fulfillmentStatus` | `orderAfterCommit.weightUnit` | `orderAfterCommit.taxIncludedInPrices` | `orderAfterCommit.billingInfo.address.streetAddress.number` | `orderAfterCommit.billingInfo.address.streetAddress.name` | `orderAfterCommit.billingInfo.contactDetails.vatId._id` | `orderAfterCommit.billingInfo.contactDetails.vatId.type` | `orderAfterCommit.shippingInfo.title` | `orderAfterCommit.shippingInfo.logistics.pickupDetails.pickupMethod` | `orderAfterCommit.status` | `orderAfterCommit.taxInfo.taxBreakdown` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.taxName` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.taxType` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.jurisdiction` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.jurisdictionType` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.rate` | `orderAfterCommit.appliedDiscounts` | `orderAfterCommit.appliedDiscounts.${number}.coupon._id` | `orderAfterCommit.appliedDiscounts.${number}.coupon.code` | `orderAfterCommit.appliedDiscounts.${number}.coupon.name` | `orderAfterCommit.appliedDiscounts.${number}.merchantDiscount.discountReason` | `orderAfterCommit.appliedDiscounts.${number}.discountRule._id` | `orderAfterCommit.appliedDiscounts.${number}.discountRule.name.original` | `orderAfterCommit.appliedDiscounts.${number}.discountType` | `orderAfterCommit.appliedDiscounts.${number}.lineItemIds` | `orderAfterCommit.activities` | `orderAfterCommit.activities.${number}.customActivity.appId` | `orderAfterCommit.activities.${number}.customActivity.type` | `orderAfterCommit.activities.${number}.merchantComment.message` | `orderAfterCommit.activities.${number}.orderRefunded.manual` | `orderAfterCommit.activities.${number}.orderRefunded.reason` | `orderAfterCommit.activities.${number}.type` | `orderAfterCommit.attributionSource` | `orderAfterCommit.createdBy.userId` | `orderAfterCommit.createdBy.memberId` | `orderAfterCommit.createdBy.visitorId` | `orderAfterCommit.createdBy.appId` | `orderAfterCommit.channelInfo.type` | `orderAfterCommit.customFields` | `orderAfterCommit.customFields.${number}.title` | `orderAfterCommit.balanceSummary.balance.amount` | `orderAfterCommit.balanceSummary.balance.formattedAmount` | `orderAfterCommit.additionalFees` | `orderAfterCommit.additionalFees.${number}.name` | `orderAfterCommit.additionalFees.${number}._id` | `orderAfterCommit.additionalFees.${number}.lineItemIds` | `orderAfterCommit.tags.privateTags.tagIds` | `orderAfterCommit.businessLocation._id` | `orderAfterCommit.businessLocation.name`>>;
4295
+ }[DraftOrderNonNullablePaths] | `orderAfterCommit.number` | `orderAfterCommit.lineItems` | `orderAfterCommit.lineItems.${number}._id` | `orderAfterCommit.lineItems.${number}.productName.original` | `orderAfterCommit.lineItems.${number}.catalogReference.catalogItemId` | `orderAfterCommit.lineItems.${number}.catalogReference.appId` | `orderAfterCommit.lineItems.${number}.quantity` | `orderAfterCommit.lineItems.${number}.totalDiscount.amount` | `orderAfterCommit.lineItems.${number}.totalDiscount.formattedAmount` | `orderAfterCommit.lineItems.${number}.physicalProperties.shippable` | `orderAfterCommit.lineItems.${number}.itemType.preset` | `orderAfterCommit.lineItems.${number}.itemType.custom` | `orderAfterCommit.lineItems.${number}.paymentOption` | `orderAfterCommit.lineItems.${number}.taxDetails.taxRate` | `orderAfterCommit.lineItems.${number}.taxInfo.taxIncludedInPrice` | `orderAfterCommit.lineItems.${number}.digitalFile.fileId` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.cycleNumber` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionOptionTitle` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionSettings.frequency` | `orderAfterCommit.lineItems.${number}.subscriptionInfo.subscriptionSettings.autoRenewal` | `orderAfterCommit.lineItems.${number}.priceDescription.original` | `orderAfterCommit.buyerInfo.visitorId` | `orderAfterCommit.buyerInfo.memberId` | `orderAfterCommit.paymentStatus` | `orderAfterCommit.fulfillmentStatus` | `orderAfterCommit.weightUnit` | `orderAfterCommit.taxIncludedInPrices` | `orderAfterCommit.billingInfo.address.streetAddress.number` | `orderAfterCommit.billingInfo.address.streetAddress.name` | `orderAfterCommit.billingInfo.contactDetails.vatId._id` | `orderAfterCommit.billingInfo.contactDetails.vatId.type` | `orderAfterCommit.shippingInfo.title` | `orderAfterCommit.shippingInfo.logistics.pickupDetails.pickupMethod` | `orderAfterCommit.status` | `orderAfterCommit.taxInfo.taxBreakdown` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.taxName` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.taxType` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.jurisdiction` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.jurisdictionType` | `orderAfterCommit.taxInfo.taxBreakdown.${number}.rate` | `orderAfterCommit.appliedDiscounts` | `orderAfterCommit.appliedDiscounts.${number}.coupon._id` | `orderAfterCommit.appliedDiscounts.${number}.coupon.code` | `orderAfterCommit.appliedDiscounts.${number}.coupon.name` | `orderAfterCommit.appliedDiscounts.${number}.merchantDiscount.discountReason` | `orderAfterCommit.appliedDiscounts.${number}.discountRule._id` | `orderAfterCommit.appliedDiscounts.${number}.discountRule.name.original` | `orderAfterCommit.appliedDiscounts.${number}.discountType` | `orderAfterCommit.activities` | `orderAfterCommit.activities.${number}.customActivity.appId` | `orderAfterCommit.activities.${number}.customActivity.type` | `orderAfterCommit.activities.${number}.merchantComment.message` | `orderAfterCommit.activities.${number}.orderRefunded.manual` | `orderAfterCommit.activities.${number}.orderRefunded.reason` | `orderAfterCommit.activities.${number}.type` | `orderAfterCommit.attributionSource` | `orderAfterCommit.createdBy.userId` | `orderAfterCommit.createdBy.memberId` | `orderAfterCommit.createdBy.visitorId` | `orderAfterCommit.createdBy.appId` | `orderAfterCommit.channelInfo.type` | `orderAfterCommit.customFields` | `orderAfterCommit.customFields.${number}.title` | `orderAfterCommit.balanceSummary.balance.amount` | `orderAfterCommit.balanceSummary.balance.formattedAmount` | `orderAfterCommit.additionalFees` | `orderAfterCommit.additionalFees.${number}.name` | `orderAfterCommit.additionalFees.${number}._id` | `orderAfterCommit.tags.privateTags.tagIds` | `orderAfterCommit.businessLocation._id` | `orderAfterCommit.businessLocation.name`>>;
4372
4296
  export interface CommitDraftOrderOptions {
4373
- /** Optional side effects to trigger */
4297
+ /** Optional side effects to trigger. */
4374
4298
  commitSettings?: DraftOrderCommitSettings;
4375
4299
  /**
4376
4300
  * Reason for edit, given by user (optional).
@@ -4379,11 +4303,14 @@ export interface CommitDraftOrderOptions {
4379
4303
  reason?: string | null;
4380
4304
  }
4381
4305
  /**
4382
- * Create new order and control what side-effects will be applied
4306
+ * Creates a new order while specifying which side-effects are executed.
4307
+ *
4383
4308
  * Commit cannot be undone or reverted.
4384
- * Order-edit become closed for editing, however it's kept for reference and can be retrieved.
4309
+ * Committed draft will become closed for further modifications, however it's kept for reference and can be retrieved.
4310
+ * @param draftOrderId - Draft order ID.
4385
4311
  * @public
4386
4312
  * @documentationMaturity preview
4313
+ * @requiredField draftOrderId
4387
4314
  * @permissionId ECOM.DRAFT_ORDER_CREATE_ORDER_FROM_DRAFT
4388
4315
  * @permissionId ECOM.DRAFT_ORDER_READ_ALL_EXTENDED_FIELDS
4389
4316
  * @permissionScope Manage Stores - all permissions
@@ -4392,16 +4319,28 @@ export interface CommitDraftOrderOptions {
4392
4319
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4393
4320
  * @permissionScope Manage eCommerce - all permissions
4394
4321
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4395
- * @permissionScope Picasso private app mega scope
4396
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4397
4322
  * @applicableIdentity APP
4398
4323
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.CreateOrderFromDraft
4399
4324
  */
4400
- export declare function createOrderFromDraft(): Promise<void>;
4325
+ export declare function createOrderFromDraft(draftOrderId: string, options?: CreateOrderFromDraftOptions): Promise<NonNullablePaths<CreateOrderFromDraftResponse, {
4326
+ [P in DraftOrderNonNullablePaths]: `committedDraftOrder.${P}`;
4327
+ }[DraftOrderNonNullablePaths] | `createdOrder.number` | `createdOrder.lineItems` | `createdOrder.lineItems.${number}._id` | `createdOrder.lineItems.${number}.productName.original` | `createdOrder.lineItems.${number}.catalogReference.catalogItemId` | `createdOrder.lineItems.${number}.catalogReference.appId` | `createdOrder.lineItems.${number}.quantity` | `createdOrder.lineItems.${number}.totalDiscount.amount` | `createdOrder.lineItems.${number}.totalDiscount.formattedAmount` | `createdOrder.lineItems.${number}.physicalProperties.shippable` | `createdOrder.lineItems.${number}.itemType.preset` | `createdOrder.lineItems.${number}.itemType.custom` | `createdOrder.lineItems.${number}.paymentOption` | `createdOrder.lineItems.${number}.taxDetails.taxRate` | `createdOrder.lineItems.${number}.taxInfo.taxIncludedInPrice` | `createdOrder.lineItems.${number}.digitalFile.fileId` | `createdOrder.lineItems.${number}.subscriptionInfo.cycleNumber` | `createdOrder.lineItems.${number}.subscriptionInfo.subscriptionOptionTitle` | `createdOrder.lineItems.${number}.subscriptionInfo.subscriptionSettings.frequency` | `createdOrder.lineItems.${number}.subscriptionInfo.subscriptionSettings.autoRenewal` | `createdOrder.lineItems.${number}.priceDescription.original` | `createdOrder.buyerInfo.visitorId` | `createdOrder.buyerInfo.memberId` | `createdOrder.paymentStatus` | `createdOrder.fulfillmentStatus` | `createdOrder.weightUnit` | `createdOrder.taxIncludedInPrices` | `createdOrder.billingInfo.address.streetAddress.number` | `createdOrder.billingInfo.address.streetAddress.name` | `createdOrder.billingInfo.contactDetails.vatId._id` | `createdOrder.billingInfo.contactDetails.vatId.type` | `createdOrder.shippingInfo.title` | `createdOrder.shippingInfo.logistics.pickupDetails.pickupMethod` | `createdOrder.status` | `createdOrder.taxInfo.taxBreakdown` | `createdOrder.taxInfo.taxBreakdown.${number}.taxName` | `createdOrder.taxInfo.taxBreakdown.${number}.taxType` | `createdOrder.taxInfo.taxBreakdown.${number}.jurisdiction` | `createdOrder.taxInfo.taxBreakdown.${number}.jurisdictionType` | `createdOrder.taxInfo.taxBreakdown.${number}.rate` | `createdOrder.appliedDiscounts` | `createdOrder.appliedDiscounts.${number}.coupon._id` | `createdOrder.appliedDiscounts.${number}.coupon.code` | `createdOrder.appliedDiscounts.${number}.coupon.name` | `createdOrder.appliedDiscounts.${number}.merchantDiscount.discountReason` | `createdOrder.appliedDiscounts.${number}.discountRule._id` | `createdOrder.appliedDiscounts.${number}.discountRule.name.original` | `createdOrder.appliedDiscounts.${number}.discountType` | `createdOrder.activities` | `createdOrder.activities.${number}.customActivity.appId` | `createdOrder.activities.${number}.customActivity.type` | `createdOrder.activities.${number}.merchantComment.message` | `createdOrder.activities.${number}.orderRefunded.manual` | `createdOrder.activities.${number}.orderRefunded.reason` | `createdOrder.activities.${number}.type` | `createdOrder.attributionSource` | `createdOrder.createdBy.userId` | `createdOrder.createdBy.memberId` | `createdOrder.createdBy.visitorId` | `createdOrder.createdBy.appId` | `createdOrder.channelInfo.type` | `createdOrder.customFields` | `createdOrder.customFields.${number}.title` | `createdOrder.balanceSummary.balance.amount` | `createdOrder.balanceSummary.balance.formattedAmount` | `createdOrder.additionalFees` | `createdOrder.additionalFees.${number}.name` | `createdOrder.additionalFees.${number}._id` | `createdOrder.tags.privateTags.tagIds` | `createdOrder.businessLocation._id` | `createdOrder.businessLocation.name`>>;
4328
+ export interface CreateOrderFromDraftOptions {
4329
+ /** Optional side effects to trigger. */
4330
+ createSettings?: OrderCreateSettings;
4331
+ /**
4332
+ * Reason for order creation, given by user (optional).
4333
+ * @maxLength 200
4334
+ */
4335
+ reason?: string | null;
4336
+ /** Information about the sales channel that submitted this order. */
4337
+ channelInfo?: ChannelInfo;
4338
+ }
4401
4339
  /**
4402
- * Delete order-edit entity with all pending changes.
4403
- * Order-edit in status 'COMMITTED' cannot be deleted.
4404
- * @param draftOrderId - The draft order id
4340
+ * Deletes a draft order along with all its pending changes.
4341
+ *
4342
+ * Draft orders in status 'COMMITTED' cannot be deleted.
4343
+ * @param draftOrderId - Draft order ID.
4405
4344
  * @public
4406
4345
  * @documentationMaturity preview
4407
4346
  * @requiredField draftOrderId
@@ -4413,8 +4352,6 @@ export declare function createOrderFromDraft(): Promise<void>;
4413
4352
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4414
4353
  * @permissionScope Manage eCommerce - all permissions
4415
4354
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4416
- * @permissionScope Picasso private app mega scope
4417
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4418
4355
  * @applicableIdentity APP
4419
4356
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.DeleteDraftOrder
4420
4357
  */
@@ -4438,8 +4375,6 @@ export declare function deleteDraftOrder(draftOrderId: string): Promise<void>;
4438
4375
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4439
4376
  * @permissionScope Manage eCommerce - all permissions
4440
4377
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4441
- * @permissionScope Picasso private app mega scope
4442
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4443
4378
  * @permissionId ECOM.DRAFT_ORDERS_READ
4444
4379
  * @applicableIdentity APP
4445
4380
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.QueryDraftOrders
@@ -4523,9 +4458,49 @@ export interface DraftOrdersQueryBuilder {
4523
4458
  find: () => Promise<DraftOrdersQueryResult>;
4524
4459
  }
4525
4460
  /**
4526
- * Sets tax exemption to a draft order.
4461
+ * Updates extended fields on a draft order.
4462
+ * @param _id - ID of the entity to update.
4463
+ * @param namespace - Identifier for the app whose extended fields are being updated.
4527
4464
  * @public
4528
4465
  * @documentationMaturity preview
4466
+ * @requiredField _id
4467
+ * @requiredField namespace
4468
+ * @requiredField options
4469
+ * @requiredField options.namespaceData
4470
+ * @permissionId ECOM.DRAFT_ORDER_UPDATE_EXTENDED_FIELDS
4471
+ * @permissionId ECOM.DRAFT_ORDER_WRITE_ALL_EXTENDED_FIELDS
4472
+ * @permissionScope Manage Stores - all permissions
4473
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
4474
+ * @permissionScope Manage Restaurants - all permissions
4475
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4476
+ * @permissionScope Manage eCommerce - all permissions
4477
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4478
+ * @permissionScope Manage Stores - all permissions
4479
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
4480
+ * @permissionScope Manage Restaurants - all permissions
4481
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4482
+ * @permissionScope Manage eCommerce - all permissions
4483
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4484
+ * @permissionScope Manage Orders
4485
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
4486
+ * @applicableIdentity APP
4487
+ * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.UpdateExtendedFields
4488
+ */
4489
+ export declare function updateExtendedFields(_id: string, namespace: string, options: NonNullablePaths<UpdateExtendedFieldsOptions, `namespaceData`>): Promise<NonNullablePaths<UpdateExtendedFieldsResponse, {
4490
+ [P in DraftOrderNonNullablePaths]: `draftOrder.${P}`;
4491
+ }[DraftOrderNonNullablePaths]>>;
4492
+ export interface UpdateExtendedFieldsOptions {
4493
+ /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
4494
+ namespaceData: Record<string, any> | null;
4495
+ }
4496
+ /**
4497
+ * Sets tax exemption on a draft order.
4498
+ * @param draftOrderId - Draft order ID.
4499
+ * @public
4500
+ * @documentationMaturity preview
4501
+ * @requiredField draftOrderId
4502
+ * @requiredField options
4503
+ * @requiredField options.taxExempt
4529
4504
  * @permissionId ECOM.DRAFT_ORDER_SET_TAX_EXEMPTION
4530
4505
  * @permissionScope Manage Stores - all permissions
4531
4506
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4533,16 +4508,27 @@ export interface DraftOrdersQueryBuilder {
4533
4508
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4534
4509
  * @permissionScope Manage eCommerce - all permissions
4535
4510
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4536
- * @permissionScope Picasso private app mega scope
4537
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4538
4511
  * @applicableIdentity APP
4539
4512
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetTaxExemption
4540
4513
  */
4541
- export declare function setTaxExemption(): Promise<void>;
4514
+ export declare function setTaxExemption(draftOrderId: string, options: NonNullablePaths<SetTaxExemptionOptions, `taxExempt`>): Promise<NonNullablePaths<SetTaxExemptionResponse, {
4515
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4516
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4517
+ export interface SetTaxExemptionOptions {
4518
+ /**
4519
+ * Flag, indicating whether the draft order is exempt from tax calculations.
4520
+ *
4521
+ * Default: `false`
4522
+ */
4523
+ taxExempt: boolean | null;
4524
+ }
4542
4525
  /**
4543
- * Sets business location to a draft order.
4526
+ * Sets business location on a draft order.
4527
+ * @param draftOrderId - Draft order ID.
4544
4528
  * @public
4545
4529
  * @documentationMaturity preview
4530
+ * @requiredField draftOrderId
4531
+ * @requiredField options.businessLocation._id
4546
4532
  * @permissionId ECOM.DRAFT_ORDER_SET_BUSINESS_LOCATION
4547
4533
  * @permissionScope Manage Stores - all permissions
4548
4534
  * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
@@ -4550,10 +4536,14 @@ export declare function setTaxExemption(): Promise<void>;
4550
4536
  * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
4551
4537
  * @permissionScope Manage eCommerce - all permissions
4552
4538
  * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
4553
- * @permissionScope Picasso private app mega scope
4554
- * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
4555
4539
  * @applicableIdentity APP
4556
4540
  * @fqn com.wix.ecom.orders.draft.v1.DraftOrders.SetBusinessLocation
4557
4541
  */
4558
- export declare function setBusinessLocation(): Promise<void>;
4542
+ export declare function setBusinessLocation(draftOrderId: string, options?: NonNullablePaths<SetBusinessLocationOptions, `businessLocation._id`>): Promise<NonNullablePaths<SetBusinessLocationResponse, {
4543
+ [P in DraftOrderNonNullablePaths]: `calculatedDraftOrder.draftOrder.${P}`;
4544
+ }[DraftOrderNonNullablePaths] | `calculatedDraftOrder.shippingOptions` | `calculatedDraftOrder.shippingOptions.${number}.code` | `calculatedDraftOrder.shippingOptions.${number}.title` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.number` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.address.streetAddress.name` | `calculatedDraftOrder.shippingOptions.${number}.logistics.pickupDetails.pickupMethod` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.amount` | `calculatedDraftOrder.shippingOptions.${number}.cost.price.formattedAmount` | `calculatedDraftOrder.shippingOptions.${number}.cost.currency` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.code` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.applicationError.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.field` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.description` | `calculatedDraftOrder.calculationErrors.generalShippingCalculationError.validationError.fieldViolations.${number}.violatedRule` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors` | `calculatedDraftOrder.calculationErrors.carrierErrors.errors.${number}.carrierId` | `calculatedDraftOrder.calculationErrors.orderValidationErrors`>>;
4545
+ export interface SetBusinessLocationOptions {
4546
+ /** Business location. */
4547
+ businessLocation?: Location;
4548
+ }
4559
4549
  export {};