@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
@@ -1,7 +1,7 @@
1
1
  // src/ecom-v1-cart-current-cart.schemas.ts
2
2
  import * as z from "zod";
3
- var GetCurrentCartRequest = z.object({});
4
- var GetCurrentCartResponse = z.object({
3
+ var GetCurrentCartRequest = /* @__PURE__ */ z.object({});
4
+ var GetCurrentCartResponse = /* @__PURE__ */ z.object({
5
5
  _id: z.string().describe("Cart ID.").regex(
6
6
  /^[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}$/,
7
7
  "Must be a valid GUID"
@@ -592,7 +592,7 @@ var GetCurrentCartResponse = z.object({
592
592
  "Revision number, which increments by 1 each time the Cart is updated."
593
593
  ).optional().nullable()
594
594
  });
595
- var UpdateCurrentCartRequest = z.object({
595
+ var UpdateCurrentCartRequest = /* @__PURE__ */ z.object({
596
596
  options: z.object({
597
597
  cartInfo: z.object({
598
598
  _id: z.string().describe("Cart ID.").regex(
@@ -1873,7 +1873,7 @@ var UpdateCurrentCartRequest = z.object({
1873
1873
  ).max(300).optional()
1874
1874
  }).describe("Current cart update options.").optional()
1875
1875
  });
1876
- var UpdateCurrentCartResponse = z.object({
1876
+ var UpdateCurrentCartResponse = /* @__PURE__ */ z.object({
1877
1877
  _id: z.string().describe("Cart ID.").regex(
1878
1878
  /^[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}$/,
1879
1879
  "Must be a valid GUID"
@@ -2464,7 +2464,7 @@ var UpdateCurrentCartResponse = z.object({
2464
2464
  "Revision number, which increments by 1 each time the Cart is updated."
2465
2465
  ).optional().nullable()
2466
2466
  });
2467
- var AddToCurrentCartRequest = z.object({
2467
+ var AddToCurrentCartRequest = /* @__PURE__ */ z.object({
2468
2468
  options: z.object({
2469
2469
  lineItems: z.array(
2470
2470
  z.object({
@@ -3131,7 +3131,7 @@ var AddToCurrentCartRequest = z.object({
3131
3131
  ).optional().nullable()
3132
3132
  }).describe("Items to be added to the current cart.").optional()
3133
3133
  });
3134
- var AddToCurrentCartResponse = z.object({
3134
+ var AddToCurrentCartResponse = /* @__PURE__ */ z.object({
3135
3135
  cart: z.object({
3136
3136
  _id: z.string().describe("Cart ID.").regex(
3137
3137
  /^[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}$/,
@@ -3730,10 +3730,10 @@ var AddToCurrentCartResponse = z.object({
3730
3730
  ).optional().nullable()
3731
3731
  }).describe("Updated cart.").optional()
3732
3732
  });
3733
- var RemoveLineItemsFromCurrentCartRequest = z.object({
3733
+ var RemoveLineItemsFromCurrentCartRequest = /* @__PURE__ */ z.object({
3734
3734
  lineItemIds: z.array(z.string()).min(1).max(100)
3735
3735
  });
3736
- var RemoveLineItemsFromCurrentCartResponse = z.object({
3736
+ var RemoveLineItemsFromCurrentCartResponse = /* @__PURE__ */ z.object({
3737
3737
  cart: z.object({
3738
3738
  _id: z.string().describe("Cart ID.").regex(
3739
3739
  /^[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}$/,
@@ -4332,7 +4332,7 @@ var RemoveLineItemsFromCurrentCartResponse = z.object({
4332
4332
  ).optional().nullable()
4333
4333
  }).describe("Updated cart.").optional()
4334
4334
  });
4335
- var CreateCheckoutFromCurrentCartRequest = z.object({
4335
+ var CreateCheckoutFromCurrentCartRequest = /* @__PURE__ */ z.object({
4336
4336
  options: z.object({
4337
4337
  channelType: z.enum([
4338
4338
  "UNSPECIFIED",
@@ -4426,11 +4426,11 @@ var CreateCheckoutFromCurrentCartRequest = z.object({
4426
4426
  ).email().optional().nullable()
4427
4427
  }).describe("Checkout creation options.").optional()
4428
4428
  });
4429
- var CreateCheckoutFromCurrentCartResponse = z.object({
4429
+ var CreateCheckoutFromCurrentCartResponse = /* @__PURE__ */ z.object({
4430
4430
  checkoutId: z.string().describe("The newly created checkout's ID.").optional()
4431
4431
  });
4432
- var RemoveCouponFromCurrentCartRequest = z.object({});
4433
- var RemoveCouponFromCurrentCartResponse = z.object({
4432
+ var RemoveCouponFromCurrentCartRequest = /* @__PURE__ */ z.object({});
4433
+ var RemoveCouponFromCurrentCartResponse = /* @__PURE__ */ z.object({
4434
4434
  cart: z.object({
4435
4435
  _id: z.string().describe("Cart ID.").regex(
4436
4436
  /^[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}$/,
@@ -5029,7 +5029,7 @@ var RemoveCouponFromCurrentCartResponse = z.object({
5029
5029
  ).optional().nullable()
5030
5030
  }).describe("Updated cart.").optional()
5031
5031
  });
5032
- var UpdateCurrentCartLineItemQuantityRequest = z.object({
5032
+ var UpdateCurrentCartLineItemQuantityRequest = /* @__PURE__ */ z.object({
5033
5033
  lineItems: z.array(
5034
5034
  z.object({
5035
5035
  _id: z.string().describe("*Required.** Line item ID.").regex(
@@ -5040,606 +5040,626 @@ var UpdateCurrentCartLineItemQuantityRequest = z.object({
5040
5040
  })
5041
5041
  ).min(1).max(100)
5042
5042
  });
5043
- var UpdateCurrentCartLineItemQuantityResponse = z.object({
5044
- cart: z.object({
5045
- _id: z.string().describe("Cart ID.").regex(
5046
- /^[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}$/,
5047
- "Must be a valid GUID"
5048
- ).optional().nullable(),
5049
- lineItems: z.array(
5050
- z.object({
5051
- _id: z.string().describe("Line item ID.").regex(
5052
- /^[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}$/,
5053
- "Must be a valid GUID"
5054
- ).optional().nullable(),
5055
- quantity: z.number().int().describe("Item quantity.").min(1).max(1e5).optional(),
5056
- catalogReference: z.object({
5057
- catalogItemId: z.string().describe("ID of the item within the catalog it belongs to.").min(1).max(36).optional(),
5058
- appId: z.string().describe(
5059
- '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"`'
5060
- ).min(1).optional(),
5061
- options: z.record(z.string(), z.any()).describe(
5062
- "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)."
5063
- ).optional().nullable()
5064
- }).describe(
5065
- "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."
5066
- ).optional(),
5067
- productName: z.object({
5068
- original: z.string().describe(
5069
- "__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."
5070
- ).min(1).max(200).optional(),
5071
- translated: z.string().describe(
5072
- "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5073
- ).min(1).max(400).optional().nullable()
5074
- }).describe(
5075
- "Item name.\n+ Stores - `product.name`\n+ Bookings - `service.info.name`\n+ Events - `ticket.name`"
5076
- ).optional(),
5077
- url: z.string().describe("URL to the item's page on the site.").optional(),
5078
- price: z.object({
5079
- amount: z.string().describe("Amount.").optional(),
5080
- convertedAmount: z.string().describe("Converted amount.").optional(),
5081
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5082
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5083
- }).describe(
5084
- "Item price **after** catalog-defined discount and line item discounts."
5085
- ).optional(),
5086
- fullPrice: z.object({
5087
- amount: z.string().describe("Amount.").optional(),
5088
- convertedAmount: z.string().describe("Converted amount.").optional(),
5089
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5090
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5091
- }).describe(
5092
- "Item price **before** catalog-defined discount. Defaults to `price` when not provided."
5093
- ).optional(),
5094
- priceBeforeDiscounts: z.object({
5095
- amount: z.string().describe("Amount.").optional(),
5096
- convertedAmount: z.string().describe("Converted amount.").optional(),
5097
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5098
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5099
- }).describe(
5100
- "Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided."
5101
- ).optional(),
5102
- lineItemPrice: z.object({
5103
- amount: z.string().describe("Amount.").optional(),
5104
- convertedAmount: z.string().describe("Converted amount.").optional(),
5105
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5106
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5107
- }).describe(
5108
- "Total price **after** catalog-defined discount and line item discounts."
5109
- ).optional(),
5110
- descriptionLines: z.array(
5111
- z.intersection(
5112
- z.object({
5113
- name: z.object({
5114
- original: z.string().describe(
5115
- "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)."
5116
- ).max(100).optional(),
5117
- translated: z.string().describe(
5118
- "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5119
- ).max(200).optional().nullable()
5120
- }).describe("Description line name.").optional()
5121
- }),
5043
+ var UpdateCurrentCartLineItemQuantityResponse = /* @__PURE__ */ z.object(
5044
+ {
5045
+ cart: z.object({
5046
+ _id: z.string().describe("Cart ID.").regex(
5047
+ /^[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}$/,
5048
+ "Must be a valid GUID"
5049
+ ).optional().nullable(),
5050
+ lineItems: z.array(
5051
+ z.object({
5052
+ _id: z.string().describe("Line item ID.").regex(
5053
+ /^[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}$/,
5054
+ "Must be a valid GUID"
5055
+ ).optional().nullable(),
5056
+ quantity: z.number().int().describe("Item quantity.").min(1).max(1e5).optional(),
5057
+ catalogReference: z.object({
5058
+ catalogItemId: z.string().describe(
5059
+ "ID of the item within the catalog it belongs to."
5060
+ ).min(1).max(36).optional(),
5061
+ appId: z.string().describe(
5062
+ '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"`'
5063
+ ).min(1).optional(),
5064
+ options: z.record(z.string(), z.any()).describe(
5065
+ "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)."
5066
+ ).optional().nullable()
5067
+ }).describe(
5068
+ "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."
5069
+ ).optional(),
5070
+ productName: z.object({
5071
+ original: z.string().describe(
5072
+ "__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."
5073
+ ).min(1).max(200).optional(),
5074
+ translated: z.string().describe(
5075
+ "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5076
+ ).min(1).max(400).optional().nullable()
5077
+ }).describe(
5078
+ "Item name.\n+ Stores - `product.name`\n+ Bookings - `service.info.name`\n+ Events - `ticket.name`"
5079
+ ).optional(),
5080
+ url: z.string().describe("URL to the item's page on the site.").optional(),
5081
+ price: z.object({
5082
+ amount: z.string().describe("Amount.").optional(),
5083
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5084
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5085
+ formattedConvertedAmount: z.string().describe(
5086
+ "Converted amount formatted with currency symbol."
5087
+ ).optional()
5088
+ }).describe(
5089
+ "Item price **after** catalog-defined discount and line item discounts."
5090
+ ).optional(),
5091
+ fullPrice: z.object({
5092
+ amount: z.string().describe("Amount.").optional(),
5093
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5094
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5095
+ formattedConvertedAmount: z.string().describe(
5096
+ "Converted amount formatted with currency symbol."
5097
+ ).optional()
5098
+ }).describe(
5099
+ "Item price **before** catalog-defined discount. Defaults to `price` when not provided."
5100
+ ).optional(),
5101
+ priceBeforeDiscounts: z.object({
5102
+ amount: z.string().describe("Amount.").optional(),
5103
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5104
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5105
+ formattedConvertedAmount: z.string().describe(
5106
+ "Converted amount formatted with currency symbol."
5107
+ ).optional()
5108
+ }).describe(
5109
+ "Item price **before** line item discounts and **after** catalog-defined discount. Defaults to `price` when not provided."
5110
+ ).optional(),
5111
+ lineItemPrice: z.object({
5112
+ amount: z.string().describe("Amount.").optional(),
5113
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5114
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5115
+ formattedConvertedAmount: z.string().describe(
5116
+ "Converted amount formatted with currency symbol."
5117
+ ).optional()
5118
+ }).describe(
5119
+ "Total price **after** catalog-defined discount and line item discounts."
5120
+ ).optional(),
5121
+ descriptionLines: z.array(
5122
+ z.intersection(
5123
+ z.object({
5124
+ name: z.object({
5125
+ original: z.string().describe(
5126
+ "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)."
5127
+ ).max(100).optional(),
5128
+ translated: z.string().describe(
5129
+ "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5130
+ ).max(200).optional().nullable()
5131
+ }).describe("Description line name.").optional()
5132
+ }),
5133
+ z.xor([
5134
+ z.object({
5135
+ plainText: z.never().optional(),
5136
+ colorInfo: z.never().optional()
5137
+ }),
5138
+ z.object({
5139
+ colorInfo: z.never().optional(),
5140
+ plainText: z.object({
5141
+ original: z.string().describe(
5142
+ "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)."
5143
+ ).max(600).optional(),
5144
+ translated: z.string().describe(
5145
+ "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5146
+ ).max(600).optional().nullable()
5147
+ }).describe("Description line plain text value.")
5148
+ }),
5149
+ z.object({
5150
+ plainText: z.never().optional(),
5151
+ colorInfo: z.object({
5152
+ original: z.string().describe(
5153
+ "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)."
5154
+ ).max(500).optional(),
5155
+ translated: z.string().describe(
5156
+ "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5157
+ ).max(500).optional().nullable(),
5158
+ code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5159
+ }).describe("Description line color value.")
5160
+ })
5161
+ ])
5162
+ )
5163
+ ).optional(),
5164
+ image: z.string().describe("Line item image details.").optional(),
5165
+ availability: z.object({
5166
+ status: z.enum([
5167
+ "AVAILABLE",
5168
+ "NOT_FOUND",
5169
+ "NOT_AVAILABLE",
5170
+ "PARTIALLY_AVAILABLE"
5171
+ ]).describe("Item availability status.").optional(),
5172
+ quantityAvailable: z.number().int().describe("Quantity available.").optional().nullable()
5173
+ }).describe("Item availability details.").optional(),
5174
+ physicalProperties: z.object({
5175
+ weight: z.number().describe(
5176
+ "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5177
+ ).optional().nullable(),
5178
+ sku: z.string().describe(
5179
+ "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5180
+ ).max(40).optional().nullable(),
5181
+ shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5182
+ }).describe(
5183
+ "Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability."
5184
+ ).optional(),
5185
+ itemType: z.intersection(
5186
+ z.object({}),
5122
5187
  z.xor([
5123
5188
  z.object({
5124
- plainText: z.never().optional(),
5125
- colorInfo: z.never().optional()
5189
+ preset: z.never().optional(),
5190
+ custom: z.never().optional()
5126
5191
  }),
5127
5192
  z.object({
5128
- colorInfo: z.never().optional(),
5129
- plainText: z.object({
5130
- original: z.string().describe(
5131
- "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)."
5132
- ).max(600).optional(),
5133
- translated: z.string().describe(
5134
- "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5135
- ).max(600).optional().nullable()
5136
- }).describe("Description line plain text value.")
5193
+ custom: z.never().optional(),
5194
+ preset: z.enum([
5195
+ "UNRECOGNISED",
5196
+ "PHYSICAL",
5197
+ "DIGITAL",
5198
+ "GIFT_CARD",
5199
+ "SERVICE"
5200
+ ]).describe("Preset item type.")
5137
5201
  }),
5138
5202
  z.object({
5139
- plainText: z.never().optional(),
5140
- colorInfo: z.object({
5141
- original: z.string().describe(
5142
- "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)."
5143
- ).max(500).optional(),
5144
- translated: z.string().describe(
5145
- "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5146
- ).max(500).optional().nullable(),
5147
- code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5148
- }).describe("Description line color value.")
5203
+ preset: z.never().optional(),
5204
+ custom: z.string().describe(
5205
+ "Custom item type. When none of the preset types are suitable, specifies the custom type."
5206
+ )
5149
5207
  })
5150
5208
  ])
5151
- )
5152
- ).optional(),
5153
- image: z.string().describe("Line item image details.").optional(),
5154
- availability: z.object({
5155
- status: z.enum([
5156
- "AVAILABLE",
5157
- "NOT_FOUND",
5158
- "NOT_AVAILABLE",
5159
- "PARTIALLY_AVAILABLE"
5160
- ]).describe("Item availability status.").optional(),
5161
- quantityAvailable: z.number().int().describe("Quantity available.").optional().nullable()
5162
- }).describe("Item availability details.").optional(),
5163
- physicalProperties: z.object({
5164
- weight: z.number().describe(
5165
- "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5166
- ).optional().nullable(),
5167
- sku: z.string().describe(
5168
- "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5169
- ).max(40).optional().nullable(),
5170
- shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5171
- }).describe(
5172
- "Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability."
5173
- ).optional(),
5174
- itemType: z.intersection(
5175
- z.object({}),
5176
- z.xor([
5177
- z.object({
5178
- preset: z.never().optional(),
5179
- custom: z.never().optional()
5180
- }),
5181
- z.object({
5182
- custom: z.never().optional(),
5183
- preset: z.enum([
5184
- "UNRECOGNISED",
5185
- "PHYSICAL",
5186
- "DIGITAL",
5187
- "GIFT_CARD",
5188
- "SERVICE"
5189
- ]).describe("Preset item type.")
5190
- }),
5191
- z.object({
5192
- preset: z.never().optional(),
5193
- custom: z.string().describe(
5194
- "Custom item type. When none of the preset types are suitable, specifies the custom type."
5195
- )
5196
- })
5197
- ])
5198
- ).describe("Item type. Either a preset type or custom.").optional(),
5199
- subscriptionOptionInfo: z.object({
5200
- subscriptionSettings: z.object({
5201
- frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
5202
- interval: z.number().int().describe(
5203
- "Interval of recurring payment.\n\nDefault: `1`.\nIf SubscriptionFrequency is Day the minimum interval is 7"
5204
- ).min(1).max(3650).optional().nullable(),
5205
- autoRenewal: z.boolean().describe(
5206
- "Whether subscription is renewed automatically at the end of each period."
5207
- ).optional(),
5208
- billingCycles: z.number().int().describe(
5209
- "Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`."
5210
- ).min(1).optional().nullable(),
5211
- enableCustomerCancellation: z.boolean().describe(
5212
- "Whether to allow the customer to cancel the subscription.."
5213
- ).optional(),
5214
- freeTrialPeriod: z.object({
5215
- frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe(
5216
- "Frequency of period. Values: DAY, WEEK, MONTH, YEAR"
5217
- ).optional(),
5209
+ ).describe("Item type. Either a preset type or custom.").optional(),
5210
+ subscriptionOptionInfo: z.object({
5211
+ subscriptionSettings: z.object({
5212
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
5218
5213
  interval: z.number().int().describe(
5219
- "Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial."
5220
- ).min(1).max(999).optional()
5221
- }).describe(
5222
- "Period until first cycle starts. If applied payNow will be 0\nIf None => no free trial"
5223
- ).optional()
5224
- }).describe("Subscription option settings.").optional(),
5225
- title: z.object({
5214
+ "Interval of recurring payment.\n\nDefault: `1`.\nIf SubscriptionFrequency is Day the minimum interval is 7"
5215
+ ).min(1).max(3650).optional().nullable(),
5216
+ autoRenewal: z.boolean().describe(
5217
+ "Whether subscription is renewed automatically at the end of each period."
5218
+ ).optional(),
5219
+ billingCycles: z.number().int().describe(
5220
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`."
5221
+ ).min(1).optional().nullable(),
5222
+ enableCustomerCancellation: z.boolean().describe(
5223
+ "Whether to allow the customer to cancel the subscription.."
5224
+ ).optional(),
5225
+ freeTrialPeriod: z.object({
5226
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe(
5227
+ "Frequency of period. Values: DAY, WEEK, MONTH, YEAR"
5228
+ ).optional(),
5229
+ interval: z.number().int().describe(
5230
+ "Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial."
5231
+ ).min(1).max(999).optional()
5232
+ }).describe(
5233
+ "Period until first cycle starts. If applied payNow will be 0\nIf None => no free trial"
5234
+ ).optional()
5235
+ }).describe("Subscription option settings.").optional(),
5236
+ title: z.object({
5237
+ original: z.string().describe(
5238
+ "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)."
5239
+ ).min(1).max(150).optional(),
5240
+ translated: z.string().describe(
5241
+ "Subscription option name translated into the buyer's language.\n\nDefault: Same as `original`."
5242
+ ).min(1).max(150).optional().nullable()
5243
+ }).describe("Subscription option title.").optional(),
5244
+ description: z.object({
5245
+ original: z.string().describe("Subscription option description.").max(500).optional(),
5246
+ translated: z.string().describe("Translated subscription option description.").max(500).optional().nullable()
5247
+ }).describe("Subscription option description.").optional()
5248
+ }).describe("Subscription option information.").optional(),
5249
+ paymentOption: z.enum([
5250
+ "FULL_PAYMENT_ONLINE",
5251
+ "FULL_PAYMENT_OFFLINE",
5252
+ "MEMBERSHIP",
5253
+ "DEPOSIT_ONLINE",
5254
+ "MEMBERSHIP_OFFLINE",
5255
+ "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5256
+ ]).describe(
5257
+ "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5258
+ ).optional(),
5259
+ serviceProperties: z.object({
5260
+ scheduledDate: z.date().describe(
5261
+ "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."
5262
+ ).optional().nullable(),
5263
+ numberOfParticipants: z.number().int().describe(
5264
+ "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."
5265
+ ).min(1).max(1e4).optional().nullable()
5266
+ }).describe(
5267
+ "Service properties. When relevant, this contains information such as date and number of participants."
5268
+ ).optional(),
5269
+ rootCatalogItemId: z.string().describe(
5270
+ "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."
5271
+ ).min(1).max(36).optional().nullable(),
5272
+ priceDescription: z.object({
5226
5273
  original: z.string().describe(
5227
- "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)."
5228
- ).min(1).max(150).optional(),
5274
+ "__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)."
5275
+ ).min(1).max(100).optional(),
5229
5276
  translated: z.string().describe(
5230
- "Subscription option name translated into the buyer's language.\n\nDefault: Same as `original`."
5231
- ).min(1).max(150).optional().nullable()
5232
- }).describe("Subscription option title.").optional(),
5233
- description: z.object({
5234
- original: z.string().describe("Subscription option description.").max(500).optional(),
5235
- translated: z.string().describe("Translated subscription option description.").max(500).optional().nullable()
5236
- }).describe("Subscription option description.").optional()
5237
- }).describe("Subscription option information.").optional(),
5238
- paymentOption: z.enum([
5239
- "FULL_PAYMENT_ONLINE",
5240
- "FULL_PAYMENT_OFFLINE",
5241
- "MEMBERSHIP",
5242
- "DEPOSIT_ONLINE",
5243
- "MEMBERSHIP_OFFLINE",
5244
- "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5245
- ]).describe(
5246
- "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5247
- ).optional(),
5248
- serviceProperties: z.object({
5249
- scheduledDate: z.date().describe(
5250
- "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."
5277
+ "Price description translated into the buyer's language.\n\nDefault: Same as `original`."
5278
+ ).min(1).max(100).optional().nullable()
5279
+ }).describe(
5280
+ 'Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67".'
5281
+ ).optional(),
5282
+ depositAmount: z.object({
5283
+ amount: z.string().describe("Amount.").optional(),
5284
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5285
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5286
+ formattedConvertedAmount: z.string().describe(
5287
+ "Converted amount formatted with currency symbol."
5288
+ ).optional()
5289
+ }).describe(
5290
+ "Partial payment to be paid upfront during the checkout. Eligible for catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only."
5291
+ ).optional(),
5292
+ selectedMembership: z.object({
5293
+ _id: z.string().describe("Membership ID.").min(1).max(100).optional(),
5294
+ appId: z.string().describe("ID of the app providing this payment option.").regex(
5295
+ /^[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}$/,
5296
+ "Must be a valid GUID"
5297
+ ).optional()
5298
+ }).describe(
5299
+ "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`."
5300
+ ).optional(),
5301
+ deliveryProfileId: z.string().describe("Delivery profile ID.").regex(
5302
+ /^[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}$/,
5303
+ "Must be a valid GUID"
5251
5304
  ).optional().nullable(),
5252
- numberOfParticipants: z.number().int().describe(
5253
- "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."
5254
- ).min(1).max(1e4).optional().nullable()
5255
- }).describe(
5256
- "Service properties. When relevant, this contains information such as date and number of participants."
5257
- ).optional(),
5258
- rootCatalogItemId: z.string().describe(
5259
- "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."
5260
- ).min(1).max(36).optional().nullable(),
5261
- priceDescription: z.object({
5262
- original: z.string().describe(
5263
- "__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)."
5264
- ).min(1).max(100).optional(),
5265
- translated: z.string().describe(
5266
- "Price description translated into the buyer's language.\n\nDefault: Same as `original`."
5267
- ).min(1).max(100).optional().nullable()
5268
- }).describe(
5269
- 'Additional description for the price. For example, when price is 0 but additional details about the actual price are needed - "Starts at $67".'
5270
- ).optional(),
5271
- depositAmount: z.object({
5272
- amount: z.string().describe("Amount.").optional(),
5273
- convertedAmount: z.string().describe("Converted amount.").optional(),
5274
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5275
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5276
- }).describe(
5277
- "Partial payment to be paid upfront during the checkout. Eligible for catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only."
5278
- ).optional(),
5279
- selectedMembership: z.object({
5280
- _id: z.string().describe("Membership ID.").min(1).max(100).optional(),
5281
- appId: z.string().describe("ID of the app providing this payment option.").regex(
5305
+ taxGroupId: z.string().describe("Tax group ID for this line item.").regex(
5282
5306
  /^[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}$/,
5283
5307
  "Must be a valid GUID"
5284
- ).optional()
5285
- }).describe(
5286
- "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`."
5287
- ).optional(),
5288
- deliveryProfileId: z.string().describe("Delivery profile ID.").regex(
5289
- /^[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}$/,
5290
- "Must be a valid GUID"
5291
- ).optional().nullable(),
5292
- taxGroupId: z.string().describe("Tax group ID for this line item.").regex(
5293
- /^[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}$/,
5294
- "Must be a valid GUID"
5295
- ).optional().nullable(),
5296
- customLineItem: z.boolean().describe(
5297
- "Whether the line item is a custom line item. Custom line items don't trigger the Catalog service plugin."
5298
- ).optional(),
5299
- consentRequiredPaymentPolicy: z.string().describe(
5300
- "Item payment policy that requires customer consent to complete purchase. The payment policy will be displayed on the checkout page."
5301
- ).min(1).max(2500).optional().nullable(),
5302
- priceUndetermined: z.boolean().describe(
5303
- "Whether the price is not yet defined, and will be updated after the order is created."
5304
- ).optional(),
5305
- fixedQuantity: z.boolean().describe(
5306
- "Whether the line item quantity is fixed and cannot be changed."
5307
- ).optional(),
5308
- catalogOverrideFields: z.object({
5309
- productName: z.object({
5310
- original: z.string().describe(
5311
- "__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."
5312
- ).min(1).max(200).optional(),
5313
- translated: z.string().describe(
5314
- "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5315
- ).min(1).max(400).optional().nullable()
5316
- }).describe("Item name.").optional(),
5317
- price: z.string().describe("Item price **after** discounts.").optional().nullable(),
5318
- fullPrice: z.string().describe("Item price **before** discounts.").optional().nullable(),
5319
- descriptionLines: z.array(
5320
- z.intersection(
5308
+ ).optional().nullable(),
5309
+ customLineItem: z.boolean().describe(
5310
+ "Whether the line item is a custom line item. Custom line items don't trigger the Catalog service plugin."
5311
+ ).optional(),
5312
+ consentRequiredPaymentPolicy: z.string().describe(
5313
+ "Item payment policy that requires customer consent to complete purchase. The payment policy will be displayed on the checkout page."
5314
+ ).min(1).max(2500).optional().nullable(),
5315
+ priceUndetermined: z.boolean().describe(
5316
+ "Whether the price is not yet defined, and will be updated after the order is created."
5317
+ ).optional(),
5318
+ fixedQuantity: z.boolean().describe(
5319
+ "Whether the line item quantity is fixed and cannot be changed."
5320
+ ).optional(),
5321
+ catalogOverrideFields: z.object({
5322
+ productName: z.object({
5323
+ original: z.string().describe(
5324
+ "__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."
5325
+ ).min(1).max(200).optional(),
5326
+ translated: z.string().describe(
5327
+ "Item name translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5328
+ ).min(1).max(400).optional().nullable()
5329
+ }).describe("Item name.").optional(),
5330
+ price: z.string().describe("Item price **after** discounts.").optional().nullable(),
5331
+ fullPrice: z.string().describe("Item price **before** discounts.").optional().nullable(),
5332
+ descriptionLines: z.array(
5333
+ z.intersection(
5334
+ z.object({
5335
+ name: z.object({
5336
+ original: z.string().describe(
5337
+ "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)."
5338
+ ).max(100).optional(),
5339
+ translated: z.string().describe(
5340
+ "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5341
+ ).max(200).optional().nullable()
5342
+ }).describe("Description line name.").optional()
5343
+ }),
5344
+ z.xor([
5345
+ z.object({
5346
+ plainText: z.never().optional(),
5347
+ colorInfo: z.never().optional()
5348
+ }),
5349
+ z.object({
5350
+ colorInfo: z.never().optional(),
5351
+ plainText: z.object({
5352
+ original: z.string().describe(
5353
+ "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)."
5354
+ ).max(600).optional(),
5355
+ translated: z.string().describe(
5356
+ "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5357
+ ).max(600).optional().nullable()
5358
+ }).describe("Description line plain text value.")
5359
+ }),
5360
+ z.object({
5361
+ plainText: z.never().optional(),
5362
+ colorInfo: z.object({
5363
+ original: z.string().describe(
5364
+ "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)."
5365
+ ).max(500).optional(),
5366
+ translated: z.string().describe(
5367
+ "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5368
+ ).max(500).optional().nullable(),
5369
+ code: z.string().describe(
5370
+ "HEX or RGB color code for display."
5371
+ ).optional().nullable()
5372
+ }).describe("Description line color value.")
5373
+ })
5374
+ ])
5375
+ )
5376
+ ).min(0).max(20).optional(),
5377
+ physicalProperties: z.object({
5378
+ weight: z.number().describe(
5379
+ "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5380
+ ).optional().nullable(),
5381
+ sku: z.string().describe(
5382
+ "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5383
+ ).max(40).optional().nullable(),
5384
+ shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5385
+ }).describe("Physical properties of the item.").optional(),
5386
+ image: z.string().describe("Item image.").optional(),
5387
+ paymentOption: z.object({
5388
+ value: z.enum([
5389
+ "FULL_PAYMENT_ONLINE",
5390
+ "FULL_PAYMENT_OFFLINE",
5391
+ "MEMBERSHIP",
5392
+ "DEPOSIT_ONLINE",
5393
+ "MEMBERSHIP_OFFLINE",
5394
+ "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5395
+ ]).describe(
5396
+ "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5397
+ ).optional()
5398
+ }).describe("Payment method selected for the item.").optional(),
5399
+ depositAmount: z.string().describe(
5400
+ "Only eligible for catalog items with `lineItem.paymentOption.value` type of `DEPOSIT_ONLINE`."
5401
+ ).optional().nullable(),
5402
+ savePaymentMethod: z.boolean().describe(
5403
+ "Whether to save the payment method on the order.\n\nDefault: `false`"
5404
+ ).optional().nullable(),
5405
+ inventoryAppId: z.string().describe("ID of the app managing the inventory.").regex(
5406
+ /^[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}$/,
5407
+ "Must be a valid GUID"
5408
+ ).optional().nullable()
5409
+ }).describe(
5410
+ '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).'
5411
+ ).optional(),
5412
+ savePaymentMethod: z.boolean().describe(
5413
+ "Whether to save the payment method on the order.\n\nDefault: `false`"
5414
+ ).optional(),
5415
+ taxableAddress: z.intersection(
5416
+ z.object({}),
5417
+ z.xor([
5418
+ z.object({ addressType: z.never().optional() }),
5321
5419
  z.object({
5322
- name: z.object({
5323
- original: z.string().describe(
5324
- "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)."
5325
- ).max(100).optional(),
5326
- translated: z.string().describe(
5327
- "Description line name translated into the buyer's language.\n\nDefault: Same as `original`."
5328
- ).max(200).optional().nullable()
5329
- }).describe("Description line name.").optional()
5330
- }),
5331
- z.xor([
5332
- z.object({
5333
- plainText: z.never().optional(),
5334
- colorInfo: z.never().optional()
5335
- }),
5420
+ addressType: z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
5421
+ "taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
5422
+ )
5423
+ })
5424
+ ])
5425
+ ).describe("Address to use for tax calculation purposes.").optional(),
5426
+ extendedFields: z.object({
5427
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5428
+ "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)."
5429
+ ).optional()
5430
+ }).describe(
5431
+ "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."
5432
+ ).optional(),
5433
+ policies: z.array(
5434
+ z.object({
5435
+ title: z.string().describe("Policy title - should be translated").min(1).max(29).optional().nullable(),
5436
+ content: z.string().describe("Policy content - should be translated").min(1).max(3e3).optional()
5437
+ })
5438
+ ).max(5).optional(),
5439
+ membersOnly: z.boolean().describe(
5440
+ "Whether the item can only be purchased by site members.\n\nDefault: `false`"
5441
+ ).optional(),
5442
+ modifierGroups: z.array(
5443
+ z.object({
5444
+ _id: z.string().describe("Modifier group ID.").min(1).max(36).optional(),
5445
+ name: z.object({
5446
+ original: z.string().describe(
5447
+ "__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."
5448
+ ).min(1).max(200).optional(),
5449
+ translated: z.string().describe(
5450
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5451
+ ).min(1).max(400).optional().nullable()
5452
+ }).describe("Modifier group name.").optional(),
5453
+ modifiers: z.array(
5336
5454
  z.object({
5337
- colorInfo: z.never().optional(),
5338
- plainText: z.object({
5455
+ _id: z.string().describe("Modifier ID.").min(1).max(36).optional(),
5456
+ quantity: z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
5457
+ label: z.object({
5339
5458
  original: z.string().describe(
5340
- "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)."
5341
- ).max(600).optional(),
5459
+ "__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."
5460
+ ).min(1).max(200).optional(),
5342
5461
  translated: z.string().describe(
5343
- "Description line plain text value translated into the buyer's language.\n\nDefault: Same as `original`."
5344
- ).max(600).optional().nullable()
5345
- }).describe("Description line plain text value.")
5346
- }),
5347
- z.object({
5348
- plainText: z.never().optional(),
5349
- colorInfo: z.object({
5462
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5463
+ ).min(1).max(400).optional().nullable()
5464
+ }).describe("Primary display label for the modifier.").optional(),
5465
+ details: z.object({
5350
5466
  original: z.string().describe(
5351
- "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)."
5352
- ).max(500).optional(),
5467
+ "__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."
5468
+ ).min(1).max(200).optional(),
5353
5469
  translated: z.string().describe(
5354
- "Description line color name translated into the buyer's language.\n\nDefault: Same as `original`."
5355
- ).max(500).optional().nullable(),
5356
- code: z.string().describe("HEX or RGB color code for display.").optional().nullable()
5357
- }).describe("Description line color value.")
5470
+ "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5471
+ ).min(1).max(400).optional().nullable()
5472
+ }).describe("Additional details.").optional(),
5473
+ price: z.object({
5474
+ amount: z.string().describe("Amount.").optional(),
5475
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5476
+ formattedAmount: z.string().describe(
5477
+ "Amount formatted with currency symbol."
5478
+ ).optional(),
5479
+ formattedConvertedAmount: z.string().describe(
5480
+ "Converted amount formatted with currency symbol."
5481
+ ).optional()
5482
+ }).describe("The price of the modifier.").optional()
5358
5483
  })
5359
- ])
5360
- )
5361
- ).min(0).max(20).optional(),
5362
- physicalProperties: z.object({
5363
- weight: z.number().describe(
5364
- "Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
5365
- ).optional().nullable(),
5366
- sku: z.string().describe(
5367
- "Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
5368
- ).max(40).optional().nullable(),
5369
- shippable: z.boolean().describe("Whether this line item is shippable.").optional()
5370
- }).describe("Physical properties of the item.").optional(),
5371
- image: z.string().describe("Item image.").optional(),
5372
- paymentOption: z.object({
5373
- value: z.enum([
5374
- "FULL_PAYMENT_ONLINE",
5375
- "FULL_PAYMENT_OFFLINE",
5376
- "MEMBERSHIP",
5377
- "DEPOSIT_ONLINE",
5378
- "MEMBERSHIP_OFFLINE",
5379
- "MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
5380
- ]).describe(
5381
- "Type of selected payment option for current item.\n\nDefault: `FULL_PAYMENT_ONLINE`"
5382
- ).optional()
5383
- }).describe("Payment method selected for the item.").optional(),
5384
- depositAmount: z.string().describe(
5385
- "Only eligible for catalog items with `lineItem.paymentOption.value` type of `DEPOSIT_ONLINE`."
5386
- ).optional().nullable(),
5387
- savePaymentMethod: z.boolean().describe(
5388
- "Whether to save the payment method on the order.\n\nDefault: `false`"
5389
- ).optional().nullable(),
5390
- inventoryAppId: z.string().describe("ID of the app managing the inventory.").regex(
5391
- /^[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}$/,
5392
- "Must be a valid GUID"
5393
- ).optional().nullable()
5394
- }).describe(
5395
- '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).'
5396
- ).optional(),
5397
- savePaymentMethod: z.boolean().describe(
5398
- "Whether to save the payment method on the order.\n\nDefault: `false`"
5399
- ).optional(),
5400
- taxableAddress: z.intersection(
5401
- z.object({}),
5402
- z.xor([
5403
- z.object({ addressType: z.never().optional() }),
5404
- z.object({
5405
- addressType: z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
5406
- "taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
5407
- )
5484
+ ).min(1).max(25).optional()
5408
5485
  })
5409
- ])
5410
- ).describe("Address to use for tax calculation purposes.").optional(),
5411
- extendedFields: z.object({
5412
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5413
- "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)."
5414
- ).optional()
5415
- }).describe(
5416
- "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."
5417
- ).optional(),
5418
- policies: z.array(
5419
- z.object({
5420
- title: z.string().describe("Policy title - should be translated").min(1).max(29).optional().nullable(),
5421
- content: z.string().describe("Policy content - should be translated").min(1).max(3e3).optional()
5422
- })
5423
- ).max(5).optional(),
5424
- membersOnly: z.boolean().describe(
5425
- "Whether the item can only be purchased by site members.\n\nDefault: `false`"
5426
- ).optional(),
5427
- modifierGroups: z.array(
5428
- z.object({
5429
- _id: z.string().describe("Modifier group ID.").min(1).max(36).optional(),
5430
- name: z.object({
5431
- original: z.string().describe(
5432
- "__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."
5433
- ).min(1).max(200).optional(),
5434
- translated: z.string().describe(
5435
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5436
- ).min(1).max(400).optional().nullable()
5437
- }).describe("Modifier group name.").optional(),
5438
- modifiers: z.array(
5439
- z.object({
5440
- _id: z.string().describe("Modifier ID.").min(1).max(36).optional(),
5441
- quantity: z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
5442
- label: z.object({
5443
- original: z.string().describe(
5444
- "__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."
5445
- ).min(1).max(200).optional(),
5446
- translated: z.string().describe(
5447
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5448
- ).min(1).max(400).optional().nullable()
5449
- }).describe("Primary display label for the modifier.").optional(),
5450
- details: z.object({
5451
- original: z.string().describe(
5452
- "__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."
5453
- ).min(1).max(200).optional(),
5454
- translated: z.string().describe(
5455
- "String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
5456
- ).min(1).max(400).optional().nullable()
5457
- }).describe("Additional details.").optional(),
5458
- price: z.object({
5459
- amount: z.string().describe("Amount.").optional(),
5460
- convertedAmount: z.string().describe("Converted amount.").optional(),
5461
- formattedAmount: z.string().describe(
5462
- "Amount formatted with currency symbol."
5463
- ).optional(),
5464
- formattedConvertedAmount: z.string().describe(
5465
- "Converted amount formatted with currency symbol."
5466
- ).optional()
5467
- }).describe("The price of the modifier.").optional()
5468
- })
5469
- ).min(1).max(25).optional()
5470
- })
5471
- ).max(25).optional(),
5472
- modifiersTotalPrice: z.object({
5473
- amount: z.string().describe("Amount.").optional(),
5474
- convertedAmount: z.string().describe("Converted amount.").optional(),
5475
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5476
- formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
5477
- }).describe(
5478
- "Total price of all item modifiers. Included in the item price."
5479
- ).optional()
5480
- })
5481
- ).min(1).max(300).optional(),
5482
- buyerNote: z.string().describe(
5483
- "[Buyer note](https://support.wix.com/en/article/collecting-and-viewing-buyer-notes) left by the customer."
5484
- ).max(1e3).optional().nullable(),
5485
- buyerInfo: z.intersection(
5486
- z.object({
5487
- contactId: z.string().describe(
5488
- "Contact ID. For more information, see the Contacts API."
5489
- ).regex(
5490
- /^[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}$/,
5491
- "Must be a valid GUID"
5492
- ).optional().nullable(),
5493
- email: z.string().describe("Buyer email address.").email().optional().nullable()
5494
- }),
5495
- z.xor([
5496
- z.object({
5497
- visitorId: z.never().optional(),
5498
- memberId: z.never().optional(),
5499
- userId: z.never().optional()
5500
- }),
5501
- z.object({
5502
- memberId: z.never().optional(),
5503
- userId: z.never().optional(),
5504
- visitorId: z.string().describe("Visitor ID. If the buyer is **not** a site member.").regex(
5505
- /^[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}$/,
5506
- "Must be a valid GUID"
5507
- )
5508
- }),
5509
- z.object({
5510
- visitorId: z.never().optional(),
5511
- userId: z.never().optional(),
5512
- memberId: z.string().describe("Member ID. If the buyer is a site member.").regex(
5513
- /^[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}$/,
5514
- "Must be a valid GUID"
5515
- )
5516
- }),
5486
+ ).max(25).optional(),
5487
+ modifiersTotalPrice: z.object({
5488
+ amount: z.string().describe("Amount.").optional(),
5489
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5490
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5491
+ formattedConvertedAmount: z.string().describe(
5492
+ "Converted amount formatted with currency symbol."
5493
+ ).optional()
5494
+ }).describe(
5495
+ "Total price of all item modifiers. Included in the item price."
5496
+ ).optional()
5497
+ })
5498
+ ).min(1).max(300).optional(),
5499
+ buyerNote: z.string().describe(
5500
+ "[Buyer note](https://support.wix.com/en/article/collecting-and-viewing-buyer-notes) left by the customer."
5501
+ ).max(1e3).optional().nullable(),
5502
+ buyerInfo: z.intersection(
5517
5503
  z.object({
5518
- visitorId: z.never().optional(),
5519
- memberId: z.never().optional(),
5520
- userId: z.string().describe(
5521
- "User ID. If the buyer, or cart owner, is a Wix user."
5504
+ contactId: z.string().describe(
5505
+ "Contact ID. For more information, see the Contacts API."
5522
5506
  ).regex(
5523
5507
  /^[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}$/,
5524
5508
  "Must be a valid GUID"
5525
- )
5526
- })
5527
- ])
5528
- ).describe("Buyer information.").optional(),
5529
- currency: z.string().describe(
5530
- "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."
5531
- ).optional(),
5532
- conversionCurrency: z.string().describe(
5533
- "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."
5534
- ).optional(),
5535
- buyerLanguage: z.string().describe(
5536
- "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."
5537
- ).optional().nullable(),
5538
- siteLanguage: z.string().describe("Site language in which original values are displayed.").optional().nullable(),
5539
- taxIncludedInPrices: z.boolean().describe("Whether tax is included in line item prices.").optional().nullable(),
5540
- weightUnit: z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight measurement unit - defaults to site's weight unit.").optional(),
5541
- checkoutId: z.string().describe("ID of the checkout that originated from this cart.").regex(
5542
- /^[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}$/,
5543
- "Must be a valid GUID"
5544
- ).optional().nullable(),
5545
- appliedDiscounts: z.array(
5546
- z.intersection(
5547
- z.object({}),
5509
+ ).optional().nullable(),
5510
+ email: z.string().describe("Buyer email address.").email().optional().nullable()
5511
+ }),
5548
5512
  z.xor([
5549
5513
  z.object({
5550
- coupon: z.never().optional(),
5551
- merchantDiscount: z.never().optional()
5514
+ visitorId: z.never().optional(),
5515
+ memberId: z.never().optional(),
5516
+ userId: z.never().optional()
5552
5517
  }),
5553
5518
  z.object({
5554
- merchantDiscount: z.never().optional(),
5555
- coupon: z.object({
5556
- _id: z.string().describe("Coupon ID.").optional(),
5557
- code: z.string().describe("Coupon code.").optional()
5558
- }).describe("Coupon details.")
5519
+ memberId: z.never().optional(),
5520
+ userId: z.never().optional(),
5521
+ visitorId: z.string().describe(
5522
+ "Visitor ID. If the buyer is **not** a site member."
5523
+ ).regex(
5524
+ /^[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}$/,
5525
+ "Must be a valid GUID"
5526
+ )
5559
5527
  }),
5560
5528
  z.object({
5561
- coupon: z.never().optional(),
5562
- merchantDiscount: z.object({
5563
- amount: z.object({
5564
- amount: z.string().describe("Amount.").optional(),
5565
- convertedAmount: z.string().describe("Converted amount.").optional(),
5566
- formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5567
- formattedConvertedAmount: z.string().describe(
5568
- "Converted amount formatted with currency symbol."
5569
- ).optional()
5570
- }).describe("Discount value.").optional()
5571
- }).describe("Merchant discount.")
5529
+ visitorId: z.never().optional(),
5530
+ userId: z.never().optional(),
5531
+ memberId: z.string().describe("Member ID. If the buyer is a site member.").regex(
5532
+ /^[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}$/,
5533
+ "Must be a valid GUID"
5534
+ )
5535
+ }),
5536
+ z.object({
5537
+ visitorId: z.never().optional(),
5538
+ memberId: z.never().optional(),
5539
+ userId: z.string().describe(
5540
+ "User ID. If the buyer, or cart owner, is a Wix user."
5541
+ ).regex(
5542
+ /^[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}$/,
5543
+ "Must be a valid GUID"
5544
+ )
5572
5545
  })
5573
5546
  ])
5574
- )
5575
- ).optional(),
5576
- _createdDate: z.date().describe("Date and time the cart was created.").optional().nullable(),
5577
- _updatedDate: z.date().describe("Date and time the cart was updated.").optional().nullable(),
5578
- contactInfo: z.object({
5579
- address: z.object({
5580
- streetAddress: z.object({
5581
- name: z.string().optional(),
5582
- number: z.string().optional()
5583
- }).optional(),
5584
- city: z.string().optional().nullable(),
5585
- subdivision: z.string().optional().nullable(),
5586
- country: z.string().optional().nullable(),
5587
- postalCode: z.string().optional().nullable(),
5588
- addressLine2: z.string().optional().nullable()
5589
- }).describe("Address.").optional(),
5590
- contactDetails: z.object({
5591
- firstName: z.string().describe("First name.").max(100).optional().nullable(),
5592
- lastName: z.string().describe("Last name.").max(100).optional().nullable(),
5593
- phone: z.string().describe("Phone number.").optional().nullable(),
5594
- company: z.string().describe("Company name.").max(1e3).optional().nullable(),
5595
- vatId: z.object({
5596
- _id: z.string().describe("Customer's tax ID.").optional(),
5597
- type: z.enum(["UNSPECIFIED", "CPF", "CNPJ"]).describe(
5598
- "Tax type.\n\nSupported values:\n+ `CPF`: for individual tax payers\n+ `CNPJ`: for corporations"
5547
+ ).describe("Buyer information.").optional(),
5548
+ currency: z.string().describe(
5549
+ "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."
5550
+ ).optional(),
5551
+ conversionCurrency: z.string().describe(
5552
+ "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."
5553
+ ).optional(),
5554
+ buyerLanguage: z.string().describe(
5555
+ "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."
5556
+ ).optional().nullable(),
5557
+ siteLanguage: z.string().describe("Site language in which original values are displayed.").optional().nullable(),
5558
+ taxIncludedInPrices: z.boolean().describe("Whether tax is included in line item prices.").optional().nullable(),
5559
+ weightUnit: z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight measurement unit - defaults to site's weight unit.").optional(),
5560
+ checkoutId: z.string().describe("ID of the checkout that originated from this cart.").regex(
5561
+ /^[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}$/,
5562
+ "Must be a valid GUID"
5563
+ ).optional().nullable(),
5564
+ appliedDiscounts: z.array(
5565
+ z.intersection(
5566
+ z.object({}),
5567
+ z.xor([
5568
+ z.object({
5569
+ coupon: z.never().optional(),
5570
+ merchantDiscount: z.never().optional()
5571
+ }),
5572
+ z.object({
5573
+ merchantDiscount: z.never().optional(),
5574
+ coupon: z.object({
5575
+ _id: z.string().describe("Coupon ID.").optional(),
5576
+ code: z.string().describe("Coupon code.").optional()
5577
+ }).describe("Coupon details.")
5578
+ }),
5579
+ z.object({
5580
+ coupon: z.never().optional(),
5581
+ merchantDiscount: z.object({
5582
+ amount: z.object({
5583
+ amount: z.string().describe("Amount.").optional(),
5584
+ convertedAmount: z.string().describe("Converted amount.").optional(),
5585
+ formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
5586
+ formattedConvertedAmount: z.string().describe(
5587
+ "Converted amount formatted with currency symbol."
5588
+ ).optional()
5589
+ }).describe("Discount value.").optional()
5590
+ }).describe("Merchant discount.")
5591
+ })
5592
+ ])
5593
+ )
5594
+ ).optional(),
5595
+ _createdDate: z.date().describe("Date and time the cart was created.").optional().nullable(),
5596
+ _updatedDate: z.date().describe("Date and time the cart was updated.").optional().nullable(),
5597
+ contactInfo: z.object({
5598
+ address: z.object({
5599
+ streetAddress: z.object({
5600
+ name: z.string().optional(),
5601
+ number: z.string().optional()
5602
+ }).optional(),
5603
+ city: z.string().optional().nullable(),
5604
+ subdivision: z.string().optional().nullable(),
5605
+ country: z.string().optional().nullable(),
5606
+ postalCode: z.string().optional().nullable(),
5607
+ addressLine2: z.string().optional().nullable()
5608
+ }).describe("Address.").optional(),
5609
+ contactDetails: z.object({
5610
+ firstName: z.string().describe("First name.").max(100).optional().nullable(),
5611
+ lastName: z.string().describe("Last name.").max(100).optional().nullable(),
5612
+ phone: z.string().describe("Phone number.").optional().nullable(),
5613
+ company: z.string().describe("Company name.").max(1e3).optional().nullable(),
5614
+ vatId: z.object({
5615
+ _id: z.string().describe("Customer's tax ID.").optional(),
5616
+ type: z.enum(["UNSPECIFIED", "CPF", "CNPJ"]).describe(
5617
+ "Tax type.\n\nSupported values:\n+ `CPF`: for individual tax payers\n+ `CNPJ`: for corporations"
5618
+ ).optional()
5619
+ }).describe(
5620
+ "Tax information (for Brazil only). If ID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed."
5599
5621
  ).optional()
5600
- }).describe(
5601
- "Tax information (for Brazil only). If ID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed."
5622
+ }).describe("Contact details.").optional()
5623
+ }).describe("Contact info.").optional(),
5624
+ overrideCheckoutUrl: z.string().describe(
5625
+ "`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`."
5626
+ ).max(1e3).optional().nullable(),
5627
+ purchaseFlowId: z.string().describe(
5628
+ "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order."
5629
+ ).regex(
5630
+ /^[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}$/,
5631
+ "Must be a valid GUID"
5632
+ ).optional().nullable(),
5633
+ selectedShippingOption: z.object({
5634
+ carrierId: z.string().describe("Carrier ID.").regex(
5635
+ /^[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}$/,
5636
+ "Must be a valid GUID"
5637
+ ).optional().nullable(),
5638
+ code: z.string().describe(
5639
+ 'Selected shipping option code. For example, "usps_std_overnight".'
5640
+ ).min(1).max(100).optional()
5641
+ }).describe("Selected shipping option.").optional(),
5642
+ extendedFields: z.object({
5643
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5644
+ "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)."
5602
5645
  ).optional()
5603
- }).describe("Contact details.").optional()
5604
- }).describe("Contact info.").optional(),
5605
- overrideCheckoutUrl: z.string().describe(
5606
- "`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`."
5607
- ).max(1e3).optional().nullable(),
5608
- purchaseFlowId: z.string().describe(
5609
- "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order."
5610
- ).regex(
5611
- /^[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}$/,
5612
- "Must be a valid GUID"
5613
- ).optional().nullable(),
5614
- selectedShippingOption: z.object({
5615
- carrierId: z.string().describe("Carrier ID.").regex(
5646
+ }).describe("Fields extended by data extensions").optional(),
5647
+ businessLocationId: z.string().describe(
5648
+ "The business location ID associated with the cart.\n\nTo learn more, see the Locations API."
5649
+ ).regex(
5616
5650
  /^[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}$/,
5617
5651
  "Must be a valid GUID"
5618
5652
  ).optional().nullable(),
5619
- code: z.string().describe(
5620
- 'Selected shipping option code. For example, "usps_std_overnight".'
5621
- ).min(1).max(100).optional()
5622
- }).describe("Selected shipping option.").optional(),
5623
- extendedFields: z.object({
5624
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
5625
- "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)."
5626
- ).optional()
5627
- }).describe("Fields extended by data extensions").optional(),
5628
- businessLocationId: z.string().describe(
5629
- "The business location ID associated with the cart.\n\nTo learn more, see the Locations API."
5630
- ).regex(
5631
- /^[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}$/,
5632
- "Must be a valid GUID"
5633
- ).optional().nullable(),
5634
- paymentCurrency: z.string().describe(
5635
- "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."
5636
- ).optional(),
5637
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
5638
- "Revision number, which increments by 1 each time the Cart is updated."
5639
- ).optional().nullable()
5640
- }).describe("Updated cart.").optional()
5641
- });
5642
- var EstimateCurrentCartTotalsRequest = z.object({
5653
+ paymentCurrency: z.string().describe(
5654
+ "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."
5655
+ ).optional(),
5656
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
5657
+ "Revision number, which increments by 1 each time the Cart is updated."
5658
+ ).optional().nullable()
5659
+ }).describe("Updated cart.").optional()
5660
+ }
5661
+ );
5662
+ var EstimateCurrentCartTotalsRequest = /* @__PURE__ */ z.object({
5643
5663
  options: z.object({
5644
5664
  selectedShippingOption: z.object({
5645
5665
  carrierId: z.string().describe("Carrier ID.").regex(
@@ -5733,7 +5753,7 @@ var EstimateCurrentCartTotalsRequest = z.object({
5733
5753
  ).optional().nullable()
5734
5754
  }).describe("Total estimation options.").optional()
5735
5755
  });
5736
- var EstimateCurrentCartTotalsResponse = z.object({
5756
+ var EstimateCurrentCartTotalsResponse = /* @__PURE__ */ z.object({
5737
5757
  cart: z.object({
5738
5758
  _id: z.string().describe("Cart ID.").regex(
5739
5759
  /^[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}$/,
@@ -7857,7 +7877,7 @@ var EstimateCurrentCartTotalsResponse = z.object({
7857
7877
  total: z.number().int().describe("Membership's initial value.").min(1).optional(),
7858
7878
  remaining: z.number().int().describe("Membership's remaining value.").min(0).optional()
7859
7879
  }).describe("Membership's payment credits (balance information).").optional(),
7860
- expirationDate: z.date().describe("Deprecated. Use `offering_description`.").optional().nullable(),
7880
+ expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
7861
7881
  additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
7862
7882
  })
7863
7883
  ).max(300).optional(),
@@ -7884,7 +7904,7 @@ var EstimateCurrentCartTotalsResponse = z.object({
7884
7904
  }).describe(
7885
7905
  "Membership's payment credits (balance information)."
7886
7906
  ).optional(),
7887
- expirationDate: z.date().describe("Deprecated. Use `offering_description`.").optional().nullable(),
7907
+ expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
7888
7908
  additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
7889
7909
  }).describe("Membership details.").optional(),
7890
7910
  reason: z.string().describe(
@@ -8081,8 +8101,8 @@ var EstimateCurrentCartTotalsResponse = z.object({
8081
8101
  })
8082
8102
  ).optional()
8083
8103
  });
8084
- var DeleteCurrentCartRequest = z.object({});
8085
- var DeleteCurrentCartResponse = z.object({});
8104
+ var DeleteCurrentCartRequest = /* @__PURE__ */ z.object({});
8105
+ var DeleteCurrentCartResponse = /* @__PURE__ */ z.object({});
8086
8106
  export {
8087
8107
  AddToCurrentCartRequest,
8088
8108
  AddToCurrentCartResponse,