@wix/ecom 1.0.504 → 1.0.505

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 (195) hide show
  1. package/build/cjs/context.d.ts +15 -0
  2. package/build/cjs/context.js +16 -1
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +1 -1
  5. package/build/cjs/index.js +2 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/index.typings.d.ts +1 -1
  8. package/build/cjs/index.typings.js +2 -2
  9. package/build/cjs/index.typings.js.map +1 -1
  10. package/build/cjs/meta.d.ts +1 -1
  11. package/build/cjs/meta.js +2 -2
  12. package/build/cjs/meta.js.map +1 -1
  13. package/build/cjs/src/ecom-discounts-v1-discount-rule.context.d.ts +7 -0
  14. package/build/cjs/src/ecom-discounts-v1-discount-rule.context.js +60 -0
  15. package/build/cjs/src/ecom-discounts-v1-discount-rule.context.js.map +1 -0
  16. package/build/cjs/src/ecom-orders-v1-invoice.context.d.ts +3 -0
  17. package/build/cjs/src/ecom-orders-v1-invoice.context.js +16 -0
  18. package/build/cjs/src/ecom-orders-v1-invoice.context.js.map +1 -0
  19. package/build/cjs/src/ecom-recommendations-v1-recommendation.context.d.ts +4 -0
  20. package/build/cjs/src/ecom-recommendations-v1-recommendation.context.js +27 -0
  21. package/build/cjs/src/ecom-recommendations-v1-recommendation.context.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-abandoned-checkout.context.d.ts +3 -0
  23. package/build/cjs/src/ecom-v1-abandoned-checkout.context.js +16 -0
  24. package/build/cjs/src/ecom-v1-abandoned-checkout.context.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-back-in-stock-notification-request.context.d.ts +9 -0
  26. package/build/cjs/src/ecom-v1-back-in-stock-notification-request.context.js +82 -0
  27. package/build/cjs/src/ecom-v1-back-in-stock-notification-request.context.js.map +1 -0
  28. package/build/cjs/src/ecom-v1-back-in-stock-settings.context.d.ts +5 -0
  29. package/build/cjs/src/ecom-v1-back-in-stock-settings.context.js +38 -0
  30. package/build/cjs/src/ecom-v1-back-in-stock-settings.context.js.map +1 -0
  31. package/build/cjs/src/ecom-v1-cart-cart.context.d.ts +12 -0
  32. package/build/cjs/src/ecom-v1-cart-cart.context.js +115 -0
  33. package/build/cjs/src/ecom-v1-cart-cart.context.js.map +1 -0
  34. package/build/cjs/src/ecom-v1-cart-cart.http.d.ts +1 -1
  35. package/build/cjs/src/ecom-v1-cart-cart.http.js +1 -1
  36. package/build/cjs/src/ecom-v1-cart-cart.types.d.ts +0 -2
  37. package/build/cjs/src/ecom-v1-cart-cart.types.js.map +1 -1
  38. package/build/cjs/src/ecom-v1-cart-cart.universal.d.ts +15 -3
  39. package/build/cjs/src/ecom-v1-cart-cart.universal.js +15 -1
  40. package/build/cjs/src/ecom-v1-cart-cart.universal.js.map +1 -1
  41. package/build/cjs/src/ecom-v1-cart-current-cart.context.d.ts +11 -0
  42. package/build/cjs/src/ecom-v1-cart-current-cart.context.js +104 -0
  43. package/build/cjs/src/ecom-v1-cart-current-cart.context.js.map +1 -0
  44. package/build/cjs/src/ecom-v1-cart-current-cart.http.d.ts +2 -2
  45. package/build/cjs/src/ecom-v1-cart-current-cart.http.js +2 -2
  46. package/build/cjs/src/ecom-v1-cart-current-cart.types.d.ts +0 -2
  47. package/build/cjs/src/ecom-v1-cart-current-cart.types.js.map +1 -1
  48. package/build/cjs/src/ecom-v1-cart-current-cart.universal.d.ts +13 -3
  49. package/build/cjs/src/ecom-v1-cart-current-cart.universal.js +13 -1
  50. package/build/cjs/src/ecom-v1-cart-current-cart.universal.js.map +1 -1
  51. package/build/cjs/src/ecom-v1-checkout-checkout.context.d.ts +14 -0
  52. package/build/cjs/src/ecom-v1-checkout-checkout.context.js +137 -0
  53. package/build/cjs/src/ecom-v1-checkout-checkout.context.js.map +1 -0
  54. package/build/cjs/src/ecom-v1-checkout-checkout.types.d.ts +0 -2
  55. package/build/cjs/src/ecom-v1-checkout-checkout.types.js.map +1 -1
  56. package/build/cjs/src/ecom-v1-checkout-checkout.universal.d.ts +0 -2
  57. package/build/cjs/src/ecom-v1-checkout-checkout.universal.js.map +1 -1
  58. package/build/cjs/src/ecom-v1-checkout-settings.context.d.ts +4 -0
  59. package/build/cjs/src/ecom-v1-checkout-settings.context.js +27 -0
  60. package/build/cjs/src/ecom-v1-checkout-settings.context.js.map +1 -0
  61. package/build/cjs/src/ecom-v1-checkout-settings.public.d.ts +1 -1
  62. package/build/cjs/src/ecom-v1-checkout-settings.types.d.ts +48 -8
  63. package/build/cjs/src/ecom-v1-checkout-settings.universal.d.ts +50 -9
  64. package/build/cjs/src/ecom-v1-checkout-settings.universal.js.map +1 -1
  65. package/build/cjs/src/ecom-v1-checkout-template.context.d.ts +8 -0
  66. package/build/cjs/src/ecom-v1-checkout-template.context.js +71 -0
  67. package/build/cjs/src/ecom-v1-checkout-template.context.js.map +1 -0
  68. package/build/cjs/src/ecom-v1-checkout-template.types.d.ts +0 -2
  69. package/build/cjs/src/ecom-v1-checkout-template.types.js.map +1 -1
  70. package/build/cjs/src/ecom-v1-checkout-template.universal.d.ts +12 -2
  71. package/build/cjs/src/ecom-v1-checkout-template.universal.js +12 -0
  72. package/build/cjs/src/ecom-v1-checkout-template.universal.js.map +1 -1
  73. package/build/cjs/src/ecom-v1-fulfillments.context.d.ts +8 -0
  74. package/build/cjs/src/ecom-v1-fulfillments.context.js +71 -0
  75. package/build/cjs/src/ecom-v1-fulfillments.context.js.map +1 -0
  76. package/build/cjs/src/ecom-v1-order-transactions.context.d.ts +7 -0
  77. package/build/cjs/src/ecom-v1-order-transactions.context.js +60 -0
  78. package/build/cjs/src/ecom-v1-order-transactions.context.js.map +1 -0
  79. package/build/cjs/src/ecom-v1-order-transactions.http.js +3 -25
  80. package/build/cjs/src/ecom-v1-order-transactions.http.js.map +1 -1
  81. package/build/cjs/src/ecom-v1-order.context.d.ts +7 -0
  82. package/build/cjs/src/ecom-v1-order.context.js +60 -0
  83. package/build/cjs/src/ecom-v1-order.context.js.map +1 -0
  84. package/build/cjs/src/ecom-v1-order.http.js +6 -16
  85. package/build/cjs/src/ecom-v1-order.http.js.map +1 -1
  86. package/build/cjs/src/ecom-v1-order.public.d.ts +26 -2
  87. package/build/cjs/src/ecom-v1-order.public.js +8 -8
  88. package/build/cjs/src/ecom-v1-order.public.js.map +1 -1
  89. package/build/cjs/src/ecom-v1-order.types.d.ts +1063 -996
  90. package/build/cjs/src/ecom-v1-order.types.js +61 -61
  91. package/build/cjs/src/ecom-v1-order.types.js.map +1 -1
  92. package/build/cjs/src/ecom-v1-order.universal.d.ts +1066 -997
  93. package/build/cjs/src/ecom-v1-order.universal.js +61 -61
  94. package/build/cjs/src/ecom-v1-order.universal.js.map +1 -1
  95. package/build/cjs/src/ecom-v1-orders-settings.context.d.ts +4 -0
  96. package/build/cjs/src/ecom-v1-orders-settings.context.js +27 -0
  97. package/build/cjs/src/ecom-v1-orders-settings.context.js.map +1 -0
  98. package/build/es/context.d.ts +15 -0
  99. package/build/es/context.js +15 -0
  100. package/build/es/context.js.map +1 -1
  101. package/build/es/index.d.ts +1 -1
  102. package/build/es/index.js +1 -1
  103. package/build/es/index.js.map +1 -1
  104. package/build/es/index.typings.d.ts +1 -1
  105. package/build/es/index.typings.js +1 -1
  106. package/build/es/index.typings.js.map +1 -1
  107. package/build/es/meta.d.ts +1 -1
  108. package/build/es/meta.js +1 -1
  109. package/build/es/meta.js.map +1 -1
  110. package/build/es/src/ecom-discounts-v1-discount-rule.context.d.ts +7 -0
  111. package/build/es/src/ecom-discounts-v1-discount-rule.context.js +52 -0
  112. package/build/es/src/ecom-discounts-v1-discount-rule.context.js.map +1 -0
  113. package/build/es/src/ecom-orders-v1-invoice.context.d.ts +3 -0
  114. package/build/es/src/ecom-orders-v1-invoice.context.js +12 -0
  115. package/build/es/src/ecom-orders-v1-invoice.context.js.map +1 -0
  116. package/build/es/src/ecom-recommendations-v1-recommendation.context.d.ts +4 -0
  117. package/build/es/src/ecom-recommendations-v1-recommendation.context.js +22 -0
  118. package/build/es/src/ecom-recommendations-v1-recommendation.context.js.map +1 -0
  119. package/build/es/src/ecom-v1-abandoned-checkout.context.d.ts +3 -0
  120. package/build/es/src/ecom-v1-abandoned-checkout.context.js +12 -0
  121. package/build/es/src/ecom-v1-abandoned-checkout.context.js.map +1 -0
  122. package/build/es/src/ecom-v1-back-in-stock-notification-request.context.d.ts +9 -0
  123. package/build/es/src/ecom-v1-back-in-stock-notification-request.context.js +72 -0
  124. package/build/es/src/ecom-v1-back-in-stock-notification-request.context.js.map +1 -0
  125. package/build/es/src/ecom-v1-back-in-stock-settings.context.d.ts +5 -0
  126. package/build/es/src/ecom-v1-back-in-stock-settings.context.js +32 -0
  127. package/build/es/src/ecom-v1-back-in-stock-settings.context.js.map +1 -0
  128. package/build/es/src/ecom-v1-cart-cart.context.d.ts +12 -0
  129. package/build/es/src/ecom-v1-cart-cart.context.js +102 -0
  130. package/build/es/src/ecom-v1-cart-cart.context.js.map +1 -0
  131. package/build/es/src/ecom-v1-cart-cart.http.d.ts +1 -1
  132. package/build/es/src/ecom-v1-cart-cart.http.js +1 -1
  133. package/build/es/src/ecom-v1-cart-cart.types.d.ts +0 -2
  134. package/build/es/src/ecom-v1-cart-cart.types.js.map +1 -1
  135. package/build/es/src/ecom-v1-cart-cart.universal.d.ts +15 -3
  136. package/build/es/src/ecom-v1-cart-cart.universal.js +15 -1
  137. package/build/es/src/ecom-v1-cart-cart.universal.js.map +1 -1
  138. package/build/es/src/ecom-v1-cart-current-cart.context.d.ts +11 -0
  139. package/build/es/src/ecom-v1-cart-current-cart.context.js +92 -0
  140. package/build/es/src/ecom-v1-cart-current-cart.context.js.map +1 -0
  141. package/build/es/src/ecom-v1-cart-current-cart.http.d.ts +2 -2
  142. package/build/es/src/ecom-v1-cart-current-cart.http.js +2 -2
  143. package/build/es/src/ecom-v1-cart-current-cart.types.d.ts +0 -2
  144. package/build/es/src/ecom-v1-cart-current-cart.types.js.map +1 -1
  145. package/build/es/src/ecom-v1-cart-current-cart.universal.d.ts +13 -3
  146. package/build/es/src/ecom-v1-cart-current-cart.universal.js +13 -1
  147. package/build/es/src/ecom-v1-cart-current-cart.universal.js.map +1 -1
  148. package/build/es/src/ecom-v1-checkout-checkout.context.d.ts +14 -0
  149. package/build/es/src/ecom-v1-checkout-checkout.context.js +122 -0
  150. package/build/es/src/ecom-v1-checkout-checkout.context.js.map +1 -0
  151. package/build/es/src/ecom-v1-checkout-checkout.types.d.ts +0 -2
  152. package/build/es/src/ecom-v1-checkout-checkout.types.js.map +1 -1
  153. package/build/es/src/ecom-v1-checkout-checkout.universal.d.ts +0 -2
  154. package/build/es/src/ecom-v1-checkout-checkout.universal.js.map +1 -1
  155. package/build/es/src/ecom-v1-checkout-settings.context.d.ts +4 -0
  156. package/build/es/src/ecom-v1-checkout-settings.context.js +22 -0
  157. package/build/es/src/ecom-v1-checkout-settings.context.js.map +1 -0
  158. package/build/es/src/ecom-v1-checkout-settings.public.d.ts +1 -1
  159. package/build/es/src/ecom-v1-checkout-settings.types.d.ts +48 -8
  160. package/build/es/src/ecom-v1-checkout-settings.universal.d.ts +50 -9
  161. package/build/es/src/ecom-v1-checkout-settings.universal.js.map +1 -1
  162. package/build/es/src/ecom-v1-checkout-template.context.d.ts +8 -0
  163. package/build/es/src/ecom-v1-checkout-template.context.js +62 -0
  164. package/build/es/src/ecom-v1-checkout-template.context.js.map +1 -0
  165. package/build/es/src/ecom-v1-checkout-template.types.d.ts +0 -2
  166. package/build/es/src/ecom-v1-checkout-template.types.js.map +1 -1
  167. package/build/es/src/ecom-v1-checkout-template.universal.d.ts +12 -2
  168. package/build/es/src/ecom-v1-checkout-template.universal.js +12 -0
  169. package/build/es/src/ecom-v1-checkout-template.universal.js.map +1 -1
  170. package/build/es/src/ecom-v1-fulfillments.context.d.ts +8 -0
  171. package/build/es/src/ecom-v1-fulfillments.context.js +62 -0
  172. package/build/es/src/ecom-v1-fulfillments.context.js.map +1 -0
  173. package/build/es/src/ecom-v1-order-transactions.context.d.ts +7 -0
  174. package/build/es/src/ecom-v1-order-transactions.context.js +52 -0
  175. package/build/es/src/ecom-v1-order-transactions.context.js.map +1 -0
  176. package/build/es/src/ecom-v1-order-transactions.http.js +3 -25
  177. package/build/es/src/ecom-v1-order-transactions.http.js.map +1 -1
  178. package/build/es/src/ecom-v1-order.context.d.ts +7 -0
  179. package/build/es/src/ecom-v1-order.context.js +52 -0
  180. package/build/es/src/ecom-v1-order.context.js.map +1 -0
  181. package/build/es/src/ecom-v1-order.http.js +6 -16
  182. package/build/es/src/ecom-v1-order.http.js.map +1 -1
  183. package/build/es/src/ecom-v1-order.public.d.ts +26 -2
  184. package/build/es/src/ecom-v1-order.public.js +1 -1
  185. package/build/es/src/ecom-v1-order.public.js.map +1 -1
  186. package/build/es/src/ecom-v1-order.types.d.ts +1063 -996
  187. package/build/es/src/ecom-v1-order.types.js +60 -60
  188. package/build/es/src/ecom-v1-order.types.js.map +1 -1
  189. package/build/es/src/ecom-v1-order.universal.d.ts +1066 -997
  190. package/build/es/src/ecom-v1-order.universal.js +60 -60
  191. package/build/es/src/ecom-v1-order.universal.js.map +1 -1
  192. package/build/es/src/ecom-v1-orders-settings.context.d.ts +4 -0
  193. package/build/es/src/ecom-v1-orders-settings.context.js +22 -0
  194. package/build/es/src/ecom-v1-orders-settings.context.js.map +1 -0
  195. package/package.json +2 -2
@@ -126,6 +126,8 @@ export interface Order {
126
126
  * + No shipping option is selected.
127
127
  */
128
128
  recipientInfo?: AddressWithContact;
129
+ /** Tag ids collections associated with current entity. private_tags requires separate permissions to be accessible and modifiable. */
130
+ tags?: Tags;
129
131
  }
130
132
  export interface OrderLineItem {
131
133
  /** Line item ID. */
@@ -1075,6 +1077,38 @@ export interface ExtendedFields {
1075
1077
  */
1076
1078
  namespaces?: Record<string, Record<string, any>>;
1077
1079
  }
1080
+ /**
1081
+ * Common object for tags.
1082
+ * Should be use as in this example:
1083
+ * message Foo {
1084
+ * string id = 1;
1085
+ * ...
1086
+ * Tags tags = 5
1087
+ * }
1088
+ *
1089
+ * example of taggable entity
1090
+ * {
1091
+ * id: "123"
1092
+ * tags: {
1093
+ * tags: {
1094
+ * tag_ids:["11","22"]
1095
+ * },
1096
+ * private_tags: {
1097
+ * tag_ids: ["33", "44"]
1098
+ * }
1099
+ * }
1100
+ * }
1101
+ */
1102
+ export interface Tags {
1103
+ /** Tags that require an additional permission in order to access them, normally not given to site members or visitors. */
1104
+ privateTags?: TagList;
1105
+ /** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */
1106
+ tags?: TagList;
1107
+ }
1108
+ export interface TagList {
1109
+ /** List of tag IDs */
1110
+ tagIds?: string[];
1111
+ }
1078
1112
  export interface TriggerReindexWithConsistencyRequest {
1079
1113
  metasiteId?: string;
1080
1114
  orderId?: string;
@@ -1970,827 +2004,645 @@ export interface PreviewResendDownloadLinksEmailRequest {
1970
2004
  export interface PreviewResendDownloadLinksEmailResponse {
1971
2005
  emailPreview?: string;
1972
2006
  }
1973
- export interface InvoicePaidEvent {
1974
- _id?: IdAndVersion;
1975
- /** @readonly */
1976
- data?: InvoiceFields;
1977
- /** @readonly */
1978
- status?: InvoiceStatus;
1979
- }
1980
- export interface IdAndVersion {
1981
- _id?: string | null;
1982
- version?: number | null;
1983
- }
1984
- export interface InvoiceFields {
1985
- /** The invoice number allocated the invoice by the server. The number is limited to at most 11 digits. */
1986
- number?: string | null;
1987
- /** The invoice 3-letter currency code in [ISO-4217 alphabetic](https://www.iso.org/iso-4217-currency-codes.html) format. */
1988
- currencyCode?: string | null;
1989
- /** The invoice customer. The customer must be a contact of the site, with an email. */
1990
- customer?: Customer;
1991
- /**
1992
- * Invoice dates: issue date and due date are mandatory and provided when the invoice is created.
1993
- * Last seen date is the optional date when the invoice was last seen be UoU.
1994
- */
1995
- dates?: InvoiceDates;
1996
- /**
1997
- * Line items containing the details of the products or services relevant to the invoice, with their name, prices,
1998
- * and quantity. There must be at least one line item on the invoice.
1999
- */
2000
- lineItems?: LineItems;
2001
- /**
2002
- * Locale of the invoice, containing the language.
2003
- * This field is not mandatory but is used for display purposes, to determine the appearance of numbers and dates
2004
- * on the invoice.
2005
- */
2006
- locale?: Locale;
2007
- /**
2008
- * The totals on the invoice.
2009
- * The totals.subtotal, totals.total and totals.taxed_amount are calculated by the server based on the line items.
2010
- * Alternatively, these fields can be provided in the invoice creation request, in this case, these values are fixed.
2011
- * The totals contain fees and a discount, that apply to the invoice.
2012
- */
2013
- totals?: TotalPrice;
2014
- /** An optional discount on the invoice. */
2015
- discount?: Discount;
2016
- /** The taxes of the invoice. */
2017
- taxes?: CalculatedTaxes;
2018
- /** The payments on the invoice. The invoice has status paid if its payments cover the invoice total. */
2019
- payments?: Payments;
2020
- /** Invoice metadata */
2021
- metaData?: MetaData;
2022
- /** Not used */
2023
- creationAdditional_BIInformation?: string | null;
2007
+ export interface PreparePaymentCollectionRequest {
2008
+ /** Ecom order ID. */
2009
+ ecomOrderId?: string;
2010
+ /** Amount to collect */
2011
+ amount?: Price;
2024
2012
  /**
2025
- * The balance and amount paid on the invoice.
2026
- * This read-only field is calculated based on the invoice totals and payments.
2027
- * @readonly
2013
+ * Optional parameter. When present, payment collection will be performed using given payment gateway order.
2014
+ * Existing payment gateway order will be updated with a new amount.
2015
+ * When parameter is absent, new payment gateway order will be created and used for payment collection.
2028
2016
  */
2029
- dynamicTotals?: InvoiceDynamicPriceTotals;
2030
- /** The invoice title */
2031
- title?: string | null;
2032
- /** Invoice custom fields */
2033
- customFields?: CustomFieldValue[];
2034
- /** Not used */
2035
- designTemplateId?: string | null;
2036
- /** Not used */
2037
- createOrder?: boolean | null;
2038
- /** The optional deposit of the invoice */
2039
- deposit?: Deposit;
2040
- /** associated checkout for this invoice */
2041
- ecomCheckoutId?: string | null;
2042
- }
2043
- export interface Customer {
2044
- contactId?: string | null;
2045
- name?: string | null;
2046
- email?: Email;
2047
- address?: QuotesAddress;
2048
- phone?: Phone;
2049
- company?: Company;
2050
- firstName?: string | null;
2051
- lastName?: string | null;
2052
- billingAddress?: CommonAddress;
2053
- shippingAddress?: CommonAddress;
2017
+ paymentGatewayOrderId?: string | null;
2054
2018
  }
2055
- export interface Email {
2056
- address?: string;
2019
+ export interface PreparePaymentCollectionResponse {
2020
+ /** Payment gateway order id which is associated with given payment */
2021
+ paymentGatewayOrderId?: string;
2057
2022
  }
2058
- export interface QuotesAddress {
2059
- street?: string | null;
2060
- city?: string | null;
2061
- zip?: string | null;
2062
- state?: string | null;
2063
- country?: string | null;
2064
- /** @readonly */
2065
- description?: AddressDescription;
2023
+ export interface GetPaymentCollectabilityStatusRequest {
2024
+ /** Ecom order ID. */
2025
+ ecomOrderId?: string;
2066
2026
  }
2067
- export interface AddressDescription {
2068
- content?: string;
2069
- placement?: Placement;
2027
+ export interface GetPaymentCollectabilityStatusResponse {
2028
+ /** Payment collectability status */
2029
+ status?: PaymentCollectabilityStatus;
2030
+ /** Collectable order amount */
2031
+ amount?: Price;
2070
2032
  }
2071
- export declare enum Placement {
2072
- Unknown = "Unknown",
2073
- Replace = "Replace",
2074
- Before = "Before",
2075
- After = "After"
2033
+ export declare enum PaymentCollectabilityStatus {
2034
+ UNKNOWN = "UNKNOWN",
2035
+ COLLECTABLE = "COLLECTABLE",
2036
+ NONCOLLECTABLE_ORDER_IS_CANCELLED = "NONCOLLECTABLE_ORDER_IS_CANCELLED",
2037
+ NONCOLLECTABLE_ORDER_IS_PAID = "NONCOLLECTABLE_ORDER_IS_PAID",
2038
+ NONCOLLECTABLE_MISSING_PAYMENT_METHOD = "NONCOLLECTABLE_MISSING_PAYMENT_METHOD"
2076
2039
  }
2077
- export interface Phone {
2078
- number?: string;
2040
+ export interface RecordManuallyCollectedPaymentRequest {
2041
+ /** Order ID. */
2042
+ orderId?: string;
2043
+ /** Amount to be recorded as approved manual payment for given order */
2044
+ amount?: Price;
2079
2045
  }
2080
- export interface Company {
2081
- name?: string;
2082
- _id?: string | null;
2046
+ export interface RecordManuallyCollectedPaymentResponse {
2083
2047
  }
2084
- /** Physical address */
2085
- export interface CommonAddress extends CommonAddressStreetOneOf {
2086
- /** Street name and number. */
2087
- streetAddress?: StreetAddress;
2088
- /** Main address line, usually street and number as free text. */
2089
- addressLine1?: string | null;
2090
- /** Country code. */
2091
- country?: string | null;
2092
- /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
2093
- subdivision?: string | null;
2094
- /** City name. */
2095
- city?: string | null;
2096
- /** Zip/postal code. */
2097
- postalCode?: string | null;
2098
- /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
2099
- addressLine2?: string | null;
2048
+ export interface V1MarkOrderAsPaidRequest {
2049
+ /** Ecom order ID. */
2050
+ ecomOrderId?: string;
2100
2051
  }
2101
- /** @oneof */
2102
- export interface CommonAddressStreetOneOf {
2103
- /** Street name and number. */
2104
- streetAddress?: StreetAddress;
2105
- /** Main address line, usually street and number as free text. */
2106
- addressLine?: string | null;
2052
+ export interface V1MarkOrderAsPaidResponse {
2053
+ /** Updated order. */
2054
+ order?: Order;
2107
2055
  }
2108
- export interface Subdivision {
2109
- /** Short subdivision code. */
2110
- code?: string;
2111
- /** Subdivision full name. */
2112
- name?: string;
2056
+ /** Triggered when the payment status of an order is updated */
2057
+ export interface PaymentStatusUpdated {
2058
+ /** The order that was updated */
2059
+ order?: Order;
2060
+ /** The previous status (before the update) */
2061
+ previousPaymentStatus?: PaymentStatus;
2113
2062
  }
2114
- export declare enum SubdivisionType {
2115
- UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
2116
- /** State */
2117
- ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
2118
- /** County */
2119
- ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
2120
- /** City/town */
2121
- ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
2122
- /** Neighborhood/quarter */
2123
- ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
2124
- /** Street/block */
2125
- ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
2126
- /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
2127
- COUNTRY = "COUNTRY"
2063
+ export interface V1BulkMarkOrdersAsPaidRequest {
2064
+ /** IDs of orders to mark as paid. */
2065
+ ecomOrderIds?: string[];
2128
2066
  }
2129
- export interface InvoiceDates {
2130
- /** use UTC midnight date to set the issue date according to the site time zone */
2131
- issueDate?: Date;
2132
- /** use UTC midnight date to set the due date according to the site time zone */
2133
- dueDate?: Date;
2134
- /** <a href="http://joda-time.sourceforge.net/timezones.html">Valid time zones</a> */
2135
- timeZoneCode?: string | null;
2067
+ export interface V1BulkMarkOrdersAsPaidResponse {
2136
2068
  /**
2137
- * ignored in request use in response to get the site time zone
2138
- * @readonly
2069
+ * Items updated by the bulk action.
2070
+ * The Order entity within the results optimistically changes its payment status to paid, however this process is async.
2139
2071
  */
2140
- lastSeenDate?: Date;
2141
- }
2142
- export interface LineItems {
2143
- lineItems?: LineItem[];
2072
+ results?: BulkOrderResult[];
2073
+ /** Bulk action metadata. */
2074
+ bulkActionMetadata?: BulkActionMetadata;
2144
2075
  }
2145
- export interface LineItem {
2146
- _id?: string;
2147
- name?: string;
2148
- description?: string | null;
2149
- price?: BigDecimalWrapper;
2150
- taxedTotal?: BigDecimalWrapper;
2151
- quantity?: BigDecimalWrapper;
2152
- taxes?: LineItemTax[];
2153
- /** The source of the line item */
2154
- source?: Source;
2155
- /** The line-item level metadata. */
2156
- metadata?: LineItemMetaData;
2076
+ export interface BulkOrderResult {
2077
+ /** Item metadata. */
2078
+ itemMetadata?: ItemMetadata;
2079
+ /** Updated item. Optional - returned only if requested with `return_full_entity` set to `true`. */
2080
+ item?: Order;
2157
2081
  }
2158
- export interface BigDecimalWrapper {
2159
- serializedValue?: number;
2082
+ export interface ItemMetadata {
2083
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
2084
+ _id?: string | null;
2085
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
2086
+ originalIndex?: number;
2087
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2088
+ success?: boolean;
2089
+ /** Details about the error in case of failure. */
2090
+ error?: ApplicationError;
2160
2091
  }
2161
- export interface LineItemTax {
2162
- name?: string;
2163
- rate?: BigDecimalWrapper;
2164
- code?: string | null;
2092
+ export interface ApplicationError {
2093
+ /** Error code. */
2094
+ code?: string;
2095
+ /** Description of the error. */
2096
+ description?: string;
2097
+ /** Data related to the error. */
2098
+ data?: Record<string, any> | null;
2165
2099
  }
2166
- export interface Source {
2167
- /**
2168
- * Source app or service ID.
2169
- * @readonly
2170
- */
2171
- sourceId?: string;
2172
- /**
2173
- * App or service type.
2174
- * @readonly
2175
- */
2176
- sourceType?: SourceType;
2100
+ export interface BulkActionMetadata {
2101
+ /** Number of items that were successfully processed. */
2102
+ totalSuccesses?: number;
2103
+ /** Number of items that couldn't be processed. */
2104
+ totalFailures?: number;
2105
+ /** Number of failures without details because detailed failure threshold was exceeded. */
2106
+ undetailedFailures?: number;
2177
2107
  }
2178
- export declare enum SourceType {
2179
- UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
2180
- WIX_APP = "WIX_APP",
2181
- EXTERNAL = "EXTERNAL",
2182
- ADMIN = "ADMIN",
2183
- OTHER = "OTHER"
2108
+ export interface GetRefundabilityStatusRequest {
2109
+ /** Order ID. */
2110
+ ecomOrderId?: string;
2184
2111
  }
2185
- export interface LineItemMetaData {
2186
- metadata?: Record<string, string>;
2112
+ export interface GetRefundabilityStatusResponse {
2113
+ /** Refundability details. */
2114
+ refundabilities?: Refundability[];
2115
+ /** Whether the order supports refunding per item. */
2116
+ refundablePerItem?: boolean;
2187
2117
  }
2188
- export interface Locale {
2189
- /** ISO 639 alpha-2 or alpha-3 language code, or a language subtag */
2190
- language?: string;
2191
- /** An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. */
2192
- country?: string | null;
2193
- invariant?: string | null;
2118
+ export interface Refundability extends RefundabilityAdditionalRefundabilityInfoOneOf {
2119
+ /** Reason why payment is not refundable. */
2120
+ nonRefundableReason?: NonRefundableReason;
2121
+ /** Reason why payment is only refundable manually. */
2122
+ manuallyRefundableReason?: ManuallyRefundableReason;
2123
+ /** Payment ID. */
2124
+ paymentId?: string;
2125
+ /** Payment refundability status. */
2126
+ refundabilityStatus?: RefundableStatus;
2127
+ /** Link to payment provider dashboard. */
2128
+ providerLink?: string | null;
2194
2129
  }
2195
- export interface TotalPrice {
2196
- /** the subtotal of the line items without the tax reduction */
2197
- subtotal?: BigDecimalWrapper;
2198
- /** the total price taking into account the itemized fees and the taxes */
2199
- total?: BigDecimalWrapper;
2200
- fees?: ItemizedFee[];
2201
- discountAmount?: BigDecimalWrapper;
2202
- taxedAmount?: BigDecimalWrapper;
2130
+ /** @oneof */
2131
+ export interface RefundabilityAdditionalRefundabilityInfoOneOf {
2132
+ /** Reason why payment is not refundable. */
2133
+ nonRefundableReason?: NonRefundableReason;
2134
+ /** Reason why payment is only refundable manually. */
2135
+ manuallyRefundableReason?: ManuallyRefundableReason;
2203
2136
  }
2204
- export interface ItemizedFee {
2205
- name?: string;
2206
- price?: BigDecimalWrapper;
2137
+ export declare enum RefundableStatus {
2138
+ NOT_REFUNDABLE = "NOT_REFUNDABLE",
2139
+ MANUAL = "MANUAL",
2140
+ REFUNDABLE = "REFUNDABLE"
2207
2141
  }
2208
- export interface Discount extends DiscountOneDiscountTypeOneOf {
2209
- /** Discount as percentage value. */
2210
- percentage?: BigDecimalWrapper;
2142
+ export declare enum NonRefundableReason {
2143
+ NONE = "NONE",
2144
+ ALREADY_REFUNDED = "ALREADY_REFUNDED",
2145
+ PROVIDER_IS_DOWN = "PROVIDER_IS_DOWN",
2146
+ INTERNAL_ERROR = "INTERNAL_ERROR",
2147
+ NOT_PAID = "NOT_PAID",
2148
+ ACCESS_DENIED = "ACCESS_DENIED",
2149
+ ZERO_PRICE = "ZERO_PRICE",
2150
+ DISABLED_BY_PROVIDER = "DISABLED_BY_PROVIDER",
2151
+ PENDING_REFUND = "PENDING_REFUND",
2152
+ FORBIDDEN = "FORBIDDEN",
2153
+ TRANSACTION_NOT_FOUND = "TRANSACTION_NOT_FOUND"
2211
2154
  }
2212
- /** @oneof */
2213
- export interface DiscountOneDiscountTypeOneOf {
2214
- /** Discount as percentage value. */
2215
- percentage?: BigDecimalWrapper;
2155
+ export declare enum ManuallyRefundableReason {
2156
+ EXPIRED = "EXPIRED",
2157
+ NOT_SUPPORTED = "NOT_SUPPORTED",
2158
+ OFFLINE = "OFFLINE"
2216
2159
  }
2217
- export interface CalculatedTaxes {
2218
- /** consider calculated or not - cannot enforce set */
2219
- taxes?: CalculatedTax[];
2160
+ export interface V1CreatePaymentGatewayOrderRequest {
2161
+ /** Ecom order ID. */
2162
+ ecomOrderId?: string;
2163
+ /** Information about the user who initiated the payment. */
2164
+ chargedBy?: ChargedBy;
2220
2165
  }
2221
- export interface CalculatedTax {
2222
- name?: string;
2223
- rate?: BigDecimalWrapper;
2224
- /** the costs on which the taxes are applied */
2225
- taxable?: BigDecimalWrapper;
2226
- /** the taxes as a result of the */
2227
- taxed?: BigDecimalWrapper;
2228
- code?: string | null;
2166
+ export interface ChargedBy {
2167
+ /** ID - id of the user who initiated the payment */
2168
+ _id?: string;
2169
+ /** Full name - name of the user who initiated the payment */
2170
+ fullName?: string | null;
2229
2171
  }
2230
- export interface Payments {
2231
- payments?: Payment[];
2172
+ export interface V1CreatePaymentGatewayOrderResponse {
2173
+ /** ID of the order created in the payment gateway */
2174
+ paymentGatewayOrderId?: string;
2232
2175
  }
2233
- export interface Payment {
2234
- /** document */
2235
- _id?: string;
2236
- type?: string;
2237
- amount?: BigDecimalWrapper;
2238
- date?: Date;
2176
+ export interface ChargeMembershipsRequest {
2177
+ /** Order ID. */
2178
+ ecomOrderId?: string;
2239
2179
  /**
2240
- * The orderId of the order in cashier associated with the payment.
2241
- * This field is populated for external payments that are charged by invoices via AddPayment endpoint.
2180
+ * The member id. Do not attempt to get it from the request context, since in some cases the caller is not a member
2181
+ * but a user which is using the membership on behalf of the a member
2242
2182
  */
2243
- orderId?: string | null;
2183
+ memberId?: string;
2184
+ /** List of items to be paid by memberships */
2185
+ membershipCharges?: MembershipChargeItem[];
2186
+ }
2187
+ export interface MembershipChargeItem {
2188
+ /** The id of used membership */
2189
+ membershipId?: string;
2190
+ /** ID of the application providing this payment option */
2191
+ appId?: string;
2192
+ /** The name of used membership */
2193
+ membershipName?: MembershipName;
2194
+ /** Additional data about this membership */
2195
+ membershipAdditionalData?: Record<string, any> | null;
2196
+ /** Catalog and item reference info. */
2197
+ catalogReference?: CatalogReference;
2198
+ /** Properties of the service. When relevant, contains information such as date and number of participants. */
2199
+ serviceProperties?: ServiceProperties;
2244
2200
  /**
2245
- * The transactionId corresponding to the orderId of the payment which are returned by cashier.
2246
- * This field is populated for external payments that are charged by invoices via AddPayment endpoint as well.
2201
+ * Usually would be the same as catalogReference.catalogItemId
2202
+ * For cases when these are not the same, this field would return the actual id of the item in the catalog
2203
+ * For example, for Wix bookings, catalogReference.catalogItemId is the booking id, and this value is being set to be the service id
2247
2204
  */
2248
- transactionId?: string | null;
2249
- }
2250
- export interface MetaData {
2251
- notes?: string | null;
2252
- legalTerms?: string | null;
2253
- sourceUrl?: string | null;
2254
- sourceProperties?: Record<string, string>;
2255
- source?: string | null;
2256
- sourceRefId?: string | null;
2257
- /** Optional indicator whether to allow editing of the invoice by other applications other than the source. Default is true. */
2258
- allowEditByOthers?: boolean | null;
2259
- }
2260
- export interface InvoiceDynamicPriceTotals {
2261
- paidAmount?: BigDecimalWrapper;
2262
- balance?: BigDecimalWrapper;
2205
+ rootCatalogItemId?: string | null;
2206
+ /** line item id of Checkout/Order line item */
2207
+ lineItemId?: string;
2263
2208
  }
2264
- /**
2265
- * A custom field value is used to add additional data to a financial document or to a financial document template.
2266
- * The custom field value may be based on a custom field definition.
2267
- */
2268
- export interface CustomFieldValue {
2209
+ export interface ServiceProperties {
2269
2210
  /**
2270
- * The unique id of the custom field value
2271
- * @readonly
2211
+ * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
2212
+ * For example, the start time of a class.
2272
2213
  */
2273
- _id?: string | null;
2274
- /** The display name of the custom field value */
2275
- displayName?: string;
2276
- /** The optional namespace of the custom field value. This field may be used to indicate intended usage or source. */
2277
- namespace?: string | null;
2278
- /** The group of the custom field indicates its intended placement in the financial document */
2279
- group?: CustomFieldGroup;
2280
- /** The value of the custom field */
2281
- value?: Value;
2282
- /** The optional key of the custom field definition on which the custom field value is based */
2283
- originCustomFieldKey?: string | null;
2284
- }
2285
- export declare enum CustomFieldGroup {
2286
- UNKNOWN_CUSTOM_FIELD_GROUP = "UNKNOWN_CUSTOM_FIELD_GROUP",
2287
- BUSINESS_DETAILS = "BUSINESS_DETAILS",
2288
- CUSTOMER_DETAILS = "CUSTOMER_DETAILS",
2289
- DOCUMENT = "DOCUMENT",
2290
- FOOTER = "FOOTER",
2291
- OTHER = "OTHER"
2214
+ scheduledDate?: Date;
2215
+ /** The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room. */
2216
+ numberOfParticipants?: number | null;
2292
2217
  }
2293
- export interface Value {
2294
- value?: string;
2295
- valueType?: ValueType;
2218
+ export interface ChargeMembershipsResponse {
2296
2219
  }
2297
- export declare enum ValueType {
2298
- UNKNOWN_VALUE_TYPE = "UNKNOWN_VALUE_TYPE",
2299
- STRING = "STRING",
2300
- DATE = "DATE",
2301
- BOOLEAN = "BOOLEAN",
2302
- NUMBER = "NUMBER"
2220
+ export interface TriggerRefundRequest {
2221
+ /** The order this refund related to */
2222
+ ecomOrderId?: string;
2223
+ /** Refund operations information */
2224
+ payments?: PaymentRefund[];
2225
+ /** Business model of a refund */
2226
+ details?: RefundDetails;
2227
+ /** Side effect details related to refund */
2228
+ sideEffects?: RefundSideEffects;
2303
2229
  }
2304
- export interface Deposit {
2305
- /** The flat amount of the deposit. The flat amount of the deposit must be less than the invoice total. */
2306
- flatAmount?: string;
2230
+ export interface PaymentRefund {
2231
+ /** Specific payment within the order to refund */
2232
+ paymentId?: string;
2233
+ /** Refund amount. Not relevant for membership refunds. */
2234
+ amount?: Price;
2307
2235
  /**
2308
- * The read-only percentage value of the deposit.
2309
- * It is computed according to the flat_amount and the invoice total and is rounded to 2 digits precision.
2310
- * @readonly
2236
+ * Whether refund is made externally and manually (on the payment provider's side)
2237
+ * When false (default), the payment gateway will be called in order to make an actual refund, and then the payment will be marked as refunded.
2238
+ * When true, the payment will only be *marked* as refunded, and no actual refund will be performed.
2311
2239
  */
2312
- percentage?: string;
2313
- /** The type of the deposit. The default is FLAT. */
2314
- type?: DepositType;
2240
+ externalRefund?: boolean;
2315
2241
  }
2316
- export declare enum DepositType {
2317
- UNKNOWN = "UNKNOWN",
2318
- FLAT = "FLAT",
2319
- PERCENTAGE = "PERCENTAGE"
2242
+ export interface RefundSideEffects {
2243
+ /** Inventory restock details as part of this refund. */
2244
+ restockInfo?: RestockInfo;
2245
+ /** Whether to send a refund confirmation email to the customer. */
2246
+ sendOrderRefundedEmail?: boolean;
2247
+ /** Custom message added to the refund confirmation email. */
2248
+ customMessage?: string | null;
2320
2249
  }
2321
- /**
2322
- * InvoiceStatus allowed transitions based on current status:
2323
- * Draft -> Deleted, Paid, Partially Paid, Sent
2324
- * Sent -> Draft, Deleted, Void, Paid, Partially Paid, Processing, (Overdue)
2325
- * Processing -> PartiallyPaid, Paid, Sent
2326
- * Paid -> Void
2327
- * PartiallyPaid -> Void, (PartialAndOverdue)
2328
- * Void -> Deleted
2329
- * Deleted
2330
- */
2331
- export declare enum InvoiceStatus {
2332
- Draft = "Draft",
2333
- Sent = "Sent",
2334
- Processing = "Processing",
2335
- Paid = "Paid",
2336
- Overdue = "Overdue",
2337
- Void = "Void",
2338
- Deleted = "Deleted",
2339
- PartiallyPaid = "PartiallyPaid",
2340
- PartialAndOverdue = "PartialAndOverdue"
2250
+ export interface RestockInfo {
2251
+ /** Restock type. */
2252
+ type?: RestockType;
2253
+ /** Restocked line items and quantities. Only relevant for `{"type": "SOME_ITEMS"}`. */
2254
+ items?: V1RestockItem[];
2341
2255
  }
2342
- export interface PreparePaymentCollectionRequest {
2343
- /** Ecom order ID. */
2344
- ecomOrderId?: string;
2345
- /** Amount to collect */
2346
- amount?: Price;
2347
- /**
2348
- * Optional parameter. When present, payment collection will be performed using given payment gateway order.
2349
- * Existing payment gateway order will be updated with a new amount.
2350
- * When parameter is absent, new payment gateway order will be created and used for payment collection.
2351
- */
2352
- paymentGatewayOrderId?: string | null;
2256
+ export declare enum RestockType {
2257
+ NO_ITEMS = "NO_ITEMS",
2258
+ ALL_ITEMS = "ALL_ITEMS",
2259
+ SOME_ITEMS = "SOME_ITEMS"
2353
2260
  }
2354
- export interface PreparePaymentCollectionResponse {
2355
- /** Payment gateway order id which is associated with given payment */
2356
- paymentGatewayOrderId?: string;
2261
+ export interface V1RestockItem {
2262
+ /** ID of the line item being restocked. */
2263
+ lineItemId?: string;
2264
+ /** Line item quantity being restocked. */
2265
+ quantity?: number;
2357
2266
  }
2358
- export interface GetPaymentCollectabilityStatusRequest {
2359
- /** Ecom order ID. */
2267
+ export interface TriggerRefundResponse {
2268
+ /** All order's transactions after the refunds were added */
2269
+ orderTransactions?: OrderTransactions;
2270
+ /** Created refund ID */
2271
+ refundId?: string | null;
2272
+ /** Payment ID's that the refund execution had failed for */
2273
+ failedPaymentIds?: ItemMetadata[];
2274
+ }
2275
+ /** Triggered when a refund is created. */
2276
+ export interface RefundCreated {
2277
+ /** Updated order transactions. */
2278
+ orderTransactions?: OrderTransactions;
2279
+ /** ID of the created refund. */
2280
+ refundId?: string;
2281
+ /** Inventory restock details as part of this refund.. */
2282
+ restockInfo?: RestockInfo;
2283
+ /** Whether to send a refund confirmation email to the customer. */
2284
+ sendOrderRefundedEmail?: boolean;
2285
+ /** Custom message added to the refund confirmation email. */
2286
+ customMessage?: string | null;
2287
+ /** Refunded line items and quantities that are part of the created refund. */
2288
+ refundItems?: RefundItem[];
2289
+ }
2290
+ export interface CalculateRefundRequest {
2291
+ /** Order ID */
2360
2292
  ecomOrderId?: string;
2293
+ /** Refunded line items and quantity */
2294
+ refundItems?: CalculateRefundItemRequest[];
2295
+ /** Should include shipping in refund calculation */
2296
+ refundShipping?: boolean;
2361
2297
  }
2362
- export interface GetPaymentCollectabilityStatusResponse {
2363
- /** Payment collectability status */
2364
- status?: PaymentCollectabilityStatus;
2365
- /** Collectable order amount */
2366
- amount?: Price;
2298
+ export interface CalculateRefundItemRequest {
2299
+ /** ID of the line item being refunded */
2300
+ _id?: string;
2301
+ /** How much of that line item is being refunded */
2302
+ quantity?: number;
2367
2303
  }
2368
- export declare enum PaymentCollectabilityStatus {
2369
- UNKNOWN = "UNKNOWN",
2370
- COLLECTABLE = "COLLECTABLE",
2371
- NONCOLLECTABLE_ORDER_IS_CANCELLED = "NONCOLLECTABLE_ORDER_IS_CANCELLED",
2372
- NONCOLLECTABLE_ORDER_IS_PAID = "NONCOLLECTABLE_ORDER_IS_PAID",
2373
- NONCOLLECTABLE_MISSING_PAYMENT_METHOD = "NONCOLLECTABLE_MISSING_PAYMENT_METHOD"
2304
+ export interface CalculateRefundResponse {
2305
+ /** Total refundable amount */
2306
+ total?: Price;
2307
+ /** Tax cost of the order */
2308
+ tax?: Price;
2309
+ /** Discount given for this order */
2310
+ discount?: Price;
2311
+ /** Total cost of the order (without tax) */
2312
+ subtotal?: Price;
2313
+ /** Total shipping cost for order */
2314
+ shipping?: Price;
2315
+ /** Previous refund given on that order */
2316
+ previouslyRefundedAmount?: Price;
2317
+ /** The refundable items of that order */
2318
+ items?: CalculateRefundItemResponse[];
2374
2319
  }
2375
- export interface RecordManuallyCollectedPaymentRequest {
2376
- /** Order ID. */
2320
+ export interface CalculateRefundItemResponse {
2321
+ /** Line item ID */
2322
+ _id?: string;
2323
+ /** Refundable amount for requested quantity of items (price of requested quantity of items without tax and discount) */
2324
+ price?: Price;
2325
+ }
2326
+ export interface DiffmatokyPayload {
2327
+ left?: string;
2328
+ right?: string;
2329
+ compareChannel?: string;
2330
+ entityId?: string;
2331
+ errorInformation?: ErrorInformation;
2332
+ tags?: string[];
2333
+ }
2334
+ export interface ErrorInformation {
2335
+ stackTrace?: string;
2336
+ }
2337
+ export interface ContinueSideEffectsFlowInLegacyData {
2338
+ storeId?: string;
2377
2339
  orderId?: string;
2378
- /** Amount to be recorded as approved manual payment for given order */
2379
- amount?: Price;
2340
+ ordersExperiments?: OrdersExperiments;
2380
2341
  }
2381
- export interface RecordManuallyCollectedPaymentResponse {
2342
+ export interface OrdersExperiments {
2343
+ epCommitTax?: boolean;
2344
+ moveMerchantEmailToEp?: boolean;
2345
+ moveBuyerOrderConfirmationEmailToEp?: boolean;
2346
+ producedByEpBridge?: boolean;
2347
+ enableRewrittenSideEffects?: boolean;
2382
2348
  }
2383
- export interface V1MarkOrderAsPaidRequest {
2384
- /** Ecom order ID. */
2385
- ecomOrderId?: string;
2349
+ export interface IndexingMessage {
2350
+ _id?: string;
2351
+ opType?: number;
2352
+ requiredVersions?: string[];
2386
2353
  }
2387
- export interface V1MarkOrderAsPaidResponse {
2388
- /** Updated order. */
2389
- order?: Order;
2354
+ export interface GetOrderRequest {
2355
+ /** ID of the order to retrieve. */
2356
+ _id: string;
2390
2357
  }
2391
- /** Triggered when the payment status of an order is updated */
2392
- export interface PaymentStatusUpdated {
2393
- /** The order that was updated */
2358
+ export interface GetOrderResponse {
2359
+ /** The requested order. */
2394
2360
  order?: Order;
2395
- /** The previous status (before the update) */
2396
- previousPaymentStatus?: PaymentStatus;
2397
2361
  }
2398
- export interface V1BulkMarkOrdersAsPaidRequest {
2399
- /** IDs of orders to mark as paid. */
2400
- ecomOrderIds?: string[];
2362
+ export interface ListOrdersResponse {
2363
+ /** The requested order. */
2364
+ orders?: Order[];
2365
+ /** Details on the paged set of results returned. */
2366
+ pagingMetadata?: CursorPagingMetadata;
2401
2367
  }
2402
- export interface V1BulkMarkOrdersAsPaidResponse {
2403
- /**
2404
- * Items updated by the bulk action.
2405
- * The Order entity within the results optimistically changes its payment status to paid, however this process is async.
2406
- */
2407
- results?: BulkOrderResult[];
2408
- /** Bulk action metadata. */
2409
- bulkActionMetadata?: BulkActionMetadata;
2368
+ export interface InternalQueryOrdersResponse {
2369
+ /** List of orders. */
2370
+ orders?: Order[];
2371
+ /** Details on the paged set of results returned. */
2372
+ metadata?: PlatformPagingMetadata;
2410
2373
  }
2411
- export interface BulkOrderResult {
2412
- /** Item metadata. */
2413
- itemMetadata?: ItemMetadata;
2414
- /** Updated item. Optional - returned only if requested with `return_full_entity` set to `true`. */
2415
- item?: Order;
2374
+ export interface QueryOrderRequest {
2375
+ /** Query options. */
2376
+ query?: PlatformQuery;
2416
2377
  }
2417
- export interface ItemMetadata {
2418
- /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
2419
- _id?: string | null;
2420
- /** Index of the item within the request array. Allows for correlation between request and response items. */
2421
- originalIndex?: number;
2422
- /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
2423
- success?: boolean;
2424
- /** Details about the error in case of failure. */
2425
- error?: ApplicationError;
2378
+ export interface QueryOrderResponse {
2379
+ /** List of orders. */
2380
+ orders?: Order[];
2381
+ /** Details on the paged set of results returned. */
2382
+ metadata?: PlatformPagingMetadata;
2426
2383
  }
2427
- export interface ApplicationError {
2428
- /** Error code. */
2429
- code?: string;
2430
- /** Description of the error. */
2431
- description?: string;
2432
- /** Data related to the error. */
2433
- data?: Record<string, any> | null;
2384
+ export interface SearchOrdersRequest {
2385
+ /** Search options. */
2386
+ search?: CursorSearch;
2434
2387
  }
2435
- export interface BulkActionMetadata {
2436
- /** Number of items that were successfully processed. */
2437
- totalSuccesses?: number;
2438
- /** Number of items that couldn't be processed. */
2439
- totalFailures?: number;
2440
- /** Number of failures without details because detailed failure threshold was exceeded. */
2441
- undetailedFailures?: number;
2388
+ export interface CursorSearch extends CursorSearchPagingMethodOneOf {
2389
+ /** Cursor pointing to page of results. `cursorPaging.cursor` cannot be used with 'filter' or 'sort'. */
2390
+ cursorPaging?: CursorPaging;
2391
+ /**
2392
+ * Filter object.
2393
+ *
2394
+ * For example, the following `filter` object will only return orders with payment statuses of paid and/or partially paid:
2395
+ * `"filter": {"paymentStatus": {"$in": ["PAID", "PARTIALLY_PAID"]}}`
2396
+ *
2397
+ * Learn more about the filter format [here](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
2398
+ */
2399
+ filter?: Record<string, any> | null;
2400
+ /**
2401
+ * Array of sort objects that specify the order in which results should be sorted.
2402
+ *
2403
+ * For example, the following `sort` array will sort by `createdDate` in descending order:
2404
+ * `"sort": [{"fieldName": "createdDate", "order":"DESC"}]`.
2405
+ *
2406
+ * Learn more about the sort format [here](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
2407
+ */
2408
+ sort?: Sorting[];
2442
2409
  }
2443
- export interface GetRefundabilityStatusRequest {
2444
- /** Order ID. */
2445
- ecomOrderId?: string;
2410
+ /** @oneof */
2411
+ export interface CursorSearchPagingMethodOneOf {
2412
+ /** Cursor pointing to page of results. `cursorPaging.cursor` cannot be used with 'filter' or 'sort'. */
2413
+ cursorPaging?: CursorPaging;
2446
2414
  }
2447
- export interface GetRefundabilityStatusResponse {
2448
- /** Refundability details. */
2449
- refundabilities?: Refundability[];
2450
- /** Whether the order supports refunding per item. */
2451
- refundablePerItem?: boolean;
2415
+ export interface SearchOrdersResponse {
2416
+ /** List of orders. */
2417
+ orders?: Order[];
2418
+ /** Details on the paged set of results returned. */
2419
+ metadata?: CursorPagingMetadata;
2452
2420
  }
2453
- export interface Refundability extends RefundabilityAdditionalRefundabilityInfoOneOf {
2454
- /** Reason why payment is not refundable. */
2455
- nonRefundableReason?: NonRefundableReason;
2456
- /** Reason why payment is only refundable manually. */
2457
- manuallyRefundableReason?: ManuallyRefundableReason;
2458
- /** Payment ID. */
2459
- paymentId?: string;
2460
- /** Payment refundability status. */
2461
- refundabilityStatus?: RefundableStatus;
2462
- /** Link to payment provider dashboard. */
2463
- providerLink?: string | null;
2464
- }
2465
- /** @oneof */
2466
- export interface RefundabilityAdditionalRefundabilityInfoOneOf {
2467
- /** Reason why payment is not refundable. */
2468
- nonRefundableReason?: NonRefundableReason;
2469
- /** Reason why payment is only refundable manually. */
2470
- manuallyRefundableReason?: ManuallyRefundableReason;
2471
- }
2472
- export declare enum RefundableStatus {
2473
- NOT_REFUNDABLE = "NOT_REFUNDABLE",
2474
- MANUAL = "MANUAL",
2475
- REFUNDABLE = "REFUNDABLE"
2421
+ export interface CreateOrderRequest {
2422
+ /** Order info. */
2423
+ order: Order;
2476
2424
  }
2477
- export declare enum NonRefundableReason {
2478
- NONE = "NONE",
2479
- ALREADY_REFUNDED = "ALREADY_REFUNDED",
2480
- PROVIDER_IS_DOWN = "PROVIDER_IS_DOWN",
2481
- INTERNAL_ERROR = "INTERNAL_ERROR",
2482
- NOT_PAID = "NOT_PAID",
2483
- ACCESS_DENIED = "ACCESS_DENIED",
2484
- ZERO_PRICE = "ZERO_PRICE",
2485
- DISABLED_BY_PROVIDER = "DISABLED_BY_PROVIDER",
2486
- PENDING_REFUND = "PENDING_REFUND",
2487
- FORBIDDEN = "FORBIDDEN",
2488
- TRANSACTION_NOT_FOUND = "TRANSACTION_NOT_FOUND"
2425
+ export interface CreateOrderResponse {
2426
+ /** Newly created order. */
2427
+ order?: Order;
2489
2428
  }
2490
- export declare enum ManuallyRefundableReason {
2491
- EXPIRED = "EXPIRED",
2492
- NOT_SUPPORTED = "NOT_SUPPORTED",
2493
- OFFLINE = "OFFLINE"
2429
+ export interface UpdateOrderRequest {
2430
+ /** Order to be updated. */
2431
+ order: Order;
2494
2432
  }
2495
- export interface V1CreatePaymentGatewayOrderRequest {
2496
- /** Ecom order ID. */
2497
- ecomOrderId?: string;
2498
- /** Information about the user who initiated the payment. */
2499
- chargedBy?: ChargedBy;
2433
+ export interface UpdateOrderResponse {
2434
+ /** Newly created order. */
2435
+ order?: Order;
2500
2436
  }
2501
- export interface ChargedBy {
2502
- /** ID - id of the user who initiated the payment */
2437
+ export interface CommitDeltasRequest {
2438
+ /** Order id to be updated */
2503
2439
  _id?: string;
2504
- /** Full name - name of the user who initiated the payment */
2505
- fullName?: string | null;
2506
- }
2507
- export interface V1CreatePaymentGatewayOrderResponse {
2508
- /** ID of the order created in the payment gateway */
2509
- paymentGatewayOrderId?: string;
2510
- }
2511
- export interface ChargeMembershipsRequest {
2512
- /** Order ID. */
2513
- ecomOrderId?: string;
2514
2440
  /**
2515
- * The member id. Do not attempt to get it from the request context, since in some cases the caller is not a member
2516
- * but a user which is using the membership on behalf of the a member
2441
+ * Draft order Id representing this change.
2442
+ * Use this ID to get this specific draft content. call .../v1/draft-orders/{draft_order_id}/get
2517
2443
  */
2518
- memberId?: string;
2519
- /** List of items to be paid by memberships */
2520
- membershipCharges?: MembershipChargeItem[];
2444
+ draftOrderId?: string;
2445
+ /** Draft order changes to be applied */
2446
+ changes?: DraftOrderDiffs;
2447
+ /** Side-effects to happen after order is updated */
2448
+ commitSettings?: DraftOrderCommitSettings;
2449
+ /** Reason for edit, given by user (optional). */
2450
+ reason?: string | null;
2521
2451
  }
2522
- export interface MembershipChargeItem {
2523
- /** The id of used membership */
2524
- membershipId?: string;
2525
- /** ID of the application providing this payment option */
2526
- appId?: string;
2527
- /** The name of used membership */
2528
- membershipName?: MembershipName;
2529
- /** Additional data about this membership */
2530
- membershipAdditionalData?: Record<string, any> | null;
2531
- /** Catalog and item reference info. */
2532
- catalogReference?: CatalogReference;
2533
- /** Properties of the service. When relevant, contains information such as date and number of participants. */
2534
- serviceProperties?: ServiceProperties;
2452
+ export interface DraftOrderDiffs extends DraftOrderDiffsShippingUpdateInfoOneOf {
2453
+ /** Shipping info and selected shipping option details. */
2454
+ changedShippingInfo?: ShippingInformation;
2455
+ /** Remove existing shipping info. */
2456
+ shippingInfoRemoved?: boolean;
2457
+ /** Added/updated/removed order line items. */
2458
+ lineItems?: LineItemDelta[];
2535
2459
  /**
2536
- * Usually would be the same as catalogReference.catalogItemId
2537
- * For cases when these are not the same, this field would return the actual id of the item in the catalog
2538
- * For example, for Wix bookings, catalogReference.catalogItemId is the booking id, and this value is being set to be the service id
2460
+ * Added/updated/removed discounts.
2461
+ * todo: set (.wix.api.maxSize). need to find it. existing : merchant can have 100 + 1 coupon + ? due to automatic discounts
2539
2462
  */
2540
- rootCatalogItemId?: string | null;
2541
- /** line item id of Checkout/Order line item */
2542
- lineItemId?: string;
2543
- }
2544
- export interface ServiceProperties {
2463
+ appliedDiscounts?: AppliedDiscountDelta[];
2464
+ /** Added/updated/removed additional fee. */
2465
+ additionalFees?: AdditionalFeeDelta[];
2466
+ /** Updated Tax summary. overwrites existing tax summary. */
2467
+ taxSummary?: TaxSummary;
2545
2468
  /**
2546
- * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
2547
- * For example, the start time of a class.
2469
+ * Updated order price summary. overwrites existing price summary.
2470
+ * balance will be updated automatically.
2548
2471
  */
2549
- scheduledDate?: Date;
2550
- /** The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room. */
2551
- numberOfParticipants?: number | null;
2472
+ priceSummary?: PriceSummary;
2552
2473
  }
2553
- export interface ChargeMembershipsResponse {
2474
+ /** @oneof */
2475
+ export interface DraftOrderDiffsShippingUpdateInfoOneOf {
2476
+ /** Shipping info and selected shipping option details. */
2477
+ changedShippingInfo?: ShippingInformation;
2478
+ /** Remove existing shipping info. */
2479
+ shippingInfoRemoved?: boolean;
2554
2480
  }
2555
- export interface TriggerRefundRequest {
2556
- /** The order this refund related to */
2557
- ecomOrderId?: string;
2558
- /** Refund operations information */
2559
- payments?: PaymentRefund[];
2560
- /** Business model of a refund */
2561
- details?: RefundDetails;
2562
- /** Side effect details related to refund */
2563
- sideEffects?: RefundSideEffects;
2481
+ export interface LineItemDelta extends LineItemDeltaDeltaOneOf {
2482
+ /** The line item was added. */
2483
+ lineItemAdded?: boolean;
2484
+ /** The line item was modified. */
2485
+ changedDetails?: ItemChangedDetails;
2486
+ /** The line item was added. */
2487
+ lineItemRemoved?: boolean;
2488
+ /** Line item ID. */
2489
+ lineItemId?: string;
2490
+ lineItem?: OrderLineItemChangedDetails;
2564
2491
  }
2565
- export interface PaymentRefund {
2566
- /** Specific payment within the order to refund */
2567
- paymentId?: string;
2568
- /** Refund amount. Not relevant for membership refunds. */
2569
- amount?: Price;
2492
+ /** @oneof */
2493
+ export interface LineItemDeltaDeltaOneOf {
2494
+ /** The line item was added. */
2495
+ lineItemAdded?: boolean;
2496
+ /** The line item was modified. */
2497
+ changedDetails?: ItemChangedDetails;
2498
+ /** The line item was added. */
2499
+ lineItemRemoved?: boolean;
2500
+ }
2501
+ export interface OrderLineItemChangedDetails {
2570
2502
  /**
2571
- * Whether refund is made externally and manually (on the payment provider's side)
2572
- * When false (default), the payment gateway will be called in order to make an actual refund, and then the payment will be marked as refunded.
2573
- * When true, the payment will only be *marked* as refunded, and no actual refund will be performed.
2503
+ * Item name.
2504
+ * + Stores - `product.name`
2505
+ * + Bookings - `service.info.name`
2506
+ * + Events - `ticket.name`
2574
2507
  */
2575
- externalRefund?: boolean;
2508
+ productName?: ProductName;
2509
+ /**
2510
+ * References to the line item's origin catalog.
2511
+ * This field is empty in the case of a custom line item.
2512
+ */
2513
+ catalogReference?: CatalogReference;
2514
+ /** Line item quantity. */
2515
+ quantity?: number;
2516
+ /** Total discount for this line item's entire quantity. */
2517
+ totalDiscount?: Price;
2518
+ /** Line item description lines. Used for display purposes for the cart, checkout and order. */
2519
+ descriptionLines?: DescriptionLine[];
2520
+ /** Line item image. */
2521
+ image?: string;
2522
+ /** Physical properties of the item. When relevant, contains information such as SKU and item weight. */
2523
+ physicalProperties?: PhysicalProperties;
2524
+ /** Item type. Either a preset type or custom. */
2525
+ itemType?: ItemType;
2526
+ /**
2527
+ * Fulfiller ID. Field is empty when the line item is self-fulfilled.
2528
+ *
2529
+ * To get fulfillment information, pass the order ID to [List Fulfillments For Single Order](https://www.wix.com/velo/reference/wix-ecom-backend/orderfulfillments/listfulfillmentsforsingleorder).
2530
+ */
2531
+ fulfillerId?: string | null;
2532
+ /** Line item price after line item discounts for display purposes. */
2533
+ price?: Price;
2534
+ /** Line item price before line item discounts for display purposes. Defaults to `price` when not provided. */
2535
+ priceBeforeDiscounts?: Price;
2536
+ /** Total price after all discounts and tax. */
2537
+ totalPriceAfterTax?: Price;
2538
+ /**
2539
+ * Type of selected payment option for current item. Defaults to `FULL_PAYMENT_ONLINE`.
2540
+ * + `FULL_PAYMENT_OFFLINE` - The entire payment for this item happens after the checkout. For example, when using cash, check, or other offline payment methods.
2541
+ * + `MEMBERSHIP` - Payment for this item is done by charging a membership. When this option is used, `lineItem.price.amount` is 0.
2542
+ */
2543
+ paymentOption?: DeltaPaymentOptionType;
2544
+ /** Tax details for this line item. */
2545
+ taxDetails?: ItemTaxFullDetails;
2546
+ /** Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67". */
2547
+ priceDescription?: PriceDescription;
2548
+ /** Total price after all discounts excluding tax. */
2549
+ totalPriceBeforeTax?: Price;
2576
2550
  }
2577
- export interface RefundSideEffects {
2578
- /** Inventory restock details as part of this refund. */
2579
- restockInfo?: RestockInfo;
2580
- /** Whether to send a refund confirmation email to the customer. */
2581
- sendOrderRefundedEmail?: boolean;
2582
- /** Custom message added to the refund confirmation email. */
2583
- customMessage?: string | null;
2551
+ /** Type of selected payment option for catalog item */
2552
+ export declare enum DeltaPaymentOptionType {
2553
+ /** irrelevant */
2554
+ UNKNOWN_PAYMENT_OPTION = "UNKNOWN_PAYMENT_OPTION",
2555
+ /** The entire payment for given item will happen after the checkout. */
2556
+ FULL_PAYMENT_OFFLINE = "FULL_PAYMENT_OFFLINE",
2557
+ /**
2558
+ * Payment for this item can only be done using a membership and must be manually redeemed in the dashboard by the site owner.
2559
+ * Note: when this option is used, price will be 0.
2560
+ */
2561
+ MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE"
2584
2562
  }
2585
- export interface RestockInfo {
2586
- /** Restock type. */
2587
- type?: RestockType;
2588
- /** Restocked line items and quantities. Only relevant for `{"type": "SOME_ITEMS"}`. */
2589
- items?: V1RestockItem[];
2563
+ export interface ItemChangedDetails {
2564
+ /** The quantity before the change. */
2565
+ quantityBeforeChange?: number | null;
2566
+ /** The price before the change. */
2567
+ priceBeforeChange?: Price;
2568
+ /** The price description before the change */
2569
+ priceDescriptionBeforeChange?: PriceDescription;
2590
2570
  }
2591
- export declare enum RestockType {
2592
- NO_ITEMS = "NO_ITEMS",
2593
- ALL_ITEMS = "ALL_ITEMS",
2594
- SOME_ITEMS = "SOME_ITEMS"
2571
+ export interface AppliedDiscountDelta extends AppliedDiscountDeltaDeltaOneOf {
2572
+ editedDiscount?: AppliedDiscount;
2573
+ discountRemoved?: boolean;
2574
+ /** Discount id. */
2575
+ discountId?: string;
2595
2576
  }
2596
- export interface V1RestockItem {
2597
- /** ID of the line item being restocked. */
2598
- lineItemId?: string;
2599
- /** Line item quantity being restocked. */
2600
- quantity?: number;
2601
- }
2602
- export interface TriggerRefundResponse {
2603
- /** All order's transactions after the refunds were added */
2604
- orderTransactions?: OrderTransactions;
2605
- /** Created refund ID */
2606
- refundId?: string | null;
2607
- /** Payment ID's that the refund execution had failed for */
2608
- failedPaymentIds?: ItemMetadata[];
2609
- }
2610
- /** Triggered when a refund is created. */
2611
- export interface RefundCreated {
2612
- /** Updated order transactions. */
2613
- orderTransactions?: OrderTransactions;
2614
- /** ID of the created refund. */
2615
- refundId?: string;
2616
- /** Inventory restock details as part of this refund.. */
2617
- restockInfo?: RestockInfo;
2618
- /** Whether to send a refund confirmation email to the customer. */
2619
- sendOrderRefundedEmail?: boolean;
2620
- /** Custom message added to the refund confirmation email. */
2621
- customMessage?: string | null;
2622
- /** Refunded line items and quantities that are part of the created refund. */
2623
- refundItems?: RefundItem[];
2624
- }
2625
- export interface CalculateRefundRequest {
2626
- /** Order ID */
2627
- ecomOrderId?: string;
2628
- /** Refunded line items and quantity */
2629
- refundItems?: CalculateRefundItemRequest[];
2630
- /** Should include shipping in refund calculation */
2631
- refundShipping?: boolean;
2632
- }
2633
- export interface CalculateRefundItemRequest {
2634
- /** ID of the line item being refunded */
2635
- _id?: string;
2636
- /** How much of that line item is being refunded */
2637
- quantity?: number;
2638
- }
2639
- export interface CalculateRefundResponse {
2640
- /** Total refundable amount */
2641
- total?: Price;
2642
- /** Tax cost of the order */
2643
- tax?: Price;
2644
- /** Discount given for this order */
2645
- discount?: Price;
2646
- /** Total cost of the order (without tax) */
2647
- subtotal?: Price;
2648
- /** Total shipping cost for order */
2649
- shipping?: Price;
2650
- /** Previous refund given on that order */
2651
- previouslyRefundedAmount?: Price;
2652
- /** The refundable items of that order */
2653
- items?: CalculateRefundItemResponse[];
2654
- }
2655
- export interface CalculateRefundItemResponse {
2656
- /** Line item ID */
2657
- _id?: string;
2658
- /** Refundable amount for requested quantity of items (price of requested quantity of items without tax and discount) */
2659
- price?: Price;
2660
- }
2661
- export interface DiffmatokyPayload {
2662
- left?: string;
2663
- right?: string;
2664
- compareChannel?: string;
2665
- entityId?: string;
2666
- errorInformation?: ErrorInformation;
2667
- tags?: string[];
2668
- }
2669
- export interface ErrorInformation {
2670
- stackTrace?: string;
2671
- }
2672
- export interface ContinueSideEffectsFlowInLegacyData {
2673
- storeId?: string;
2674
- orderId?: string;
2675
- ordersExperiments?: OrdersExperiments;
2676
- }
2677
- export interface OrdersExperiments {
2678
- epCommitTax?: boolean;
2679
- moveMerchantEmailToEp?: boolean;
2680
- moveBuyerOrderConfirmationEmailToEp?: boolean;
2681
- producedByEpBridge?: boolean;
2682
- enableRewrittenSideEffects?: boolean;
2683
- }
2684
- export interface IndexingMessage {
2685
- _id?: string;
2686
- opType?: number;
2687
- requiredVersions?: string[];
2688
- }
2689
- export interface GetOrderRequest {
2690
- /** ID of the order to retrieve. */
2691
- _id: string;
2692
- }
2693
- export interface GetOrderResponse {
2694
- /** The requested order. */
2695
- order?: Order;
2696
- }
2697
- export interface ListOrdersResponse {
2698
- /** The requested order. */
2699
- orders?: Order[];
2700
- /** Details on the paged set of results returned. */
2701
- pagingMetadata?: CursorPagingMetadata;
2702
- }
2703
- export interface InternalQueryOrdersResponse {
2704
- /** List of orders. */
2705
- orders?: Order[];
2706
- /** Details on the paged set of results returned. */
2707
- metadata?: PlatformPagingMetadata;
2708
- }
2709
- export interface QueryOrderRequest {
2710
- /** Query options. */
2711
- query?: PlatformQuery;
2712
- }
2713
- export interface QueryOrderResponse {
2714
- /** List of orders. */
2715
- orders?: Order[];
2716
- /** Details on the paged set of results returned. */
2717
- metadata?: PlatformPagingMetadata;
2718
- }
2719
- export interface SearchOrdersRequest {
2720
- /** Search options. */
2721
- search?: CursorSearch;
2577
+ /** @oneof */
2578
+ export interface AppliedDiscountDeltaDeltaOneOf {
2579
+ editedDiscount?: AppliedDiscount;
2580
+ discountRemoved?: boolean;
2722
2581
  }
2723
- export interface CursorSearch extends CursorSearchPagingMethodOneOf {
2724
- /** Cursor pointing to page of results. `cursorPaging.cursor` cannot be used with 'filter' or 'sort'. */
2725
- cursorPaging?: CursorPaging;
2726
- /**
2727
- * Filter object.
2728
- *
2729
- * For example, the following `filter` object will only return orders with payment statuses of paid and/or partially paid:
2730
- * `"filter": {"paymentStatus": {"$in": ["PAID", "PARTIALLY_PAID"]}}`
2731
- *
2732
- * Learn more about the filter format [here](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
2733
- */
2734
- filter?: Record<string, any> | null;
2735
- /**
2736
- * Array of sort objects that specify the order in which results should be sorted.
2737
- *
2738
- * For example, the following `sort` array will sort by `createdDate` in descending order:
2739
- * `"sort": [{"fieldName": "createdDate", "order":"DESC"}]`.
2740
- *
2741
- * Learn more about the sort format [here](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
2742
- */
2743
- sort?: Sorting[];
2582
+ export interface AdditionalFeeDelta extends AdditionalFeeDeltaDeltaOneOf {
2583
+ editedAdditionalFee?: AdditionalFee;
2584
+ additionalFeeRemoved?: boolean;
2585
+ /** Additional fee id. */
2586
+ additionalFeeId?: string;
2744
2587
  }
2745
2588
  /** @oneof */
2746
- export interface CursorSearchPagingMethodOneOf {
2747
- /** Cursor pointing to page of results. `cursorPaging.cursor` cannot be used with 'filter' or 'sort'. */
2748
- cursorPaging?: CursorPaging;
2749
- }
2750
- export interface SearchOrdersResponse {
2751
- /** List of orders. */
2752
- orders?: Order[];
2753
- /** Details on the paged set of results returned. */
2754
- metadata?: CursorPagingMetadata;
2589
+ export interface AdditionalFeeDeltaDeltaOneOf {
2590
+ editedAdditionalFee?: AdditionalFee;
2591
+ additionalFeeRemoved?: boolean;
2755
2592
  }
2756
- export interface CreateOrderRequest {
2757
- /** Order info. */
2758
- order: Order;
2593
+ export interface DraftOrderCommitSettings {
2594
+ /** If false, do not send notifications to buyer. Default is true. */
2595
+ sendNotificationsToBuyer?: boolean | null;
2596
+ /** If false, do not send notifications to business. Default is true. */
2597
+ sendNotificationsToBusiness?: boolean | null;
2598
+ /** If false,do not add activities to the order. Default is true. */
2599
+ addActivitiesToOrder?: boolean | null;
2600
+ /** If false, do not send mails to custom fulfillers in case of a change of shippable items fulfilled by custom fulfillers. Default is true. */
2601
+ sendNotificationsToCustomFulfillers?: boolean | null;
2602
+ /** Inventory changes to be applied. Either to restock, or decrease. */
2603
+ inventoryUpdates?: InventoryUpdateDetails[];
2759
2604
  }
2760
- export interface CreateOrderResponse {
2761
- /** Newly created order. */
2762
- order?: Order;
2605
+ export interface InventoryUpdateDetails {
2606
+ /** Action to be applied - decrease or restock */
2607
+ actionType?: InventoryAction;
2608
+ /** Order line item id */
2609
+ lineItemId?: string;
2610
+ /** The amount to be increased or restocked */
2611
+ quantityChange?: number;
2763
2612
  }
2764
- export interface UpdateOrderRequest {
2765
- /** Order to be updated. */
2766
- order: Order;
2613
+ export declare enum InventoryAction {
2614
+ /** Restock inventory */
2615
+ RESTOCK = "RESTOCK",
2616
+ /** Decrease inventory. Without failing on negative inventory. */
2617
+ DECREASE = "DECREASE"
2767
2618
  }
2768
- export interface UpdateOrderResponse {
2769
- /** Newly created order. */
2619
+ export interface CommitDeltasResponse {
2620
+ /** Order after deltas are applied */
2770
2621
  order?: Order;
2771
2622
  }
2772
- export interface CommitDeltasRequest {
2773
- /** Order id to be updated */
2774
- _id?: string;
2775
- /**
2776
- * Draft order Id representing this change.
2777
- * Use this ID to get this specific draft content. call .../v1/draft-orders/{draft_order_id}/get
2778
- */
2623
+ /** Triggered when order is edited by draftOrders */
2624
+ export interface OrderDeltasCommitted {
2625
+ /** The order after committed changes. */
2626
+ order?: Order;
2627
+ /** Draft order Id representing this change. */
2779
2628
  draftOrderId?: string;
2780
- /** Draft order changes to be applied */
2781
- changes?: DraftOrderDiffs;
2782
- /** Side-effects to happen after order is updated */
2629
+ /** Applied changes. */
2630
+ changes?: CommittedDiffs;
2631
+ /** Side-effects requested to happen as a result of this edit. */
2783
2632
  commitSettings?: DraftOrderCommitSettings;
2784
- /** Reason for edit, given by user (optional). */
2785
- reason?: string | null;
2633
+ /**
2634
+ * Date and time when order deltas were committed.
2635
+ * @readonly
2636
+ */
2637
+ commitDate?: Date;
2786
2638
  }
2787
- export interface DraftOrderDiffs extends DraftOrderDiffsShippingUpdateInfoOneOf {
2639
+ export interface CommittedDiffs extends CommittedDiffsShippingUpdateInfoOneOf {
2788
2640
  /** Shipping info and selected shipping option details. */
2789
2641
  changedShippingInfo?: ShippingInformation;
2790
2642
  /** Remove existing shipping info. */
2791
2643
  shippingInfoRemoved?: boolean;
2792
2644
  /** Added/updated/removed order line items. */
2793
- lineItems?: LineItemDelta[];
2645
+ lineItems?: CommittedDiffsLineItemDelta[];
2794
2646
  /**
2795
2647
  * Added/updated/removed discounts.
2796
2648
  * todo: set (.wix.api.maxSize). need to find it. existing : merchant can have 100 + 1 coupon + ? due to automatic discounts
@@ -2798,213 +2650,26 @@ export interface DraftOrderDiffs extends DraftOrderDiffsShippingUpdateInfoOneOf
2798
2650
  appliedDiscounts?: AppliedDiscountDelta[];
2799
2651
  /** Added/updated/removed additional fee. */
2800
2652
  additionalFees?: AdditionalFeeDelta[];
2801
- /** Updated Tax summary. overwrites existing tax summary. */
2802
- taxSummary?: TaxSummary;
2803
- /**
2804
- * Updated order price summary. overwrites existing price summary.
2805
- * balance will be updated automatically.
2806
- */
2807
- priceSummary?: PriceSummary;
2808
2653
  }
2809
2654
  /** @oneof */
2810
- export interface DraftOrderDiffsShippingUpdateInfoOneOf {
2655
+ export interface CommittedDiffsShippingUpdateInfoOneOf {
2811
2656
  /** Shipping info and selected shipping option details. */
2812
2657
  changedShippingInfo?: ShippingInformation;
2813
2658
  /** Remove existing shipping info. */
2814
2659
  shippingInfoRemoved?: boolean;
2815
2660
  }
2816
- export interface LineItemDelta extends LineItemDeltaDeltaOneOf {
2817
- /** The line item was added. */
2661
+ export interface CommittedDiffsLineItemDelta extends CommittedDiffsLineItemDeltaDeltaOneOf {
2818
2662
  lineItemAdded?: boolean;
2819
- /** The line item was modified. */
2820
2663
  changedDetails?: ItemChangedDetails;
2821
- /** The line item was added. */
2822
- lineItemRemoved?: boolean;
2664
+ lineItemRemoved?: OrderLineItemChangedDetails;
2823
2665
  /** Line item ID. */
2824
2666
  lineItemId?: string;
2825
- lineItem?: OrderLineItemChangedDetails;
2826
2667
  }
2827
2668
  /** @oneof */
2828
- export interface LineItemDeltaDeltaOneOf {
2829
- /** The line item was added. */
2669
+ export interface CommittedDiffsLineItemDeltaDeltaOneOf {
2830
2670
  lineItemAdded?: boolean;
2831
- /** The line item was modified. */
2832
2671
  changedDetails?: ItemChangedDetails;
2833
- /** The line item was added. */
2834
- lineItemRemoved?: boolean;
2835
- }
2836
- export interface OrderLineItemChangedDetails {
2837
- /**
2838
- * Item name.
2839
- * + Stores - `product.name`
2840
- * + Bookings - `service.info.name`
2841
- * + Events - `ticket.name`
2842
- */
2843
- productName?: ProductName;
2844
- /**
2845
- * References to the line item's origin catalog.
2846
- * This field is empty in the case of a custom line item.
2847
- */
2848
- catalogReference?: CatalogReference;
2849
- /** Line item quantity. */
2850
- quantity?: number;
2851
- /** Total discount for this line item's entire quantity. */
2852
- totalDiscount?: Price;
2853
- /** Line item description lines. Used for display purposes for the cart, checkout and order. */
2854
- descriptionLines?: DescriptionLine[];
2855
- /** Line item image. */
2856
- image?: string;
2857
- /** Physical properties of the item. When relevant, contains information such as SKU and item weight. */
2858
- physicalProperties?: PhysicalProperties;
2859
- /** Item type. Either a preset type or custom. */
2860
- itemType?: ItemType;
2861
- /**
2862
- * Fulfiller ID. Field is empty when the line item is self-fulfilled.
2863
- *
2864
- * To get fulfillment information, pass the order ID to [List Fulfillments For Single Order](https://www.wix.com/velo/reference/wix-ecom-backend/orderfulfillments/listfulfillmentsforsingleorder).
2865
- */
2866
- fulfillerId?: string | null;
2867
- /** Line item price after line item discounts for display purposes. */
2868
- price?: Price;
2869
- /** Line item price before line item discounts for display purposes. Defaults to `price` when not provided. */
2870
- priceBeforeDiscounts?: Price;
2871
- /** Total price after all discounts and tax. */
2872
- totalPriceAfterTax?: Price;
2873
- /**
2874
- * Type of selected payment option for current item. Defaults to `FULL_PAYMENT_ONLINE`.
2875
- * + `FULL_PAYMENT_OFFLINE` - The entire payment for this item happens after the checkout. For example, when using cash, check, or other offline payment methods.
2876
- * + `MEMBERSHIP` - Payment for this item is done by charging a membership. When this option is used, `lineItem.price.amount` is 0.
2877
- */
2878
- paymentOption?: DeltaPaymentOptionType;
2879
- /** Tax details for this line item. */
2880
- taxDetails?: ItemTaxFullDetails;
2881
- /** Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67". */
2882
- priceDescription?: PriceDescription;
2883
- /** Total price after all discounts excluding tax. */
2884
- totalPriceBeforeTax?: Price;
2885
- }
2886
- /** Type of selected payment option for catalog item */
2887
- export declare enum DeltaPaymentOptionType {
2888
- /** irrelevant */
2889
- UNKNOWN_PAYMENT_OPTION = "UNKNOWN_PAYMENT_OPTION",
2890
- /** The entire payment for given item will happen after the checkout. */
2891
- FULL_PAYMENT_OFFLINE = "FULL_PAYMENT_OFFLINE",
2892
- /**
2893
- * Payment for this item can only be done using a membership and must be manually redeemed in the dashboard by the site owner.
2894
- * Note: when this option is used, price will be 0.
2895
- */
2896
- MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE"
2897
- }
2898
- export interface ItemChangedDetails {
2899
- /** The quantity before the change. */
2900
- quantityBeforeChange?: number | null;
2901
- /** The price before the change. */
2902
- priceBeforeChange?: Price;
2903
- /** The price description before the change */
2904
- priceDescriptionBeforeChange?: PriceDescription;
2905
- }
2906
- export interface AppliedDiscountDelta extends AppliedDiscountDeltaDeltaOneOf {
2907
- editedDiscount?: AppliedDiscount;
2908
- discountRemoved?: boolean;
2909
- /** Discount id. */
2910
- discountId?: string;
2911
- }
2912
- /** @oneof */
2913
- export interface AppliedDiscountDeltaDeltaOneOf {
2914
- editedDiscount?: AppliedDiscount;
2915
- discountRemoved?: boolean;
2916
- }
2917
- export interface AdditionalFeeDelta extends AdditionalFeeDeltaDeltaOneOf {
2918
- editedAdditionalFee?: AdditionalFee;
2919
- additionalFeeRemoved?: boolean;
2920
- /** Additional fee id. */
2921
- additionalFeeId?: string;
2922
- }
2923
- /** @oneof */
2924
- export interface AdditionalFeeDeltaDeltaOneOf {
2925
- editedAdditionalFee?: AdditionalFee;
2926
- additionalFeeRemoved?: boolean;
2927
- }
2928
- export interface DraftOrderCommitSettings {
2929
- /** If false, do not send notifications to buyer. Default is true. */
2930
- sendNotificationsToBuyer?: boolean | null;
2931
- /** If false, do not send notifications to business. Default is true. */
2932
- sendNotificationsToBusiness?: boolean | null;
2933
- /** If false,do not add activities to the order. Default is true. */
2934
- addActivitiesToOrder?: boolean | null;
2935
- /** If false, do not send mails to custom fulfillers in case of a change of shippable items fulfilled by custom fulfillers. Default is true. */
2936
- sendNotificationsToCustomFulfillers?: boolean | null;
2937
- /** Inventory changes to be applied. Either to restock, or decrease. */
2938
- inventoryUpdates?: InventoryUpdateDetails[];
2939
- }
2940
- export interface InventoryUpdateDetails {
2941
- /** Action to be applied - decrease or restock */
2942
- actionType?: InventoryAction;
2943
- /** Order line item id */
2944
- lineItemId?: string;
2945
- /** The amount to be increased or restocked */
2946
- quantityChange?: number;
2947
- }
2948
- export declare enum InventoryAction {
2949
- /** Restock inventory */
2950
- RESTOCK = "RESTOCK",
2951
- /** Decrease inventory. Without failing on negative inventory. */
2952
- DECREASE = "DECREASE"
2953
- }
2954
- export interface CommitDeltasResponse {
2955
- /** Order after deltas are applied */
2956
- order?: Order;
2957
- }
2958
- /** Triggered when order is edited by draftOrders */
2959
- export interface OrderDeltasCommitted {
2960
- /** The order after committed changes. */
2961
- order?: Order;
2962
- /** Draft order Id representing this change. */
2963
- draftOrderId?: string;
2964
- /** Applied changes. */
2965
- changes?: CommittedDiffs;
2966
- /** Side-effects requested to happen as a result of this edit. */
2967
- commitSettings?: DraftOrderCommitSettings;
2968
- /**
2969
- * Date and time when order deltas were committed.
2970
- * @readonly
2971
- */
2972
- commitDate?: Date;
2973
- }
2974
- export interface CommittedDiffs extends CommittedDiffsShippingUpdateInfoOneOf {
2975
- /** Shipping info and selected shipping option details. */
2976
- changedShippingInfo?: ShippingInformation;
2977
- /** Remove existing shipping info. */
2978
- shippingInfoRemoved?: boolean;
2979
- /** Added/updated/removed order line items. */
2980
- lineItems?: CommittedDiffsLineItemDelta[];
2981
- /**
2982
- * Added/updated/removed discounts.
2983
- * todo: set (.wix.api.maxSize). need to find it. existing : merchant can have 100 + 1 coupon + ? due to automatic discounts
2984
- */
2985
- appliedDiscounts?: AppliedDiscountDelta[];
2986
- /** Added/updated/removed additional fee. */
2987
- additionalFees?: AdditionalFeeDelta[];
2988
- }
2989
- /** @oneof */
2990
- export interface CommittedDiffsShippingUpdateInfoOneOf {
2991
- /** Shipping info and selected shipping option details. */
2992
- changedShippingInfo?: ShippingInformation;
2993
- /** Remove existing shipping info. */
2994
- shippingInfoRemoved?: boolean;
2995
- }
2996
- export interface CommittedDiffsLineItemDelta extends CommittedDiffsLineItemDeltaDeltaOneOf {
2997
- lineItemAdded?: boolean;
2998
- changedDetails?: ItemChangedDetails;
2999
- lineItemRemoved?: OrderLineItemChangedDetails;
3000
- /** Line item ID. */
3001
- lineItemId?: string;
3002
- }
3003
- /** @oneof */
3004
- export interface CommittedDiffsLineItemDeltaDeltaOneOf {
3005
- lineItemAdded?: boolean;
3006
- changedDetails?: ItemChangedDetails;
3007
- lineItemRemoved?: OrderLineItemChangedDetails;
2672
+ lineItemRemoved?: OrderLineItemChangedDetails;
3008
2673
  }
3009
2674
  export interface ArchiveOrderRequest {
3010
2675
  /** Order ID. */
@@ -3496,115 +3161,477 @@ export interface BulkMarkOrdersAsPaidRequest {
3496
3161
  }
3497
3162
  export interface BulkMarkOrdersAsPaidResponse {
3498
3163
  /**
3499
- * Items updated by the bulk action.
3500
- * The Order entity within the results optimistically changes its payment status to paid, however this process is async.
3164
+ * Items updated by the bulk action.
3165
+ * The Order entity within the results optimistically changes its payment status to paid, however this process is async.
3166
+ */
3167
+ results?: BulkOrderResult[];
3168
+ /** Bulk action metadata. */
3169
+ bulkActionMetadata?: BulkActionMetadata;
3170
+ }
3171
+ export interface CreatePaymentGatewayOrderRequest {
3172
+ /** eCom Order ID */
3173
+ ecomOrderId?: string;
3174
+ }
3175
+ export interface CreatePaymentGatewayOrderResponse {
3176
+ /** ID of the order created in the payment gateway */
3177
+ paymentGatewayOrderId?: string;
3178
+ }
3179
+ export interface GetShipmentsRequest {
3180
+ _id?: string;
3181
+ }
3182
+ export interface GetShipmentsResponse {
3183
+ shipmentIds?: string[];
3184
+ }
3185
+ export interface AggregateOrdersRequest {
3186
+ /** Filter applied to original data */
3187
+ filter?: Record<string, any> | null;
3188
+ /** This is an object defining aggregation itself */
3189
+ aggregation?: Record<string, any> | null;
3190
+ /**
3191
+ * Optional custom separator string that can be used to override default separator value '|'
3192
+ * for hierarchical responses of multifaceted aggregation requests like:
3193
+ * '{"aggregation": {"example_request_key": {"$count" : ["deliveryMethod", "shippingRegion"]}}}'
3194
+ * with example response for default '|' separator like:
3195
+ * '{"aggregates" :{"example_request_key": {"(Mail|Region 1)": 5, "(Pickup|Region 2)": 10}}}'
3196
+ */
3197
+ hierarchySeparatorOverride?: string | null;
3198
+ }
3199
+ export interface AggregateOrdersResponse {
3200
+ aggregates?: Record<string, any> | null;
3201
+ }
3202
+ export interface DecrementItemsQuantityRequest {
3203
+ /** Order ID */
3204
+ _id?: string;
3205
+ /** Which items to decrement, and how much to decrement from each one */
3206
+ decrementData?: DecrementData[];
3207
+ }
3208
+ export interface DecrementData {
3209
+ /** ID of the line item being decremented. */
3210
+ lineItemId?: string;
3211
+ /** Line item quantity being decremented. */
3212
+ decrementBy?: number;
3213
+ /** Whether to restock the line item (triggers inventory update). */
3214
+ restock?: boolean;
3215
+ }
3216
+ export interface DecrementItemsQuantityResponse {
3217
+ /** Updated order data */
3218
+ order?: Order;
3219
+ }
3220
+ /** Triggered when order items are marked as restocked */
3221
+ export interface OrderItemsRestocked {
3222
+ /** The order which items were restocked */
3223
+ order?: Order;
3224
+ /** Restocked items and quantities */
3225
+ restockItems?: RestockItem[];
3226
+ }
3227
+ export interface RestockItem {
3228
+ /** ID of the line item being restocked. */
3229
+ lineItemId?: string;
3230
+ /** Line item quantity being restocked. */
3231
+ quantity?: number;
3232
+ }
3233
+ /** Triggered when the the order status changes to approved */
3234
+ export interface OrderApproved {
3235
+ /** The order that was updated */
3236
+ order?: Order;
3237
+ }
3238
+ export interface Task {
3239
+ key?: TaskKey;
3240
+ executeAt?: Date;
3241
+ payload?: string | null;
3242
+ }
3243
+ export interface TaskKey {
3244
+ appId?: string;
3245
+ instanceId?: string;
3246
+ subjectId?: string | null;
3247
+ }
3248
+ export interface TaskAction extends TaskActionActionOneOf {
3249
+ complete?: Complete;
3250
+ cancel?: Cancel;
3251
+ reschedule?: Reschedule;
3252
+ }
3253
+ /** @oneof */
3254
+ export interface TaskActionActionOneOf {
3255
+ complete?: Complete;
3256
+ cancel?: Cancel;
3257
+ reschedule?: Reschedule;
3258
+ }
3259
+ export interface Complete {
3260
+ }
3261
+ export interface Cancel {
3262
+ }
3263
+ export interface Reschedule {
3264
+ executeAt?: Date;
3265
+ payload?: string | null;
3266
+ }
3267
+ export interface InvoiceSentEvent {
3268
+ _id?: IdAndVersion;
3269
+ /** @readonly */
3270
+ data?: InvoiceFields;
3271
+ /** @readonly */
3272
+ status?: InvoiceStatus;
3273
+ }
3274
+ export interface IdAndVersion {
3275
+ _id?: string | null;
3276
+ version?: number | null;
3277
+ }
3278
+ export interface InvoiceFields {
3279
+ /** The invoice number allocated the invoice by the server. The number is limited to at most 11 digits. */
3280
+ number?: string | null;
3281
+ /** The invoice 3-letter currency code in [ISO-4217 alphabetic](https://www.iso.org/iso-4217-currency-codes.html) format. */
3282
+ currencyCode?: string | null;
3283
+ /** The invoice customer. The customer must be a contact of the site, with an email. */
3284
+ customer?: Customer;
3285
+ /**
3286
+ * Invoice dates: issue date and due date are mandatory and provided when the invoice is created.
3287
+ * Last seen date is the optional date when the invoice was last seen be UoU.
3288
+ */
3289
+ dates?: InvoiceDates;
3290
+ /**
3291
+ * Line items containing the details of the products or services relevant to the invoice, with their name, prices,
3292
+ * and quantity. There must be at least one line item on the invoice.
3293
+ */
3294
+ lineItems?: LineItems;
3295
+ /**
3296
+ * Locale of the invoice, containing the language.
3297
+ * This field is not mandatory but is used for display purposes, to determine the appearance of numbers and dates
3298
+ * on the invoice.
3299
+ */
3300
+ locale?: Locale;
3301
+ /**
3302
+ * The totals on the invoice.
3303
+ * The totals.subtotal, totals.total and totals.taxed_amount are calculated by the server based on the line items.
3304
+ * Alternatively, these fields can be provided in the invoice creation request, in this case, these values are fixed.
3305
+ * The totals contain fees and a discount, that apply to the invoice.
3306
+ */
3307
+ totals?: TotalPrice;
3308
+ /** An optional discount on the invoice. */
3309
+ discount?: Discount;
3310
+ /** The taxes of the invoice. */
3311
+ taxes?: CalculatedTaxes;
3312
+ /** The payments on the invoice. The invoice has status paid if its payments cover the invoice total. */
3313
+ payments?: Payments;
3314
+ /** Invoice metadata */
3315
+ metaData?: MetaData;
3316
+ /** Not used */
3317
+ creationAdditional_BIInformation?: string | null;
3318
+ /**
3319
+ * The balance and amount paid on the invoice.
3320
+ * This read-only field is calculated based on the invoice totals and payments.
3321
+ * @readonly
3322
+ */
3323
+ dynamicTotals?: InvoiceDynamicPriceTotals;
3324
+ /** The invoice title */
3325
+ title?: string | null;
3326
+ /** Invoice custom fields */
3327
+ customFields?: CustomFieldValue[];
3328
+ /** Not used */
3329
+ designTemplateId?: string | null;
3330
+ /** Not used */
3331
+ createOrder?: boolean | null;
3332
+ /** The optional deposit of the invoice */
3333
+ deposit?: Deposit;
3334
+ /** associated checkout for this invoice */
3335
+ ecomCheckoutId?: string | null;
3336
+ }
3337
+ export interface Customer {
3338
+ contactId?: string | null;
3339
+ name?: string | null;
3340
+ email?: Email;
3341
+ address?: QuotesAddress;
3342
+ phone?: Phone;
3343
+ company?: Company;
3344
+ firstName?: string | null;
3345
+ lastName?: string | null;
3346
+ billingAddress?: CommonAddress;
3347
+ shippingAddress?: CommonAddress;
3348
+ }
3349
+ export interface Email {
3350
+ address?: string;
3351
+ }
3352
+ export interface QuotesAddress {
3353
+ street?: string | null;
3354
+ city?: string | null;
3355
+ zip?: string | null;
3356
+ state?: string | null;
3357
+ country?: string | null;
3358
+ /** @readonly */
3359
+ description?: AddressDescription;
3360
+ }
3361
+ export interface AddressDescription {
3362
+ content?: string;
3363
+ placement?: Placement;
3364
+ }
3365
+ export declare enum Placement {
3366
+ Unknown = "Unknown",
3367
+ Replace = "Replace",
3368
+ Before = "Before",
3369
+ After = "After"
3370
+ }
3371
+ export interface Phone {
3372
+ number?: string;
3373
+ }
3374
+ export interface Company {
3375
+ name?: string;
3376
+ _id?: string | null;
3377
+ }
3378
+ /** Physical address */
3379
+ export interface CommonAddress extends CommonAddressStreetOneOf {
3380
+ /** Street name and number. */
3381
+ streetAddress?: StreetAddress;
3382
+ /** Main address line, usually street and number as free text. */
3383
+ addressLine1?: string | null;
3384
+ /** Country code. */
3385
+ country?: string | null;
3386
+ /** Subdivision. Usually a state, region, prefecture, or province code, according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). */
3387
+ subdivision?: string | null;
3388
+ /** City name. */
3389
+ city?: string | null;
3390
+ /** Zip/postal code. */
3391
+ postalCode?: string | null;
3392
+ /** Free text providing more detailed address info. Usually contains Apt, Suite, and Floor. */
3393
+ addressLine2?: string | null;
3394
+ }
3395
+ /** @oneof */
3396
+ export interface CommonAddressStreetOneOf {
3397
+ /** Street name and number. */
3398
+ streetAddress?: StreetAddress;
3399
+ /** Main address line, usually street and number as free text. */
3400
+ addressLine?: string | null;
3401
+ }
3402
+ export interface Subdivision {
3403
+ /** Short subdivision code. */
3404
+ code?: string;
3405
+ /** Subdivision full name. */
3406
+ name?: string;
3407
+ }
3408
+ export declare enum SubdivisionType {
3409
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
3410
+ /** State */
3411
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
3412
+ /** County */
3413
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
3414
+ /** City/town */
3415
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
3416
+ /** Neighborhood/quarter */
3417
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
3418
+ /** Street/block */
3419
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
3420
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
3421
+ COUNTRY = "COUNTRY"
3422
+ }
3423
+ export interface InvoiceDates {
3424
+ /** use UTC midnight date to set the issue date according to the site time zone */
3425
+ issueDate?: Date;
3426
+ /** use UTC midnight date to set the due date according to the site time zone */
3427
+ dueDate?: Date;
3428
+ /** <a href="http://joda-time.sourceforge.net/timezones.html">Valid time zones</a> */
3429
+ timeZoneCode?: string | null;
3430
+ /**
3431
+ * ignored in request use in response to get the site time zone
3432
+ * @readonly
3433
+ */
3434
+ lastSeenDate?: Date;
3435
+ }
3436
+ export interface LineItems {
3437
+ lineItems?: LineItem[];
3438
+ }
3439
+ export interface LineItem {
3440
+ _id?: string;
3441
+ name?: string;
3442
+ description?: string | null;
3443
+ price?: BigDecimalWrapper;
3444
+ taxedTotal?: BigDecimalWrapper;
3445
+ quantity?: BigDecimalWrapper;
3446
+ taxes?: LineItemTax[];
3447
+ /** The source of the line item */
3448
+ source?: Source;
3449
+ /** The line-item level metadata. */
3450
+ metadata?: LineItemMetaData;
3451
+ }
3452
+ export interface BigDecimalWrapper {
3453
+ serializedValue?: number;
3454
+ }
3455
+ export interface LineItemTax {
3456
+ name?: string;
3457
+ rate?: BigDecimalWrapper;
3458
+ code?: string | null;
3459
+ }
3460
+ export interface Source {
3461
+ /**
3462
+ * Source app or service ID.
3463
+ * @readonly
3501
3464
  */
3502
- results?: BulkOrderResult[];
3503
- /** Bulk action metadata. */
3504
- bulkActionMetadata?: BulkActionMetadata;
3465
+ sourceId?: string;
3466
+ /**
3467
+ * App or service type.
3468
+ * @readonly
3469
+ */
3470
+ sourceType?: SourceType;
3505
3471
  }
3506
- export interface CreatePaymentGatewayOrderRequest {
3507
- /** eCom Order ID */
3508
- ecomOrderId?: string;
3472
+ export declare enum SourceType {
3473
+ UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
3474
+ WIX_APP = "WIX_APP",
3475
+ EXTERNAL = "EXTERNAL",
3476
+ ADMIN = "ADMIN",
3477
+ OTHER = "OTHER"
3509
3478
  }
3510
- export interface CreatePaymentGatewayOrderResponse {
3511
- /** ID of the order created in the payment gateway */
3512
- paymentGatewayOrderId?: string;
3479
+ export interface LineItemMetaData {
3480
+ metadata?: Record<string, string>;
3513
3481
  }
3514
- export interface GetShipmentsRequest {
3515
- _id?: string;
3482
+ export interface Locale {
3483
+ /** ISO 639 alpha-2 or alpha-3 language code, or a language subtag */
3484
+ language?: string;
3485
+ /** An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code. */
3486
+ country?: string | null;
3487
+ invariant?: string | null;
3516
3488
  }
3517
- export interface GetShipmentsResponse {
3518
- shipmentIds?: string[];
3489
+ export interface TotalPrice {
3490
+ /** the subtotal of the line items without the tax reduction */
3491
+ subtotal?: BigDecimalWrapper;
3492
+ /** the total price taking into account the itemized fees and the taxes */
3493
+ total?: BigDecimalWrapper;
3494
+ fees?: ItemizedFee[];
3495
+ discountAmount?: BigDecimalWrapper;
3496
+ taxedAmount?: BigDecimalWrapper;
3519
3497
  }
3520
- export interface AggregateOrdersRequest {
3521
- /** Filter applied to original data */
3522
- filter?: Record<string, any> | null;
3523
- /** This is an object defining aggregation itself */
3524
- aggregation?: Record<string, any> | null;
3525
- /**
3526
- * Optional custom separator string that can be used to override default separator value '|'
3527
- * for hierarchical responses of multifaceted aggregation requests like:
3528
- * '{"aggregation": {"example_request_key": {"$count" : ["deliveryMethod", "shippingRegion"]}}}'
3529
- * with example response for default '|' separator like:
3530
- * '{"aggregates" :{"example_request_key": {"(Mail|Region 1)": 5, "(Pickup|Region 2)": 10}}}'
3531
- */
3532
- hierarchySeparatorOverride?: string | null;
3498
+ export interface ItemizedFee {
3499
+ name?: string;
3500
+ price?: BigDecimalWrapper;
3533
3501
  }
3534
- export interface AggregateOrdersResponse {
3535
- aggregates?: Record<string, any> | null;
3502
+ export interface Discount extends DiscountOneDiscountTypeOneOf {
3503
+ /** Discount as percentage value. */
3504
+ percentage?: BigDecimalWrapper;
3536
3505
  }
3537
- export interface DecrementItemsQuantityRequest {
3538
- /** Order ID */
3539
- _id?: string;
3540
- /** Which items to decrement, and how much to decrement from each one */
3541
- decrementData?: DecrementData[];
3506
+ /** @oneof */
3507
+ export interface DiscountOneDiscountTypeOneOf {
3508
+ /** Discount as percentage value. */
3509
+ percentage?: BigDecimalWrapper;
3542
3510
  }
3543
- export interface DecrementData {
3544
- /** ID of the line item being decremented. */
3545
- lineItemId?: string;
3546
- /** Line item quantity being decremented. */
3547
- decrementBy?: number;
3548
- /** Whether to restock the line item (triggers inventory update). */
3549
- restock?: boolean;
3511
+ export interface CalculatedTaxes {
3512
+ /** consider calculated or not - cannot enforce set */
3513
+ taxes?: CalculatedTax[];
3550
3514
  }
3551
- export interface DecrementItemsQuantityResponse {
3552
- /** Updated order data */
3553
- order?: Order;
3515
+ export interface CalculatedTax {
3516
+ name?: string;
3517
+ rate?: BigDecimalWrapper;
3518
+ /** the costs on which the taxes are applied */
3519
+ taxable?: BigDecimalWrapper;
3520
+ /** the taxes as a result of the */
3521
+ taxed?: BigDecimalWrapper;
3522
+ code?: string | null;
3554
3523
  }
3555
- /** Triggered when order items are marked as restocked */
3556
- export interface OrderItemsRestocked {
3557
- /** The order which items were restocked */
3558
- order?: Order;
3559
- /** Restocked items and quantities */
3560
- restockItems?: RestockItem[];
3524
+ export interface Payments {
3525
+ payments?: Payment[];
3561
3526
  }
3562
- export interface RestockItem {
3563
- /** ID of the line item being restocked. */
3564
- lineItemId?: string;
3565
- /** Line item quantity being restocked. */
3566
- quantity?: number;
3527
+ export interface Payment {
3528
+ /** document */
3529
+ _id?: string;
3530
+ type?: string;
3531
+ amount?: BigDecimalWrapper;
3532
+ date?: Date;
3533
+ /**
3534
+ * The orderId of the order in cashier associated with the payment.
3535
+ * This field is populated for external payments that are charged by invoices via AddPayment endpoint.
3536
+ */
3537
+ orderId?: string | null;
3538
+ /**
3539
+ * The transactionId corresponding to the orderId of the payment which are returned by cashier.
3540
+ * This field is populated for external payments that are charged by invoices via AddPayment endpoint as well.
3541
+ */
3542
+ transactionId?: string | null;
3567
3543
  }
3568
- /** Triggered when the the order status changes to approved */
3569
- export interface OrderApproved {
3570
- /** The order that was updated */
3571
- order?: Order;
3544
+ export interface MetaData {
3545
+ notes?: string | null;
3546
+ legalTerms?: string | null;
3547
+ sourceUrl?: string | null;
3548
+ sourceProperties?: Record<string, string>;
3549
+ source?: string | null;
3550
+ sourceRefId?: string | null;
3551
+ /** Optional indicator whether to allow editing of the invoice by other applications other than the source. Default is true. */
3552
+ allowEditByOthers?: boolean | null;
3572
3553
  }
3573
- export interface Task {
3574
- key?: TaskKey;
3575
- executeAt?: Date;
3576
- payload?: string | null;
3554
+ export interface InvoiceDynamicPriceTotals {
3555
+ paidAmount?: BigDecimalWrapper;
3556
+ balance?: BigDecimalWrapper;
3577
3557
  }
3578
- export interface TaskKey {
3579
- appId?: string;
3580
- instanceId?: string;
3581
- subjectId?: string | null;
3558
+ /**
3559
+ * A custom field value is used to add additional data to a financial document or to a financial document template.
3560
+ * The custom field value may be based on a custom field definition.
3561
+ */
3562
+ export interface CustomFieldValue {
3563
+ /**
3564
+ * The unique id of the custom field value
3565
+ * @readonly
3566
+ */
3567
+ _id?: string | null;
3568
+ /** The display name of the custom field value */
3569
+ displayName?: string;
3570
+ /** The optional namespace of the custom field value. This field may be used to indicate intended usage or source. */
3571
+ namespace?: string | null;
3572
+ /** The group of the custom field indicates its intended placement in the financial document */
3573
+ group?: CustomFieldGroup;
3574
+ /** The value of the custom field */
3575
+ value?: Value;
3576
+ /** The optional key of the custom field definition on which the custom field value is based */
3577
+ originCustomFieldKey?: string | null;
3582
3578
  }
3583
- export interface TaskAction extends TaskActionActionOneOf {
3584
- complete?: Complete;
3585
- cancel?: Cancel;
3586
- reschedule?: Reschedule;
3579
+ export declare enum CustomFieldGroup {
3580
+ UNKNOWN_CUSTOM_FIELD_GROUP = "UNKNOWN_CUSTOM_FIELD_GROUP",
3581
+ BUSINESS_DETAILS = "BUSINESS_DETAILS",
3582
+ CUSTOMER_DETAILS = "CUSTOMER_DETAILS",
3583
+ DOCUMENT = "DOCUMENT",
3584
+ FOOTER = "FOOTER",
3585
+ OTHER = "OTHER"
3587
3586
  }
3588
- /** @oneof */
3589
- export interface TaskActionActionOneOf {
3590
- complete?: Complete;
3591
- cancel?: Cancel;
3592
- reschedule?: Reschedule;
3587
+ export interface Value {
3588
+ value?: string;
3589
+ valueType?: ValueType;
3593
3590
  }
3594
- export interface Complete {
3591
+ export declare enum ValueType {
3592
+ UNKNOWN_VALUE_TYPE = "UNKNOWN_VALUE_TYPE",
3593
+ STRING = "STRING",
3594
+ DATE = "DATE",
3595
+ BOOLEAN = "BOOLEAN",
3596
+ NUMBER = "NUMBER"
3595
3597
  }
3596
- export interface Cancel {
3598
+ export interface Deposit {
3599
+ /** The flat amount of the deposit. The flat amount of the deposit must be less than the invoice total. */
3600
+ flatAmount?: string;
3601
+ /**
3602
+ * The read-only percentage value of the deposit.
3603
+ * It is computed according to the flat_amount and the invoice total and is rounded to 2 digits precision.
3604
+ * @readonly
3605
+ */
3606
+ percentage?: string;
3607
+ /** The type of the deposit. The default is FLAT. */
3608
+ type?: DepositType;
3597
3609
  }
3598
- export interface Reschedule {
3599
- executeAt?: Date;
3600
- payload?: string | null;
3610
+ export declare enum DepositType {
3611
+ UNKNOWN = "UNKNOWN",
3612
+ FLAT = "FLAT",
3613
+ PERCENTAGE = "PERCENTAGE"
3601
3614
  }
3602
- export interface InvoiceSentEvent {
3603
- _id?: IdAndVersion;
3604
- /** @readonly */
3605
- data?: InvoiceFields;
3606
- /** @readonly */
3607
- status?: InvoiceStatus;
3615
+ /**
3616
+ * InvoiceStatus allowed transitions based on current status:
3617
+ * Draft -> Deleted, Paid, Partially Paid, Sent
3618
+ * Sent -> Draft, Deleted, Void, Paid, Partially Paid, Processing, (Overdue)
3619
+ * Processing -> PartiallyPaid, Paid, Sent
3620
+ * Paid -> Void
3621
+ * PartiallyPaid -> Void, (PartialAndOverdue)
3622
+ * Void -> Deleted
3623
+ * Deleted
3624
+ */
3625
+ export declare enum InvoiceStatus {
3626
+ Draft = "Draft",
3627
+ Sent = "Sent",
3628
+ Processing = "Processing",
3629
+ Paid = "Paid",
3630
+ Overdue = "Overdue",
3631
+ Void = "Void",
3632
+ Deleted = "Deleted",
3633
+ PartiallyPaid = "PartiallyPaid",
3634
+ PartialAndOverdue = "PartialAndOverdue"
3608
3635
  }
3609
3636
  export interface TriggerSideEffectsFromLegacyData {
3610
3637
  storeId?: string;
@@ -3878,6 +3905,14 @@ export interface GetOrderResponseNonNullableFields {
3878
3905
  };
3879
3906
  };
3880
3907
  };
3908
+ tags?: {
3909
+ privateTags?: {
3910
+ tagIds: string[];
3911
+ };
3912
+ tags?: {
3913
+ tagIds: string[];
3914
+ };
3915
+ };
3881
3916
  };
3882
3917
  }
3883
3918
  export interface SearchOrdersResponseNonNullableFields {
@@ -4147,6 +4182,14 @@ export interface SearchOrdersResponseNonNullableFields {
4147
4182
  };
4148
4183
  };
4149
4184
  };
4185
+ tags?: {
4186
+ privateTags?: {
4187
+ tagIds: string[];
4188
+ };
4189
+ tags?: {
4190
+ tagIds: string[];
4191
+ };
4192
+ };
4150
4193
  }[];
4151
4194
  }
4152
4195
  export interface CreateOrderResponseNonNullableFields {
@@ -4416,6 +4459,14 @@ export interface CreateOrderResponseNonNullableFields {
4416
4459
  };
4417
4460
  };
4418
4461
  };
4462
+ tags?: {
4463
+ privateTags?: {
4464
+ tagIds: string[];
4465
+ };
4466
+ tags?: {
4467
+ tagIds: string[];
4468
+ };
4469
+ };
4419
4470
  };
4420
4471
  }
4421
4472
  export interface UpdateOrderResponseNonNullableFields {
@@ -4685,6 +4736,14 @@ export interface UpdateOrderResponseNonNullableFields {
4685
4736
  };
4686
4737
  };
4687
4738
  };
4739
+ tags?: {
4740
+ privateTags?: {
4741
+ tagIds: string[];
4742
+ };
4743
+ tags?: {
4744
+ tagIds: string[];
4745
+ };
4746
+ };
4688
4747
  };
4689
4748
  }
4690
4749
  export interface CancelOrderResponseNonNullableFields {
@@ -4954,6 +5013,14 @@ export interface CancelOrderResponseNonNullableFields {
4954
5013
  };
4955
5014
  };
4956
5015
  };
5016
+ tags?: {
5017
+ privateTags?: {
5018
+ tagIds: string[];
5019
+ };
5020
+ tags?: {
5021
+ tagIds: string[];
5022
+ };
5023
+ };
4957
5024
  };
4958
5025
  }
4959
5026
  /**
@@ -5204,6 +5271,8 @@ export interface UpdateOrder {
5204
5271
  * + No shipping option is selected.
5205
5272
  */
5206
5273
  recipientInfo?: AddressWithContact;
5274
+ /** Tag ids collections associated with current entity. private_tags requires separate permissions to be accessible and modifiable. */
5275
+ tags?: Tags;
5207
5276
  }
5208
5277
  /**
5209
5278
  * Cancels an order.