@wix/auto_sdk_ecom_totals-calculator 1.0.115 → 1.0.116
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.
- package/build/cjs/schemas.js +1101 -1057
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/schemas.mjs +1101 -1057
- package/build/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
- package/build/internal/cjs/index.js +0 -485
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.js +0 -472
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.js +0 -388
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/schemas.js +0 -2121
- package/build/internal/cjs/schemas.js.map +0 -1
- package/build/internal/es/index.mjs +0 -441
- package/build/internal/es/index.mjs.map +0 -1
- package/build/internal/es/index.typings.mjs +0 -428
- package/build/internal/es/index.typings.mjs.map +0 -1
- package/build/internal/es/meta.mjs +0 -341
- package/build/internal/es/meta.mjs.map +0 -1
- package/build/internal/es/schemas.mjs +0 -2083
- package/build/internal/es/schemas.mjs.map +0 -1
package/build/cjs/schemas.js
CHANGED
|
@@ -38,43 +38,43 @@ module.exports = __toCommonJS(schemas_exports);
|
|
|
38
38
|
// src/ecom-v1-totals-calculation-totals-calculator.schemas.ts
|
|
39
39
|
var z = __toESM(require("zod"));
|
|
40
40
|
var CalculateTotalsRequest = /* @__PURE__ */ z.object({
|
|
41
|
-
options: z.intersection(
|
|
42
|
-
z.object({
|
|
43
|
-
calculationId: z.string().describe(
|
|
41
|
+
options: /* @__PURE__ */ z.intersection(
|
|
42
|
+
/* @__PURE__ */ z.object({
|
|
43
|
+
calculationId: /* @__PURE__ */ z.string().describe(
|
|
44
44
|
"Calculation ID. An identifier of the entity that you are calculating totals for, for example, cart ID or checkout ID.\nThis value will be used in order to optimise calculations by caching.\nIf not passed, calculation might be slower in some cases."
|
|
45
45
|
).min(1).max(100).optional().nullable(),
|
|
46
|
-
lineItems: z.array(
|
|
47
|
-
z.object({
|
|
48
|
-
_id: z.string().describe("Line item ID.").min(1).max(100),
|
|
49
|
-
quantity: z.number().int().describe("Quantity.").min(0).max(1e5),
|
|
50
|
-
catalogReference: z.object({
|
|
51
|
-
catalogItemId: z.string().describe(
|
|
46
|
+
lineItems: /* @__PURE__ */ z.array(
|
|
47
|
+
/* @__PURE__ */ z.object({
|
|
48
|
+
_id: /* @__PURE__ */ z.string().describe("Line item ID.").min(1).max(100),
|
|
49
|
+
quantity: /* @__PURE__ */ z.number().int().describe("Quantity.").min(0).max(1e5),
|
|
50
|
+
catalogReference: /* @__PURE__ */ z.object({
|
|
51
|
+
catalogItemId: /* @__PURE__ */ z.string().describe(
|
|
52
52
|
"ID of the item within the catalog it belongs to."
|
|
53
53
|
).min(1).max(36).optional(),
|
|
54
|
-
appId: z.string().describe(
|
|
54
|
+
appId: /* @__PURE__ */ z.string().describe(
|
|
55
55
|
'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"`'
|
|
56
56
|
).min(1).optional(),
|
|
57
|
-
options: z.record(z.string(), z.any()).describe(
|
|
57
|
+
options: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe(
|
|
58
58
|
"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)."
|
|
59
59
|
).optional().nullable()
|
|
60
60
|
}).describe(
|
|
61
61
|
"Optional references to the line item's origin catalog.\nSee [Catalog SPI](https://bo.wix.com/wix-docs/rest/ecommerce/catalog-spi/introduction) for more details.\nThis field may be empty in the case of a custom line item.\ncurrently we only use the catalog app id to set tax=0 for specific apps."
|
|
62
62
|
).optional(),
|
|
63
|
-
productName: z.string().describe("Product/booking/event name.").min(0).max(200).optional().nullable(),
|
|
64
|
-
price: z.string().describe("Catalog price."),
|
|
65
|
-
physicalProperties: z.object({
|
|
66
|
-
weight: z.number().describe(
|
|
63
|
+
productName: /* @__PURE__ */ z.string().describe("Product/booking/event name.").min(0).max(200).optional().nullable(),
|
|
64
|
+
price: /* @__PURE__ */ z.string().describe("Catalog price."),
|
|
65
|
+
physicalProperties: /* @__PURE__ */ z.object({
|
|
66
|
+
weight: /* @__PURE__ */ z.number().describe(
|
|
67
67
|
"Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request."
|
|
68
68
|
).optional().nullable(),
|
|
69
|
-
sku: z.string().describe(
|
|
69
|
+
sku: /* @__PURE__ */ z.string().describe(
|
|
70
70
|
"Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)."
|
|
71
71
|
).max(40).optional().nullable(),
|
|
72
|
-
shippable: z.boolean().describe("Whether this line item is shippable.").optional()
|
|
72
|
+
shippable: /* @__PURE__ */ z.boolean().describe("Whether this line item is shippable.").optional()
|
|
73
73
|
}).describe("Physical properties (if applicable).").optional(),
|
|
74
|
-
subscriptionSettings: z.object({
|
|
75
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional()
|
|
74
|
+
subscriptionSettings: /* @__PURE__ */ z.object({
|
|
75
|
+
frequency: /* @__PURE__ */ z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional()
|
|
76
76
|
}).describe("Subscription settings.").optional(),
|
|
77
|
-
paymentOption: z.enum([
|
|
77
|
+
paymentOption: /* @__PURE__ */ z.enum([
|
|
78
78
|
"FULL_PAYMENT_ONLINE",
|
|
79
79
|
"FULL_PAYMENT_OFFLINE",
|
|
80
80
|
"MEMBERSHIP",
|
|
@@ -82,37 +82,37 @@ var CalculateTotalsRequest = /* @__PURE__ */ z.object({
|
|
|
82
82
|
"MEMBERSHIP_OFFLINE",
|
|
83
83
|
"MEMBERSHIP_ONLINE_WITH_OFFLINE_REMAINDER"
|
|
84
84
|
]).optional(),
|
|
85
|
-
serviceProperties: z.object({
|
|
86
|
-
scheduledDate: z.date().describe(
|
|
85
|
+
serviceProperties: /* @__PURE__ */ z.object({
|
|
86
|
+
scheduledDate: /* @__PURE__ */ z.date().describe(
|
|
87
87
|
"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."
|
|
88
88
|
).optional().nullable(),
|
|
89
|
-
numberOfParticipants: z.number().int().describe(
|
|
89
|
+
numberOfParticipants: /* @__PURE__ */ z.number().int().describe(
|
|
90
90
|
"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."
|
|
91
91
|
).min(1).max(1e4).optional().nullable()
|
|
92
92
|
}).describe(
|
|
93
93
|
"Service properties. When relevant, this contains information such as date and number of participants."
|
|
94
94
|
).optional(),
|
|
95
|
-
rootCatalogItemId: z.string().describe(
|
|
95
|
+
rootCatalogItemId: /* @__PURE__ */ z.string().describe(
|
|
96
96
|
"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 has the same value as `catalogReference.catalogItemId`.\n+ Used in membership validation."
|
|
97
97
|
).min(1).max(36).optional().nullable(),
|
|
98
|
-
depositAmount: z.string().describe(
|
|
98
|
+
depositAmount: /* @__PURE__ */ z.string().describe(
|
|
99
99
|
"Optional - partial amount of item's price to be paid now for checkout cases with DEPOSIT_ONLINE payment option\nIf omitted - item's price will not be split and is expected to be paid in single installment"
|
|
100
100
|
).optional().nullable(),
|
|
101
|
-
fullPrice: z.string().describe("full price of the item before all the discounts").optional().nullable(),
|
|
102
|
-
deliveryProfileId: z.string().describe("The Item's Delivery Profile Id").regex(
|
|
101
|
+
fullPrice: /* @__PURE__ */ z.string().describe("full price of the item before all the discounts").optional().nullable(),
|
|
102
|
+
deliveryProfileId: /* @__PURE__ */ z.string().describe("The Item's Delivery Profile Id").regex(
|
|
103
103
|
/^[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}$/,
|
|
104
104
|
"Must be a valid GUID"
|
|
105
105
|
).optional().nullable(),
|
|
106
|
-
itemType: z.intersection(
|
|
107
|
-
z.object({}),
|
|
108
|
-
z.xor([
|
|
109
|
-
z.object({
|
|
110
|
-
preset: z.never().optional(),
|
|
111
|
-
custom: z.never().optional()
|
|
106
|
+
itemType: /* @__PURE__ */ z.intersection(
|
|
107
|
+
/* @__PURE__ */ z.object({}),
|
|
108
|
+
/* @__PURE__ */ z.xor([
|
|
109
|
+
/* @__PURE__ */ z.object({
|
|
110
|
+
preset: /* @__PURE__ */ z.never().optional(),
|
|
111
|
+
custom: /* @__PURE__ */ z.never().optional()
|
|
112
112
|
}),
|
|
113
|
-
z.object({
|
|
114
|
-
custom: z.never().optional(),
|
|
115
|
-
preset: z.enum([
|
|
113
|
+
/* @__PURE__ */ z.object({
|
|
114
|
+
custom: /* @__PURE__ */ z.never().optional(),
|
|
115
|
+
preset: /* @__PURE__ */ z.enum([
|
|
116
116
|
"UNRECOGNISED",
|
|
117
117
|
"PHYSICAL",
|
|
118
118
|
"DIGITAL",
|
|
@@ -120,35 +120,37 @@ var CalculateTotalsRequest = /* @__PURE__ */ z.object({
|
|
|
120
120
|
"SERVICE"
|
|
121
121
|
]).describe("Preset item type.")
|
|
122
122
|
}),
|
|
123
|
-
z.object({
|
|
124
|
-
preset: z.never().optional(),
|
|
125
|
-
custom: z.string().describe(
|
|
123
|
+
/* @__PURE__ */ z.object({
|
|
124
|
+
preset: /* @__PURE__ */ z.never().optional(),
|
|
125
|
+
custom: /* @__PURE__ */ z.string().describe(
|
|
126
126
|
"Custom item type. When none of the preset types are suitable, specifies the custom type."
|
|
127
127
|
)
|
|
128
128
|
})
|
|
129
129
|
])
|
|
130
130
|
).describe("Item type. Either a preset type or custom.").optional(),
|
|
131
|
-
taxableAddress: z.intersection(
|
|
132
|
-
z.object({}),
|
|
133
|
-
z.xor([
|
|
134
|
-
z.object({
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
taxableAddress: /* @__PURE__ */ z.intersection(
|
|
132
|
+
/* @__PURE__ */ z.object({}),
|
|
133
|
+
/* @__PURE__ */ z.xor([
|
|
134
|
+
/* @__PURE__ */ z.object({
|
|
135
|
+
addressType: /* @__PURE__ */ z.never().optional()
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ z.object({
|
|
138
|
+
addressType: /* @__PURE__ */ z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
|
|
137
139
|
"taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
|
|
138
140
|
)
|
|
139
141
|
})
|
|
140
142
|
])
|
|
141
143
|
).describe("Address to use for tax calculation purposes.").optional(),
|
|
142
|
-
additionalFees: z.array(
|
|
143
|
-
z.object({
|
|
144
|
-
code: z.string().describe("Additional fee's unique code or ID.").min(1).max(100).optional().nullable(),
|
|
145
|
-
name: z.string().describe("Additional fee's name.\n\nMax: 50 characters").min(1).max(50).optional(),
|
|
146
|
-
price: z.string().describe(
|
|
144
|
+
additionalFees: /* @__PURE__ */ z.array(
|
|
145
|
+
/* @__PURE__ */ z.object({
|
|
146
|
+
code: /* @__PURE__ */ z.string().describe("Additional fee's unique code or ID.").min(1).max(100).optional().nullable(),
|
|
147
|
+
name: /* @__PURE__ */ z.string().describe("Additional fee's name.\n\nMax: 50 characters").min(1).max(50).optional(),
|
|
148
|
+
price: /* @__PURE__ */ z.string().describe(
|
|
147
149
|
"Total additional fees. This `price` does not include any taxes that may apply to these additional fees."
|
|
148
150
|
).optional(),
|
|
149
|
-
taxDetails: z.object({
|
|
150
|
-
taxable: z.boolean().describe("Whether additional fee is taxable.").optional(),
|
|
151
|
-
taxGroupId: z.string().describe("Reserved for internal use.").regex(
|
|
151
|
+
taxDetails: /* @__PURE__ */ z.object({
|
|
152
|
+
taxable: /* @__PURE__ */ z.boolean().describe("Whether additional fee is taxable.").optional(),
|
|
153
|
+
taxGroupId: /* @__PURE__ */ z.string().describe("Reserved for internal use.").regex(
|
|
152
154
|
/^[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}$/,
|
|
153
155
|
"Must be a valid GUID"
|
|
154
156
|
).optional().nullable()
|
|
@@ -157,288 +159,296 @@ var CalculateTotalsRequest = /* @__PURE__ */ z.object({
|
|
|
157
159
|
).optional()
|
|
158
160
|
})
|
|
159
161
|
).max(5).optional(),
|
|
160
|
-
modifierGroups: z.array(
|
|
161
|
-
z.object({
|
|
162
|
-
_id: z.string().describe("Modifier group ID.").min(1).max(36).optional(),
|
|
163
|
-
name: z.object({
|
|
164
|
-
original: z.string().describe(
|
|
162
|
+
modifierGroups: /* @__PURE__ */ z.array(
|
|
163
|
+
/* @__PURE__ */ z.object({
|
|
164
|
+
_id: /* @__PURE__ */ z.string().describe("Modifier group ID.").min(1).max(36).optional(),
|
|
165
|
+
name: /* @__PURE__ */ z.object({
|
|
166
|
+
original: /* @__PURE__ */ z.string().describe(
|
|
165
167
|
"__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."
|
|
166
168
|
).min(1).max(200).optional(),
|
|
167
|
-
translated: z.string().describe(
|
|
169
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
168
170
|
"String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
|
|
169
171
|
).min(1).max(400).optional().nullable()
|
|
170
172
|
}).describe("Modifier group name.").optional(),
|
|
171
|
-
modifiers: z.array(
|
|
172
|
-
z.object({
|
|
173
|
-
_id: z.string().describe("Modifier ID.").min(1).max(36).optional(),
|
|
174
|
-
quantity: z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
|
|
175
|
-
label: z.object({
|
|
176
|
-
original: z.string().describe(
|
|
173
|
+
modifiers: /* @__PURE__ */ z.array(
|
|
174
|
+
/* @__PURE__ */ z.object({
|
|
175
|
+
_id: /* @__PURE__ */ z.string().describe("Modifier ID.").min(1).max(36).optional(),
|
|
176
|
+
quantity: /* @__PURE__ */ z.number().int().describe("The quantity of this modifier.").min(1).max(1e5).optional().nullable(),
|
|
177
|
+
label: /* @__PURE__ */ z.object({
|
|
178
|
+
original: /* @__PURE__ */ z.string().describe(
|
|
177
179
|
"__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."
|
|
178
180
|
).min(1).max(200).optional(),
|
|
179
|
-
translated: z.string().describe(
|
|
181
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
180
182
|
"String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
|
|
181
183
|
).min(1).max(400).optional().nullable()
|
|
182
184
|
}).describe("Primary display label for the modifier.").optional(),
|
|
183
|
-
details: z.object({
|
|
184
|
-
original: z.string().describe(
|
|
185
|
+
details: /* @__PURE__ */ z.object({
|
|
186
|
+
original: /* @__PURE__ */ z.string().describe(
|
|
185
187
|
"__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."
|
|
186
188
|
).min(1).max(200).optional(),
|
|
187
|
-
translated: z.string().describe(
|
|
189
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
188
190
|
"String translated into the buyer's language.\n\nMin: 1 character.\nMax: 400 characters.\nDefault: Same as `original`."
|
|
189
191
|
).min(1).max(400).optional().nullable()
|
|
190
192
|
}).describe("Additional details.").optional(),
|
|
191
|
-
price: z.string().describe("The price of the modifier.").optional().nullable()
|
|
193
|
+
price: /* @__PURE__ */ z.string().describe("The price of the modifier.").optional().nullable()
|
|
192
194
|
})
|
|
193
195
|
).min(1).max(25).optional()
|
|
194
196
|
})
|
|
195
197
|
).max(25).optional()
|
|
196
198
|
})
|
|
197
199
|
).max(300).optional(),
|
|
198
|
-
shippingAddress: z.object({
|
|
199
|
-
country: z.string().describe(
|
|
200
|
+
shippingAddress: /* @__PURE__ */ z.object({
|
|
201
|
+
country: /* @__PURE__ */ z.string().describe(
|
|
200
202
|
"Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format."
|
|
201
203
|
).optional().nullable(),
|
|
202
|
-
subdivision: z.string().describe(
|
|
204
|
+
subdivision: /* @__PURE__ */ z.string().describe(
|
|
203
205
|
"Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format."
|
|
204
206
|
).max(50).optional().nullable(),
|
|
205
|
-
city: z.string().describe("City name.").max(50).optional().nullable(),
|
|
206
|
-
postalCode: z.string().describe("Postal or zip code.").max(50).optional().nullable(),
|
|
207
|
-
streetAddress: z.object({
|
|
208
|
-
number: z.string().describe("Street number.").optional(),
|
|
209
|
-
name: z.string().describe("Street name.").optional()
|
|
207
|
+
city: /* @__PURE__ */ z.string().describe("City name.").max(50).optional().nullable(),
|
|
208
|
+
postalCode: /* @__PURE__ */ z.string().describe("Postal or zip code.").max(50).optional().nullable(),
|
|
209
|
+
streetAddress: /* @__PURE__ */ z.object({
|
|
210
|
+
number: /* @__PURE__ */ z.string().describe("Street number.").optional(),
|
|
211
|
+
name: /* @__PURE__ */ z.string().describe("Street name.").optional()
|
|
210
212
|
}).describe("Street address.").optional(),
|
|
211
|
-
addressLine: z.string().describe("Main address line (usually street name and number).").max(150).optional().nullable(),
|
|
212
|
-
addressLine2: z.string().describe(
|
|
213
|
+
addressLine: /* @__PURE__ */ z.string().describe("Main address line (usually street name and number).").max(150).optional().nullable(),
|
|
214
|
+
addressLine2: /* @__PURE__ */ z.string().describe(
|
|
213
215
|
"Free text providing more detailed address info. Usually contains apt, suite, floor."
|
|
214
216
|
).max(100).optional().nullable(),
|
|
215
|
-
geocode: z.object({
|
|
216
|
-
latitude: z.number().describe("Address latitude.").optional().nullable(),
|
|
217
|
-
longitude: z.number().describe("Address longitude.").optional().nullable()
|
|
217
|
+
geocode: /* @__PURE__ */ z.object({
|
|
218
|
+
latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
|
|
219
|
+
longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
|
|
218
220
|
}).describe(
|
|
219
221
|
"Geocode object containing latitude and longitude coordinates."
|
|
220
222
|
).optional(),
|
|
221
|
-
countryFullname: z.string().describe("Country's full name.").optional().nullable(),
|
|
222
|
-
subdivisionFullname: z.string().describe("Subdivision full-name.").optional().nullable()
|
|
223
|
+
countryFullname: /* @__PURE__ */ z.string().describe("Country's full name.").optional().nullable(),
|
|
224
|
+
subdivisionFullname: /* @__PURE__ */ z.string().describe("Subdivision full-name.").optional().nullable()
|
|
223
225
|
}).describe(
|
|
224
226
|
"Shipping address for tax and shipping calculation (if applicable)."
|
|
225
227
|
).optional(),
|
|
226
|
-
billingAddress: z.object({
|
|
227
|
-
country: z.string().describe(
|
|
228
|
+
billingAddress: /* @__PURE__ */ z.object({
|
|
229
|
+
country: /* @__PURE__ */ z.string().describe(
|
|
228
230
|
"Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format."
|
|
229
231
|
).optional().nullable(),
|
|
230
|
-
subdivision: z.string().describe(
|
|
232
|
+
subdivision: /* @__PURE__ */ z.string().describe(
|
|
231
233
|
"Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format."
|
|
232
234
|
).max(50).optional().nullable(),
|
|
233
|
-
city: z.string().describe("City name.").max(50).optional().nullable(),
|
|
234
|
-
postalCode: z.string().describe("Postal or zip code.").max(50).optional().nullable(),
|
|
235
|
-
streetAddress: z.object({
|
|
236
|
-
number: z.string().describe("Street number.").optional(),
|
|
237
|
-
name: z.string().describe("Street name.").optional()
|
|
235
|
+
city: /* @__PURE__ */ z.string().describe("City name.").max(50).optional().nullable(),
|
|
236
|
+
postalCode: /* @__PURE__ */ z.string().describe("Postal or zip code.").max(50).optional().nullable(),
|
|
237
|
+
streetAddress: /* @__PURE__ */ z.object({
|
|
238
|
+
number: /* @__PURE__ */ z.string().describe("Street number.").optional(),
|
|
239
|
+
name: /* @__PURE__ */ z.string().describe("Street name.").optional()
|
|
238
240
|
}).describe("Street address.").optional(),
|
|
239
|
-
addressLine: z.string().describe("Main address line (usually street name and number).").max(150).optional().nullable(),
|
|
240
|
-
addressLine2: z.string().describe(
|
|
241
|
+
addressLine: /* @__PURE__ */ z.string().describe("Main address line (usually street name and number).").max(150).optional().nullable(),
|
|
242
|
+
addressLine2: /* @__PURE__ */ z.string().describe(
|
|
241
243
|
"Free text providing more detailed address info. Usually contains apt, suite, floor."
|
|
242
244
|
).max(100).optional().nullable(),
|
|
243
|
-
geocode: z.object({
|
|
244
|
-
latitude: z.number().describe("Address latitude.").optional().nullable(),
|
|
245
|
-
longitude: z.number().describe("Address longitude.").optional().nullable()
|
|
245
|
+
geocode: /* @__PURE__ */ z.object({
|
|
246
|
+
latitude: /* @__PURE__ */ z.number().describe("Address latitude.").optional().nullable(),
|
|
247
|
+
longitude: /* @__PURE__ */ z.number().describe("Address longitude.").optional().nullable()
|
|
246
248
|
}).describe(
|
|
247
249
|
"Geocode object containing latitude and longitude coordinates."
|
|
248
250
|
).optional(),
|
|
249
|
-
countryFullname: z.string().describe("Country's full name.").optional().nullable(),
|
|
250
|
-
subdivisionFullname: z.string().describe("Subdivision full-name.").optional().nullable()
|
|
251
|
+
countryFullname: /* @__PURE__ */ z.string().describe("Country's full name.").optional().nullable(),
|
|
252
|
+
subdivisionFullname: /* @__PURE__ */ z.string().describe("Subdivision full-name.").optional().nullable()
|
|
251
253
|
}).describe(
|
|
252
254
|
"Billing address. Used for calculating tax if all the items in the cart are not shippable."
|
|
253
255
|
).optional(),
|
|
254
|
-
selectedShippingOption: z.object({
|
|
255
|
-
carrierId: z.string().describe("Carrier ID.").regex(
|
|
256
|
+
selectedShippingOption: /* @__PURE__ */ z.object({
|
|
257
|
+
carrierId: /* @__PURE__ */ z.string().describe("Carrier ID.").regex(
|
|
256
258
|
/^[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}$/,
|
|
257
259
|
"Must be a valid GUID"
|
|
258
260
|
).optional().nullable(),
|
|
259
|
-
code: z.string().describe(
|
|
261
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
260
262
|
'Selected shipping option code. For example, "usps_std_overnight".'
|
|
261
263
|
).min(1).max(100)
|
|
262
264
|
}).describe("Details about selected shipping option.").optional(),
|
|
263
|
-
buyerEmail: z.string().describe(
|
|
265
|
+
buyerEmail: /* @__PURE__ */ z.string().describe(
|
|
264
266
|
"Buyer email. Used to enforce coupon [single-use per customer](https://support.wix.com/en/article/wix-stores-limiting-coupon-usage). If not passed, single coupon usage per customer will not be enforced."
|
|
265
267
|
).email().optional().nullable(),
|
|
266
|
-
memberId: z.string().describe(
|
|
268
|
+
memberId: /* @__PURE__ */ z.string().describe(
|
|
267
269
|
"Member id to use for this calculation\nWhen not provided, given that the caller is a member, its member id will be used\nProviding this require elevated permissions - ECOM.ADMIN_CALCULATE_TOTALS"
|
|
268
270
|
).optional().nullable(),
|
|
269
|
-
selectedMemberships: z.object({
|
|
270
|
-
memberships: z.array(
|
|
271
|
-
z.object({
|
|
272
|
-
_id: z.string().describe("Membership ID.").min(1).max(200),
|
|
273
|
-
appId: z.string().describe("ID of the app providing this payment option.").regex(
|
|
271
|
+
selectedMemberships: /* @__PURE__ */ z.object({
|
|
272
|
+
memberships: /* @__PURE__ */ z.array(
|
|
273
|
+
/* @__PURE__ */ z.object({
|
|
274
|
+
_id: /* @__PURE__ */ z.string().describe("Membership ID.").min(1).max(200),
|
|
275
|
+
appId: /* @__PURE__ */ z.string().describe("ID of the app providing this payment option.").regex(
|
|
274
276
|
/^[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}$/,
|
|
275
277
|
"Must be a valid GUID"
|
|
276
278
|
),
|
|
277
|
-
lineItemIds: z.array(z.string()).min(1).max(300)
|
|
279
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).min(1).max(300)
|
|
278
280
|
})
|
|
279
281
|
).max(300).optional()
|
|
280
282
|
}).describe(
|
|
281
283
|
"The selected memberships and which line items they apply to\nWhen not provided, default selection will be returned\nYou can also set it to empty selection\nMutually exclusive with `membership_selection` - providing both returns an INVALID_ARGUMENT error."
|
|
282
284
|
).optional(),
|
|
283
|
-
buyerPhone: z.string().describe("Buyer phone number. Used to get shipping rates.").optional().nullable(),
|
|
284
|
-
purchaseFlowId: z.string().describe(
|
|
285
|
+
buyerPhone: /* @__PURE__ */ z.string().describe("Buyer phone number. Used to get shipping rates.").optional().nullable(),
|
|
286
|
+
purchaseFlowId: /* @__PURE__ */ z.string().describe(
|
|
285
287
|
"Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order."
|
|
286
288
|
).regex(
|
|
287
289
|
/^[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}$/,
|
|
288
290
|
"Must be a valid GUID"
|
|
289
291
|
).optional().nullable(),
|
|
290
|
-
externalReferences: z.array(
|
|
291
|
-
z.object({
|
|
292
|
-
appId: z.string().describe(
|
|
292
|
+
externalReferences: /* @__PURE__ */ z.array(
|
|
293
|
+
/* @__PURE__ */ z.object({
|
|
294
|
+
appId: /* @__PURE__ */ z.string().describe(
|
|
293
295
|
"ID of the app associated with the purchase flow.\nFor example, the Wix Pay Links app ID."
|
|
294
296
|
).regex(
|
|
295
297
|
/^[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}$/,
|
|
296
298
|
"Must be a valid GUID"
|
|
297
299
|
).optional(),
|
|
298
|
-
resourceId: z.string().describe(
|
|
300
|
+
resourceId: /* @__PURE__ */ z.string().describe(
|
|
299
301
|
"Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.\nFor example, a Wix Pay Link ID."
|
|
300
302
|
).min(1).max(100).optional().nullable()
|
|
301
303
|
})
|
|
302
304
|
).max(20).optional(),
|
|
303
|
-
businessLocationId: z.string().describe(
|
|
305
|
+
businessLocationId: /* @__PURE__ */ z.string().describe(
|
|
304
306
|
"The business location ID to be used as the basis for some calculations.\nLearn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction)."
|
|
305
307
|
).regex(
|
|
306
308
|
/^[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}$/,
|
|
307
309
|
"Must be a valid GUID"
|
|
308
310
|
).optional().nullable(),
|
|
309
|
-
giftCardRedeemAmount: z.string().describe("DEPRECATED: Use `giftCards.redeemAmount` instead.").optional().nullable(),
|
|
310
|
-
extendedFields: z.object({
|
|
311
|
-
namespaces:
|
|
311
|
+
giftCardRedeemAmount: /* @__PURE__ */ z.string().describe("DEPRECATED: Use `giftCards.redeemAmount` instead.").optional().nullable(),
|
|
312
|
+
extendedFields: /* @__PURE__ */ z.object({
|
|
313
|
+
namespaces: /* @__PURE__ */ z.record(
|
|
314
|
+
/* @__PURE__ */ z.string(),
|
|
315
|
+
/* @__PURE__ */ z.record(
|
|
316
|
+
/* @__PURE__ */ z.string(),
|
|
317
|
+
/* @__PURE__ */ z.any()
|
|
318
|
+
)
|
|
319
|
+
).describe(
|
|
312
320
|
"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)."
|
|
313
321
|
).optional()
|
|
314
322
|
}).describe(
|
|
315
323
|
"[Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
316
324
|
).optional()
|
|
317
325
|
}),
|
|
318
|
-
z.intersection(
|
|
319
|
-
z.xor([
|
|
320
|
-
z.object({
|
|
321
|
-
couponId: z.never().optional(),
|
|
322
|
-
couponCode: z.never().optional()
|
|
326
|
+
/* @__PURE__ */ z.intersection(
|
|
327
|
+
/* @__PURE__ */ z.xor([
|
|
328
|
+
/* @__PURE__ */ z.object({
|
|
329
|
+
couponId: /* @__PURE__ */ z.never().optional(),
|
|
330
|
+
couponCode: /* @__PURE__ */ z.never().optional()
|
|
323
331
|
}),
|
|
324
|
-
z.object({
|
|
325
|
-
couponCode: z.never().optional(),
|
|
326
|
-
couponId: z.string().describe("Coupon ID.")
|
|
332
|
+
/* @__PURE__ */ z.object({
|
|
333
|
+
couponCode: /* @__PURE__ */ z.never().optional(),
|
|
334
|
+
couponId: /* @__PURE__ */ z.string().describe("Coupon ID.")
|
|
327
335
|
}),
|
|
328
|
-
z.object({
|
|
329
|
-
couponId: z.never().optional(),
|
|
330
|
-
couponCode: z.string().describe("Coupon code.")
|
|
336
|
+
/* @__PURE__ */ z.object({
|
|
337
|
+
couponId: /* @__PURE__ */ z.never().optional(),
|
|
338
|
+
couponCode: /* @__PURE__ */ z.string().describe("Coupon code.")
|
|
331
339
|
})
|
|
332
340
|
]),
|
|
333
|
-
z.xor([
|
|
334
|
-
z.object({
|
|
335
|
-
|
|
336
|
-
|
|
341
|
+
/* @__PURE__ */ z.xor([
|
|
342
|
+
/* @__PURE__ */ z.object({
|
|
343
|
+
giftCardCode: /* @__PURE__ */ z.never().optional()
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ z.object({
|
|
346
|
+
giftCardCode: /* @__PURE__ */ z.string().describe("DEPRECATED: Use gift_cards instead.")
|
|
337
347
|
})
|
|
338
348
|
])
|
|
339
349
|
)
|
|
340
350
|
).optional()
|
|
341
351
|
});
|
|
342
352
|
var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
343
|
-
calculatedLineItems: z.array(
|
|
344
|
-
z.object({
|
|
345
|
-
lineItemId: z.string().describe("Line item ID.").optional(),
|
|
346
|
-
pricesBreakdown: z.object({
|
|
347
|
-
totalPriceAfterTax: z.object({
|
|
348
|
-
amount: z.string().describe("Amount.").optional(),
|
|
349
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
350
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
351
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
353
|
+
calculatedLineItems: /* @__PURE__ */ z.array(
|
|
354
|
+
/* @__PURE__ */ z.object({
|
|
355
|
+
lineItemId: /* @__PURE__ */ z.string().describe("Line item ID.").optional(),
|
|
356
|
+
pricesBreakdown: /* @__PURE__ */ z.object({
|
|
357
|
+
totalPriceAfterTax: /* @__PURE__ */ z.object({
|
|
358
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
359
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
360
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
361
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
352
362
|
}).describe("Total price after discounts, tax, and modifiers.").optional(),
|
|
353
|
-
totalPriceBeforeTax: z.object({
|
|
354
|
-
amount: z.string().describe("Amount.").optional(),
|
|
355
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
356
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
357
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
363
|
+
totalPriceBeforeTax: /* @__PURE__ */ z.object({
|
|
364
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
365
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
366
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
367
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
358
368
|
}).describe(
|
|
359
369
|
"Total price after discounts and modifiers, and before tax."
|
|
360
370
|
).optional(),
|
|
361
|
-
taxDetails: z.object({
|
|
362
|
-
taxableAmount: z.object({
|
|
363
|
-
amount: z.string().describe("Amount.").optional(),
|
|
364
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
365
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
366
|
-
formattedConvertedAmount: z.string().describe(
|
|
371
|
+
taxDetails: /* @__PURE__ */ z.object({
|
|
372
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
373
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
374
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
375
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
376
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
367
377
|
"Converted amount formatted with currency symbol."
|
|
368
378
|
).optional()
|
|
369
379
|
}).describe("Amount for which tax is calculated.").optional(),
|
|
370
|
-
taxRate: z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
371
|
-
totalTax: z.object({
|
|
372
|
-
amount: z.string().describe("Amount.").optional(),
|
|
373
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
374
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
375
|
-
formattedConvertedAmount: z.string().describe(
|
|
380
|
+
taxRate: /* @__PURE__ */ z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
381
|
+
totalTax: /* @__PURE__ */ z.object({
|
|
382
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
383
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
384
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
385
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
376
386
|
"Converted amount formatted with currency symbol."
|
|
377
387
|
).optional()
|
|
378
388
|
}).describe(
|
|
379
389
|
"Calculated tax, based on `taxable_amount` and `tax_rate`."
|
|
380
390
|
).optional(),
|
|
381
|
-
rateBreakdown: z.array(
|
|
382
|
-
z.object({
|
|
383
|
-
name: z.string().describe(
|
|
391
|
+
rateBreakdown: /* @__PURE__ */ z.array(
|
|
392
|
+
/* @__PURE__ */ z.object({
|
|
393
|
+
name: /* @__PURE__ */ z.string().describe(
|
|
384
394
|
"Name of tax against which the calculation was performed."
|
|
385
395
|
).max(100).optional(),
|
|
386
|
-
rate: z.string().describe(
|
|
396
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
387
397
|
"Rate at which this tax detail was calculated."
|
|
388
398
|
).optional(),
|
|
389
|
-
tax: z.object({
|
|
390
|
-
amount: z.string().describe("Amount.").optional(),
|
|
391
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
392
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
393
|
-
formattedConvertedAmount: z.string().describe(
|
|
399
|
+
tax: /* @__PURE__ */ z.object({
|
|
400
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
401
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
402
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
403
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
394
404
|
"Converted amount formatted with currency symbol."
|
|
395
405
|
).optional()
|
|
396
406
|
}).describe("Amount of tax for this tax detail.").optional()
|
|
397
407
|
})
|
|
398
408
|
).optional(),
|
|
399
|
-
taxBreakdown: z.array(
|
|
400
|
-
z.object({
|
|
401
|
-
jurisdiction: z.string().describe(
|
|
409
|
+
taxBreakdown: /* @__PURE__ */ z.array(
|
|
410
|
+
/* @__PURE__ */ z.object({
|
|
411
|
+
jurisdiction: /* @__PURE__ */ z.string().describe(
|
|
402
412
|
'The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".'
|
|
403
413
|
).max(200).optional().nullable(),
|
|
404
|
-
nonTaxableAmount: z.object({
|
|
405
|
-
amount: z.string().describe("Amount.").optional(),
|
|
406
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
407
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
408
|
-
formattedConvertedAmount: z.string().describe(
|
|
414
|
+
nonTaxableAmount: /* @__PURE__ */ z.object({
|
|
415
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
416
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
417
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
418
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
409
419
|
"Converted amount formatted with currency symbol."
|
|
410
420
|
).optional()
|
|
411
421
|
}).describe(
|
|
412
422
|
"The amount of this line item price that was considered nontaxable. (Decimal value)"
|
|
413
423
|
).optional(),
|
|
414
|
-
rate: z.string().describe(
|
|
424
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
415
425
|
"The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)"
|
|
416
426
|
).optional().nullable(),
|
|
417
|
-
taxAmount: z.object({
|
|
418
|
-
amount: z.string().describe("Amount.").optional(),
|
|
419
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
420
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
421
|
-
formattedConvertedAmount: z.string().describe(
|
|
427
|
+
taxAmount: /* @__PURE__ */ z.object({
|
|
428
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
429
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
430
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
431
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
422
432
|
"Converted amount formatted with currency symbol."
|
|
423
433
|
).optional()
|
|
424
434
|
}).describe(
|
|
425
435
|
"The amount of tax estimated for this line item. (Decimal value)"
|
|
426
436
|
).optional(),
|
|
427
|
-
taxableAmount: z.object({
|
|
428
|
-
amount: z.string().describe("Amount.").optional(),
|
|
429
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
430
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
431
|
-
formattedConvertedAmount: z.string().describe(
|
|
437
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
438
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
439
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
440
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
441
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
432
442
|
"Converted amount formatted with currency symbol."
|
|
433
443
|
).optional()
|
|
434
444
|
}).describe("The taxable amount of this line item.").optional(),
|
|
435
|
-
taxType: z.string().describe(
|
|
445
|
+
taxType: /* @__PURE__ */ z.string().describe(
|
|
436
446
|
`The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.`
|
|
437
447
|
).max(200).optional().nullable(),
|
|
438
|
-
taxName: z.string().describe(
|
|
448
|
+
taxName: /* @__PURE__ */ z.string().describe(
|
|
439
449
|
'The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.\nThis name should be explicit enough to allow the merchant to understand what tax was calculated.'
|
|
440
450
|
).max(200).optional().nullable(),
|
|
441
|
-
jurisdictionType: z.enum([
|
|
451
|
+
jurisdictionType: /* @__PURE__ */ z.enum([
|
|
442
452
|
"UNDEFINED",
|
|
443
453
|
"COUNTRY",
|
|
444
454
|
"STATE",
|
|
@@ -451,58 +461,58 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
451
461
|
})
|
|
452
462
|
).min(0).max(1e3).optional()
|
|
453
463
|
}).describe("Tax details.").optional(),
|
|
454
|
-
totalDiscount: z.object({
|
|
455
|
-
amount: z.string().describe("Amount.").optional(),
|
|
456
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
457
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
458
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
464
|
+
totalDiscount: /* @__PURE__ */ z.object({
|
|
465
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
466
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
467
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
468
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
459
469
|
}).describe("Total discount applied for the line item.").optional(),
|
|
460
|
-
price: z.object({
|
|
461
|
-
amount: z.string().describe("Amount.").optional(),
|
|
462
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
463
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
464
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
470
|
+
price: /* @__PURE__ */ z.object({
|
|
471
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
472
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
473
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
474
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
465
475
|
}).describe(
|
|
466
476
|
"Catalog price after catalog-defined discount, automatic discounts, and modifiers."
|
|
467
477
|
).optional(),
|
|
468
|
-
priceBeforeDiscounts: z.object({
|
|
469
|
-
amount: z.string().describe("Amount.").optional(),
|
|
470
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
471
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
472
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
478
|
+
priceBeforeDiscounts: /* @__PURE__ */ z.object({
|
|
479
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
480
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
481
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
482
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
473
483
|
}).describe(
|
|
474
484
|
"Item price before automatic discounts, coupons, and global discounts; after catalog-defined discounts and modifiers.\nDefaults to `price` when not provided."
|
|
475
485
|
).optional(),
|
|
476
|
-
lineItemPrice: z.object({
|
|
477
|
-
amount: z.string().describe("Amount.").optional(),
|
|
478
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
479
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
480
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
486
|
+
lineItemPrice: /* @__PURE__ */ z.object({
|
|
487
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
488
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
489
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
490
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
481
491
|
}).describe(
|
|
482
492
|
"Total line item price after catalog-defined discounts, automatic discounts, and modifiers."
|
|
483
493
|
).optional(),
|
|
484
|
-
fullPrice: z.object({
|
|
485
|
-
amount: z.string().describe("Amount.").optional(),
|
|
486
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
487
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
488
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
494
|
+
fullPrice: /* @__PURE__ */ z.object({
|
|
495
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
496
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
497
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
498
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
489
499
|
}).describe("Catalog price before any discounts, with modifiers.").optional(),
|
|
490
|
-
modifiers: z.object({
|
|
491
|
-
amount: z.string().describe("Amount.").optional(),
|
|
492
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
493
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
494
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
500
|
+
modifiers: /* @__PURE__ */ z.object({
|
|
501
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
502
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
503
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
504
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
495
505
|
}).describe("Sum of all modifiers for a single unit of the item.").optional(),
|
|
496
|
-
depositAmount: z.object({
|
|
497
|
-
amount: z.string().describe("Amount.").optional(),
|
|
498
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
499
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
500
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
506
|
+
depositAmount: /* @__PURE__ */ z.object({
|
|
507
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
508
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
509
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
510
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
501
511
|
}).describe(
|
|
502
512
|
"Partial payment out of `price` to be paid upfront during the checkout.\nApplies to catalog items with `lineItem.paymentOption` type `DEPOSIT_ONLINE` only."
|
|
503
513
|
).optional()
|
|
504
514
|
}).describe("Price breakdown for this line item.").optional(),
|
|
505
|
-
paymentOption: z.enum([
|
|
515
|
+
paymentOption: /* @__PURE__ */ z.enum([
|
|
506
516
|
"FULL_PAYMENT_ONLINE",
|
|
507
517
|
"FULL_PAYMENT_OFFLINE",
|
|
508
518
|
"MEMBERSHIP",
|
|
@@ -512,12 +522,14 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
512
522
|
]).describe(
|
|
513
523
|
'Type of selected payment option for current item. Supported values:\n+ `"FULL_PAYMENT_ONLINE"` - The entire payment for this item will happen as part of the checkout\n+ `"FULL_PAYMENT_OFFLINE"` - The entire payment for this item will happen after the checkout\n+ `"MEMBERSHIP"` - This item cannot be paid via monetary payment options, only via non monetary option such membership. When this option is used, price must be set to 0\n+ `"DEPOSIT_ONLINE"` - Partial payment of the given item will happen as part of the checkout. Amount to be paid is defined by deposit_amount field.'
|
|
514
524
|
).optional(),
|
|
515
|
-
taxableAddress: z.intersection(
|
|
516
|
-
z.object({}),
|
|
517
|
-
z.xor([
|
|
518
|
-
z.object({
|
|
519
|
-
|
|
520
|
-
|
|
525
|
+
taxableAddress: /* @__PURE__ */ z.intersection(
|
|
526
|
+
/* @__PURE__ */ z.object({}),
|
|
527
|
+
/* @__PURE__ */ z.xor([
|
|
528
|
+
/* @__PURE__ */ z.object({
|
|
529
|
+
addressType: /* @__PURE__ */ z.never().optional()
|
|
530
|
+
}),
|
|
531
|
+
/* @__PURE__ */ z.object({
|
|
532
|
+
addressType: /* @__PURE__ */ z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
|
|
521
533
|
"taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
|
|
522
534
|
)
|
|
523
535
|
})
|
|
@@ -525,108 +537,108 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
525
537
|
).describe("tax calculation address.").optional()
|
|
526
538
|
})
|
|
527
539
|
).optional(),
|
|
528
|
-
priceSummary: z.object({
|
|
529
|
-
subtotal: z.object({
|
|
530
|
-
amount: z.string().describe("Amount.").optional(),
|
|
531
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
532
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
533
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
540
|
+
priceSummary: /* @__PURE__ */ z.object({
|
|
541
|
+
subtotal: /* @__PURE__ */ z.object({
|
|
542
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
543
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
544
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
545
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
534
546
|
}).describe(
|
|
535
547
|
"Subtotal of all line items, before discounts and before tax."
|
|
536
548
|
).optional(),
|
|
537
|
-
shipping: z.object({
|
|
538
|
-
amount: z.string().describe("Amount.").optional(),
|
|
539
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
540
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
541
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
549
|
+
shipping: /* @__PURE__ */ z.object({
|
|
550
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
551
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
552
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
553
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
542
554
|
}).describe("Total shipping price, before discounts and before tax.").optional(),
|
|
543
|
-
tax: z.object({
|
|
544
|
-
amount: z.string().describe("Amount.").optional(),
|
|
545
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
546
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
547
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
555
|
+
tax: /* @__PURE__ */ z.object({
|
|
556
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
557
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
558
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
559
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
548
560
|
}).describe("Total tax.").optional(),
|
|
549
|
-
discount: z.object({
|
|
550
|
-
amount: z.string().describe("Amount.").optional(),
|
|
551
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
552
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
553
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
561
|
+
discount: /* @__PURE__ */ z.object({
|
|
562
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
563
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
564
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
565
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
554
566
|
}).describe("Total calculated discount value.").optional(),
|
|
555
|
-
total: z.object({
|
|
556
|
-
amount: z.string().describe("Amount.").optional(),
|
|
557
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
558
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
559
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
567
|
+
total: /* @__PURE__ */ z.object({
|
|
568
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
569
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
570
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
571
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
560
572
|
}).describe("Total price after discounts, gift cards, and tax.").optional(),
|
|
561
|
-
additionalFees: z.object({
|
|
562
|
-
amount: z.string().describe("Amount.").optional(),
|
|
563
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
564
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
565
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
573
|
+
additionalFees: /* @__PURE__ */ z.object({
|
|
574
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
575
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
576
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
577
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
566
578
|
}).describe("Total additional fees price before tax.").optional()
|
|
567
579
|
}).describe("Price summary.").optional(),
|
|
568
|
-
giftCard: z.object({
|
|
569
|
-
_id: z.string().describe("Gift Card ID.").optional(),
|
|
570
|
-
obfuscatedCode: z.string().describe("Gift card obfuscated code.").optional(),
|
|
571
|
-
amount: z.object({
|
|
572
|
-
amount: z.string().describe("Amount.").optional(),
|
|
573
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
574
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
575
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
580
|
+
giftCard: /* @__PURE__ */ z.object({
|
|
581
|
+
_id: /* @__PURE__ */ z.string().describe("Gift Card ID.").optional(),
|
|
582
|
+
obfuscatedCode: /* @__PURE__ */ z.string().describe("Gift card obfuscated code.").optional(),
|
|
583
|
+
amount: /* @__PURE__ */ z.object({
|
|
584
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
585
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
586
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
587
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
576
588
|
}).describe("Actual amount to be redeemed from the gift card.").optional(),
|
|
577
|
-
appId: z.string().describe("App ID of the gift card provider.").regex(
|
|
589
|
+
appId: /* @__PURE__ */ z.string().describe("App ID of the gift card provider.").regex(
|
|
578
590
|
/^[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}$/,
|
|
579
591
|
"Must be a valid GUID"
|
|
580
592
|
).optional(),
|
|
581
|
-
externalId: z.string().describe(
|
|
593
|
+
externalId: /* @__PURE__ */ z.string().describe(
|
|
582
594
|
"External ID in the gift card provider's system.\nUsed for integration and tracking across different platforms."
|
|
583
595
|
).min(1).max(50).optional().nullable(),
|
|
584
|
-
requestedAmount: z.object({
|
|
585
|
-
amount: z.string().describe("Amount.").optional(),
|
|
586
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
587
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
588
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
596
|
+
requestedAmount: /* @__PURE__ */ z.object({
|
|
597
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
598
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
599
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
600
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
589
601
|
}).describe("Requested amount to redeem from the gift card.").optional()
|
|
590
602
|
}).describe("DEPRECATED: Use gift_cards instead.").optional(),
|
|
591
|
-
taxSummary: z.object({
|
|
592
|
-
taxableAmount: z.object({
|
|
593
|
-
amount: z.string().describe("Amount.").optional(),
|
|
594
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
595
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
596
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
603
|
+
taxSummary: /* @__PURE__ */ z.object({
|
|
604
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
605
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
606
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
607
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
608
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
597
609
|
}).describe("Amount for which tax is calculated, added from line items.").optional(),
|
|
598
|
-
totalTax: z.object({
|
|
599
|
-
amount: z.string().describe("Amount.").optional(),
|
|
600
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
601
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
602
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
610
|
+
totalTax: /* @__PURE__ */ z.object({
|
|
611
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
612
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
613
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
614
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
603
615
|
}).describe("Calculated tax, added from line items.").optional(),
|
|
604
|
-
calculationDetails: z.intersection(
|
|
605
|
-
z.object({
|
|
606
|
-
rateType: z.enum([
|
|
616
|
+
calculationDetails: /* @__PURE__ */ z.intersection(
|
|
617
|
+
/* @__PURE__ */ z.object({
|
|
618
|
+
rateType: /* @__PURE__ */ z.enum([
|
|
607
619
|
"NO_TAX_COLLECTED",
|
|
608
620
|
"MANUAL_RATE",
|
|
609
621
|
"AUTO_RATE",
|
|
610
622
|
"FALLBACK_RATE"
|
|
611
623
|
]).describe("Rate calculation type.").optional()
|
|
612
624
|
}),
|
|
613
|
-
z.xor([
|
|
614
|
-
z.object({
|
|
615
|
-
manualRateReason: z.never().optional(),
|
|
616
|
-
autoTaxFallbackDetails: z.never().optional()
|
|
625
|
+
/* @__PURE__ */ z.xor([
|
|
626
|
+
/* @__PURE__ */ z.object({
|
|
627
|
+
manualRateReason: /* @__PURE__ */ z.never().optional(),
|
|
628
|
+
autoTaxFallbackDetails: /* @__PURE__ */ z.never().optional()
|
|
617
629
|
}),
|
|
618
|
-
z.object({
|
|
619
|
-
autoTaxFallbackDetails: z.never().optional(),
|
|
620
|
-
manualRateReason: z.enum(["GLOBAL_SETTING_TO_MANUAL", "REGION_SETTING_TO_MANUAL"]).describe("Reason the manual calculation was used.")
|
|
630
|
+
/* @__PURE__ */ z.object({
|
|
631
|
+
autoTaxFallbackDetails: /* @__PURE__ */ z.never().optional(),
|
|
632
|
+
manualRateReason: /* @__PURE__ */ z.enum(["GLOBAL_SETTING_TO_MANUAL", "REGION_SETTING_TO_MANUAL"]).describe("Reason the manual calculation was used.")
|
|
621
633
|
}),
|
|
622
|
-
z.object({
|
|
623
|
-
manualRateReason: z.never().optional(),
|
|
624
|
-
autoTaxFallbackDetails: z.object({
|
|
625
|
-
fallbackReason: z.enum(["AUTO_TAX_FAILED", "AUTO_TAX_DEACTIVATED"]).describe("reason for fallback").optional(),
|
|
626
|
-
error: z.object({
|
|
627
|
-
code: z.string().describe("Error code.").optional(),
|
|
628
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
629
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
634
|
+
/* @__PURE__ */ z.object({
|
|
635
|
+
manualRateReason: /* @__PURE__ */ z.never().optional(),
|
|
636
|
+
autoTaxFallbackDetails: /* @__PURE__ */ z.object({
|
|
637
|
+
fallbackReason: /* @__PURE__ */ z.enum(["AUTO_TAX_FAILED", "AUTO_TAX_DEACTIVATED"]).describe("reason for fallback").optional(),
|
|
638
|
+
error: /* @__PURE__ */ z.object({
|
|
639
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
640
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
641
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
630
642
|
}).describe(
|
|
631
643
|
"invalid request (i.e. address), timeout, internal error, license error, and others will be encoded here"
|
|
632
644
|
).optional()
|
|
@@ -635,154 +647,154 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
635
647
|
])
|
|
636
648
|
).describe("Tax calculator that was active when the order was created.").optional()
|
|
637
649
|
}).describe("Tax summary.").optional(),
|
|
638
|
-
shippingInfo: z.object({
|
|
639
|
-
region: z.object({
|
|
640
|
-
_id: z.string().describe("Shipping region ID.").regex(
|
|
650
|
+
shippingInfo: /* @__PURE__ */ z.object({
|
|
651
|
+
region: /* @__PURE__ */ z.object({
|
|
652
|
+
_id: /* @__PURE__ */ z.string().describe("Shipping region ID.").regex(
|
|
641
653
|
/^[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}$/,
|
|
642
654
|
"Must be a valid GUID"
|
|
643
655
|
).optional(),
|
|
644
|
-
name: z.string().describe("Shipping region name.").max(100).optional()
|
|
656
|
+
name: /* @__PURE__ */ z.string().describe("Shipping region name.").max(100).optional()
|
|
645
657
|
}).describe("Shipping region.").optional(),
|
|
646
|
-
selectedCarrierServiceOption: z.object({
|
|
647
|
-
code: z.string().describe(
|
|
658
|
+
selectedCarrierServiceOption: /* @__PURE__ */ z.object({
|
|
659
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
648
660
|
'Unique identifier of selected option. For example, "usps_std_overnight".'
|
|
649
661
|
).max(100).optional(),
|
|
650
|
-
title: z.string().describe(
|
|
662
|
+
title: /* @__PURE__ */ z.string().describe(
|
|
651
663
|
'Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).\nFor example, "Standard" or "First-Class Package International".'
|
|
652
664
|
).max(250).optional(),
|
|
653
|
-
logistics: z.object({
|
|
654
|
-
deliveryTime: z.string().describe(
|
|
665
|
+
logistics: /* @__PURE__ */ z.object({
|
|
666
|
+
deliveryTime: /* @__PURE__ */ z.string().describe(
|
|
655
667
|
'Expected delivery time, in free text. For example, "3-5 business days".'
|
|
656
668
|
).max(500).optional().nullable(),
|
|
657
|
-
instructions: z.string().describe(
|
|
669
|
+
instructions: /* @__PURE__ */ z.string().describe(
|
|
658
670
|
`Instructions for caller, e.g for pickup: "Please deliver during opening hours, and please don't park in disabled parking spot".`
|
|
659
671
|
).max(1e3).optional().nullable(),
|
|
660
|
-
pickupDetails: z.object({
|
|
661
|
-
address: z.object({
|
|
662
|
-
streetAddress: z.object({
|
|
663
|
-
name: z.string().optional(),
|
|
664
|
-
number: z.string().optional()
|
|
672
|
+
pickupDetails: /* @__PURE__ */ z.object({
|
|
673
|
+
address: /* @__PURE__ */ z.object({
|
|
674
|
+
streetAddress: /* @__PURE__ */ z.object({
|
|
675
|
+
name: /* @__PURE__ */ z.string().optional(),
|
|
676
|
+
number: /* @__PURE__ */ z.string().optional()
|
|
665
677
|
}).optional(),
|
|
666
|
-
city: z.string().optional().nullable(),
|
|
667
|
-
subdivision: z.string().optional().nullable(),
|
|
668
|
-
country: z.string().optional().nullable(),
|
|
669
|
-
postalCode: z.string().optional().nullable(),
|
|
670
|
-
addressLine2: z.string().optional().nullable()
|
|
678
|
+
city: /* @__PURE__ */ z.string().optional().nullable(),
|
|
679
|
+
subdivision: /* @__PURE__ */ z.string().optional().nullable(),
|
|
680
|
+
country: /* @__PURE__ */ z.string().optional().nullable(),
|
|
681
|
+
postalCode: /* @__PURE__ */ z.string().optional().nullable(),
|
|
682
|
+
addressLine2: /* @__PURE__ */ z.string().optional().nullable()
|
|
671
683
|
}).describe("Pickup address.").optional(),
|
|
672
|
-
businessLocation: z.boolean().describe(
|
|
684
|
+
businessLocation: /* @__PURE__ */ z.boolean().describe(
|
|
673
685
|
"Whether the pickup address is that of a business - this may effect tax calculation."
|
|
674
686
|
).optional(),
|
|
675
|
-
pickupMethod: z.enum(["STORE_PICKUP", "PICKUP_POINT"]).describe("Pickup method").optional()
|
|
687
|
+
pickupMethod: /* @__PURE__ */ z.enum(["STORE_PICKUP", "PICKUP_POINT"]).describe("Pickup method").optional()
|
|
676
688
|
}).describe("Pickup details.").optional()
|
|
677
689
|
}).describe("Delivery logistics.").optional(),
|
|
678
|
-
cost: z.object({
|
|
679
|
-
totalPriceAfterTax: z.object({
|
|
680
|
-
amount: z.string().describe("Amount.").optional(),
|
|
681
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
682
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
683
|
-
formattedConvertedAmount: z.string().describe(
|
|
690
|
+
cost: /* @__PURE__ */ z.object({
|
|
691
|
+
totalPriceAfterTax: /* @__PURE__ */ z.object({
|
|
692
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
693
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
694
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
695
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
684
696
|
"Converted amount formatted with currency symbol."
|
|
685
697
|
).optional()
|
|
686
698
|
}).describe("Total shipping price, after discount and after tax.").optional(),
|
|
687
|
-
totalPriceBeforeTax: z.object({
|
|
688
|
-
amount: z.string().describe("Amount.").optional(),
|
|
689
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
690
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
691
|
-
formattedConvertedAmount: z.string().describe(
|
|
699
|
+
totalPriceBeforeTax: /* @__PURE__ */ z.object({
|
|
700
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
701
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
702
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
703
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
692
704
|
"Converted amount formatted with currency symbol."
|
|
693
705
|
).optional()
|
|
694
706
|
}).describe(
|
|
695
707
|
"Total price of shipping after discounts (when relevant), and before tax."
|
|
696
708
|
).optional(),
|
|
697
|
-
taxDetails: z.object({
|
|
698
|
-
taxableAmount: z.object({
|
|
699
|
-
amount: z.string().describe("Amount.").optional(),
|
|
700
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
701
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
702
|
-
formattedConvertedAmount: z.string().describe(
|
|
709
|
+
taxDetails: /* @__PURE__ */ z.object({
|
|
710
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
711
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
712
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
713
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
714
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
703
715
|
"Converted amount formatted with currency symbol."
|
|
704
716
|
).optional()
|
|
705
717
|
}).describe("Amount for which tax is calculated.").optional(),
|
|
706
|
-
taxRate: z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
707
|
-
totalTax: z.object({
|
|
708
|
-
amount: z.string().describe("Amount.").optional(),
|
|
709
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
710
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
711
|
-
formattedConvertedAmount: z.string().describe(
|
|
718
|
+
taxRate: /* @__PURE__ */ z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
719
|
+
totalTax: /* @__PURE__ */ z.object({
|
|
720
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
721
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
722
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
723
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
712
724
|
"Converted amount formatted with currency symbol."
|
|
713
725
|
).optional()
|
|
714
726
|
}).describe(
|
|
715
727
|
"Calculated tax, based on `taxable_amount` and `tax_rate`."
|
|
716
728
|
).optional(),
|
|
717
|
-
rateBreakdown: z.array(
|
|
718
|
-
z.object({
|
|
719
|
-
name: z.string().describe(
|
|
729
|
+
rateBreakdown: /* @__PURE__ */ z.array(
|
|
730
|
+
/* @__PURE__ */ z.object({
|
|
731
|
+
name: /* @__PURE__ */ z.string().describe(
|
|
720
732
|
"Name of tax against which the calculation was performed."
|
|
721
733
|
).max(100).optional(),
|
|
722
|
-
rate: z.string().describe(
|
|
734
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
723
735
|
"Rate at which this tax detail was calculated."
|
|
724
736
|
).optional(),
|
|
725
|
-
tax: z.object({
|
|
726
|
-
amount: z.string().describe("Amount.").optional(),
|
|
727
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
728
|
-
formattedAmount: z.string().describe(
|
|
737
|
+
tax: /* @__PURE__ */ z.object({
|
|
738
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
739
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
740
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
729
741
|
"Amount formatted with currency symbol."
|
|
730
742
|
).optional(),
|
|
731
|
-
formattedConvertedAmount: z.string().describe(
|
|
743
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
732
744
|
"Converted amount formatted with currency symbol."
|
|
733
745
|
).optional()
|
|
734
746
|
}).describe("Amount of tax for this tax detail.").optional()
|
|
735
747
|
})
|
|
736
748
|
).optional(),
|
|
737
|
-
taxBreakdown: z.array(
|
|
738
|
-
z.object({
|
|
739
|
-
jurisdiction: z.string().describe(
|
|
749
|
+
taxBreakdown: /* @__PURE__ */ z.array(
|
|
750
|
+
/* @__PURE__ */ z.object({
|
|
751
|
+
jurisdiction: /* @__PURE__ */ z.string().describe(
|
|
740
752
|
'The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".'
|
|
741
753
|
).max(200).optional().nullable(),
|
|
742
|
-
nonTaxableAmount: z.object({
|
|
743
|
-
amount: z.string().describe("Amount.").optional(),
|
|
744
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
745
|
-
formattedAmount: z.string().describe(
|
|
754
|
+
nonTaxableAmount: /* @__PURE__ */ z.object({
|
|
755
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
756
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
757
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
746
758
|
"Amount formatted with currency symbol."
|
|
747
759
|
).optional(),
|
|
748
|
-
formattedConvertedAmount: z.string().describe(
|
|
760
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
749
761
|
"Converted amount formatted with currency symbol."
|
|
750
762
|
).optional()
|
|
751
763
|
}).describe(
|
|
752
764
|
"The amount of this line item price that was considered nontaxable. (Decimal value)"
|
|
753
765
|
).optional(),
|
|
754
|
-
rate: z.string().describe(
|
|
766
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
755
767
|
"The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)"
|
|
756
768
|
).optional().nullable(),
|
|
757
|
-
taxAmount: z.object({
|
|
758
|
-
amount: z.string().describe("Amount.").optional(),
|
|
759
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
760
|
-
formattedAmount: z.string().describe(
|
|
769
|
+
taxAmount: /* @__PURE__ */ z.object({
|
|
770
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
771
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
772
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
761
773
|
"Amount formatted with currency symbol."
|
|
762
774
|
).optional(),
|
|
763
|
-
formattedConvertedAmount: z.string().describe(
|
|
775
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
764
776
|
"Converted amount formatted with currency symbol."
|
|
765
777
|
).optional()
|
|
766
778
|
}).describe(
|
|
767
779
|
"The amount of tax estimated for this line item. (Decimal value)"
|
|
768
780
|
).optional(),
|
|
769
|
-
taxableAmount: z.object({
|
|
770
|
-
amount: z.string().describe("Amount.").optional(),
|
|
771
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
772
|
-
formattedAmount: z.string().describe(
|
|
781
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
782
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
783
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
784
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
773
785
|
"Amount formatted with currency symbol."
|
|
774
786
|
).optional(),
|
|
775
|
-
formattedConvertedAmount: z.string().describe(
|
|
787
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
776
788
|
"Converted amount formatted with currency symbol."
|
|
777
789
|
).optional()
|
|
778
790
|
}).describe("The taxable amount of this line item.").optional(),
|
|
779
|
-
taxType: z.string().describe(
|
|
791
|
+
taxType: /* @__PURE__ */ z.string().describe(
|
|
780
792
|
`The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.`
|
|
781
793
|
).max(200).optional().nullable(),
|
|
782
|
-
taxName: z.string().describe(
|
|
794
|
+
taxName: /* @__PURE__ */ z.string().describe(
|
|
783
795
|
'The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.\nThis name should be explicit enough to allow the merchant to understand what tax was calculated.'
|
|
784
796
|
).max(200).optional().nullable(),
|
|
785
|
-
jurisdictionType: z.enum([
|
|
797
|
+
jurisdictionType: /* @__PURE__ */ z.enum([
|
|
786
798
|
"UNDEFINED",
|
|
787
799
|
"COUNTRY",
|
|
788
800
|
"STATE",
|
|
@@ -795,150 +807,150 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
795
807
|
})
|
|
796
808
|
).min(0).max(1e3).optional()
|
|
797
809
|
}).describe("Tax details.").optional(),
|
|
798
|
-
totalDiscount: z.object({
|
|
799
|
-
amount: z.string().describe("Amount.").optional(),
|
|
800
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
801
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
802
|
-
formattedConvertedAmount: z.string().describe(
|
|
810
|
+
totalDiscount: /* @__PURE__ */ z.object({
|
|
811
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
812
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
813
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
814
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
803
815
|
"Converted amount formatted with currency symbol."
|
|
804
816
|
).optional()
|
|
805
817
|
}).describe("Shipping discount before tax.").optional(),
|
|
806
|
-
price: z.object({
|
|
807
|
-
amount: z.string().describe("Amount.").optional(),
|
|
808
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
809
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
810
|
-
formattedConvertedAmount: z.string().describe(
|
|
818
|
+
price: /* @__PURE__ */ z.object({
|
|
819
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
820
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
821
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
822
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
811
823
|
"Converted amount formatted with currency symbol."
|
|
812
824
|
).optional()
|
|
813
825
|
}).describe("Shipping price before discount and before tax.").optional()
|
|
814
826
|
}).describe("Shipping costs.").optional(),
|
|
815
|
-
requestedShippingOption: z.boolean().describe(
|
|
827
|
+
requestedShippingOption: /* @__PURE__ */ z.boolean().describe(
|
|
816
828
|
"Were we able to find the requested shipping option, or otherwise we fallback to the default one (the first)"
|
|
817
829
|
).optional(),
|
|
818
|
-
otherCharges: z.array(
|
|
819
|
-
z.object({
|
|
820
|
-
type: z.enum(["HANDLING_FEE", "INSURANCE"]).describe("Type of additional cost.").optional(),
|
|
821
|
-
details: z.string().describe(
|
|
830
|
+
otherCharges: /* @__PURE__ */ z.array(
|
|
831
|
+
/* @__PURE__ */ z.object({
|
|
832
|
+
type: /* @__PURE__ */ z.enum(["HANDLING_FEE", "INSURANCE"]).describe("Type of additional cost.").optional(),
|
|
833
|
+
details: /* @__PURE__ */ z.string().describe(
|
|
822
834
|
"Details of the charge, such as 'Full Coverage Insurance of up to 80% of value of shipment'."
|
|
823
835
|
).max(200).optional().nullable(),
|
|
824
|
-
cost: z.object({
|
|
825
|
-
totalPriceAfterTax: z.object({
|
|
826
|
-
amount: z.string().describe("Amount.").optional(),
|
|
827
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
828
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
829
|
-
formattedConvertedAmount: z.string().describe(
|
|
836
|
+
cost: /* @__PURE__ */ z.object({
|
|
837
|
+
totalPriceAfterTax: /* @__PURE__ */ z.object({
|
|
838
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
839
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
840
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
841
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
830
842
|
"Converted amount formatted with currency symbol."
|
|
831
843
|
).optional()
|
|
832
844
|
}).describe(
|
|
833
845
|
"Total shipping price, after discount and after tax."
|
|
834
846
|
).optional(),
|
|
835
|
-
totalPriceBeforeTax: z.object({
|
|
836
|
-
amount: z.string().describe("Amount.").optional(),
|
|
837
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
838
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
839
|
-
formattedConvertedAmount: z.string().describe(
|
|
847
|
+
totalPriceBeforeTax: /* @__PURE__ */ z.object({
|
|
848
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
849
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
850
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
851
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
840
852
|
"Converted amount formatted with currency symbol."
|
|
841
853
|
).optional()
|
|
842
854
|
}).describe(
|
|
843
855
|
"Total price of shipping after discounts (when relevant), and before tax."
|
|
844
856
|
).optional(),
|
|
845
|
-
taxDetails: z.object({
|
|
846
|
-
taxableAmount: z.object({
|
|
847
|
-
amount: z.string().describe("Amount.").optional(),
|
|
848
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
849
|
-
formattedAmount: z.string().describe(
|
|
857
|
+
taxDetails: /* @__PURE__ */ z.object({
|
|
858
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
859
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
860
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
861
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
850
862
|
"Amount formatted with currency symbol."
|
|
851
863
|
).optional(),
|
|
852
|
-
formattedConvertedAmount: z.string().describe(
|
|
864
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
853
865
|
"Converted amount formatted with currency symbol."
|
|
854
866
|
).optional()
|
|
855
867
|
}).describe("Amount for which tax is calculated.").optional(),
|
|
856
|
-
taxRate: z.string().describe(
|
|
868
|
+
taxRate: /* @__PURE__ */ z.string().describe(
|
|
857
869
|
"Tax rate %, as a decimal point between 0 and 1."
|
|
858
870
|
).optional(),
|
|
859
|
-
totalTax: z.object({
|
|
860
|
-
amount: z.string().describe("Amount.").optional(),
|
|
861
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
862
|
-
formattedAmount: z.string().describe(
|
|
871
|
+
totalTax: /* @__PURE__ */ z.object({
|
|
872
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
873
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
874
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
863
875
|
"Amount formatted with currency symbol."
|
|
864
876
|
).optional(),
|
|
865
|
-
formattedConvertedAmount: z.string().describe(
|
|
877
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
866
878
|
"Converted amount formatted with currency symbol."
|
|
867
879
|
).optional()
|
|
868
880
|
}).describe(
|
|
869
881
|
"Calculated tax, based on `taxable_amount` and `tax_rate`."
|
|
870
882
|
).optional(),
|
|
871
|
-
rateBreakdown: z.array(
|
|
872
|
-
z.object({
|
|
873
|
-
name: z.string().describe(
|
|
883
|
+
rateBreakdown: /* @__PURE__ */ z.array(
|
|
884
|
+
/* @__PURE__ */ z.object({
|
|
885
|
+
name: /* @__PURE__ */ z.string().describe(
|
|
874
886
|
"Name of tax against which the calculation was performed."
|
|
875
887
|
).max(100).optional(),
|
|
876
|
-
rate: z.string().describe(
|
|
888
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
877
889
|
"Rate at which this tax detail was calculated."
|
|
878
890
|
).optional(),
|
|
879
|
-
tax: z.object({
|
|
880
|
-
amount: z.string().describe("Amount.").optional(),
|
|
881
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
882
|
-
formattedAmount: z.string().describe(
|
|
891
|
+
tax: /* @__PURE__ */ z.object({
|
|
892
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
893
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
894
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
883
895
|
"Amount formatted with currency symbol."
|
|
884
896
|
).optional(),
|
|
885
|
-
formattedConvertedAmount: z.string().describe(
|
|
897
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
886
898
|
"Converted amount formatted with currency symbol."
|
|
887
899
|
).optional()
|
|
888
900
|
}).describe("Amount of tax for this tax detail.").optional()
|
|
889
901
|
})
|
|
890
902
|
).optional(),
|
|
891
|
-
taxBreakdown: z.array(
|
|
892
|
-
z.object({
|
|
893
|
-
jurisdiction: z.string().describe(
|
|
903
|
+
taxBreakdown: /* @__PURE__ */ z.array(
|
|
904
|
+
/* @__PURE__ */ z.object({
|
|
905
|
+
jurisdiction: /* @__PURE__ */ z.string().describe(
|
|
894
906
|
'The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".'
|
|
895
907
|
).max(200).optional().nullable(),
|
|
896
|
-
nonTaxableAmount: z.object({
|
|
897
|
-
amount: z.string().describe("Amount.").optional(),
|
|
898
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
899
|
-
formattedAmount: z.string().describe(
|
|
908
|
+
nonTaxableAmount: /* @__PURE__ */ z.object({
|
|
909
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
910
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
911
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
900
912
|
"Amount formatted with currency symbol."
|
|
901
913
|
).optional(),
|
|
902
|
-
formattedConvertedAmount: z.string().describe(
|
|
914
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
903
915
|
"Converted amount formatted with currency symbol."
|
|
904
916
|
).optional()
|
|
905
917
|
}).describe(
|
|
906
918
|
"The amount of this line item price that was considered nontaxable. (Decimal value)"
|
|
907
919
|
).optional(),
|
|
908
|
-
rate: z.string().describe(
|
|
920
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
909
921
|
"The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)"
|
|
910
922
|
).optional().nullable(),
|
|
911
|
-
taxAmount: z.object({
|
|
912
|
-
amount: z.string().describe("Amount.").optional(),
|
|
913
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
914
|
-
formattedAmount: z.string().describe(
|
|
923
|
+
taxAmount: /* @__PURE__ */ z.object({
|
|
924
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
925
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
926
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
915
927
|
"Amount formatted with currency symbol."
|
|
916
928
|
).optional(),
|
|
917
|
-
formattedConvertedAmount: z.string().describe(
|
|
929
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
918
930
|
"Converted amount formatted with currency symbol."
|
|
919
931
|
).optional()
|
|
920
932
|
}).describe(
|
|
921
933
|
"The amount of tax estimated for this line item. (Decimal value)"
|
|
922
934
|
).optional(),
|
|
923
|
-
taxableAmount: z.object({
|
|
924
|
-
amount: z.string().describe("Amount.").optional(),
|
|
925
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
926
|
-
formattedAmount: z.string().describe(
|
|
935
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
936
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
937
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
938
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
927
939
|
"Amount formatted with currency symbol."
|
|
928
940
|
).optional(),
|
|
929
|
-
formattedConvertedAmount: z.string().describe(
|
|
941
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
930
942
|
"Converted amount formatted with currency symbol."
|
|
931
943
|
).optional()
|
|
932
944
|
}).describe(
|
|
933
945
|
"The taxable amount of this line item."
|
|
934
946
|
).optional(),
|
|
935
|
-
taxType: z.string().describe(
|
|
947
|
+
taxType: /* @__PURE__ */ z.string().describe(
|
|
936
948
|
`The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.`
|
|
937
949
|
).max(200).optional().nullable(),
|
|
938
|
-
taxName: z.string().describe(
|
|
950
|
+
taxName: /* @__PURE__ */ z.string().describe(
|
|
939
951
|
'The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.\nThis name should be explicit enough to allow the merchant to understand what tax was calculated.'
|
|
940
952
|
).max(200).optional().nullable(),
|
|
941
|
-
jurisdictionType: z.enum([
|
|
953
|
+
jurisdictionType: /* @__PURE__ */ z.enum([
|
|
942
954
|
"UNDEFINED",
|
|
943
955
|
"COUNTRY",
|
|
944
956
|
"STATE",
|
|
@@ -951,19 +963,19 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
951
963
|
})
|
|
952
964
|
).min(0).max(1e3).optional()
|
|
953
965
|
}).describe("Tax details.").optional(),
|
|
954
|
-
totalDiscount: z.object({
|
|
955
|
-
amount: z.string().describe("Amount.").optional(),
|
|
956
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
957
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
958
|
-
formattedConvertedAmount: z.string().describe(
|
|
966
|
+
totalDiscount: /* @__PURE__ */ z.object({
|
|
967
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
968
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
969
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
970
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
959
971
|
"Converted amount formatted with currency symbol."
|
|
960
972
|
).optional()
|
|
961
973
|
}).describe("Shipping discount before tax.").optional(),
|
|
962
|
-
price: z.object({
|
|
963
|
-
amount: z.string().describe("Amount.").optional(),
|
|
964
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
965
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
966
|
-
formattedConvertedAmount: z.string().describe(
|
|
974
|
+
price: /* @__PURE__ */ z.object({
|
|
975
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
976
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
977
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
978
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
967
979
|
"Converted amount formatted with currency symbol."
|
|
968
980
|
).optional()
|
|
969
981
|
}).describe(
|
|
@@ -972,140 +984,140 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
972
984
|
}).describe("Price of added charge.").optional()
|
|
973
985
|
})
|
|
974
986
|
).optional(),
|
|
975
|
-
carrierId: z.string().describe("This carrier's unique ID").regex(
|
|
987
|
+
carrierId: /* @__PURE__ */ z.string().describe("This carrier's unique ID").regex(
|
|
976
988
|
/^[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}$/,
|
|
977
989
|
"Must be a valid GUID"
|
|
978
990
|
).optional().nullable(),
|
|
979
|
-
deliveryAllocations: z.array(
|
|
980
|
-
z.object({
|
|
981
|
-
deliveryCarrier: z.object({
|
|
982
|
-
appId: z.string().describe("The carrier app id").regex(
|
|
991
|
+
deliveryAllocations: /* @__PURE__ */ z.array(
|
|
992
|
+
/* @__PURE__ */ z.object({
|
|
993
|
+
deliveryCarrier: /* @__PURE__ */ z.object({
|
|
994
|
+
appId: /* @__PURE__ */ z.string().describe("The carrier app id").regex(
|
|
983
995
|
/^[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}$/,
|
|
984
996
|
"Must be a valid GUID"
|
|
985
997
|
).optional().nullable(),
|
|
986
|
-
code: z.string().describe(
|
|
998
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
987
999
|
'Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`.'
|
|
988
1000
|
).max(250).optional()
|
|
989
1001
|
}).describe(
|
|
990
1002
|
"The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers"
|
|
991
1003
|
).optional(),
|
|
992
|
-
deliveryRegion: z.object({
|
|
993
|
-
_id: z.string().describe("The delivery region id.").regex(
|
|
1004
|
+
deliveryRegion: /* @__PURE__ */ z.object({
|
|
1005
|
+
_id: /* @__PURE__ */ z.string().describe("The delivery region id.").regex(
|
|
994
1006
|
/^[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}$/,
|
|
995
1007
|
"Must be a valid GUID"
|
|
996
1008
|
).optional().nullable(),
|
|
997
|
-
name: z.string().describe("The delivery region name.").max(100).optional().nullable()
|
|
1009
|
+
name: /* @__PURE__ */ z.string().describe("The delivery region name.").max(100).optional().nullable()
|
|
998
1010
|
}).describe(
|
|
999
1011
|
"The delivery region that are relevant for this delivery solution."
|
|
1000
1012
|
).optional(),
|
|
1001
|
-
applicableLineItems: z.object({
|
|
1002
|
-
lineItemIds: z.array(z.string()).max(300).optional()
|
|
1013
|
+
applicableLineItems: /* @__PURE__ */ z.object({
|
|
1014
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(300).optional()
|
|
1003
1015
|
}).describe(
|
|
1004
1016
|
"Populated if the delivery solution is a partially supplied by this carrier."
|
|
1005
1017
|
).optional()
|
|
1006
1018
|
})
|
|
1007
1019
|
).max(300).optional(),
|
|
1008
|
-
partial: z.boolean().describe(
|
|
1020
|
+
partial: /* @__PURE__ */ z.boolean().describe(
|
|
1009
1021
|
"If the delivery solution is a partial and doesn't apply to all items."
|
|
1010
1022
|
).optional().nullable()
|
|
1011
1023
|
}).describe("Selected shipping option.").optional(),
|
|
1012
|
-
carrierServiceOptions: z.array(
|
|
1013
|
-
z.object({
|
|
1014
|
-
carrierId: z.string().describe("Carrier ID.").regex(
|
|
1024
|
+
carrierServiceOptions: /* @__PURE__ */ z.array(
|
|
1025
|
+
/* @__PURE__ */ z.object({
|
|
1026
|
+
carrierId: /* @__PURE__ */ z.string().describe("Carrier ID.").regex(
|
|
1015
1027
|
/^[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}$/,
|
|
1016
1028
|
"Must be a valid GUID"
|
|
1017
1029
|
).optional(),
|
|
1018
|
-
shippingOptions: z.array(
|
|
1019
|
-
z.object({
|
|
1020
|
-
code: z.string().describe(
|
|
1030
|
+
shippingOptions: /* @__PURE__ */ z.array(
|
|
1031
|
+
/* @__PURE__ */ z.object({
|
|
1032
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
1021
1033
|
'Unique code of provided shipping option like "usps_std_overnight".\nFor legacy calculators this would be the UUID of the option.'
|
|
1022
1034
|
).max(100).optional(),
|
|
1023
|
-
title: z.string().describe(
|
|
1035
|
+
title: /* @__PURE__ */ z.string().describe(
|
|
1024
1036
|
'Title of the option, such as USPS Standard Overnight Delivery (in the requested locale).\nFor example, "Standard" or "First-Class Package International".'
|
|
1025
1037
|
).max(250).optional(),
|
|
1026
|
-
logistics: z.object({
|
|
1027
|
-
deliveryTime: z.string().describe(
|
|
1038
|
+
logistics: /* @__PURE__ */ z.object({
|
|
1039
|
+
deliveryTime: /* @__PURE__ */ z.string().describe(
|
|
1028
1040
|
'Expected delivery time, in free text. For example, "3-5 business days".'
|
|
1029
1041
|
).max(500).optional().nullable(),
|
|
1030
|
-
instructions: z.string().describe(
|
|
1042
|
+
instructions: /* @__PURE__ */ z.string().describe(
|
|
1031
1043
|
`Instructions for caller, e.g for pickup: "Please deliver during opening hours, and please don't park in disabled parking spot".`
|
|
1032
1044
|
).max(1e3).optional().nullable(),
|
|
1033
|
-
pickupDetails: z.object({
|
|
1034
|
-
address: z.object({
|
|
1035
|
-
streetAddress: z.object({
|
|
1036
|
-
name: z.string().optional(),
|
|
1037
|
-
number: z.string().optional()
|
|
1045
|
+
pickupDetails: /* @__PURE__ */ z.object({
|
|
1046
|
+
address: /* @__PURE__ */ z.object({
|
|
1047
|
+
streetAddress: /* @__PURE__ */ z.object({
|
|
1048
|
+
name: /* @__PURE__ */ z.string().optional(),
|
|
1049
|
+
number: /* @__PURE__ */ z.string().optional()
|
|
1038
1050
|
}).optional(),
|
|
1039
|
-
city: z.string().optional().nullable(),
|
|
1040
|
-
subdivision: z.string().optional().nullable(),
|
|
1041
|
-
country: z.string().optional().nullable(),
|
|
1042
|
-
postalCode: z.string().optional().nullable(),
|
|
1043
|
-
addressLine2: z.string().optional().nullable()
|
|
1051
|
+
city: /* @__PURE__ */ z.string().optional().nullable(),
|
|
1052
|
+
subdivision: /* @__PURE__ */ z.string().optional().nullable(),
|
|
1053
|
+
country: /* @__PURE__ */ z.string().optional().nullable(),
|
|
1054
|
+
postalCode: /* @__PURE__ */ z.string().optional().nullable(),
|
|
1055
|
+
addressLine2: /* @__PURE__ */ z.string().optional().nullable()
|
|
1044
1056
|
}).describe("Pickup address.").optional(),
|
|
1045
|
-
businessLocation: z.boolean().describe(
|
|
1057
|
+
businessLocation: /* @__PURE__ */ z.boolean().describe(
|
|
1046
1058
|
"Whether the pickup address is that of a business - this may effect tax calculation."
|
|
1047
1059
|
).optional(),
|
|
1048
|
-
pickupMethod: z.enum(["STORE_PICKUP", "PICKUP_POINT"]).describe("Pickup method").optional()
|
|
1060
|
+
pickupMethod: /* @__PURE__ */ z.enum(["STORE_PICKUP", "PICKUP_POINT"]).describe("Pickup method").optional()
|
|
1049
1061
|
}).describe("Pickup details.").optional()
|
|
1050
1062
|
}).describe("Delivery logistics.").optional(),
|
|
1051
|
-
cost: z.object({
|
|
1052
|
-
price: z.object({
|
|
1053
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1054
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1055
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1056
|
-
formattedConvertedAmount: z.string().describe(
|
|
1063
|
+
cost: /* @__PURE__ */ z.object({
|
|
1064
|
+
price: /* @__PURE__ */ z.object({
|
|
1065
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1066
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1067
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1068
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1057
1069
|
"Converted amount formatted with currency symbol."
|
|
1058
1070
|
).optional()
|
|
1059
1071
|
}).describe("Shipping price.").optional(),
|
|
1060
|
-
otherCharges: z.array(
|
|
1061
|
-
z.object({
|
|
1062
|
-
type: z.enum(["HANDLING_FEE", "INSURANCE"]).describe("Type of additional cost.").optional(),
|
|
1063
|
-
price: z.object({
|
|
1064
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1065
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1066
|
-
formattedAmount: z.string().describe(
|
|
1072
|
+
otherCharges: /* @__PURE__ */ z.array(
|
|
1073
|
+
/* @__PURE__ */ z.object({
|
|
1074
|
+
type: /* @__PURE__ */ z.enum(["HANDLING_FEE", "INSURANCE"]).describe("Type of additional cost.").optional(),
|
|
1075
|
+
price: /* @__PURE__ */ z.object({
|
|
1076
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1077
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1078
|
+
formattedAmount: /* @__PURE__ */ z.string().describe(
|
|
1067
1079
|
"Amount formatted with currency symbol."
|
|
1068
1080
|
).optional(),
|
|
1069
|
-
formattedConvertedAmount: z.string().describe(
|
|
1081
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1070
1082
|
"Converted amount formatted with currency symbol."
|
|
1071
1083
|
).optional()
|
|
1072
1084
|
}).describe("Price of added cost.").optional(),
|
|
1073
|
-
details: z.string().describe(
|
|
1085
|
+
details: /* @__PURE__ */ z.string().describe(
|
|
1074
1086
|
'Description of the additional charge. For example, `"Handling fee of $5 applied for gift wrapping"`.'
|
|
1075
1087
|
).max(250).optional().nullable()
|
|
1076
1088
|
})
|
|
1077
1089
|
).optional()
|
|
1078
1090
|
}).describe("Sipping price information.").optional(),
|
|
1079
|
-
deliveryAllocations: z.array(
|
|
1080
|
-
z.object({
|
|
1081
|
-
deliveryCarrier: z.object({
|
|
1082
|
-
appId: z.string().describe("The carrier app id").regex(
|
|
1091
|
+
deliveryAllocations: /* @__PURE__ */ z.array(
|
|
1092
|
+
/* @__PURE__ */ z.object({
|
|
1093
|
+
deliveryCarrier: /* @__PURE__ */ z.object({
|
|
1094
|
+
appId: /* @__PURE__ */ z.string().describe("The carrier app id").regex(
|
|
1083
1095
|
/^[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}$/,
|
|
1084
1096
|
"Must be a valid GUID"
|
|
1085
1097
|
).optional().nullable(),
|
|
1086
|
-
code: z.string().describe(
|
|
1098
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
1087
1099
|
'Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`.'
|
|
1088
1100
|
).max(250).optional()
|
|
1089
1101
|
}).describe(
|
|
1090
1102
|
"The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers"
|
|
1091
1103
|
).optional(),
|
|
1092
|
-
deliveryRegion: z.object({
|
|
1093
|
-
_id: z.string().describe("The delivery region id.").regex(
|
|
1104
|
+
deliveryRegion: /* @__PURE__ */ z.object({
|
|
1105
|
+
_id: /* @__PURE__ */ z.string().describe("The delivery region id.").regex(
|
|
1094
1106
|
/^[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}$/,
|
|
1095
1107
|
"Must be a valid GUID"
|
|
1096
1108
|
).optional().nullable(),
|
|
1097
|
-
name: z.string().describe("The delivery region name.").max(100).optional().nullable()
|
|
1109
|
+
name: /* @__PURE__ */ z.string().describe("The delivery region name.").max(100).optional().nullable()
|
|
1098
1110
|
}).describe(
|
|
1099
1111
|
"The delivery region that are relevant for this delivery solution."
|
|
1100
1112
|
).optional(),
|
|
1101
|
-
applicableLineItems: z.object({
|
|
1102
|
-
lineItemIds: z.array(z.string()).max(300).optional()
|
|
1113
|
+
applicableLineItems: /* @__PURE__ */ z.object({
|
|
1114
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(300).optional()
|
|
1103
1115
|
}).describe(
|
|
1104
1116
|
"Populated if the delivery solution is a partially supplied by this carrier."
|
|
1105
1117
|
).optional()
|
|
1106
1118
|
})
|
|
1107
1119
|
).max(300).optional(),
|
|
1108
|
-
partial: z.boolean().describe(
|
|
1120
|
+
partial: /* @__PURE__ */ z.boolean().describe(
|
|
1109
1121
|
"If the delivery solution is a partial and doesn't apply to all items."
|
|
1110
1122
|
).optional().nullable()
|
|
1111
1123
|
})
|
|
@@ -1113,73 +1125,73 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1113
1125
|
})
|
|
1114
1126
|
).optional()
|
|
1115
1127
|
}).describe("Shipping information.").optional(),
|
|
1116
|
-
appliedDiscounts: z.array(
|
|
1117
|
-
z.intersection(
|
|
1118
|
-
z.object({
|
|
1119
|
-
discountType: z.enum(["GLOBAL", "SPECIFIC_ITEMS", "SHIPPING"]).describe("Discount type.").optional(),
|
|
1120
|
-
lineItemIds: z.array(z.string()).optional()
|
|
1128
|
+
appliedDiscounts: /* @__PURE__ */ z.array(
|
|
1129
|
+
/* @__PURE__ */ z.intersection(
|
|
1130
|
+
/* @__PURE__ */ z.object({
|
|
1131
|
+
discountType: /* @__PURE__ */ z.enum(["GLOBAL", "SPECIFIC_ITEMS", "SHIPPING"]).describe("Discount type.").optional(),
|
|
1132
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional()
|
|
1121
1133
|
}),
|
|
1122
|
-
z.xor([
|
|
1123
|
-
z.object({
|
|
1124
|
-
coupon: z.never().optional(),
|
|
1125
|
-
merchantDiscount: z.never().optional(),
|
|
1126
|
-
discountRule: z.never().optional()
|
|
1134
|
+
/* @__PURE__ */ z.xor([
|
|
1135
|
+
/* @__PURE__ */ z.object({
|
|
1136
|
+
coupon: /* @__PURE__ */ z.never().optional(),
|
|
1137
|
+
merchantDiscount: /* @__PURE__ */ z.never().optional(),
|
|
1138
|
+
discountRule: /* @__PURE__ */ z.never().optional()
|
|
1127
1139
|
}),
|
|
1128
|
-
z.object({
|
|
1129
|
-
merchantDiscount: z.never().optional(),
|
|
1130
|
-
discountRule: z.never().optional(),
|
|
1131
|
-
coupon: z.object({
|
|
1132
|
-
_id: z.string().describe("Coupon ID.").optional(),
|
|
1133
|
-
code: z.string().describe("Coupon code.").optional(),
|
|
1134
|
-
amount: z.object({
|
|
1135
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1136
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1137
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1138
|
-
formattedConvertedAmount: z.string().describe(
|
|
1140
|
+
/* @__PURE__ */ z.object({
|
|
1141
|
+
merchantDiscount: /* @__PURE__ */ z.never().optional(),
|
|
1142
|
+
discountRule: /* @__PURE__ */ z.never().optional(),
|
|
1143
|
+
coupon: /* @__PURE__ */ z.object({
|
|
1144
|
+
_id: /* @__PURE__ */ z.string().describe("Coupon ID.").optional(),
|
|
1145
|
+
code: /* @__PURE__ */ z.string().describe("Coupon code.").optional(),
|
|
1146
|
+
amount: /* @__PURE__ */ z.object({
|
|
1147
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1148
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1149
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1150
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1139
1151
|
"Converted amount formatted with currency symbol."
|
|
1140
1152
|
).optional()
|
|
1141
1153
|
}).describe("Coupon value.").optional(),
|
|
1142
|
-
name: z.string().describe("Coupon name.").optional()
|
|
1154
|
+
name: /* @__PURE__ */ z.string().describe("Coupon name.").optional()
|
|
1143
1155
|
}).describe("Coupon details.")
|
|
1144
1156
|
}),
|
|
1145
|
-
z.object({
|
|
1146
|
-
coupon: z.never().optional(),
|
|
1147
|
-
discountRule: z.never().optional(),
|
|
1148
|
-
merchantDiscount: z.object({
|
|
1149
|
-
amount: z.object({
|
|
1150
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1151
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1152
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1153
|
-
formattedConvertedAmount: z.string().describe(
|
|
1157
|
+
/* @__PURE__ */ z.object({
|
|
1158
|
+
coupon: /* @__PURE__ */ z.never().optional(),
|
|
1159
|
+
discountRule: /* @__PURE__ */ z.never().optional(),
|
|
1160
|
+
merchantDiscount: /* @__PURE__ */ z.object({
|
|
1161
|
+
amount: /* @__PURE__ */ z.object({
|
|
1162
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1163
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1164
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1165
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1154
1166
|
"Converted amount formatted with currency symbol."
|
|
1155
1167
|
).optional()
|
|
1156
1168
|
}).describe("Discount value.").optional(),
|
|
1157
|
-
percentage: z.number().describe(
|
|
1169
|
+
percentage: /* @__PURE__ */ z.number().describe(
|
|
1158
1170
|
"Discount Percentage. Will be calculated from items price before other discounts."
|
|
1159
1171
|
).min(1).max(100).optional().nullable()
|
|
1160
1172
|
}).describe("Merchant discount.")
|
|
1161
1173
|
}),
|
|
1162
|
-
z.object({
|
|
1163
|
-
coupon: z.never().optional(),
|
|
1164
|
-
merchantDiscount: z.never().optional(),
|
|
1165
|
-
discountRule: z.object({
|
|
1166
|
-
_id: z.string().describe("Discount rule ID").regex(
|
|
1174
|
+
/* @__PURE__ */ z.object({
|
|
1175
|
+
coupon: /* @__PURE__ */ z.never().optional(),
|
|
1176
|
+
merchantDiscount: /* @__PURE__ */ z.never().optional(),
|
|
1177
|
+
discountRule: /* @__PURE__ */ z.object({
|
|
1178
|
+
_id: /* @__PURE__ */ z.string().describe("Discount rule ID").regex(
|
|
1167
1179
|
/^[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}$/,
|
|
1168
1180
|
"Must be a valid GUID"
|
|
1169
1181
|
).optional(),
|
|
1170
|
-
name: z.object({
|
|
1171
|
-
original: z.string().describe(
|
|
1182
|
+
name: /* @__PURE__ */ z.object({
|
|
1183
|
+
original: /* @__PURE__ */ z.string().describe(
|
|
1172
1184
|
"Original discount rule name (in site's default language)."
|
|
1173
1185
|
).min(1).max(256).optional(),
|
|
1174
|
-
translated: z.string().describe(
|
|
1186
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
1175
1187
|
"Translated discount rule name according to buyer language. Defaults to `original` when not provided."
|
|
1176
1188
|
).min(1).max(500).optional().nullable()
|
|
1177
1189
|
}).describe("Discount rule name").optional(),
|
|
1178
|
-
amount: z.object({
|
|
1179
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1180
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1181
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1182
|
-
formattedConvertedAmount: z.string().describe(
|
|
1190
|
+
amount: /* @__PURE__ */ z.object({
|
|
1191
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1192
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1193
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1194
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1183
1195
|
"Converted amount formatted with currency symbol."
|
|
1184
1196
|
).optional()
|
|
1185
1197
|
}).describe("Discount value.").optional()
|
|
@@ -1188,38 +1200,38 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1188
1200
|
])
|
|
1189
1201
|
)
|
|
1190
1202
|
).max(320).optional(),
|
|
1191
|
-
calculationErrors: z.intersection(
|
|
1192
|
-
z.object({
|
|
1193
|
-
taxCalculationError: z.intersection(
|
|
1194
|
-
z.object({
|
|
1195
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1203
|
+
calculationErrors: /* @__PURE__ */ z.intersection(
|
|
1204
|
+
/* @__PURE__ */ z.object({
|
|
1205
|
+
taxCalculationError: /* @__PURE__ */ z.intersection(
|
|
1206
|
+
/* @__PURE__ */ z.object({
|
|
1207
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1196
1208
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1197
1209
|
).optional()
|
|
1198
1210
|
}),
|
|
1199
|
-
z.xor([
|
|
1200
|
-
z.object({
|
|
1201
|
-
applicationError: z.never().optional(),
|
|
1202
|
-
validationError: z.never().optional(),
|
|
1203
|
-
systemError: z.never().optional()
|
|
1211
|
+
/* @__PURE__ */ z.xor([
|
|
1212
|
+
/* @__PURE__ */ z.object({
|
|
1213
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1214
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1215
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1204
1216
|
}),
|
|
1205
|
-
z.object({
|
|
1206
|
-
validationError: z.never().optional(),
|
|
1207
|
-
systemError: z.never().optional(),
|
|
1208
|
-
applicationError: z.object({
|
|
1209
|
-
code: z.string().describe("Error code.").optional(),
|
|
1210
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1211
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1217
|
+
/* @__PURE__ */ z.object({
|
|
1218
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1219
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1220
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1221
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1222
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1223
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1212
1224
|
})
|
|
1213
1225
|
}),
|
|
1214
|
-
z.object({
|
|
1215
|
-
applicationError: z.never().optional(),
|
|
1216
|
-
systemError: z.never().optional(),
|
|
1217
|
-
validationError: z.object({
|
|
1218
|
-
fieldViolations: z.array(
|
|
1219
|
-
z.object({
|
|
1220
|
-
field: z.string().optional(),
|
|
1221
|
-
description: z.string().optional(),
|
|
1222
|
-
violatedRule: z.enum([
|
|
1226
|
+
/* @__PURE__ */ z.object({
|
|
1227
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1228
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1229
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1230
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1231
|
+
/* @__PURE__ */ z.object({
|
|
1232
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1233
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1234
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1223
1235
|
"VALIDATION",
|
|
1224
1236
|
"OTHER",
|
|
1225
1237
|
"MAX",
|
|
@@ -1242,51 +1254,54 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1242
1254
|
"EXACT_SIZE",
|
|
1243
1255
|
"REQUIRED_ONE_OF_FIELD"
|
|
1244
1256
|
]).optional(),
|
|
1245
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1246
|
-
data: z.record(
|
|
1257
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1258
|
+
data: /* @__PURE__ */ z.record(
|
|
1259
|
+
/* @__PURE__ */ z.string(),
|
|
1260
|
+
/* @__PURE__ */ z.any()
|
|
1261
|
+
).optional().nullable()
|
|
1247
1262
|
})
|
|
1248
1263
|
).optional()
|
|
1249
1264
|
})
|
|
1250
1265
|
}),
|
|
1251
|
-
z.object({
|
|
1252
|
-
applicationError: z.never().optional(),
|
|
1253
|
-
validationError: z.never().optional(),
|
|
1254
|
-
systemError: z.object({
|
|
1255
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1266
|
+
/* @__PURE__ */ z.object({
|
|
1267
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1268
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1269
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1270
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1256
1271
|
})
|
|
1257
1272
|
})
|
|
1258
1273
|
])
|
|
1259
1274
|
).describe("Tax calculation error.").optional(),
|
|
1260
|
-
couponCalculationError: z.intersection(
|
|
1261
|
-
z.object({
|
|
1262
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1275
|
+
couponCalculationError: /* @__PURE__ */ z.intersection(
|
|
1276
|
+
/* @__PURE__ */ z.object({
|
|
1277
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1263
1278
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1264
1279
|
).optional()
|
|
1265
1280
|
}),
|
|
1266
|
-
z.xor([
|
|
1267
|
-
z.object({
|
|
1268
|
-
applicationError: z.never().optional(),
|
|
1269
|
-
validationError: z.never().optional(),
|
|
1270
|
-
systemError: z.never().optional()
|
|
1281
|
+
/* @__PURE__ */ z.xor([
|
|
1282
|
+
/* @__PURE__ */ z.object({
|
|
1283
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1284
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1285
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1271
1286
|
}),
|
|
1272
|
-
z.object({
|
|
1273
|
-
validationError: z.never().optional(),
|
|
1274
|
-
systemError: z.never().optional(),
|
|
1275
|
-
applicationError: z.object({
|
|
1276
|
-
code: z.string().describe("Error code.").optional(),
|
|
1277
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1278
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1287
|
+
/* @__PURE__ */ z.object({
|
|
1288
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1289
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1290
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1291
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1292
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1293
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1279
1294
|
})
|
|
1280
1295
|
}),
|
|
1281
|
-
z.object({
|
|
1282
|
-
applicationError: z.never().optional(),
|
|
1283
|
-
systemError: z.never().optional(),
|
|
1284
|
-
validationError: z.object({
|
|
1285
|
-
fieldViolations: z.array(
|
|
1286
|
-
z.object({
|
|
1287
|
-
field: z.string().optional(),
|
|
1288
|
-
description: z.string().optional(),
|
|
1289
|
-
violatedRule: z.enum([
|
|
1296
|
+
/* @__PURE__ */ z.object({
|
|
1297
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1298
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1299
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1300
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1301
|
+
/* @__PURE__ */ z.object({
|
|
1302
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1303
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1304
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1290
1305
|
"VALIDATION",
|
|
1291
1306
|
"OTHER",
|
|
1292
1307
|
"MAX",
|
|
@@ -1309,51 +1324,54 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1309
1324
|
"EXACT_SIZE",
|
|
1310
1325
|
"REQUIRED_ONE_OF_FIELD"
|
|
1311
1326
|
]).optional(),
|
|
1312
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1313
|
-
data: z.record(
|
|
1327
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1328
|
+
data: /* @__PURE__ */ z.record(
|
|
1329
|
+
/* @__PURE__ */ z.string(),
|
|
1330
|
+
/* @__PURE__ */ z.any()
|
|
1331
|
+
).optional().nullable()
|
|
1314
1332
|
})
|
|
1315
1333
|
).optional()
|
|
1316
1334
|
})
|
|
1317
1335
|
}),
|
|
1318
|
-
z.object({
|
|
1319
|
-
applicationError: z.never().optional(),
|
|
1320
|
-
validationError: z.never().optional(),
|
|
1321
|
-
systemError: z.object({
|
|
1322
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1336
|
+
/* @__PURE__ */ z.object({
|
|
1337
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1338
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1339
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1340
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1323
1341
|
})
|
|
1324
1342
|
})
|
|
1325
1343
|
])
|
|
1326
1344
|
).describe("Coupon calculation error.").optional(),
|
|
1327
|
-
giftCardCalculationError: z.intersection(
|
|
1328
|
-
z.object({
|
|
1329
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1345
|
+
giftCardCalculationError: /* @__PURE__ */ z.intersection(
|
|
1346
|
+
/* @__PURE__ */ z.object({
|
|
1347
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1330
1348
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1331
1349
|
).optional()
|
|
1332
1350
|
}),
|
|
1333
|
-
z.xor([
|
|
1334
|
-
z.object({
|
|
1335
|
-
applicationError: z.never().optional(),
|
|
1336
|
-
validationError: z.never().optional(),
|
|
1337
|
-
systemError: z.never().optional()
|
|
1351
|
+
/* @__PURE__ */ z.xor([
|
|
1352
|
+
/* @__PURE__ */ z.object({
|
|
1353
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1354
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1355
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1338
1356
|
}),
|
|
1339
|
-
z.object({
|
|
1340
|
-
validationError: z.never().optional(),
|
|
1341
|
-
systemError: z.never().optional(),
|
|
1342
|
-
applicationError: z.object({
|
|
1343
|
-
code: z.string().describe("Error code.").optional(),
|
|
1344
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1345
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1357
|
+
/* @__PURE__ */ z.object({
|
|
1358
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1359
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1360
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1361
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1362
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1363
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1346
1364
|
})
|
|
1347
1365
|
}),
|
|
1348
|
-
z.object({
|
|
1349
|
-
applicationError: z.never().optional(),
|
|
1350
|
-
systemError: z.never().optional(),
|
|
1351
|
-
validationError: z.object({
|
|
1352
|
-
fieldViolations: z.array(
|
|
1353
|
-
z.object({
|
|
1354
|
-
field: z.string().optional(),
|
|
1355
|
-
description: z.string().optional(),
|
|
1356
|
-
violatedRule: z.enum([
|
|
1366
|
+
/* @__PURE__ */ z.object({
|
|
1367
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1368
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1369
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1370
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1371
|
+
/* @__PURE__ */ z.object({
|
|
1372
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1373
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1374
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1357
1375
|
"VALIDATION",
|
|
1358
1376
|
"OTHER",
|
|
1359
1377
|
"MAX",
|
|
@@ -1376,58 +1394,61 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1376
1394
|
"EXACT_SIZE",
|
|
1377
1395
|
"REQUIRED_ONE_OF_FIELD"
|
|
1378
1396
|
]).optional(),
|
|
1379
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1380
|
-
data: z.record(
|
|
1397
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1398
|
+
data: /* @__PURE__ */ z.record(
|
|
1399
|
+
/* @__PURE__ */ z.string(),
|
|
1400
|
+
/* @__PURE__ */ z.any()
|
|
1401
|
+
).optional().nullable()
|
|
1381
1402
|
})
|
|
1382
1403
|
).optional()
|
|
1383
1404
|
})
|
|
1384
1405
|
}),
|
|
1385
|
-
z.object({
|
|
1386
|
-
applicationError: z.never().optional(),
|
|
1387
|
-
validationError: z.never().optional(),
|
|
1388
|
-
systemError: z.object({
|
|
1389
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1406
|
+
/* @__PURE__ */ z.object({
|
|
1407
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1408
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1409
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1410
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1390
1411
|
})
|
|
1391
1412
|
})
|
|
1392
1413
|
])
|
|
1393
1414
|
).describe("DEPRECATED: Use gift_card_calculation_errors instead.").optional(),
|
|
1394
|
-
orderValidationErrors: z.array(
|
|
1395
|
-
z.object({
|
|
1396
|
-
code: z.string().describe("Error code.").optional(),
|
|
1397
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1398
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1415
|
+
orderValidationErrors: /* @__PURE__ */ z.array(
|
|
1416
|
+
/* @__PURE__ */ z.object({
|
|
1417
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1418
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1419
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1399
1420
|
})
|
|
1400
1421
|
).optional(),
|
|
1401
|
-
membershipError: z.intersection(
|
|
1402
|
-
z.object({
|
|
1403
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1422
|
+
membershipError: /* @__PURE__ */ z.intersection(
|
|
1423
|
+
/* @__PURE__ */ z.object({
|
|
1424
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1404
1425
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1405
1426
|
).optional()
|
|
1406
1427
|
}),
|
|
1407
|
-
z.xor([
|
|
1408
|
-
z.object({
|
|
1409
|
-
applicationError: z.never().optional(),
|
|
1410
|
-
validationError: z.never().optional(),
|
|
1411
|
-
systemError: z.never().optional()
|
|
1428
|
+
/* @__PURE__ */ z.xor([
|
|
1429
|
+
/* @__PURE__ */ z.object({
|
|
1430
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1431
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1432
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1412
1433
|
}),
|
|
1413
|
-
z.object({
|
|
1414
|
-
validationError: z.never().optional(),
|
|
1415
|
-
systemError: z.never().optional(),
|
|
1416
|
-
applicationError: z.object({
|
|
1417
|
-
code: z.string().describe("Error code.").optional(),
|
|
1418
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1419
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1434
|
+
/* @__PURE__ */ z.object({
|
|
1435
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1436
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1437
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1438
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1439
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1440
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1420
1441
|
})
|
|
1421
1442
|
}),
|
|
1422
|
-
z.object({
|
|
1423
|
-
applicationError: z.never().optional(),
|
|
1424
|
-
systemError: z.never().optional(),
|
|
1425
|
-
validationError: z.object({
|
|
1426
|
-
fieldViolations: z.array(
|
|
1427
|
-
z.object({
|
|
1428
|
-
field: z.string().optional(),
|
|
1429
|
-
description: z.string().optional(),
|
|
1430
|
-
violatedRule: z.enum([
|
|
1443
|
+
/* @__PURE__ */ z.object({
|
|
1444
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1445
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1446
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1447
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1448
|
+
/* @__PURE__ */ z.object({
|
|
1449
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1450
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1451
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1431
1452
|
"VALIDATION",
|
|
1432
1453
|
"OTHER",
|
|
1433
1454
|
"MAX",
|
|
@@ -1450,53 +1471,56 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1450
1471
|
"EXACT_SIZE",
|
|
1451
1472
|
"REQUIRED_ONE_OF_FIELD"
|
|
1452
1473
|
]).optional(),
|
|
1453
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1454
|
-
data: z.record(
|
|
1474
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1475
|
+
data: /* @__PURE__ */ z.record(
|
|
1476
|
+
/* @__PURE__ */ z.string(),
|
|
1477
|
+
/* @__PURE__ */ z.any()
|
|
1478
|
+
).optional().nullable()
|
|
1455
1479
|
})
|
|
1456
1480
|
).optional()
|
|
1457
1481
|
})
|
|
1458
1482
|
}),
|
|
1459
|
-
z.object({
|
|
1460
|
-
applicationError: z.never().optional(),
|
|
1461
|
-
validationError: z.never().optional(),
|
|
1462
|
-
systemError: z.object({
|
|
1463
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1483
|
+
/* @__PURE__ */ z.object({
|
|
1484
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1485
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1486
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1487
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1464
1488
|
})
|
|
1465
1489
|
})
|
|
1466
1490
|
])
|
|
1467
1491
|
).describe(
|
|
1468
1492
|
"Membership payment methods calculation errors\nFor example, will indicate that a line item that must be paid with membership payment doesn't have one or selected memberships are invalid"
|
|
1469
1493
|
).optional(),
|
|
1470
|
-
discountsCalculationError: z.intersection(
|
|
1471
|
-
z.object({
|
|
1472
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1494
|
+
discountsCalculationError: /* @__PURE__ */ z.intersection(
|
|
1495
|
+
/* @__PURE__ */ z.object({
|
|
1496
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1473
1497
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1474
1498
|
).optional()
|
|
1475
1499
|
}),
|
|
1476
|
-
z.xor([
|
|
1477
|
-
z.object({
|
|
1478
|
-
applicationError: z.never().optional(),
|
|
1479
|
-
validationError: z.never().optional(),
|
|
1480
|
-
systemError: z.never().optional()
|
|
1500
|
+
/* @__PURE__ */ z.xor([
|
|
1501
|
+
/* @__PURE__ */ z.object({
|
|
1502
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1503
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1504
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1481
1505
|
}),
|
|
1482
|
-
z.object({
|
|
1483
|
-
validationError: z.never().optional(),
|
|
1484
|
-
systemError: z.never().optional(),
|
|
1485
|
-
applicationError: z.object({
|
|
1486
|
-
code: z.string().describe("Error code.").optional(),
|
|
1487
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1488
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1506
|
+
/* @__PURE__ */ z.object({
|
|
1507
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1508
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1509
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1510
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1511
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1512
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1489
1513
|
})
|
|
1490
1514
|
}),
|
|
1491
|
-
z.object({
|
|
1492
|
-
applicationError: z.never().optional(),
|
|
1493
|
-
systemError: z.never().optional(),
|
|
1494
|
-
validationError: z.object({
|
|
1495
|
-
fieldViolations: z.array(
|
|
1496
|
-
z.object({
|
|
1497
|
-
field: z.string().optional(),
|
|
1498
|
-
description: z.string().optional(),
|
|
1499
|
-
violatedRule: z.enum([
|
|
1515
|
+
/* @__PURE__ */ z.object({
|
|
1516
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1517
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1518
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1519
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1520
|
+
/* @__PURE__ */ z.object({
|
|
1521
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1522
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1523
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1500
1524
|
"VALIDATION",
|
|
1501
1525
|
"OTHER",
|
|
1502
1526
|
"MAX",
|
|
@@ -1519,61 +1543,64 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1519
1543
|
"EXACT_SIZE",
|
|
1520
1544
|
"REQUIRED_ONE_OF_FIELD"
|
|
1521
1545
|
]).optional(),
|
|
1522
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1523
|
-
data: z.record(
|
|
1546
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1547
|
+
data: /* @__PURE__ */ z.record(
|
|
1548
|
+
/* @__PURE__ */ z.string(),
|
|
1549
|
+
/* @__PURE__ */ z.any()
|
|
1550
|
+
).optional().nullable()
|
|
1524
1551
|
})
|
|
1525
1552
|
).optional()
|
|
1526
1553
|
})
|
|
1527
1554
|
}),
|
|
1528
|
-
z.object({
|
|
1529
|
-
applicationError: z.never().optional(),
|
|
1530
|
-
validationError: z.never().optional(),
|
|
1531
|
-
systemError: z.object({
|
|
1532
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1555
|
+
/* @__PURE__ */ z.object({
|
|
1556
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1557
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1558
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1559
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1533
1560
|
})
|
|
1534
1561
|
})
|
|
1535
1562
|
])
|
|
1536
1563
|
).describe("Discount Rule calculation error.").optional()
|
|
1537
1564
|
}),
|
|
1538
|
-
z.xor([
|
|
1539
|
-
z.object({
|
|
1540
|
-
generalShippingCalculationError: z.never().optional(),
|
|
1541
|
-
carrierErrors: z.never().optional(),
|
|
1542
|
-
selectedShippingOptionError: z.never().optional()
|
|
1565
|
+
/* @__PURE__ */ z.xor([
|
|
1566
|
+
/* @__PURE__ */ z.object({
|
|
1567
|
+
generalShippingCalculationError: /* @__PURE__ */ z.never().optional(),
|
|
1568
|
+
carrierErrors: /* @__PURE__ */ z.never().optional(),
|
|
1569
|
+
selectedShippingOptionError: /* @__PURE__ */ z.never().optional()
|
|
1543
1570
|
}),
|
|
1544
|
-
z.object({
|
|
1545
|
-
carrierErrors: z.never().optional(),
|
|
1546
|
-
selectedShippingOptionError: z.never().optional(),
|
|
1547
|
-
generalShippingCalculationError: z.intersection(
|
|
1548
|
-
z.object({
|
|
1549
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1571
|
+
/* @__PURE__ */ z.object({
|
|
1572
|
+
carrierErrors: /* @__PURE__ */ z.never().optional(),
|
|
1573
|
+
selectedShippingOptionError: /* @__PURE__ */ z.never().optional(),
|
|
1574
|
+
generalShippingCalculationError: /* @__PURE__ */ z.intersection(
|
|
1575
|
+
/* @__PURE__ */ z.object({
|
|
1576
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1550
1577
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1551
1578
|
).optional()
|
|
1552
1579
|
}),
|
|
1553
|
-
z.xor([
|
|
1554
|
-
z.object({
|
|
1555
|
-
applicationError: z.never().optional(),
|
|
1556
|
-
validationError: z.never().optional(),
|
|
1557
|
-
systemError: z.never().optional()
|
|
1580
|
+
/* @__PURE__ */ z.xor([
|
|
1581
|
+
/* @__PURE__ */ z.object({
|
|
1582
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1583
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1584
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1558
1585
|
}),
|
|
1559
|
-
z.object({
|
|
1560
|
-
validationError: z.never().optional(),
|
|
1561
|
-
systemError: z.never().optional(),
|
|
1562
|
-
applicationError: z.object({
|
|
1563
|
-
code: z.string().describe("Error code.").optional(),
|
|
1564
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1565
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1586
|
+
/* @__PURE__ */ z.object({
|
|
1587
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1588
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1589
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1590
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1591
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1592
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1566
1593
|
})
|
|
1567
1594
|
}),
|
|
1568
|
-
z.object({
|
|
1569
|
-
applicationError: z.never().optional(),
|
|
1570
|
-
systemError: z.never().optional(),
|
|
1571
|
-
validationError: z.object({
|
|
1572
|
-
fieldViolations: z.array(
|
|
1573
|
-
z.object({
|
|
1574
|
-
field: z.string().optional(),
|
|
1575
|
-
description: z.string().optional(),
|
|
1576
|
-
violatedRule: z.enum([
|
|
1595
|
+
/* @__PURE__ */ z.object({
|
|
1596
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1597
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1598
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1599
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1600
|
+
/* @__PURE__ */ z.object({
|
|
1601
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1602
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1603
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1577
1604
|
"VALIDATION",
|
|
1578
1605
|
"OTHER",
|
|
1579
1606
|
"MAX",
|
|
@@ -1596,59 +1623,68 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1596
1623
|
"EXACT_SIZE",
|
|
1597
1624
|
"REQUIRED_ONE_OF_FIELD"
|
|
1598
1625
|
]).optional(),
|
|
1599
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1600
|
-
data: z.record(
|
|
1626
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1627
|
+
data: /* @__PURE__ */ z.record(
|
|
1628
|
+
/* @__PURE__ */ z.string(),
|
|
1629
|
+
/* @__PURE__ */ z.any()
|
|
1630
|
+
).optional().nullable()
|
|
1601
1631
|
})
|
|
1602
1632
|
).optional()
|
|
1603
1633
|
})
|
|
1604
1634
|
}),
|
|
1605
|
-
z.object({
|
|
1606
|
-
applicationError: z.never().optional(),
|
|
1607
|
-
validationError: z.never().optional(),
|
|
1608
|
-
systemError: z.object({
|
|
1609
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1635
|
+
/* @__PURE__ */ z.object({
|
|
1636
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1637
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1638
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1639
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1610
1640
|
})
|
|
1611
1641
|
})
|
|
1612
1642
|
])
|
|
1613
1643
|
).describe("General shipping calculation error.")
|
|
1614
1644
|
}),
|
|
1615
|
-
z.object({
|
|
1616
|
-
generalShippingCalculationError: z.never().optional(),
|
|
1617
|
-
selectedShippingOptionError: z.never().optional(),
|
|
1618
|
-
carrierErrors: z.object({
|
|
1619
|
-
errors: z.array(
|
|
1620
|
-
z.object({
|
|
1621
|
-
carrierId: z.string().describe("Carrier ID.").optional(),
|
|
1622
|
-
error: z.intersection(
|
|
1623
|
-
z.object({
|
|
1624
|
-
tracing: z.record(
|
|
1645
|
+
/* @__PURE__ */ z.object({
|
|
1646
|
+
generalShippingCalculationError: /* @__PURE__ */ z.never().optional(),
|
|
1647
|
+
selectedShippingOptionError: /* @__PURE__ */ z.never().optional(),
|
|
1648
|
+
carrierErrors: /* @__PURE__ */ z.object({
|
|
1649
|
+
errors: /* @__PURE__ */ z.array(
|
|
1650
|
+
/* @__PURE__ */ z.object({
|
|
1651
|
+
carrierId: /* @__PURE__ */ z.string().describe("Carrier ID.").optional(),
|
|
1652
|
+
error: /* @__PURE__ */ z.intersection(
|
|
1653
|
+
/* @__PURE__ */ z.object({
|
|
1654
|
+
tracing: /* @__PURE__ */ z.record(
|
|
1655
|
+
/* @__PURE__ */ z.string(),
|
|
1656
|
+
/* @__PURE__ */ z.string()
|
|
1657
|
+
).describe(
|
|
1625
1658
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1626
1659
|
).optional()
|
|
1627
1660
|
}),
|
|
1628
|
-
z.xor([
|
|
1629
|
-
z.object({
|
|
1630
|
-
applicationError: z.never().optional(),
|
|
1631
|
-
validationError: z.never().optional(),
|
|
1632
|
-
systemError: z.never().optional()
|
|
1661
|
+
/* @__PURE__ */ z.xor([
|
|
1662
|
+
/* @__PURE__ */ z.object({
|
|
1663
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1664
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1665
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1633
1666
|
}),
|
|
1634
|
-
z.object({
|
|
1635
|
-
validationError: z.never().optional(),
|
|
1636
|
-
systemError: z.never().optional(),
|
|
1637
|
-
applicationError: z.object({
|
|
1638
|
-
code: z.string().describe("Error code.").optional(),
|
|
1639
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1640
|
-
data:
|
|
1667
|
+
/* @__PURE__ */ z.object({
|
|
1668
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1669
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1670
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1671
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1672
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1673
|
+
data: /* @__PURE__ */ z.record(
|
|
1674
|
+
/* @__PURE__ */ z.string(),
|
|
1675
|
+
/* @__PURE__ */ z.any()
|
|
1676
|
+
).describe("Data related to the error.").optional().nullable()
|
|
1641
1677
|
})
|
|
1642
1678
|
}),
|
|
1643
|
-
z.object({
|
|
1644
|
-
applicationError: z.never().optional(),
|
|
1645
|
-
systemError: z.never().optional(),
|
|
1646
|
-
validationError: z.object({
|
|
1647
|
-
fieldViolations: z.array(
|
|
1648
|
-
z.object({
|
|
1649
|
-
field: z.string().optional(),
|
|
1650
|
-
description: z.string().optional(),
|
|
1651
|
-
violatedRule: z.enum([
|
|
1679
|
+
/* @__PURE__ */ z.object({
|
|
1680
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1681
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1682
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1683
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1684
|
+
/* @__PURE__ */ z.object({
|
|
1685
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1686
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1687
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1652
1688
|
"VALIDATION",
|
|
1653
1689
|
"OTHER",
|
|
1654
1690
|
"MAX",
|
|
@@ -1671,19 +1707,22 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1671
1707
|
"EXACT_SIZE",
|
|
1672
1708
|
"REQUIRED_ONE_OF_FIELD"
|
|
1673
1709
|
]).optional(),
|
|
1674
|
-
ruleName: z.string().describe(
|
|
1710
|
+
ruleName: /* @__PURE__ */ z.string().describe(
|
|
1675
1711
|
"applicable when violated_rule=OTHER"
|
|
1676
1712
|
).optional().nullable(),
|
|
1677
|
-
data: z.record(
|
|
1713
|
+
data: /* @__PURE__ */ z.record(
|
|
1714
|
+
/* @__PURE__ */ z.string(),
|
|
1715
|
+
/* @__PURE__ */ z.any()
|
|
1716
|
+
).optional().nullable()
|
|
1678
1717
|
})
|
|
1679
1718
|
).optional()
|
|
1680
1719
|
})
|
|
1681
1720
|
}),
|
|
1682
|
-
z.object({
|
|
1683
|
-
applicationError: z.never().optional(),
|
|
1684
|
-
validationError: z.never().optional(),
|
|
1685
|
-
systemError: z.object({
|
|
1686
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1721
|
+
/* @__PURE__ */ z.object({
|
|
1722
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1723
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1724
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1725
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1687
1726
|
})
|
|
1688
1727
|
})
|
|
1689
1728
|
])
|
|
@@ -1692,39 +1731,39 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1692
1731
|
).optional()
|
|
1693
1732
|
}).describe("Errors related to the delivery carrier.")
|
|
1694
1733
|
}),
|
|
1695
|
-
z.object({
|
|
1696
|
-
generalShippingCalculationError: z.never().optional(),
|
|
1697
|
-
carrierErrors: z.never().optional(),
|
|
1698
|
-
selectedShippingOptionError: z.intersection(
|
|
1699
|
-
z.object({
|
|
1700
|
-
tracing: z.record(z.string(), z.string()).describe(
|
|
1734
|
+
/* @__PURE__ */ z.object({
|
|
1735
|
+
generalShippingCalculationError: /* @__PURE__ */ z.never().optional(),
|
|
1736
|
+
carrierErrors: /* @__PURE__ */ z.never().optional(),
|
|
1737
|
+
selectedShippingOptionError: /* @__PURE__ */ z.intersection(
|
|
1738
|
+
/* @__PURE__ */ z.object({
|
|
1739
|
+
tracing: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()).describe(
|
|
1701
1740
|
"deprecated in API's - to enable migration from rendering arbitrary tracing to rest response"
|
|
1702
1741
|
).optional()
|
|
1703
1742
|
}),
|
|
1704
|
-
z.xor([
|
|
1705
|
-
z.object({
|
|
1706
|
-
applicationError: z.never().optional(),
|
|
1707
|
-
validationError: z.never().optional(),
|
|
1708
|
-
systemError: z.never().optional()
|
|
1743
|
+
/* @__PURE__ */ z.xor([
|
|
1744
|
+
/* @__PURE__ */ z.object({
|
|
1745
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1746
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1747
|
+
systemError: /* @__PURE__ */ z.never().optional()
|
|
1709
1748
|
}),
|
|
1710
|
-
z.object({
|
|
1711
|
-
validationError: z.never().optional(),
|
|
1712
|
-
systemError: z.never().optional(),
|
|
1713
|
-
applicationError: z.object({
|
|
1714
|
-
code: z.string().describe("Error code.").optional(),
|
|
1715
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
1716
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1749
|
+
/* @__PURE__ */ z.object({
|
|
1750
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1751
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1752
|
+
applicationError: /* @__PURE__ */ z.object({
|
|
1753
|
+
code: /* @__PURE__ */ z.string().describe("Error code.").optional(),
|
|
1754
|
+
description: /* @__PURE__ */ z.string().describe("Description of the error.").optional(),
|
|
1755
|
+
data: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Data related to the error.").optional().nullable()
|
|
1717
1756
|
})
|
|
1718
1757
|
}),
|
|
1719
|
-
z.object({
|
|
1720
|
-
applicationError: z.never().optional(),
|
|
1721
|
-
systemError: z.never().optional(),
|
|
1722
|
-
validationError: z.object({
|
|
1723
|
-
fieldViolations: z.array(
|
|
1724
|
-
z.object({
|
|
1725
|
-
field: z.string().optional(),
|
|
1726
|
-
description: z.string().optional(),
|
|
1727
|
-
violatedRule: z.enum([
|
|
1758
|
+
/* @__PURE__ */ z.object({
|
|
1759
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1760
|
+
systemError: /* @__PURE__ */ z.never().optional(),
|
|
1761
|
+
validationError: /* @__PURE__ */ z.object({
|
|
1762
|
+
fieldViolations: /* @__PURE__ */ z.array(
|
|
1763
|
+
/* @__PURE__ */ z.object({
|
|
1764
|
+
field: /* @__PURE__ */ z.string().optional(),
|
|
1765
|
+
description: /* @__PURE__ */ z.string().optional(),
|
|
1766
|
+
violatedRule: /* @__PURE__ */ z.enum([
|
|
1728
1767
|
"VALIDATION",
|
|
1729
1768
|
"OTHER",
|
|
1730
1769
|
"MAX",
|
|
@@ -1747,17 +1786,20 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1747
1786
|
"EXACT_SIZE",
|
|
1748
1787
|
"REQUIRED_ONE_OF_FIELD"
|
|
1749
1788
|
]).optional(),
|
|
1750
|
-
ruleName: z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1751
|
-
data: z.record(
|
|
1789
|
+
ruleName: /* @__PURE__ */ z.string().describe("applicable when violated_rule=OTHER").optional().nullable(),
|
|
1790
|
+
data: /* @__PURE__ */ z.record(
|
|
1791
|
+
/* @__PURE__ */ z.string(),
|
|
1792
|
+
/* @__PURE__ */ z.any()
|
|
1793
|
+
).optional().nullable()
|
|
1752
1794
|
})
|
|
1753
1795
|
).optional()
|
|
1754
1796
|
})
|
|
1755
1797
|
}),
|
|
1756
|
-
z.object({
|
|
1757
|
-
applicationError: z.never().optional(),
|
|
1758
|
-
validationError: z.never().optional(),
|
|
1759
|
-
systemError: z.object({
|
|
1760
|
-
errorCode: z.string().describe("Error code.").optional().nullable()
|
|
1798
|
+
/* @__PURE__ */ z.object({
|
|
1799
|
+
applicationError: /* @__PURE__ */ z.never().optional(),
|
|
1800
|
+
validationError: /* @__PURE__ */ z.never().optional(),
|
|
1801
|
+
systemError: /* @__PURE__ */ z.object({
|
|
1802
|
+
errorCode: /* @__PURE__ */ z.string().describe("Error code.").optional().nullable()
|
|
1761
1803
|
})
|
|
1762
1804
|
})
|
|
1763
1805
|
])
|
|
@@ -1765,248 +1807,248 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
1765
1807
|
})
|
|
1766
1808
|
])
|
|
1767
1809
|
).describe("Calculation errors.").optional(),
|
|
1768
|
-
weightUnit: z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight unit.").optional(),
|
|
1769
|
-
currency: z.string().describe(
|
|
1810
|
+
weightUnit: /* @__PURE__ */ z.enum(["UNSPECIFIED_WEIGHT_UNIT", "KG", "LB"]).describe("Weight unit.").optional(),
|
|
1811
|
+
currency: /* @__PURE__ */ z.string().describe(
|
|
1770
1812
|
"The currency the price calculations were performed in.\nThis is the business\u2019s default currency: the base currency configured for the site, which remains constant regardless of the [customer\u2019s currency selection](https://support.wix.com/en/article/multicurrency-an-overview).\nWhen `amountCurrency` is specified on the request, this returns that value instead."
|
|
1771
1813
|
).optional(),
|
|
1772
|
-
conversionCurrency: z.string().describe(
|
|
1814
|
+
conversionCurrency: /* @__PURE__ */ z.string().describe(
|
|
1773
1815
|
"The currency the converted price calculations are in.\nThis is the currency [selected by the customer](https://support.wix.com/en/article/multicurrency-an-overview), which may differ from `currency`.\nWhen `amountCurrency` is specified on the request, nothing is converted and this returns that value."
|
|
1774
1816
|
).optional(),
|
|
1775
|
-
taxIncludedInPrice: z.boolean().describe("Whether tax is included in price.").optional(),
|
|
1776
|
-
payNow: z.object({
|
|
1777
|
-
subtotal: z.object({
|
|
1778
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1779
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1780
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1781
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1817
|
+
taxIncludedInPrice: /* @__PURE__ */ z.boolean().describe("Whether tax is included in price.").optional(),
|
|
1818
|
+
payNow: /* @__PURE__ */ z.object({
|
|
1819
|
+
subtotal: /* @__PURE__ */ z.object({
|
|
1820
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1821
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1822
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1823
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1782
1824
|
}).describe(
|
|
1783
1825
|
"Subtotal of all line items, before discounts and before tax."
|
|
1784
1826
|
).optional(),
|
|
1785
|
-
shipping: z.object({
|
|
1786
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1787
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1788
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1789
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1827
|
+
shipping: /* @__PURE__ */ z.object({
|
|
1828
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1829
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1830
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1831
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1790
1832
|
}).describe("Total shipping price, before discounts and before tax.").optional(),
|
|
1791
|
-
tax: z.object({
|
|
1792
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1793
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1794
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1795
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1833
|
+
tax: /* @__PURE__ */ z.object({
|
|
1834
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1835
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1836
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1837
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1796
1838
|
}).describe("Total tax.").optional(),
|
|
1797
|
-
discount: z.object({
|
|
1798
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1799
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1800
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1801
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1839
|
+
discount: /* @__PURE__ */ z.object({
|
|
1840
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1841
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1842
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1843
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1802
1844
|
}).describe("Total calculated discount value.").optional(),
|
|
1803
|
-
total: z.object({
|
|
1804
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1805
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1806
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1807
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1845
|
+
total: /* @__PURE__ */ z.object({
|
|
1846
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1847
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1848
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1849
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1808
1850
|
}).describe("Total price after discounts, gift cards, and tax.").optional(),
|
|
1809
|
-
additionalFees: z.object({
|
|
1810
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1811
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1812
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1813
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1851
|
+
additionalFees: /* @__PURE__ */ z.object({
|
|
1852
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1853
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1854
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1855
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1814
1856
|
}).describe("Total additional fees price before tax.").optional()
|
|
1815
1857
|
}).describe("Minimal amount to pay in order to place the order.").optional(),
|
|
1816
|
-
payLater: z.object({
|
|
1817
|
-
subtotal: z.object({
|
|
1818
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1819
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1820
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1821
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1858
|
+
payLater: /* @__PURE__ */ z.object({
|
|
1859
|
+
subtotal: /* @__PURE__ */ z.object({
|
|
1860
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1861
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1862
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1863
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1822
1864
|
}).describe(
|
|
1823
1865
|
"Subtotal of all line items, before discounts and before tax."
|
|
1824
1866
|
).optional(),
|
|
1825
|
-
shipping: z.object({
|
|
1826
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1827
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1828
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1829
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1867
|
+
shipping: /* @__PURE__ */ z.object({
|
|
1868
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1869
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1870
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1871
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1830
1872
|
}).describe("Total shipping price, before discounts and before tax.").optional(),
|
|
1831
|
-
tax: z.object({
|
|
1832
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1833
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1834
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1835
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1873
|
+
tax: /* @__PURE__ */ z.object({
|
|
1874
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1875
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1876
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1877
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1836
1878
|
}).describe("Total tax.").optional(),
|
|
1837
|
-
discount: z.object({
|
|
1838
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1839
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1840
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1841
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1879
|
+
discount: /* @__PURE__ */ z.object({
|
|
1880
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1881
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1882
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1883
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1842
1884
|
}).describe("Total calculated discount value.").optional(),
|
|
1843
|
-
total: z.object({
|
|
1844
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1845
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1846
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1847
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1885
|
+
total: /* @__PURE__ */ z.object({
|
|
1886
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1887
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1888
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1889
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1848
1890
|
}).describe("Total price after discounts, gift cards, and tax.").optional(),
|
|
1849
|
-
additionalFees: z.object({
|
|
1850
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1851
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1852
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1853
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1891
|
+
additionalFees: /* @__PURE__ */ z.object({
|
|
1892
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1893
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1894
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1895
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1854
1896
|
}).describe("Total additional fees price before tax.").optional()
|
|
1855
1897
|
}).describe("Remaining amount for the order to be fully paid.").optional(),
|
|
1856
|
-
membershipOptions: z.object({
|
|
1857
|
-
eligibleMemberships: z.array(
|
|
1858
|
-
z.object({
|
|
1859
|
-
_id: z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1860
|
-
appId: z.string().describe("ID of the application providing this payment option.").regex(
|
|
1898
|
+
membershipOptions: /* @__PURE__ */ z.object({
|
|
1899
|
+
eligibleMemberships: /* @__PURE__ */ z.array(
|
|
1900
|
+
/* @__PURE__ */ z.object({
|
|
1901
|
+
_id: /* @__PURE__ */ z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1902
|
+
appId: /* @__PURE__ */ z.string().describe("ID of the application providing this payment option.").regex(
|
|
1861
1903
|
/^[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}$/,
|
|
1862
1904
|
"Must be a valid GUID"
|
|
1863
1905
|
).optional(),
|
|
1864
|
-
name: z.object({
|
|
1865
|
-
original: z.string().describe("Membership name.").max(100).optional(),
|
|
1866
|
-
translated: z.string().describe(
|
|
1906
|
+
name: /* @__PURE__ */ z.object({
|
|
1907
|
+
original: /* @__PURE__ */ z.string().describe("Membership name.").max(100).optional(),
|
|
1908
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
1867
1909
|
"Translated membership name. Defaults to `original` when not provided."
|
|
1868
1910
|
).max(100).optional().nullable()
|
|
1869
1911
|
}).describe("The name of this membership.").optional(),
|
|
1870
|
-
lineItemIds: z.array(z.string()).max(300).optional(),
|
|
1871
|
-
credits: z.object({
|
|
1872
|
-
total: z.number().int().describe("Membership's initial value.").min(1).optional(),
|
|
1873
|
-
remaining: z.number().int().describe("Membership's remaining value.").min(0).optional()
|
|
1912
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(300).optional(),
|
|
1913
|
+
credits: /* @__PURE__ */ z.object({
|
|
1914
|
+
total: /* @__PURE__ */ z.number().int().describe("Membership's initial value.").min(1).optional(),
|
|
1915
|
+
remaining: /* @__PURE__ */ z.number().int().describe("Membership's remaining value.").min(0).optional()
|
|
1874
1916
|
}).describe("Membership's payment credits (balance information).").optional(),
|
|
1875
|
-
expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
|
|
1876
|
-
additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
|
|
1917
|
+
expirationDate: /* @__PURE__ */ z.date().describe("Membership expiration date.").optional().nullable(),
|
|
1918
|
+
additionalData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
|
|
1877
1919
|
})
|
|
1878
1920
|
).max(300).optional(),
|
|
1879
|
-
invalidMemberships: z.array(
|
|
1880
|
-
z.object({
|
|
1881
|
-
membership: z.object({
|
|
1882
|
-
_id: z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1883
|
-
appId: z.string().describe(
|
|
1921
|
+
invalidMemberships: /* @__PURE__ */ z.array(
|
|
1922
|
+
/* @__PURE__ */ z.object({
|
|
1923
|
+
membership: /* @__PURE__ */ z.object({
|
|
1924
|
+
_id: /* @__PURE__ */ z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1925
|
+
appId: /* @__PURE__ */ z.string().describe(
|
|
1884
1926
|
"ID of the application providing this payment option."
|
|
1885
1927
|
).regex(
|
|
1886
1928
|
/^[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}$/,
|
|
1887
1929
|
"Must be a valid GUID"
|
|
1888
1930
|
).optional(),
|
|
1889
|
-
name: z.object({
|
|
1890
|
-
original: z.string().describe("Membership name.").max(100).optional(),
|
|
1891
|
-
translated: z.string().describe(
|
|
1931
|
+
name: /* @__PURE__ */ z.object({
|
|
1932
|
+
original: /* @__PURE__ */ z.string().describe("Membership name.").max(100).optional(),
|
|
1933
|
+
translated: /* @__PURE__ */ z.string().describe(
|
|
1892
1934
|
"Translated membership name. Defaults to `original` when not provided."
|
|
1893
1935
|
).max(100).optional().nullable()
|
|
1894
1936
|
}).describe("The name of this membership.").optional(),
|
|
1895
|
-
lineItemIds: z.array(z.string()).max(300).optional(),
|
|
1896
|
-
credits: z.object({
|
|
1897
|
-
total: z.number().int().describe("Membership's initial value.").min(1).optional(),
|
|
1898
|
-
remaining: z.number().int().describe("Membership's remaining value.").min(0).optional()
|
|
1937
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).max(300).optional(),
|
|
1938
|
+
credits: /* @__PURE__ */ z.object({
|
|
1939
|
+
total: /* @__PURE__ */ z.number().int().describe("Membership's initial value.").min(1).optional(),
|
|
1940
|
+
remaining: /* @__PURE__ */ z.number().int().describe("Membership's remaining value.").min(0).optional()
|
|
1899
1941
|
}).describe(
|
|
1900
1942
|
"Membership's payment credits (balance information)."
|
|
1901
1943
|
).optional(),
|
|
1902
|
-
expirationDate: z.date().describe("Membership expiration date.").optional().nullable(),
|
|
1903
|
-
additionalData: z.record(z.string(), z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
|
|
1944
|
+
expirationDate: /* @__PURE__ */ z.date().describe("Membership expiration date.").optional().nullable(),
|
|
1945
|
+
additionalData: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.any()).describe("Deprecated. Use `offering_description`.").optional().nullable()
|
|
1904
1946
|
}).describe("Membership details.").optional(),
|
|
1905
|
-
reason: z.string().describe(
|
|
1947
|
+
reason: /* @__PURE__ */ z.string().describe(
|
|
1906
1948
|
"Reason why this membership is invalid and cannot be used."
|
|
1907
1949
|
).min(1).max(100).optional()
|
|
1908
1950
|
})
|
|
1909
1951
|
).max(300).optional(),
|
|
1910
|
-
selectedMemberships: z.array(
|
|
1911
|
-
z.object({
|
|
1912
|
-
_id: z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1913
|
-
appId: z.string().describe("ID of the app providing this payment option.").regex(
|
|
1952
|
+
selectedMemberships: /* @__PURE__ */ z.array(
|
|
1953
|
+
/* @__PURE__ */ z.object({
|
|
1954
|
+
_id: /* @__PURE__ */ z.string().describe("Membership ID.").min(1).max(200).optional(),
|
|
1955
|
+
appId: /* @__PURE__ */ z.string().describe("ID of the app providing this payment option.").regex(
|
|
1914
1956
|
/^[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}$/,
|
|
1915
1957
|
"Must be a valid GUID"
|
|
1916
1958
|
).optional(),
|
|
1917
|
-
lineItemIds: z.array(z.string()).min(1).max(300).optional()
|
|
1959
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).min(1).max(300).optional()
|
|
1918
1960
|
})
|
|
1919
1961
|
).max(300).optional()
|
|
1920
1962
|
}).describe(
|
|
1921
1963
|
"Information about valid and invalid memberships, and which ones are selected for usage."
|
|
1922
1964
|
).optional(),
|
|
1923
|
-
additionalFees: z.array(
|
|
1924
|
-
z.object({
|
|
1925
|
-
code: z.string().describe(
|
|
1965
|
+
additionalFees: /* @__PURE__ */ z.array(
|
|
1966
|
+
/* @__PURE__ */ z.object({
|
|
1967
|
+
code: /* @__PURE__ */ z.string().describe(
|
|
1926
1968
|
"Additional fee's unique code (or ID) for future processing."
|
|
1927
1969
|
).min(1).max(100).optional().nullable(),
|
|
1928
|
-
name: z.string().describe("Additional fee's name.").min(1).max(50).optional(),
|
|
1929
|
-
price: z.object({
|
|
1930
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1931
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1932
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1933
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1970
|
+
name: /* @__PURE__ */ z.string().describe("Additional fee's name.").min(1).max(50).optional(),
|
|
1971
|
+
price: /* @__PURE__ */ z.object({
|
|
1972
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1973
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1974
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1975
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1934
1976
|
}).describe("Additional fee's price.").optional(),
|
|
1935
|
-
taxDetails: z.object({
|
|
1936
|
-
taxableAmount: z.object({
|
|
1937
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1938
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1939
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1940
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1977
|
+
taxDetails: /* @__PURE__ */ z.object({
|
|
1978
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
1979
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1980
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1981
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1982
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1941
1983
|
}).describe("Amount for which tax is calculated.").optional(),
|
|
1942
|
-
taxRate: z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
1943
|
-
totalTax: z.object({
|
|
1944
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1945
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1946
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1947
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1984
|
+
taxRate: /* @__PURE__ */ z.string().describe("Tax rate %, as a decimal point between 0 and 1.").optional(),
|
|
1985
|
+
totalTax: /* @__PURE__ */ z.object({
|
|
1986
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
1987
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
1988
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1989
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
1948
1990
|
}).describe(
|
|
1949
1991
|
"Calculated tax, based on `taxable_amount` and `tax_rate`."
|
|
1950
1992
|
).optional(),
|
|
1951
|
-
rateBreakdown: z.array(
|
|
1952
|
-
z.object({
|
|
1953
|
-
name: z.string().describe(
|
|
1993
|
+
rateBreakdown: /* @__PURE__ */ z.array(
|
|
1994
|
+
/* @__PURE__ */ z.object({
|
|
1995
|
+
name: /* @__PURE__ */ z.string().describe(
|
|
1954
1996
|
"Name of tax against which the calculation was performed."
|
|
1955
1997
|
).max(100).optional(),
|
|
1956
|
-
rate: z.string().describe("Rate at which this tax detail was calculated.").optional(),
|
|
1957
|
-
tax: z.object({
|
|
1958
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1959
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1960
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1961
|
-
formattedConvertedAmount: z.string().describe(
|
|
1998
|
+
rate: /* @__PURE__ */ z.string().describe("Rate at which this tax detail was calculated.").optional(),
|
|
1999
|
+
tax: /* @__PURE__ */ z.object({
|
|
2000
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2001
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2002
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2003
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1962
2004
|
"Converted amount formatted with currency symbol."
|
|
1963
2005
|
).optional()
|
|
1964
2006
|
}).describe("Amount of tax for this tax detail.").optional()
|
|
1965
2007
|
})
|
|
1966
2008
|
).optional(),
|
|
1967
|
-
taxBreakdown: z.array(
|
|
1968
|
-
z.object({
|
|
1969
|
-
jurisdiction: z.string().describe(
|
|
2009
|
+
taxBreakdown: /* @__PURE__ */ z.array(
|
|
2010
|
+
/* @__PURE__ */ z.object({
|
|
2011
|
+
jurisdiction: /* @__PURE__ */ z.string().describe(
|
|
1970
2012
|
'The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".'
|
|
1971
2013
|
).max(200).optional().nullable(),
|
|
1972
|
-
nonTaxableAmount: z.object({
|
|
1973
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1974
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1975
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1976
|
-
formattedConvertedAmount: z.string().describe(
|
|
2014
|
+
nonTaxableAmount: /* @__PURE__ */ z.object({
|
|
2015
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2016
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2017
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2018
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1977
2019
|
"Converted amount formatted with currency symbol."
|
|
1978
2020
|
).optional()
|
|
1979
2021
|
}).describe(
|
|
1980
2022
|
"The amount of this line item price that was considered nontaxable. (Decimal value)"
|
|
1981
2023
|
).optional(),
|
|
1982
|
-
rate: z.string().describe(
|
|
2024
|
+
rate: /* @__PURE__ */ z.string().describe(
|
|
1983
2025
|
"The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)"
|
|
1984
2026
|
).optional().nullable(),
|
|
1985
|
-
taxAmount: z.object({
|
|
1986
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1987
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1988
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1989
|
-
formattedConvertedAmount: z.string().describe(
|
|
2027
|
+
taxAmount: /* @__PURE__ */ z.object({
|
|
2028
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2029
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2030
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2031
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
1990
2032
|
"Converted amount formatted with currency symbol."
|
|
1991
2033
|
).optional()
|
|
1992
2034
|
}).describe(
|
|
1993
2035
|
"The amount of tax estimated for this line item. (Decimal value)"
|
|
1994
2036
|
).optional(),
|
|
1995
|
-
taxableAmount: z.object({
|
|
1996
|
-
amount: z.string().describe("Amount.").optional(),
|
|
1997
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
1998
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
1999
|
-
formattedConvertedAmount: z.string().describe(
|
|
2037
|
+
taxableAmount: /* @__PURE__ */ z.object({
|
|
2038
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2039
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2040
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2041
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe(
|
|
2000
2042
|
"Converted amount formatted with currency symbol."
|
|
2001
2043
|
).optional()
|
|
2002
2044
|
}).describe("The taxable amount of this line item.").optional(),
|
|
2003
|
-
taxType: z.string().describe(
|
|
2045
|
+
taxType: /* @__PURE__ */ z.string().describe(
|
|
2004
2046
|
`The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.`
|
|
2005
2047
|
).max(200).optional().nullable(),
|
|
2006
|
-
taxName: z.string().describe(
|
|
2048
|
+
taxName: /* @__PURE__ */ z.string().describe(
|
|
2007
2049
|
'The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc.\nThis name should be explicit enough to allow the merchant to understand what tax was calculated.'
|
|
2008
2050
|
).max(200).optional().nullable(),
|
|
2009
|
-
jurisdictionType: z.enum([
|
|
2051
|
+
jurisdictionType: /* @__PURE__ */ z.enum([
|
|
2010
2052
|
"UNDEFINED",
|
|
2011
2053
|
"COUNTRY",
|
|
2012
2054
|
"STATE",
|
|
@@ -2019,21 +2061,21 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
2019
2061
|
})
|
|
2020
2062
|
).min(0).max(1e3).optional()
|
|
2021
2063
|
}).describe("Tax details.").optional(),
|
|
2022
|
-
providerAppId: z.string().describe("Provider's app id.").min(1).max(100).optional().nullable(),
|
|
2023
|
-
priceBeforeTax: z.object({
|
|
2024
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2025
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2026
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2027
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2064
|
+
providerAppId: /* @__PURE__ */ z.string().describe("Provider's app id.").min(1).max(100).optional().nullable(),
|
|
2065
|
+
priceBeforeTax: /* @__PURE__ */ z.object({
|
|
2066
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2067
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2068
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2069
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2028
2070
|
}).describe("Additional fee's price before tax.").optional(),
|
|
2029
|
-
priceAfterTax: z.object({
|
|
2030
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2031
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2032
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2033
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2071
|
+
priceAfterTax: /* @__PURE__ */ z.object({
|
|
2072
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2073
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2074
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2075
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2034
2076
|
}).describe("Additional fee's price after tax.").optional(),
|
|
2035
|
-
lineItemIds: z.array(z.string()).optional(),
|
|
2036
|
-
source: z.enum([
|
|
2077
|
+
lineItemIds: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
|
|
2078
|
+
source: /* @__PURE__ */ z.enum([
|
|
2037
2079
|
"UNKNOWN_ADDITIONAL_FEE_SOURCE",
|
|
2038
2080
|
"SERVICE_PLUGIN",
|
|
2039
2081
|
"ITEM",
|
|
@@ -2041,15 +2083,17 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
2041
2083
|
"SHIPPING",
|
|
2042
2084
|
"PLATFORM"
|
|
2043
2085
|
]).describe("the source the additional fee was added from").optional(),
|
|
2044
|
-
translatedName: z.string().describe(
|
|
2086
|
+
translatedName: /* @__PURE__ */ z.string().describe(
|
|
2045
2087
|
"The translated name of the additional fee. The translation language is determined by the `languages` field 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)."
|
|
2046
2088
|
).min(1).max(50).optional().nullable(),
|
|
2047
|
-
taxableAddress: z.intersection(
|
|
2048
|
-
z.object({}),
|
|
2049
|
-
z.xor([
|
|
2050
|
-
z.object({
|
|
2051
|
-
|
|
2052
|
-
|
|
2089
|
+
taxableAddress: /* @__PURE__ */ z.intersection(
|
|
2090
|
+
/* @__PURE__ */ z.object({}),
|
|
2091
|
+
/* @__PURE__ */ z.xor([
|
|
2092
|
+
/* @__PURE__ */ z.object({
|
|
2093
|
+
addressType: /* @__PURE__ */ z.never().optional()
|
|
2094
|
+
}),
|
|
2095
|
+
/* @__PURE__ */ z.object({
|
|
2096
|
+
addressType: /* @__PURE__ */ z.enum(["BUSINESS", "BILLING", "SHIPPING"]).describe(
|
|
2053
2097
|
"taxable address type. if this field is selected, the address is automatically resolved, and the tax is calculated accordingly."
|
|
2054
2098
|
)
|
|
2055
2099
|
})
|
|
@@ -2057,59 +2101,59 @@ var CalculateTotalsResponse = /* @__PURE__ */ z.object({
|
|
|
2057
2101
|
).describe("Address type tax was calculated against for this fee.").optional()
|
|
2058
2102
|
})
|
|
2059
2103
|
).max(100).optional(),
|
|
2060
|
-
checkoutConversionRate: z.string().describe(
|
|
2104
|
+
checkoutConversionRate: /* @__PURE__ */ z.string().describe(
|
|
2061
2105
|
"The rate used when converting from the site currency to the checkout currency."
|
|
2062
2106
|
).optional().nullable(),
|
|
2063
|
-
payNowTotalAfterGiftCard: z.object({
|
|
2064
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2065
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2066
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2067
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2107
|
+
payNowTotalAfterGiftCard: /* @__PURE__ */ z.object({
|
|
2108
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2109
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2110
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2111
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2068
2112
|
}).describe("The pay now total amount after all gift cards are applied.").optional(),
|
|
2069
|
-
totalAfterGiftCard: z.object({
|
|
2070
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2071
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2072
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2073
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2113
|
+
totalAfterGiftCard: /* @__PURE__ */ z.object({
|
|
2114
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2115
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2116
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2117
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2074
2118
|
}).describe("The total amount after all gift cards are applied.").optional(),
|
|
2075
|
-
payAfterFreeTrial: z.object({
|
|
2076
|
-
subtotal: z.object({
|
|
2077
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2078
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2079
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2080
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2119
|
+
payAfterFreeTrial: /* @__PURE__ */ z.object({
|
|
2120
|
+
subtotal: /* @__PURE__ */ z.object({
|
|
2121
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2122
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2123
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2124
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2081
2125
|
}).describe(
|
|
2082
2126
|
"Subtotal of all line items, before discounts and before tax."
|
|
2083
2127
|
).optional(),
|
|
2084
|
-
shipping: z.object({
|
|
2085
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2086
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2087
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2088
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2128
|
+
shipping: /* @__PURE__ */ z.object({
|
|
2129
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2130
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2131
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2132
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2089
2133
|
}).describe("Total shipping price, before discounts and before tax.").optional(),
|
|
2090
|
-
tax: z.object({
|
|
2091
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2092
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2093
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2094
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2134
|
+
tax: /* @__PURE__ */ z.object({
|
|
2135
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2136
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2137
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2138
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2095
2139
|
}).describe("Total tax.").optional(),
|
|
2096
|
-
discount: z.object({
|
|
2097
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2098
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2099
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2100
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2140
|
+
discount: /* @__PURE__ */ z.object({
|
|
2141
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2142
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2143
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2144
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2101
2145
|
}).describe("Total calculated discount value.").optional(),
|
|
2102
|
-
total: z.object({
|
|
2103
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2104
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2105
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2106
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2146
|
+
total: /* @__PURE__ */ z.object({
|
|
2147
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2148
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2149
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2150
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2107
2151
|
}).describe("Total price after discounts, gift cards, and tax.").optional(),
|
|
2108
|
-
additionalFees: z.object({
|
|
2109
|
-
amount: z.string().describe("Amount.").optional(),
|
|
2110
|
-
convertedAmount: z.string().describe("Converted amount.").optional(),
|
|
2111
|
-
formattedAmount: z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2112
|
-
formattedConvertedAmount: z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2152
|
+
additionalFees: /* @__PURE__ */ z.object({
|
|
2153
|
+
amount: /* @__PURE__ */ z.string().describe("Amount.").optional(),
|
|
2154
|
+
convertedAmount: /* @__PURE__ */ z.string().describe("Converted amount.").optional(),
|
|
2155
|
+
formattedAmount: /* @__PURE__ */ z.string().describe("Amount formatted with currency symbol.").optional(),
|
|
2156
|
+
formattedConvertedAmount: /* @__PURE__ */ z.string().describe("Converted amount formatted with currency symbol.").optional()
|
|
2113
2157
|
}).describe("Total additional fees price before tax.").optional()
|
|
2114
2158
|
}).describe("Payment for subscriptions after free trial period.").optional()
|
|
2115
2159
|
});
|