@wix/auto_sdk_ecom_current-cart 1.0.181 → 1.0.183

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 (41) hide show
  1. package/build/cjs/index.d.ts +9 -0
  2. package/build/cjs/index.js +6 -6
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +28 -12
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +2 -12
  7. package/build/cjs/meta.js +2 -0
  8. package/build/cjs/meta.js.map +1 -1
  9. package/build/cjs/schemas.js +599 -579
  10. package/build/cjs/schemas.js.map +1 -1
  11. package/build/es/index.d.mts +9 -0
  12. package/build/es/index.mjs +6 -6
  13. package/build/es/index.mjs.map +1 -1
  14. package/build/es/index.typings.d.mts +28 -12
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +2 -12
  17. package/build/es/meta.mjs +2 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/es/schemas.mjs +599 -579
  20. package/build/es/schemas.mjs.map +1 -1
  21. package/build/internal/cjs/index.d.ts +9 -0
  22. package/build/internal/cjs/index.js +6 -6
  23. package/build/internal/cjs/index.js.map +1 -1
  24. package/build/internal/cjs/index.typings.d.ts +275 -12
  25. package/build/internal/cjs/index.typings.js.map +1 -1
  26. package/build/internal/cjs/meta.d.ts +528 -13
  27. package/build/internal/cjs/meta.js +2 -0
  28. package/build/internal/cjs/meta.js.map +1 -1
  29. package/build/internal/cjs/schemas.js +599 -579
  30. package/build/internal/cjs/schemas.js.map +1 -1
  31. package/build/internal/es/index.d.mts +9 -0
  32. package/build/internal/es/index.mjs +6 -6
  33. package/build/internal/es/index.mjs.map +1 -1
  34. package/build/internal/es/index.typings.d.mts +275 -12
  35. package/build/internal/es/index.typings.mjs.map +1 -1
  36. package/build/internal/es/meta.d.mts +528 -13
  37. package/build/internal/es/meta.mjs +2 -0
  38. package/build/internal/es/meta.mjs.map +1 -1
  39. package/build/internal/es/schemas.mjs +599 -579
  40. package/build/internal/es/schemas.mjs.map +1 -1
  41. package/package.json +4 -4
@@ -53,8 +53,8 @@ module.exports = __toCommonJS(schemas_exports);
53
53
 
54
54
  // src/ecom-v1-cart-current-cart.schemas.ts
55
55
  var z = __toESM(require("zod"));
56
- var GetCurrentCartRequest = z.object({});
57
- var GetCurrentCartResponse = z.object({
56
+ var GetCurrentCartRequest = /* @__PURE__ */ z.object({});
57
+ var GetCurrentCartResponse = /* @__PURE__ */ z.object({
58
58
  _id: z.string().describe("Cart ID.").regex(
59
59
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
60
60
  "Must be a valid GUID"
@@ -645,7 +645,7 @@ var GetCurrentCartResponse = z.object({
645
645
  "Revision number, which increments by 1 each time the Cart is updated."
646
646
  ).optional().nullable()
647
647
  });
648
- var UpdateCurrentCartRequest = z.object({
648
+ var UpdateCurrentCartRequest = /* @__PURE__ */ z.object({
649
649
  options: z.object({
650
650
  cartInfo: z.object({
651
651
  _id: z.string().describe("Cart ID.").regex(
@@ -1926,7 +1926,7 @@ var UpdateCurrentCartRequest = z.object({
1926
1926
  ).max(300).optional()
1927
1927
  }).describe("Current cart update options.").optional()
1928
1928
  });
1929
- var UpdateCurrentCartResponse = z.object({
1929
+ var UpdateCurrentCartResponse = /* @__PURE__ */ z.object({
1930
1930
  _id: z.string().describe("Cart ID.").regex(
1931
1931
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1932
1932
  "Must be a valid GUID"
@@ -2517,7 +2517,7 @@ var UpdateCurrentCartResponse = z.object({
2517
2517
  "Revision number, which increments by 1 each time the Cart is updated."
2518
2518
  ).optional().nullable()
2519
2519
  });
2520
- var AddToCurrentCartRequest = z.object({
2520
+ var AddToCurrentCartRequest = /* @__PURE__ */ z.object({
2521
2521
  options: z.object({
2522
2522
  lineItems: z.array(
2523
2523
  z.object({
@@ -3184,7 +3184,7 @@ var AddToCurrentCartRequest = z.object({
3184
3184
  ).optional().nullable()
3185
3185
  }).describe("Items to be added to the current cart.").optional()
3186
3186
  });
3187
- var AddToCurrentCartResponse = z.object({
3187
+ var AddToCurrentCartResponse = /* @__PURE__ */ z.object({
3188
3188
  cart: z.object({
3189
3189
  _id: z.string().describe("Cart ID.").regex(
3190
3190
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -3783,10 +3783,10 @@ var AddToCurrentCartResponse = z.object({
3783
3783
  ).optional().nullable()
3784
3784
  }).describe("Updated cart.").optional()
3785
3785
  });
3786
- var RemoveLineItemsFromCurrentCartRequest = z.object({
3786
+ var RemoveLineItemsFromCurrentCartRequest = /* @__PURE__ */ z.object({
3787
3787
  lineItemIds: z.array(z.string()).min(1).max(100)
3788
3788
  });
3789
- var RemoveLineItemsFromCurrentCartResponse = z.object({
3789
+ var RemoveLineItemsFromCurrentCartResponse = /* @__PURE__ */ z.object({
3790
3790
  cart: z.object({
3791
3791
  _id: z.string().describe("Cart ID.").regex(
3792
3792
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -4385,7 +4385,7 @@ var RemoveLineItemsFromCurrentCartResponse = z.object({
4385
4385
  ).optional().nullable()
4386
4386
  }).describe("Updated cart.").optional()
4387
4387
  });
4388
- var CreateCheckoutFromCurrentCartRequest = z.object({
4388
+ var CreateCheckoutFromCurrentCartRequest = /* @__PURE__ */ z.object({
4389
4389
  options: z.object({
4390
4390
  channelType: z.enum([
4391
4391
  "UNSPECIFIED",
@@ -4479,11 +4479,11 @@ var CreateCheckoutFromCurrentCartRequest = z.object({
4479
4479
  ).email().optional().nullable()
4480
4480
  }).describe("Checkout creation options.").optional()
4481
4481
  });
4482
- var CreateCheckoutFromCurrentCartResponse = z.object({
4482
+ var CreateCheckoutFromCurrentCartResponse = /* @__PURE__ */ z.object({
4483
4483
  checkoutId: z.string().describe("The newly created checkout's ID.").optional()
4484
4484
  });
4485
- var RemoveCouponFromCurrentCartRequest = z.object({});
4486
- var RemoveCouponFromCurrentCartResponse = z.object({
4485
+ var RemoveCouponFromCurrentCartRequest = /* @__PURE__ */ z.object({});
4486
+ var RemoveCouponFromCurrentCartResponse = /* @__PURE__ */ z.object({
4487
4487
  cart: z.object({
4488
4488
  _id: z.string().describe("Cart ID.").regex(
4489
4489
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -5082,7 +5082,7 @@ var RemoveCouponFromCurrentCartResponse = z.object({
5082
5082
  ).optional().nullable()
5083
5083
  }).describe("Updated cart.").optional()
5084
5084
  });
5085
- var UpdateCurrentCartLineItemQuantityRequest = z.object({
5085
+ var UpdateCurrentCartLineItemQuantityRequest = /* @__PURE__ */ z.object({
5086
5086
  lineItems: z.array(
5087
5087
  z.object({
5088
5088
  _id: z.string().describe("*Required.** Line item ID.").regex(
@@ -5093,606 +5093,626 @@ var UpdateCurrentCartLineItemQuantityRequest = z.object({
5093
5093
  })
5094
5094
  ).min(1).max(100)
5095
5095
  });
5096
- var UpdateCurrentCartLineItemQuantityResponse = z.object({
5097
- cart: z.object({
5098
- _id: z.string().describe("Cart ID.").regex(
5099
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5100
- "Must be a valid GUID"
5101
- ).optional().nullable(),
5102
- lineItems: z.array(
5103
- z.object({
5104
- _id: z.string().describe("Line item ID.").regex(
5105
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5106
- "Must be a valid GUID"
5107
- ).optional().nullable(),
5108
- quantity: z.number().int().describe("Item quantity.").min(1).max(1e5).optional(),
5109
- catalogReference: z.object({
5110
- catalogItemId: z.string().describe("ID of the item within the catalog it belongs to.").min(1).max(36).optional(),
5111
- appId: z.string().describe(
5112
- 'ID of the app providing the catalog.\n\nYou can get your app\'s ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n\nFor items from Wix catalogs, the following values always apply:\n+ Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`\n+ Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`\n+ Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`'
5113
- ).min(1).optional(),
5114
- options: z.record(z.string(), z.any()).describe(
5115
- "Additional item details in `key:value` pairs.\n\nUse this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n\nFor Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\nor [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction)."
5116
- ).optional().nullable()
5117
- }).describe(
5118
- "Catalog and item reference. Holds IDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin."
5119
- ).optional(),
5120
- productName: z.object({
5121
- original: z.string().describe(
5122
- "__Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5123
- ).min(1).max(200).optional(),
5124
- translated: z.string().describe(
5125
- "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5126
- ).min(1).max(400).optional().nullable()
5127
- }).describe(
5128
- "Item name.\n+ Stores - `product.name`\n+ Bookings - `service.info.name`\n+ Events - `ticket.name`"
5129
- ).optional(),
5130
- url: z.string().describe("URL to the item's page on the site.").optional(),
5131
- price: z.object({
5132
- amount: z.string().describe("Amount.").optional(),
5133
- convertedAmount: z.string().describe("Converted amount.").optional(),
5134
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5135
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5136
- }).describe(
5137
- "Item price **after** catalog-defined discount and line item discounts."
5138
- ).optional(),
5139
- fullPrice: z.object({
5140
- amount: z.string().describe("Amount.").optional(),
5141
- convertedAmount: z.string().describe("Converted amount.").optional(),
5142
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5143
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5144
- }).describe(
5145
- "Item price **before** catalog-defined discount. Defaults to `price` when not provided."
5146
- ).optional(),
5147
- priceBeforeDiscounts: z.object({
5148
- amount: z.string().describe("Amount.").optional(),
5149
- convertedAmount: z.string().describe("Converted amount.").optional(),
5150
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5151
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5152
- }).describe(
5153
- "Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided."
5154
- ).optional(),
5155
- lineItemPrice: z.object({
5156
- amount: z.string().describe("Amount.").optional(),
5157
- convertedAmount: z.string().describe("Converted amount.").optional(),
5158
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5159
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5160
- }).describe(
5161
- "Total price **after** catalog-defined discount and line item discounts."
5162
- ).optional(),
5163
- descriptionLines: z.array(
5164
- z.intersection(
5165
- z.object({
5166
- name: z.object({
5167
- original: z.string().describe(
5168
- "Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5169
- ).max(100).optional(),
5170
- translated: z.string().describe(
5171
- "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5172
- ).max(200).optional().nullable()
5173
- }).describe("Description line name.").optional()
5174
- }),
5096
+ var UpdateCurrentCartLineItemQuantityResponse = /* @__PURE__ */ z.object(
5097
+ {
5098
+ cart: z.object({
5099
+ _id: z.string().describe("Cart ID.").regex(
5100
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5101
+ "Must be a valid GUID"
5102
+ ).optional().nullable(),
5103
+ lineItems: z.array(
5104
+ z.object({
5105
+ _id: z.string().describe("Line item ID.").regex(
5106
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5107
+ "Must be a valid GUID"
5108
+ ).optional().nullable(),
5109
+ quantity: z.number().int().describe("Item quantity.").min(1).max(1e5).optional(),
5110
+ catalogReference: z.object({
5111
+ catalogItemId: z.string().describe(
5112
+ "ID of the item within the catalog it belongs to."
5113
+ ).min(1).max(36).optional(),
5114
+ appId: z.string().describe(
5115
+ 'ID of the app providing the catalog.\n\nYou can get your app\'s ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).\n\nFor items from Wix catalogs, the following values always apply:\n+ Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`\n+ Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`\n+ Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`'
5116
+ ).min(1).optional(),
5117
+ options: z.record(z.string(), z.any()).describe(
5118
+ "Additional item details in `key:value` pairs.\n\nUse this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.\n\nFor Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)\nor [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction)."
5119
+ ).optional().nullable()
5120
+ }).describe(
5121
+ "Catalog and item reference. Holds IDs for the item and the catalog it came from, as well as further optional info. Optional for custom line items, which don't trigger the Catalog service plugin."
5122
+ ).optional(),
5123
+ productName: z.object({
5124
+ original: z.string().describe(
5125
+ "__Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5126
+ ).min(1).max(200).optional(),
5127
+ translated: z.string().describe(
5128
+ "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5129
+ ).min(1).max(400).optional().nullable()
5130
+ }).describe(
5131
+ "Item name.\n+ Stores - `product.name`\n+ Bookings - `service.info.name`\n+ Events - `ticket.name`"
5132
+ ).optional(),
5133
+ url: z.string().describe("URL to the item's page on the site.").optional(),
5134
+ price: z.object({
5135
+ amount: z.string().describe("Amount.").optional(),
5136
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5137
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5138
+ formattedConvertedAmount: z.string().describe(
5139
+ "Converted amount formatted with currency symbol."
5140
+ ).optional()
5141
+ }).describe(
5142
+ "Item price **after** catalog-defined discount and line item discounts."
5143
+ ).optional(),
5144
+ fullPrice: z.object({
5145
+ amount: z.string().describe("Amount.").optional(),
5146
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5147
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5148
+ formattedConvertedAmount: z.string().describe(
5149
+ "Converted amount formatted with currency symbol."
5150
+ ).optional()
5151
+ }).describe(
5152
+ "Item price **before** catalog-defined discount. Defaults to `price` when not provided."
5153
+ ).optional(),
5154
+ priceBeforeDiscounts: z.object({
5155
+ amount: z.string().describe("Amount.").optional(),
5156
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5157
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5158
+ formattedConvertedAmount: z.string().describe(
5159
+ "Converted amount formatted with currency symbol."
5160
+ ).optional()
5161
+ }).describe(
5162
+ "Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided."
5163
+ ).optional(),
5164
+ lineItemPrice: z.object({
5165
+ amount: z.string().describe("Amount.").optional(),
5166
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5167
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5168
+ formattedConvertedAmount: z.string().describe(
5169
+ "Converted amount formatted with currency symbol."
5170
+ ).optional()
5171
+ }).describe(
5172
+ "Total price **after** catalog-defined discount and line item discounts."
5173
+ ).optional(),
5174
+ descriptionLines: z.array(
5175
+ z.intersection(
5176
+ z.object({
5177
+ name: z.object({
5178
+ original: z.string().describe(
5179
+ "Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5180
+ ).max(100).optional(),
5181
+ translated: z.string().describe(
5182
+ "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5183
+ ).max(200).optional().nullable()
5184
+ }).describe("Description line name.").optional()
5185
+ }),
5186
+ z.xor([
5187
+ z.object({
5188
+ plainText: z.never().optional(),
5189
+ colorInfo: z.never().optional()
5190
+ }),
5191
+ z.object({
5192
+ colorInfo: z.never().optional(),
5193
+ plainText: z.object({
5194
+ original: z.string().describe(
5195
+ "Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5196
+ ).max(600).optional(),
5197
+ translated: z.string().describe(
5198
+ "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5199
+ ).max(600).optional().nullable()
5200
+ }).describe("Description line plain text value.")
5201
+ }),
5202
+ z.object({
5203
+ plainText: z.never().optional(),
5204
+ colorInfo: z.object({
5205
+ original: z.string().describe(
5206
+ "Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5207
+ ).max(500).optional(),
5208
+ translated: z.string().describe(
5209
+ "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5210
+ ).max(500).optional().nullable(),
5211
+ code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5212
+ }).describe("Description line color value.")
5213
+ })
5214
+ ])
5215
+ )
5216
+ ).optional(),
5217
+ image: z.string().describe("Line item image details.").optional(),
5218
+ availability: z.object({
5219
+ status: z.enum([
5220
+ "AVAILABLE",
5221
+ "NOT_FOUND",
5222
+ "NOT_AVAILABLE",
5223
+ "PARTIALLY_AVAILABLE"
5224
+ ]).describe("Item availability status.").optional(),
5225
+ quantityAvailable: z.number().int().describe("Quantity available.").optional().nullable()
5226
+ }).describe("Item availability details.").optional(),
5227
+ physicalProperties: z.object({
5228
+ weight: z.number().describe(
5229
+ "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5230
+ ).optional().nullable(),
5231
+ sku: z.string().describe(
5232
+ "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5233
+ ).max(40).optional().nullable(),
5234
+ shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5235
+ }).describe(
5236
+ "Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability."
5237
+ ).optional(),
5238
+ itemType: z.intersection(
5239
+ z.object({}),
5175
5240
  z.xor([
5176
5241
  z.object({
5177
- plainText: z.never().optional(),
5178
- colorInfo: z.never().optional()
5242
+ preset: z.never().optional(),
5243
+ custom: z.never().optional()
5179
5244
  }),
5180
5245
  z.object({
5181
- colorInfo: z.never().optional(),
5182
- plainText: z.object({
5183
- original: z.string().describe(
5184
- "Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5185
- ).max(600).optional(),
5186
- translated: z.string().describe(
5187
- "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5188
- ).max(600).optional().nullable()
5189
- }).describe("Description line plain text value.")
5246
+ custom: z.never().optional(),
5247
+ preset: z.enum([
5248
+ "UNRECOGNISED",
5249
+ "PHYSICAL",
5250
+ "DIGITAL",
5251
+ "GIFT_CARD",
5252
+ "SERVICE"
5253
+ ]).describe("Preset item type.")
5190
5254
  }),
5191
5255
  z.object({
5192
- plainText: z.never().optional(),
5193
- colorInfo: z.object({
5194
- original: z.string().describe(
5195
- "Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5196
- ).max(500).optional(),
5197
- translated: z.string().describe(
5198
- "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5199
- ).max(500).optional().nullable(),
5200
- code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5201
- }).describe("Description line color value.")
5256
+ preset: z.never().optional(),
5257
+ custom: z.string().describe(
5258
+ "Custom item type. When none of the preset types are suitable, specifies the custom type."
5259
+ )
5202
5260
  })
5203
5261
  ])
5204
- )
5205
- ).optional(),
5206
- image: z.string().describe("Line item image details.").optional(),
5207
- availability: z.object({
5208
- status: z.enum([
5209
- "AVAILABLE",
5210
- "NOT_FOUND",
5211
- "NOT_AVAILABLE",
5212
- "PARTIALLY_AVAILABLE"
5213
- ]).describe("Item availability status.").optional(),
5214
- quantityAvailable: z.number().int().describe("Quantity available.").optional().nullable()
5215
- }).describe("Item availability details.").optional(),
5216
- physicalProperties: z.object({
5217
- weight: z.number().describe(
5218
- "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5219
- ).optional().nullable(),
5220
- sku: z.string().describe(
5221
- "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5222
- ).max(40).optional().nullable(),
5223
- shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5224
- }).describe(
5225
- "Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability."
5226
- ).optional(),
5227
- itemType: z.intersection(
5228
- z.object({}),
5229
- z.xor([
5230
- z.object({
5231
- preset: z.never().optional(),
5232
- custom: z.never().optional()
5233
- }),
5234
- z.object({
5235
- custom: z.never().optional(),
5236
- preset: z.enum([
5237
- "UNRECOGNISED",
5238
- "PHYSICAL",
5239
- "DIGITAL",
5240
- "GIFT_CARD",
5241
- "SERVICE"
5242
- ]).describe("Preset item type.")
5243
- }),
5244
- z.object({
5245
- preset: z.never().optional(),
5246
- custom: z.string().describe(
5247
- "Custom item type. When none of the preset types are suitable, specifies the custom type."
5248
- )
5249
- })
5250
- ])
5251
- ).describe("Item type. Either a preset type or custom.").optional(),
5252
- subscriptionOptionInfo: z.object({
5253
- subscriptionSettings: z.object({
5254
- frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
5255
- interval: z.number().int().describe(
5256
- "Interval of recurring payment.\n\nDefault: `1`.\nIf SubscriptionFrequency is Day the minimum interval is 7"
5257
- ).min(1).max(3650).optional().nullable(),
5258
- autoRenewal: z.boolean().describe(
5259
- "Whether subscription is renewed automatically at the end of each period."
5260
- ).optional(),
5261
- billingCycles: z.number().int().describe(
5262
- "Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`."
5263
- ).min(1).optional().nullable(),
5264
- enableCustomerCancellation: z.boolean().describe(
5265
- "Whether to allow the customer to cancel the subscription.."
5266
- ).optional(),
5267
- freeTrialPeriod: z.object({
5268
- frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe(
5269
- "Frequency of period. Values: DAY, WEEK, MONTH, YEAR"
5270
- ).optional(),
5262
+ ).describe("Item type. Either a preset type or custom.").optional(),
5263
+ subscriptionOptionInfo: z.object({
5264
+ subscriptionSettings: z.object({
5265
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
5271
5266
  interval: z.number().int().describe(
5272
- "Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial."
5273
- ).min(1).max(999).optional()
5274
- }).describe(
5275
- "Period until first cycle starts. If applied payNow will be 0\nIf None => no free trial"
5276
- ).optional()
5277
- }).describe("Subscription option settings.").optional(),
5278
- title: z.object({
5267
+ "Interval of recurring payment.\n\nDefault: `1`.\nIf SubscriptionFrequency is Day the minimum interval is 7"
5268
+ ).min(1).max(3650).optional().nullable(),
5269
+ autoRenewal: z.boolean().describe(
5270
+ "Whether subscription is renewed automatically at the end of each period."
5271
+ ).optional(),
5272
+ billingCycles: z.number().int().describe(
5273
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`."
5274
+ ).min(1).optional().nullable(),
5275
+ enableCustomerCancellation: z.boolean().describe(
5276
+ "Whether to allow the customer to cancel the subscription.."
5277
+ ).optional(),
5278
+ freeTrialPeriod: z.object({
5279
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe(
5280
+ "Frequency of period. Values: DAY, WEEK, MONTH, YEAR"
5281
+ ).optional(),
5282
+ interval: z.number().int().describe(
5283
+ "Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial."
5284
+ ).min(1).max(999).optional()
5285
+ }).describe(
5286
+ "Period until first cycle starts. If applied payNow will be 0\nIf None => no free trial"
5287
+ ).optional()
5288
+ }).describe("Subscription option settings.").optional(),
5289
+ title: z.object({
5290
+ original: z.string().describe(
5291
+ "Subscription option name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5292
+ ).min(1).max(150).optional(),
5293
+ translated: z.string().describe(
5294
+ "Subscription option name translated into the buyer's language.\n\nDefault: Same as `original`."
5295
+ ).min(1).max(150).optional().nullable()
5296
+ }).describe("Subscription option title.").optional(),
5297
+ description: z.object({
5298
+ original: z.string().describe("Subscription option description.").max(500).optional(),
5299
+ translated: z.string().describe("Translated subscription option description.").max(500).optional().nullable()
5300
+ }).describe("Subscription option description.").optional()
5301
+ }).describe("Subscription option information.").optional(),
5302
+ paymentOption: z.enum([
5303
+ "FULL_PAYMENT_ONLINE",
5304
+ "FULL_PAYMENT_OFFLINE",
5305
+ "MEMBERSHIP",
5306
+ "DEPOSIT_ONLINE",
5307
+ "MEMBERSHIP_OFFLINE",
5308
+ "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5309
+ ]).describe(
5310
+ "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5311
+ ).optional(),
5312
+ serviceProperties: z.object({
5313
+ scheduledDate: z.date().describe(
5314
+ "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.\nFor example, the start time of a class."
5315
+ ).optional().nullable(),
5316
+ numberOfParticipants: z.number().int().describe(
5317
+ "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."
5318
+ ).min(1).max(1e4).optional().nullable()
5319
+ }).describe(
5320
+ "Service properties. When relevant, this contains information such as date and number of participants."
5321
+ ).optional(),
5322
+ rootCatalogItemId: z.string().describe(
5323
+ "In cases where `catalogReference.catalogItemId` is NOT the actual catalog item ID, this field will return the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID.\n+ in most cases, this field is the same as `catalogReference.catalogItemId`.\n+ Used in membership validation."
5324
+ ).min(1).max(36).optional().nullable(),
5325
+ priceDescription: z.object({
5279
5326
  original: z.string().describe(
5280
- "Subscription option name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5281
- ).min(1).max(150).optional(),
5327
+ "__Required.__ Price description in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5328
+ ).min(1).max(100).optional(),
5282
5329
  translated: z.string().describe(
5283
- "Subscription option name translated into the buyer's language.\n\nDefault: Same as `original`."
5284
- ).min(1).max(150).optional().nullable()
5285
- }).describe("Subscription option title.").optional(),
5286
- description: z.object({
5287
- original: z.string().describe("Subscription option description.").max(500).optional(),
5288
- translated: z.string().describe("Translated subscription option description.").max(500).optional().nullable()
5289
- }).describe("Subscription option description.").optional()
5290
- }).describe("Subscription option information.").optional(),
5291
- paymentOption: z.enum([
5292
- "FULL_PAYMENT_ONLINE",
5293
- "FULL_PAYMENT_OFFLINE",
5294
- "MEMBERSHIP",
5295
- "DEPOSIT_ONLINE",
5296
- "MEMBERSHIP_OFFLINE",
5297
- "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5298
- ]).describe(
5299
- "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5300
- ).optional(),
5301
- serviceProperties: z.object({
5302
- scheduledDate: z.date().describe(
5303
- "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.\nFor example, the start time of a class."
5330
+ "Price description translated into the buyer's language.\n\nDefault: Same as `original`."
5331
+ ).min(1).max(100).optional().nullable()
5332
+ }).describe(
5333
+ 'Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67".'
5334
+ ).optional(),
5335
+ depositAmount: z.object({
5336
+ amount: z.string().describe("Amount.").optional(),
5337
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5338
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5339
+ formattedConvertedAmount: z.string().describe(
5340
+ "Converted amount formatted with currency symbol."
5341
+ ).optional()
5342
+ }).describe(
5343
+ "Partial payment to be paid upfront during the checkout. Eligible for catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only."
5344
+ ).optional(),
5345
+ selectedMembership: z.object({
5346
+ _id: z.string().describe("Membership ID.").min(1).max(100).optional(),
5347
+ appId: z.string().describe("ID of the app providing this payment option.").regex(
5348
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5349
+ "Must be a valid GUID"
5350
+ ).optional()
5351
+ }).describe(
5352
+ "Selected membership to be used as payment for this item. Must be used with `lineItem.paymentOption` set to `MEMBERSHIP` or `MEMBERSHIP_OFFLINE`. This field can be empty when `lineItem.paymentOption` is set to `MEMBERSHIP_OFFLINE`."
5353
+ ).optional(),
5354
+ deliveryProfileId: z.string().describe("Delivery profile ID.").regex(
5355
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5356
+ "Must be a valid GUID"
5304
5357
  ).optional().nullable(),
5305
- numberOfParticipants: z.number().int().describe(
5306
- "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."
5307
- ).min(1).max(1e4).optional().nullable()
5308
- }).describe(
5309
- "Service properties. When relevant, this contains information such as date and number of participants."
5310
- ).optional(),
5311
- rootCatalogItemId: z.string().describe(
5312
- "In cases where `catalogReference.catalogItemId` is NOT the actual catalog item ID, this field will return the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID.\n+ in most cases, this field is the same as `catalogReference.catalogItemId`.\n+ Used in membership validation."
5313
- ).min(1).max(36).optional().nullable(),
5314
- priceDescription: z.object({
5315
- original: z.string().describe(
5316
- "__Required.__ Price description in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5317
- ).min(1).max(100).optional(),
5318
- translated: z.string().describe(
5319
- "Price description translated into the buyer's language.\n\nDefault: Same as `original`."
5320
- ).min(1).max(100).optional().nullable()
5321
- }).describe(
5322
- 'Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67".'
5323
- ).optional(),
5324
- depositAmount: z.object({
5325
- amount: z.string().describe("Amount.").optional(),
5326
- convertedAmount: z.string().describe("Converted amount.").optional(),
5327
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5328
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5329
- }).describe(
5330
- "Partial payment to be paid upfront during the checkout. Eligible for catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only."
5331
- ).optional(),
5332
- selectedMembership: z.object({
5333
- _id: z.string().describe("Membership ID.").min(1).max(100).optional(),
5334
- appId: z.string().describe("ID of the app providing this payment option.").regex(
5358
+ taxGroupId: z.string().describe("Tax group ID for this line item.").regex(
5335
5359
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5336
5360
  "Must be a valid GUID"
5337
- ).optional()
5338
- }).describe(
5339
- "Selected membership to be used as payment for this item. Must be used with `lineItem.paymentOption` set to `MEMBERSHIP` or `MEMBERSHIP_OFFLINE`. This field can be empty when `lineItem.paymentOption` is set to `MEMBERSHIP_OFFLINE`."
5340
- ).optional(),
5341
- deliveryProfileId: z.string().describe("Delivery profile ID.").regex(
5342
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5343
- "Must be a valid GUID"
5344
- ).optional().nullable(),
5345
- taxGroupId: z.string().describe("Tax group ID for this line item.").regex(
5346
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5347
- "Must be a valid GUID"
5348
- ).optional().nullable(),
5349
- customLineItem: z.boolean().describe(
5350
- "Whether the line item is a custom line item. Custom line items don't trigger the Catalog service plugin."
5351
- ).optional(),
5352
- consentRequiredPaymentPolicy: z.string().describe(
5353
- "Item payment policy that requires customer consent to complete purchase. The payment policy will be displayed on the checkout page."
5354
- ).min(1).max(2500).optional().nullable(),
5355
- priceUndetermined: z.boolean().describe(
5356
- "Whether the price is not yet defined, and will be updated after the order is created."
5357
- ).optional(),
5358
- fixedQuantity: z.boolean().describe(
5359
- "Whether the line item quantity is fixed and cannot be changed."
5360
- ).optional(),
5361
- catalogOverrideFields: z.object({
5362
- productName: z.object({
5363
- original: z.string().describe(
5364
- "__Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5365
- ).min(1).max(200).optional(),
5366
- translated: z.string().describe(
5367
- "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5368
- ).min(1).max(400).optional().nullable()
5369
- }).describe("Item name.").optional(),
5370
- price: z.string().describe("Item price **after** discounts.").optional().nullable(),
5371
- fullPrice: z.string().describe("Item price **before** discounts.").optional().nullable(),
5372
- descriptionLines: z.array(
5373
- z.intersection(
5361
+ ).optional().nullable(),
5362
+ customLineItem: z.boolean().describe(
5363
+ "Whether the line item is a custom line item. Custom line items don't trigger the Catalog service plugin."
5364
+ ).optional(),
5365
+ consentRequiredPaymentPolicy: z.string().describe(
5366
+ "Item payment policy that requires customer consent to complete purchase. The payment policy will be displayed on the checkout page."
5367
+ ).min(1).max(2500).optional().nullable(),
5368
+ priceUndetermined: z.boolean().describe(
5369
+ "Whether the price is not yet defined, and will be updated after the order is created."
5370
+ ).optional(),
5371
+ fixedQuantity: z.boolean().describe(
5372
+ "Whether the line item quantity is fixed and cannot be changed."
5373
+ ).optional(),
5374
+ catalogOverrideFields: z.object({
5375
+ productName: z.object({
5376
+ original: z.string().describe(
5377
+ "__Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5378
+ ).min(1).max(200).optional(),
5379
+ translated: z.string().describe(
5380
+ "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5381
+ ).min(1).max(400).optional().nullable()
5382
+ }).describe("Item name.").optional(),
5383
+ price: z.string().describe("Item price **after** discounts.").optional().nullable(),
5384
+ fullPrice: z.string().describe("Item price **before** discounts.").optional().nullable(),
5385
+ descriptionLines: z.array(
5386
+ z.intersection(
5387
+ z.object({
5388
+ name: z.object({
5389
+ original: z.string().describe(
5390
+ "Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5391
+ ).max(100).optional(),
5392
+ translated: z.string().describe(
5393
+ "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5394
+ ).max(200).optional().nullable()
5395
+ }).describe("Description line name.").optional()
5396
+ }),
5397
+ z.xor([
5398
+ z.object({
5399
+ plainText: z.never().optional(),
5400
+ colorInfo: z.never().optional()
5401
+ }),
5402
+ z.object({
5403
+ colorInfo: z.never().optional(),
5404
+ plainText: z.object({
5405
+ original: z.string().describe(
5406
+ "Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5407
+ ).max(600).optional(),
5408
+ translated: z.string().describe(
5409
+ "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5410
+ ).max(600).optional().nullable()
5411
+ }).describe("Description line plain text value.")
5412
+ }),
5413
+ z.object({
5414
+ plainText: z.never().optional(),
5415
+ colorInfo: z.object({
5416
+ original: z.string().describe(
5417
+ "Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5418
+ ).max(500).optional(),
5419
+ translated: z.string().describe(
5420
+ "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5421
+ ).max(500).optional().nullable(),
5422
+ code: z.string().describe(
5423
+ "HEX or RGB color code for display."
5424
+ ).optional().nullable()
5425
+ }).describe("Description line color value.")
5426
+ })
5427
+ ])
5428
+ )
5429
+ ).min(0).max(20).optional(),
5430
+ physicalProperties: z.object({
5431
+ weight: z.number().describe(
5432
+ "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5433
+ ).optional().nullable(),
5434
+ sku: z.string().describe(
5435
+ "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5436
+ ).max(40).optional().nullable(),
5437
+ shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5438
+ }).describe("Physical properties of the item.").optional(),
5439
+ image: z.string().describe("Item image.").optional(),
5440
+ paymentOption: z.object({
5441
+ value: z.enum([
5442
+ "FULL_PAYMENT_ONLINE",
5443
+ "FULL_PAYMENT_OFFLINE",
5444
+ "MEMBERSHIP",
5445
+ "DEPOSIT_ONLINE",
5446
+ "MEMBERSHIP_OFFLINE",
5447
+ "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5448
+ ]).describe(
5449
+ "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5450
+ ).optional()
5451
+ }).describe("Payment method selected for the item.").optional(),
5452
+ depositAmount: z.string().describe(
5453
+ "Only eligible for catalog items with `lineItem.paymentOption.value` type of `DEPOSIT_ONLINE`."
5454
+ ).optional().nullable(),
5455
+ savePaymentMethod: z.boolean().describe(
5456
+ "Whether to save the payment method on the order.\n\nDefault: `false`"
5457
+ ).optional().nullable(),
5458
+ inventoryAppId: z.string().describe("ID of the app managing the inventory.").regex(
5459
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5460
+ "Must be a valid GUID"
5461
+ ).optional().nullable()
5462
+ }).describe(
5463
+ 'Overriding values for catalog item properties.\n\nTo override catalog fields, your app must have the permission scope named "Manage eCommerce - Admin Permissions".\nLearn more about [permission scopes](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).'
5464
+ ).optional(),
5465
+ savePaymentMethod: z.boolean().describe(
5466
+ "Whether to save the payment method on the order.\n\nDefault: `false`"
5467
+ ).optional(),
5468
+ taxableAddress: z.intersection(
5469
+ z.object({}),
5470
+ z.xor([
5471
+ z.object({ addressType: z.never().optional() }),
5374
5472
  z.object({
5375
- name: z.object({
5376
- original: z.string().describe(
5377
- "Description line name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5378
- ).max(100).optional(),
5379
- translated: z.string().describe(
5380
- "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5381
- ).max(200).optional().nullable()
5382
- }).describe("Description line name.").optional()
5383
- }),
5384
- z.xor([
5385
- z.object({
5386
- plainText: z.never().optional(),
5387
- colorInfo: z.never().optional()
5388
- }),
5473
+ addressType: z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
5474
+ "taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
5475
+ )
5476
+ })
5477
+ ])
5478
+ ).describe("Address to use for tax calculation purposes.").optional(),
5479
+ extendedFields: z.object({
5480
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5481
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
5482
+ ).optional()
5483
+ }).describe(
5484
+ "Custom extended fields for the line item object.\n\n[Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured using the 'Checkout & Orders - Line Items Schema Plugin' in the app dashboard before they can be accessed with API calls."
5485
+ ).optional(),
5486
+ policies: z.array(
5487
+ z.object({
5488
+ title: z.string().describe("Policy title - should be translated").min(1).max(29).optional().nullable(),
5489
+ content: z.string().describe("Policy content - should be translated").min(1).max(3e3).optional()
5490
+ })
5491
+ ).max(5).optional(),
5492
+ membersOnly: z.boolean().describe(
5493
+ "Whether the item can only be purchased by site members.\n\nDefault: `false`"
5494
+ ).optional(),
5495
+ modifierGroups: z.array(
5496
+ z.object({
5497
+ _id: z.string().describe("Modifier group ID.").min(1).max(36).optional(),
5498
+ name: z.object({
5499
+ original: z.string().describe(
5500
+ "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5501
+ ).min(1).max(200).optional(),
5502
+ translated: z.string().describe(
5503
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5504
+ ).min(1).max(400).optional().nullable()
5505
+ }).describe("Modifier group name.").optional(),
5506
+ modifiers: z.array(
5389
5507
  z.object({
5390
- colorInfo: z.never().optional(),
5391
- plainText: z.object({
5508
+ _id: z.string().describe("Modifier ID.").min(1).max(36).optional(),
5509
+ quantity: z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
5510
+ label: z.object({
5392
5511
  original: z.string().describe(
5393
- "Description line plain text value in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5394
- ).max(600).optional(),
5512
+ "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5513
+ ).min(1).max(200).optional(),
5395
5514
  translated: z.string().describe(
5396
- "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5397
- ).max(600).optional().nullable()
5398
- }).describe("Description line plain text value.")
5399
- }),
5400
- z.object({
5401
- plainText: z.never().optional(),
5402
- colorInfo: z.object({
5515
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5516
+ ).min(1).max(400).optional().nullable()
5517
+ }).describe("Primary display label for the modifier.").optional(),
5518
+ details: z.object({
5403
5519
  original: z.string().describe(
5404
- "Description line color name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope)."
5405
- ).max(500).optional(),
5520
+ "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5521
+ ).min(1).max(200).optional(),
5406
5522
  translated: z.string().describe(
5407
- "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5408
- ).max(500).optional().nullable(),
5409
- code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5410
- }).describe("Description line color value.")
5523
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5524
+ ).min(1).max(400).optional().nullable()
5525
+ }).describe("Additional details.").optional(),
5526
+ price: z.object({
5527
+ amount: z.string().describe("Amount.").optional(),
5528
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5529
+ formattedAmount: z.string().describe(
5530
+ "Amount formatted with currency symbol."
5531
+ ).optional(),
5532
+ formattedConvertedAmount: z.string().describe(
5533
+ "Converted amount formatted with currency symbol."
5534
+ ).optional()
5535
+ }).describe("The price of the modifier.").optional()
5411
5536
  })
5412
- ])
5413
- )
5414
- ).min(0).max(20).optional(),
5415
- physicalProperties: z.object({
5416
- weight: z.number().describe(
5417
- "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5418
- ).optional().nullable(),
5419
- sku: z.string().describe(
5420
- "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5421
- ).max(40).optional().nullable(),
5422
- shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5423
- }).describe("Physical properties of the item.").optional(),
5424
- image: z.string().describe("Item image.").optional(),
5425
- paymentOption: z.object({
5426
- value: z.enum([
5427
- "FULL_PAYMENT_ONLINE",
5428
- "FULL_PAYMENT_OFFLINE",
5429
- "MEMBERSHIP",
5430
- "DEPOSIT_ONLINE",
5431
- "MEMBERSHIP_OFFLINE",
5432
- "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5433
- ]).describe(
5434
- "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5435
- ).optional()
5436
- }).describe("Payment method selected for the item.").optional(),
5437
- depositAmount: z.string().describe(
5438
- "Only eligible for catalog items with `lineItem.paymentOption.value` type of `DEPOSIT_ONLINE`."
5439
- ).optional().nullable(),
5440
- savePaymentMethod: z.boolean().describe(
5441
- "Whether to save the payment method on the order.\n\nDefault: `false`"
5442
- ).optional().nullable(),
5443
- inventoryAppId: z.string().describe("ID of the app managing the inventory.").regex(
5444
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5445
- "Must be a valid GUID"
5446
- ).optional().nullable()
5447
- }).describe(
5448
- 'Overriding values for catalog item properties.\n\nTo override catalog fields, your app must have the permission scope named "Manage eCommerce - Admin Permissions".\nLearn more about [permission scopes](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).'
5449
- ).optional(),
5450
- savePaymentMethod: z.boolean().describe(
5451
- "Whether to save the payment method on the order.\n\nDefault: `false`"
5452
- ).optional(),
5453
- taxableAddress: z.intersection(
5454
- z.object({}),
5455
- z.xor([
5456
- z.object({ addressType: z.never().optional() }),
5457
- z.object({
5458
- addressType: z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
5459
- "taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
5460
- )
5537
+ ).min(1).max(25).optional()
5461
5538
  })
5462
- ])
5463
- ).describe("Address to use for tax calculation purposes.").optional(),
5464
- extendedFields: z.object({
5465
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5466
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
5467
- ).optional()
5468
- }).describe(
5469
- "Custom extended fields for the line item object.\n\n[Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured using the 'Checkout & Orders - Line Items Schema Plugin' in the app dashboard before they can be accessed with API calls."
5470
- ).optional(),
5471
- policies: z.array(
5472
- z.object({
5473
- title: z.string().describe("Policy title - should be translated").min(1).max(29).optional().nullable(),
5474
- content: z.string().describe("Policy content - should be translated").min(1).max(3e3).optional()
5475
- })
5476
- ).max(5).optional(),
5477
- membersOnly: z.boolean().describe(
5478
- "Whether the item can only be purchased by site members.\n\nDefault: `false`"
5479
- ).optional(),
5480
- modifierGroups: z.array(
5481
- z.object({
5482
- _id: z.string().describe("Modifier group ID.").min(1).max(36).optional(),
5483
- name: z.object({
5484
- original: z.string().describe(
5485
- "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5486
- ).min(1).max(200).optional(),
5487
- translated: z.string().describe(
5488
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5489
- ).min(1).max(400).optional().nullable()
5490
- }).describe("Modifier group name.").optional(),
5491
- modifiers: z.array(
5492
- z.object({
5493
- _id: z.string().describe("Modifier ID.").min(1).max(36).optional(),
5494
- quantity: z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
5495
- label: z.object({
5496
- original: z.string().describe(
5497
- "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5498
- ).min(1).max(200).optional(),
5499
- translated: z.string().describe(
5500
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5501
- ).min(1).max(400).optional().nullable()
5502
- }).describe("Primary display label for the modifier.").optional(),
5503
- details: z.object({
5504
- original: z.string().describe(
5505
- "__Required.__ String in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions#request-envelope).\n\nMin: 1 character.\nMax: 200 characters."
5506
- ).min(1).max(200).optional(),
5507
- translated: z.string().describe(
5508
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5509
- ).min(1).max(400).optional().nullable()
5510
- }).describe("Additional details.").optional(),
5511
- price: z.object({
5512
- amount: z.string().describe("Amount.").optional(),
5513
- convertedAmount: z.string().describe("Converted amount.").optional(),
5514
- formattedAmount: z.string().describe(
5515
- "Amount formatted with currency symbol."
5516
- ).optional(),
5517
- formattedConvertedAmount: z.string().describe(
5518
- "Converted amount formatted with currency symbol."
5519
- ).optional()
5520
- }).describe("The price of the modifier.").optional()
5521
- })
5522
- ).min(1).max(25).optional()
5523
- })
5524
- ).max(25).optional(),
5525
- modifiersTotalPrice: z.object({
5526
- amount: z.string().describe("Amount.").optional(),
5527
- convertedAmount: z.string().describe("Converted amount.").optional(),
5528
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5529
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5530
- }).describe(
5531
- "Total price of all item modifiers. Included in the item price."
5532
- ).optional()
5533
- })
5534
- ).min(1).max(300).optional(),
5535
- buyerNote: z.string().describe(
5536
- "[Buyer note](https://support.wix.com/en/article/collecting-and-viewing-buyer-notes) left by the customer."
5537
- ).max(1e3).optional().nullable(),
5538
- buyerInfo: z.intersection(
5539
- z.object({
5540
- contactId: z.string().describe(
5541
- "Contact ID. For more information, see the Contacts API."
5542
- ).regex(
5543
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5544
- "Must be a valid GUID"
5545
- ).optional().nullable(),
5546
- email: z.string().describe("Buyer email address.").email().optional().nullable()
5547
- }),
5548
- z.xor([
5549
- z.object({
5550
- visitorId: z.never().optional(),
5551
- memberId: z.never().optional(),
5552
- userId: z.never().optional()
5553
- }),
5554
- z.object({
5555
- memberId: z.never().optional(),
5556
- userId: z.never().optional(),
5557
- visitorId: z.string().describe("Visitor ID. If the buyer is **not** a site member.").regex(
5558
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5559
- "Must be a valid GUID"
5560
- )
5561
- }),
5562
- z.object({
5563
- visitorId: z.never().optional(),
5564
- userId: z.never().optional(),
5565
- memberId: z.string().describe("Member ID. If the buyer is a site member.").regex(
5566
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5567
- "Must be a valid GUID"
5568
- )
5569
- }),
5539
+ ).max(25).optional(),
5540
+ modifiersTotalPrice: z.object({
5541
+ amount: z.string().describe("Amount.").optional(),
5542
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5543
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5544
+ formattedConvertedAmount: z.string().describe(
5545
+ "Converted amount formatted with currency symbol."
5546
+ ).optional()
5547
+ }).describe(
5548
+ "Total price of all item modifiers. Included in the item price."
5549
+ ).optional()
5550
+ })
5551
+ ).min(1).max(300).optional(),
5552
+ buyerNote: z.string().describe(
5553
+ "[Buyer note](https://support.wix.com/en/article/collecting-and-viewing-buyer-notes) left by the customer."
5554
+ ).max(1e3).optional().nullable(),
5555
+ buyerInfo: z.intersection(
5570
5556
  z.object({
5571
- visitorId: z.never().optional(),
5572
- memberId: z.never().optional(),
5573
- userId: z.string().describe(
5574
- "User ID. If the buyer, or cart owner, is a Wix user."
5557
+ contactId: z.string().describe(
5558
+ "Contact ID. For more information, see the Contacts API."
5575
5559
  ).regex(
5576
5560
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5577
5561
  "Must be a valid GUID"
5578
- )
5579
- })
5580
- ])
5581
- ).describe("Buyer information.").optional(),
5582
- currency: z.string().describe(
5583
- "The site\u2019s default currency, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. This represents the base currency configured for the site and remains constant regardless of the customer\u2019s currency selection."
5584
- ).optional(),
5585
- conversionCurrency: z.string().describe(
5586
- "The currency [selected by the customer](https://support.wix.com/en/article/multicurrency-an-overview) during the purchase flow, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThis reflects the customer\u2019s preferred display currency and may differ from the site\u2019s default currency.\nWhen no specific currency is selected by the customer, this matches the `currency` property."
5587
- ).optional(),
5588
- buyerLanguage: z.string().describe(
5589
- "Language for communication with the buyer. Defaults to the site language.\n\nFor a site that supports multiple languages, this is the language the buyer selected."
5590
- ).optional().nullable(),
5591
- siteLanguage: z.string().describe("Site language in which original values are displayed.").optional().nullable(),
5592
- taxIncludedInPrices: z.boolean().describe("Whether tax is included in line item prices.").optional().nullable(),
5593
- weightUnit: z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight measurement unit - defaults to site's weight unit.").optional(),
5594
- checkoutId: z.string().describe("ID of the checkout that originated from this cart.").regex(
5595
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5596
- "Must be a valid GUID"
5597
- ).optional().nullable(),
5598
- appliedDiscounts: z.array(
5599
- z.intersection(
5600
- z.object({}),
5562
+ ).optional().nullable(),
5563
+ email: z.string().describe("Buyer email address.").email().optional().nullable()
5564
+ }),
5601
5565
  z.xor([
5602
5566
  z.object({
5603
- coupon: z.never().optional(),
5604
- merchantDiscount: z.never().optional()
5567
+ visitorId: z.never().optional(),
5568
+ memberId: z.never().optional(),
5569
+ userId: z.never().optional()
5605
5570
  }),
5606
5571
  z.object({
5607
- merchantDiscount: z.never().optional(),
5608
- coupon: z.object({
5609
- _id: z.string().describe("Coupon ID.").optional(),
5610
- code: z.string().describe("Coupon code.").optional()
5611
- }).describe("Coupon details.")
5572
+ memberId: z.never().optional(),
5573
+ userId: z.never().optional(),
5574
+ visitorId: z.string().describe(
5575
+ "Visitor ID. If the buyer is **not** a site member."
5576
+ ).regex(
5577
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5578
+ "Must be a valid GUID"
5579
+ )
5612
5580
  }),
5613
5581
  z.object({
5614
- coupon: z.never().optional(),
5615
- merchantDiscount: z.object({
5616
- amount: z.object({
5617
- amount: z.string().describe("Amount.").optional(),
5618
- convertedAmount: z.string().describe("Converted amount.").optional(),
5619
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5620
- formattedConvertedAmount: z.string().describe(
5621
- "Converted amount formatted with currency symbol."
5622
- ).optional()
5623
- }).describe("Discount value.").optional()
5624
- }).describe("Merchant discount.")
5582
+ visitorId: z.never().optional(),
5583
+ userId: z.never().optional(),
5584
+ memberId: z.string().describe("Member ID. If the buyer is a site member.").regex(
5585
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5586
+ "Must be a valid GUID"
5587
+ )
5588
+ }),
5589
+ z.object({
5590
+ visitorId: z.never().optional(),
5591
+ memberId: z.never().optional(),
5592
+ userId: z.string().describe(
5593
+ "User ID. If the buyer, or cart owner, is a Wix user."
5594
+ ).regex(
5595
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5596
+ "Must be a valid GUID"
5597
+ )
5625
5598
  })
5626
5599
  ])
5627
- )
5628
- ).optional(),
5629
- _createdDate: z.date().describe("Date and time the cart was created.").optional().nullable(),
5630
- _updatedDate: z.date().describe("Date and time the cart was updated.").optional().nullable(),
5631
- contactInfo: z.object({
5632
- address: z.object({
5633
- streetAddress: z.object({
5634
- name: z.string().optional(),
5635
- number: z.string().optional()
5636
- }).optional(),
5637
- city: z.string().optional().nullable(),
5638
- subdivision: z.string().optional().nullable(),
5639
- country: z.string().optional().nullable(),
5640
- postalCode: z.string().optional().nullable(),
5641
- addressLine2: z.string().optional().nullable()
5642
- }).describe("Address.").optional(),
5643
- contactDetails: z.object({
5644
- firstName: z.string().describe("First name.").max(100).optional().nullable(),
5645
- lastName: z.string().describe("Last name.").max(100).optional().nullable(),
5646
- phone: z.string().describe("Phone number.").optional().nullable(),
5647
- company: z.string().describe("Company name.").max(1e3).optional().nullable(),
5648
- vatId: z.object({
5649
- _id: z.string().describe("Customer's tax ID.").optional(),
5650
- type: z.enum(["UNSPECIFIED", "CPF", "CNPJ"]).describe(
5651
- "Tax type.\n\nSupported values:\n+ `CPF`: for individual tax payers\n+ `CNPJ`: for corporations"
5600
+ ).describe("Buyer information.").optional(),
5601
+ currency: z.string().describe(
5602
+ "The site\u2019s default currency, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. This represents the base currency configured for the site and remains constant regardless of the customer\u2019s currency selection."
5603
+ ).optional(),
5604
+ conversionCurrency: z.string().describe(
5605
+ "The currency [selected by the customer](https://support.wix.com/en/article/multicurrency-an-overview) during the purchase flow, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThis reflects the customer\u2019s preferred display currency and may differ from the site\u2019s default currency.\nWhen no specific currency is selected by the customer, this matches the `currency` property."
5606
+ ).optional(),
5607
+ buyerLanguage: z.string().describe(
5608
+ "Language for communication with the buyer. Defaults to the site language.\n\nFor a site that supports multiple languages, this is the language the buyer selected."
5609
+ ).optional().nullable(),
5610
+ siteLanguage: z.string().describe("Site language in which original values are displayed.").optional().nullable(),
5611
+ taxIncludedInPrices: z.boolean().describe("Whether tax is included in line item prices.").optional().nullable(),
5612
+ weightUnit: z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight measurement unit - defaults to site's weight unit.").optional(),
5613
+ checkoutId: z.string().describe("ID of the checkout that originated from this cart.").regex(
5614
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5615
+ "Must be a valid GUID"
5616
+ ).optional().nullable(),
5617
+ appliedDiscounts: z.array(
5618
+ z.intersection(
5619
+ z.object({}),
5620
+ z.xor([
5621
+ z.object({
5622
+ coupon: z.never().optional(),
5623
+ merchantDiscount: z.never().optional()
5624
+ }),
5625
+ z.object({
5626
+ merchantDiscount: z.never().optional(),
5627
+ coupon: z.object({
5628
+ _id: z.string().describe("Coupon ID.").optional(),
5629
+ code: z.string().describe("Coupon code.").optional()
5630
+ }).describe("Coupon details.")
5631
+ }),
5632
+ z.object({
5633
+ coupon: z.never().optional(),
5634
+ merchantDiscount: z.object({
5635
+ amount: z.object({
5636
+ amount: z.string().describe("Amount.").optional(),
5637
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5638
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5639
+ formattedConvertedAmount: z.string().describe(
5640
+ "Converted amount formatted with currency symbol."
5641
+ ).optional()
5642
+ }).describe("Discount value.").optional()
5643
+ }).describe("Merchant discount.")
5644
+ })
5645
+ ])
5646
+ )
5647
+ ).optional(),
5648
+ _createdDate: z.date().describe("Date and time the cart was created.").optional().nullable(),
5649
+ _updatedDate: z.date().describe("Date and time the cart was updated.").optional().nullable(),
5650
+ contactInfo: z.object({
5651
+ address: z.object({
5652
+ streetAddress: z.object({
5653
+ name: z.string().optional(),
5654
+ number: z.string().optional()
5655
+ }).optional(),
5656
+ city: z.string().optional().nullable(),
5657
+ subdivision: z.string().optional().nullable(),
5658
+ country: z.string().optional().nullable(),
5659
+ postalCode: z.string().optional().nullable(),
5660
+ addressLine2: z.string().optional().nullable()
5661
+ }).describe("Address.").optional(),
5662
+ contactDetails: z.object({
5663
+ firstName: z.string().describe("First name.").max(100).optional().nullable(),
5664
+ lastName: z.string().describe("Last name.").max(100).optional().nullable(),
5665
+ phone: z.string().describe("Phone number.").optional().nullable(),
5666
+ company: z.string().describe("Company name.").max(1e3).optional().nullable(),
5667
+ vatId: z.object({
5668
+ _id: z.string().describe("Customer's tax ID.").optional(),
5669
+ type: z.enum(["UNSPECIFIED", "CPF", "CNPJ"]).describe(
5670
+ "Tax type.\n\nSupported values:\n+ `CPF`: for individual tax payers\n+ `CNPJ`: for corporations"
5671
+ ).optional()
5672
+ }).describe(
5673
+ "Tax information (for Brazil only). If ID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed."
5652
5674
  ).optional()
5653
- }).describe(
5654
- "Tax information (for Brazil only). If ID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed."
5675
+ }).describe("Contact details.").optional()
5676
+ }).describe("Contact info.").optional(),
5677
+ overrideCheckoutUrl: z.string().describe(
5678
+ "`overrideCheckoutUrl` allows the flexibility to redirect customers to a customized checkout page.\n\nThis field overrides the `checkoutUrl` in a cart or checkout. `checkoutUrl` is used in the Abandoned Checkout API\nto send customers back to their checkouts. By default, a `checkoutUrl` generates for a checkout and directs to a\nstandard Wix checkout page. When `overrideCheckoutUrl` has a value, it will replace and set the value of `checkoutUrl`."
5679
+ ).max(1e3).optional().nullable(),
5680
+ purchaseFlowId: z.string().describe(
5681
+ "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order."
5682
+ ).regex(
5683
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5684
+ "Must be a valid GUID"
5685
+ ).optional().nullable(),
5686
+ selectedShippingOption: z.object({
5687
+ carrierId: z.string().describe("Carrier ID.").regex(
5688
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5689
+ "Must be a valid GUID"
5690
+ ).optional().nullable(),
5691
+ code: z.string().describe(
5692
+ 'Selected shipping option code. For example, "usps_std_overnight".'
5693
+ ).min(1).max(100).optional()
5694
+ }).describe("Selected shipping option.").optional(),
5695
+ extendedFields: z.object({
5696
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5697
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
5655
5698
  ).optional()
5656
- }).describe("Contact details.").optional()
5657
- }).describe("Contact info.").optional(),
5658
- overrideCheckoutUrl: z.string().describe(
5659
- "`overrideCheckoutUrl` allows the flexibility to redirect customers to a customized checkout page.\n\nThis field overrides the `checkoutUrl` in a cart or checkout. `checkoutUrl` is used in the Abandoned Checkout API\nto send customers back to their checkouts. By default, a `checkoutUrl` generates for a checkout and directs to a\nstandard Wix checkout page. When `overrideCheckoutUrl` has a value, it will replace and set the value of `checkoutUrl`."
5660
- ).max(1e3).optional().nullable(),
5661
- purchaseFlowId: z.string().describe(
5662
- "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order."
5663
- ).regex(
5664
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5665
- "Must be a valid GUID"
5666
- ).optional().nullable(),
5667
- selectedShippingOption: z.object({
5668
- carrierId: z.string().describe("Carrier ID.").regex(
5699
+ }).describe("Fields extended by data extensions").optional(),
5700
+ businessLocationId: z.string().describe(
5701
+ "The business location ID associated with the cart.\n\nTo learn more, see the Locations API."
5702
+ ).regex(
5669
5703
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5670
5704
  "Must be a valid GUID"
5671
5705
  ).optional().nullable(),
5672
- code: z.string().describe(
5673
- 'Selected shipping option code. For example, "usps_std_overnight".'
5674
- ).min(1).max(100).optional()
5675
- }).describe("Selected shipping option.").optional(),
5676
- extendedFields: z.object({
5677
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5678
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
5679
- ).optional()
5680
- }).describe("Fields extended by data extensions").optional(),
5681
- businessLocationId: z.string().describe(
5682
- "The business location ID associated with the cart.\n\nTo learn more, see the Locations API."
5683
- ).regex(
5684
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
5685
- "Must be a valid GUID"
5686
- ).optional().nullable(),
5687
- paymentCurrency: z.string().describe(
5688
- "The currency used for payment, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThis is determined by the [customer's selected currency](https://support.wix.com/en/article/multicurrency-an-overview) and the site\u2019s supported payment currencies.\nIf the customer\u2019s selected currency is supported for payment, this matches the `conversionCurrency` property. If not supported, this falls back to the `currency` property."
5689
- ).optional(),
5690
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
5691
- "Revision number, which increments by 1 each time the Cart is updated."
5692
- ).optional().nullable()
5693
- }).describe("Updated cart.").optional()
5694
- });
5695
- var EstimateCurrentCartTotalsRequest = z.object({
5706
+ paymentCurrency: z.string().describe(
5707
+ "The currency used for payment, in three-letter [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThis is determined by the [customer's selected currency](https://support.wix.com/en/article/multicurrency-an-overview) and the site\u2019s supported payment currencies.\nIf the customer\u2019s selected currency is supported for payment, this matches the `conversionCurrency` property. If not supported, this falls back to the `currency` property."
5708
+ ).optional(),
5709
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
5710
+ "Revision number, which increments by 1 each time the Cart is updated."
5711
+ ).optional().nullable()
5712
+ }).describe("Updated cart.").optional()
5713
+ }
5714
+ );
5715
+ var EstimateCurrentCartTotalsRequest = /* @__PURE__ */ z.object({
5696
5716
  options: z.object({
5697
5717
  selectedShippingOption: z.object({
5698
5718
  carrierId: z.string().describe("Carrier ID.").regex(
@@ -5786,7 +5806,7 @@ var EstimateCurrentCartTotalsRequest = z.object({
5786
5806
  ).optional().nullable()
5787
5807
  }).describe("Total estimation options.").optional()
5788
5808
  });
5789
- var EstimateCurrentCartTotalsResponse = z.object({
5809
+ var EstimateCurrentCartTotalsResponse = /* @__PURE__ */ z.object({
5790
5810
  cart: z.object({
5791
5811
  _id: z.string().describe("Cart ID.").regex(
5792
5812
  /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
@@ -7910,7 +7930,7 @@ var EstimateCurrentCartTotalsResponse = z.object({
7910
7930
  total: z.number().int().describe("Membership's initial value.").min(1).optional(),
7911
7931
  remaining: z.number().int().describe("Membership's remaining value.").min(0).optional()
7912
7932
  }).describe("Membership's payment credits (balance information).").optional(),
7913
- expirationDate: z.date().describe("Deprecated. Use `offering_description`.").optional().nullable(),
7933
+ expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
7914
7934
  additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
7915
7935
  })
7916
7936
  ).max(300).optional(),
@@ -7937,7 +7957,7 @@ var EstimateCurrentCartTotalsResponse = z.object({
7937
7957
  }).describe(
7938
7958
  "Membership's payment credits (balance information)."
7939
7959
  ).optional(),
7940
- expirationDate: z.date().describe("Deprecated. Use `offering_description`.").optional().nullable(),
7960
+ expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
7941
7961
  additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
7942
7962
  }).describe("Membership details.").optional(),
7943
7963
  reason: z.string().describe(
@@ -8134,8 +8154,8 @@ var EstimateCurrentCartTotalsResponse = z.object({
8134
8154
  })
8135
8155
  ).optional()
8136
8156
  });
8137
- var DeleteCurrentCartRequest = z.object({});
8138
- var DeleteCurrentCartResponse = z.object({});
8157
+ var DeleteCurrentCartRequest = /* @__PURE__ */ z.object({});
8158
+ var DeleteCurrentCartResponse = /* @__PURE__ */ z.object({});
8139
8159
  // Annotate the CommonJS export names for ESM import in node:
8140
8160
  0 && (module.exports = {
8141
8161
  AddToCurrentCartRequest,