@epcc-sdk/sdks-cart-checkout-order 0.2.0 → 0.4.0
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/README.md +1 -1
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/client/types.gen.cjs.map +1 -1
- package/dist/client/zod.gen.cjs +3236 -1161
- package/dist/client/zod.gen.cjs.map +1 -1
- package/dist/client/zod.gen.mjs +2657 -626
- package/dist/client/zod.gen.mjs.map +1 -1
- package/dist/index.d.cts +7698 -11
- package/dist/index.d.ts +7698 -11
- package/dist/zod.d.cts +24157 -2
- package/dist/zod.d.ts +24157 -2
- package/package.json +3 -3
- package/dist/client/client/client.gen.d.cts +0 -10
- package/dist/client/client/client.gen.d.ts +0 -10
- package/dist/client/client/index.d.cts +0 -9
- package/dist/client/client/index.d.ts +0 -9
- package/dist/client/client/types.gen.d.cts +0 -6
- package/dist/client/client/types.gen.d.ts +0 -6
- package/dist/client/client/utils.gen.d.cts +0 -6
- package/dist/client/client/utils.gen.d.ts +0 -6
- package/dist/client/client.gen.d.cts +0 -20
- package/dist/client/client.gen.d.ts +0 -20
- package/dist/client/core/auth.gen.d.cts +0 -27
- package/dist/client/core/auth.gen.d.ts +0 -27
- package/dist/client/core/bodySerializer.gen.d.cts +0 -27
- package/dist/client/core/bodySerializer.gen.d.ts +0 -27
- package/dist/client/core/params.gen.d.cts +0 -44
- package/dist/client/core/params.gen.d.ts +0 -44
- package/dist/client/core/pathSerializer.gen.d.cts +0 -34
- package/dist/client/core/pathSerializer.gen.d.ts +0 -34
- package/dist/client/core/queryKeySerializer.gen.d.cts +0 -20
- package/dist/client/core/queryKeySerializer.gen.d.ts +0 -20
- package/dist/client/core/serverSentEvents.gen.d.cts +0 -77
- package/dist/client/core/serverSentEvents.gen.d.ts +0 -77
- package/dist/client/core/types.gen.d.cts +0 -86
- package/dist/client/core/types.gen.d.ts +0 -86
- package/dist/client/core/utils.gen.d.cts +0 -23
- package/dist/client/core/utils.gen.d.ts +0 -23
- package/dist/client/index.d.cts +0 -8
- package/dist/client/index.d.ts +0 -8
- package/dist/client/sdk.gen.d.cts +0 -1449
- package/dist/client/sdk.gen.d.ts +0 -1449
- package/dist/client/types.gen.d.cts +0 -4960
- package/dist/client/types.gen.d.ts +0 -4960
- package/dist/client/zod.gen.d.cts +0 -130743
- package/dist/client/zod.gen.d.ts +0 -130743
- package/dist/runtime.d.cts +0 -12
- package/dist/runtime.d.ts +0 -12
- package/dist/types.gen-DXwTHYA3.d.ts +0 -157
- package/dist/types.gen-mB6gWg8u.d.cts +0 -157
package/dist/client/zod.gen.mjs
CHANGED
|
@@ -1,53 +1,102 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
const zCartContact = z.object({
|
|
3
|
-
email: z.
|
|
3
|
+
email: z.email().register(z.globalRegistry, {
|
|
4
|
+
description: "The email address attached to a cart."
|
|
5
|
+
}).optional()
|
|
4
6
|
});
|
|
5
7
|
const zDiscountSettings = z.object({
|
|
6
|
-
custom_discounts_enabled: z.boolean().
|
|
7
|
-
|
|
8
|
+
custom_discounts_enabled: z.boolean().register(z.globalRegistry, {
|
|
9
|
+
description: "This parameter enables custom discounts for a cart. When set to true and `use_rule_promotions` is not enabled, Elastic Path promotions will not be applied to the new carts. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/carts/put-v-2-settings-cart)."
|
|
10
|
+
}).optional(),
|
|
11
|
+
use_rule_promotions: z.boolean().register(z.globalRegistry, {
|
|
12
|
+
description: "When set to true, this parameter allows the cart to use rule promotions. You can enable this setting together with `custom_discounts_enabled`, for example, while transitioning between promotion systems. However, an individual cart can only contain one type of discount at a time."
|
|
13
|
+
}).optional()
|
|
8
14
|
});
|
|
9
15
|
const zInventorySettings = z.object({
|
|
10
|
-
defer_inventory_check: z.boolean().
|
|
16
|
+
defer_inventory_check: z.boolean().register(z.globalRegistry, {
|
|
17
|
+
description: "This parameter enables deferring inventory checks on the cart. This allows items to be added to or updating in the cart without checking stock levels. Inventory checks are still performed as normal on checkout"
|
|
18
|
+
}).optional()
|
|
11
19
|
});
|
|
12
20
|
const zItemSettings = z.object({
|
|
13
|
-
separate_items_by_location: z.boolean().
|
|
21
|
+
separate_items_by_location: z.boolean().register(z.globalRegistry, {
|
|
22
|
+
description: "When set to true, cart items with the same SKU but different locations are kept as separate line items instead of being merged. When false (default), items with the same SKU are merged and the location is updated to the most recent value."
|
|
23
|
+
}).optional()
|
|
14
24
|
});
|
|
15
25
|
const zCustomAttributes = z.record(
|
|
26
|
+
z.string(),
|
|
16
27
|
z.object({
|
|
17
|
-
type: z.enum(["string", "integer", "boolean", "float"]),
|
|
28
|
+
type: z.enum(["string", "integer", "boolean", "float"]).register(z.globalRegistry, {
|
|
29
|
+
description: "The type of the custom attribute value."
|
|
30
|
+
}),
|
|
18
31
|
value: z.union([z.string(), z.boolean(), z.number()])
|
|
19
32
|
})
|
|
20
|
-
)
|
|
33
|
+
).register(z.globalRegistry, {
|
|
34
|
+
description: 'Specifies custom attributes for cart or order objects. Each attribute includes a top-level key, as well as corresponding type and value entries. Attribute values must correspond to the assigned types.\n\nExample:\n```\n"custom_attributes": {\n "is_member": {\n "type": "boolean",\n "value": true\n },\n "membership_level": {\n "type": "string",\n "value": "premium"\n }\n}\n```\n'
|
|
35
|
+
});
|
|
21
36
|
const zFormattedPriceData = z.object({
|
|
22
|
-
amount: z.number().
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
amount: z.number().register(z.globalRegistry, {
|
|
38
|
+
description: "The raw total."
|
|
39
|
+
}).optional(),
|
|
40
|
+
currency: z.string().register(z.globalRegistry, {
|
|
41
|
+
description: "The currency set for this amount."
|
|
42
|
+
}).optional(),
|
|
43
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
44
|
+
description: "The formatted total based on the amount and currency."
|
|
45
|
+
}).optional()
|
|
25
46
|
});
|
|
26
47
|
const zCartTimestamps = z.object({
|
|
27
|
-
created_at: z.string().
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
created_at: z.string().register(z.globalRegistry, {
|
|
49
|
+
description: "The date this was created."
|
|
50
|
+
}).optional(),
|
|
51
|
+
updated_at: z.string().register(z.globalRegistry, {
|
|
52
|
+
description: "The date this was last updated."
|
|
53
|
+
}).optional(),
|
|
54
|
+
expires_at: z.string().register(z.globalRegistry, {
|
|
55
|
+
description: "The date this expires."
|
|
56
|
+
}).optional()
|
|
30
57
|
});
|
|
31
58
|
const zRelationshipItem = z.object({
|
|
32
|
-
type: z.string(),
|
|
33
|
-
|
|
59
|
+
type: z.string().register(z.globalRegistry, {
|
|
60
|
+
description: "The type of related resource."
|
|
61
|
+
}),
|
|
62
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
63
|
+
description: "The ID of the related resource."
|
|
64
|
+
})
|
|
65
|
+
}).register(z.globalRegistry, {
|
|
66
|
+
description: "Relationship data entry"
|
|
34
67
|
});
|
|
35
68
|
const zRelationshipArray = z.object({
|
|
36
|
-
data: z.array(zRelationshipItem).
|
|
69
|
+
data: z.array(zRelationshipItem).register(z.globalRegistry, {
|
|
70
|
+
description: "Individual relationships"
|
|
71
|
+
}).optional()
|
|
72
|
+
}).register(z.globalRegistry, {
|
|
73
|
+
description: "Array of relationships"
|
|
37
74
|
});
|
|
38
75
|
const zBaseCartResponse = z.object({
|
|
39
|
-
id: z.string().
|
|
40
|
-
|
|
41
|
-
|
|
76
|
+
id: z.string().register(z.globalRegistry, {
|
|
77
|
+
description: "The unique identifier for the cart. Use SDK or create it yourself."
|
|
78
|
+
}).optional(),
|
|
79
|
+
name: z.string().register(z.globalRegistry, {
|
|
80
|
+
description: "The name of this cart."
|
|
81
|
+
}).optional(),
|
|
82
|
+
description: z.string().register(z.globalRegistry, {
|
|
83
|
+
description: "A description of the cart."
|
|
84
|
+
}).optional(),
|
|
42
85
|
contact: zCartContact.optional(),
|
|
43
86
|
discount_settings: zDiscountSettings.optional(),
|
|
44
87
|
inventory_settings: zInventorySettings.optional(),
|
|
45
88
|
item_settings: zItemSettings.optional(),
|
|
46
|
-
payment_intent_id: z.string().
|
|
89
|
+
payment_intent_id: z.string().register(z.globalRegistry, {
|
|
90
|
+
description: "Stripe-assigned unique identifier for the linked Payment Intent"
|
|
91
|
+
}).optional(),
|
|
47
92
|
custom_attributes: zCustomAttributes.optional(),
|
|
48
|
-
snapshot_date: z.
|
|
93
|
+
snapshot_date: z.iso.datetime().register(z.globalRegistry, {
|
|
94
|
+
description: "The snapshot date for the cart."
|
|
95
|
+
}).optional(),
|
|
49
96
|
links: z.object({
|
|
50
|
-
self: z.string().
|
|
97
|
+
self: z.string().register(z.globalRegistry, {
|
|
98
|
+
description: "A link to that specific resource."
|
|
99
|
+
}).optional()
|
|
51
100
|
}).optional(),
|
|
52
101
|
meta: z.object({
|
|
53
102
|
display_price: z.object({
|
|
@@ -64,21 +113,33 @@ const zBaseCartResponse = z.object({
|
|
|
64
113
|
z.object({
|
|
65
114
|
bundle: z.array(
|
|
66
115
|
z.object({
|
|
67
|
-
auto_add_free_gift: z.boolean().
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
116
|
+
auto_add_free_gift: z.boolean().register(z.globalRegistry, {
|
|
117
|
+
description: "Whether to automatically add free gift"
|
|
118
|
+
}).optional(),
|
|
119
|
+
cart_item_id: z.string().register(z.globalRegistry, {
|
|
120
|
+
description: "Cart item ID for the target"
|
|
121
|
+
}).optional(),
|
|
122
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
123
|
+
description: "Quantity for the promotion"
|
|
124
|
+
}).optional(),
|
|
125
|
+
targets: z.array(z.string()).register(z.globalRegistry, {
|
|
126
|
+
description: "Array of target SKUs"
|
|
127
|
+
}).optional()
|
|
71
128
|
})
|
|
72
|
-
).
|
|
129
|
+
).register(z.globalRegistry, {
|
|
130
|
+
description: "Bundle configuration with promotion targets"
|
|
131
|
+
}).optional(),
|
|
73
132
|
code: z.string().optional(),
|
|
74
133
|
info: z.string().optional(),
|
|
75
134
|
message: z.string().optional(),
|
|
76
135
|
promotion_id: z.string().optional()
|
|
77
136
|
})
|
|
78
|
-
).
|
|
137
|
+
).register(z.globalRegistry, {
|
|
138
|
+
description: "Array of promotion suggestions"
|
|
139
|
+
}).optional()
|
|
79
140
|
}).optional(),
|
|
80
141
|
relationships: z.object({
|
|
81
|
-
customers: z.union([zRelationshipArray, z.record(z.unknown())]).optional(),
|
|
142
|
+
customers: z.union([zRelationshipArray, z.record(z.string(), z.unknown())]).optional(),
|
|
82
143
|
items: z.union([
|
|
83
144
|
zRelationshipArray,
|
|
84
145
|
z.object({
|
|
@@ -90,31 +151,53 @@ const zBaseCartResponse = z.object({
|
|
|
90
151
|
).nullable()
|
|
91
152
|
})
|
|
92
153
|
]).optional(),
|
|
93
|
-
accounts: z.union([zRelationshipArray, z.record(z.unknown())]).optional(),
|
|
154
|
+
accounts: z.union([zRelationshipArray, z.record(z.string(), z.unknown())]).optional(),
|
|
94
155
|
custom_discounts: zRelationshipArray.optional(),
|
|
95
156
|
promotions: zRelationshipArray.optional()
|
|
96
157
|
}).optional()
|
|
97
158
|
});
|
|
98
159
|
const zCartResponse = zBaseCartResponse.and(
|
|
99
160
|
z.object({
|
|
100
|
-
type: z.literal("cart").
|
|
161
|
+
type: z.literal("cart").register(z.globalRegistry, {
|
|
162
|
+
description: "The type of object being returned."
|
|
163
|
+
}).optional()
|
|
101
164
|
})
|
|
102
165
|
);
|
|
103
166
|
const zResponsePageLinks = z.object({
|
|
104
|
-
current: z.string().
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
167
|
+
current: z.string().register(z.globalRegistry, {
|
|
168
|
+
description: "Always the current page."
|
|
169
|
+
}).optional(),
|
|
170
|
+
first: z.string().register(z.globalRegistry, {
|
|
171
|
+
description: "Always the first page."
|
|
172
|
+
}).optional(),
|
|
173
|
+
last: z.string().register(z.globalRegistry, {
|
|
174
|
+
description: "If there is only one page, it is `null`."
|
|
175
|
+
}).optional(),
|
|
176
|
+
next: z.string().register(z.globalRegistry, {
|
|
177
|
+
description: "If there is only one page, it is `null`."
|
|
178
|
+
}).optional(),
|
|
179
|
+
prev: z.string().register(z.globalRegistry, {
|
|
180
|
+
description: "if the user is on the first page, it is `null`."
|
|
181
|
+
}).optional()
|
|
109
182
|
});
|
|
110
183
|
const zResponsePaginationPage = z.object({
|
|
111
|
-
current: z.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
184
|
+
current: z.int().register(z.globalRegistry, {
|
|
185
|
+
description: "The current page."
|
|
186
|
+
}).optional(),
|
|
187
|
+
limit: z.int().register(z.globalRegistry, {
|
|
188
|
+
description: "The maximum number of records per page for this response. You can set this value up to 100."
|
|
189
|
+
}).optional(),
|
|
190
|
+
offset: z.int().register(z.globalRegistry, {
|
|
191
|
+
description: "The current offset by number of records, not pages. Offset is zero-based."
|
|
192
|
+
}).optional(),
|
|
193
|
+
total: z.int().register(z.globalRegistry, {
|
|
194
|
+
description: "The total page count."
|
|
195
|
+
}).optional()
|
|
115
196
|
});
|
|
116
197
|
const zResponsePaginationResults = z.object({
|
|
117
|
-
total: z.
|
|
198
|
+
total: z.int().register(z.globalRegistry, {
|
|
199
|
+
description: "The total page count."
|
|
200
|
+
}).optional()
|
|
118
201
|
});
|
|
119
202
|
const zResponseMetaCarts = z.object({
|
|
120
203
|
page: zResponsePaginationPage.optional(),
|
|
@@ -126,30 +209,68 @@ const zCartCollectionResponse = z.object({
|
|
|
126
209
|
meta: zResponseMetaCarts.optional()
|
|
127
210
|
});
|
|
128
211
|
const zResponseErrorItem = z.object({
|
|
129
|
-
title: z.string(),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
212
|
+
title: z.string().register(z.globalRegistry, {
|
|
213
|
+
description: "A brief summary of the error."
|
|
214
|
+
}),
|
|
215
|
+
status: z.union([z.string(), z.int()]),
|
|
216
|
+
detail: z.string().register(z.globalRegistry, {
|
|
217
|
+
description: "Optional additional detail about the error."
|
|
218
|
+
}).optional(),
|
|
219
|
+
source: z.string().register(z.globalRegistry, {
|
|
220
|
+
description: "The field or location that caused the validation error. For JSON schema validation errors, this contains the JSON path to the invalid field (e.g., 'data.name', 'request', 'data.items[0].quantity')."
|
|
221
|
+
}).optional(),
|
|
133
222
|
meta: z.object({
|
|
134
|
-
id: z.string().
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
223
|
+
id: z.string().register(z.globalRegistry, {
|
|
224
|
+
description: "The resource id associated with the error"
|
|
225
|
+
}).optional(),
|
|
226
|
+
ids: z.array(
|
|
227
|
+
z.string().register(z.globalRegistry, {
|
|
228
|
+
description: "The resource ids associated with the error"
|
|
229
|
+
})
|
|
230
|
+
).optional(),
|
|
231
|
+
item_ids: z.array(
|
|
232
|
+
z.string().register(z.globalRegistry, {
|
|
233
|
+
description: "The cart_item ids associated with the error"
|
|
234
|
+
})
|
|
235
|
+
).optional(),
|
|
236
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
237
|
+
description: "The shipping group id associated with the error"
|
|
238
|
+
}).optional(),
|
|
239
|
+
shipping_group_ids: z.array(
|
|
240
|
+
z.string().register(z.globalRegistry, {
|
|
241
|
+
description: "The shipping group ids associated with the error"
|
|
242
|
+
})
|
|
243
|
+
).optional(),
|
|
244
|
+
cart_id: z.string().register(z.globalRegistry, {
|
|
245
|
+
description: "The cart id associated with the error"
|
|
246
|
+
}).optional(),
|
|
247
|
+
code: z.string().register(z.globalRegistry, {
|
|
248
|
+
description: "The code associated with the error."
|
|
249
|
+
}).optional(),
|
|
250
|
+
order_id: z.string().register(z.globalRegistry, {
|
|
251
|
+
description: "The order id associated with the error."
|
|
252
|
+
}).optional(),
|
|
253
|
+
sku: z.string().register(z.globalRegistry, {
|
|
254
|
+
description: "The SKU associated with the error."
|
|
255
|
+
}).optional(),
|
|
256
|
+
email: z.email().register(z.globalRegistry, {
|
|
257
|
+
description: "The email address associated with the error."
|
|
258
|
+
}).optional(),
|
|
259
|
+
component_product_id: z.uuid().register(z.globalRegistry, {
|
|
260
|
+
description: "The component product ID associated with the error."
|
|
261
|
+
}).optional(),
|
|
262
|
+
"error-meta-key": z.string().register(z.globalRegistry, {
|
|
263
|
+
description: "Custom error metadata key used for additional error context (e.g., in payment rejections)."
|
|
264
|
+
}).optional(),
|
|
146
265
|
value: z.union([
|
|
147
266
|
z.string(),
|
|
148
|
-
z.
|
|
267
|
+
z.int(),
|
|
149
268
|
z.boolean(),
|
|
150
|
-
z.record(z.unknown()),
|
|
269
|
+
z.record(z.string(), z.unknown()),
|
|
151
270
|
z.array(z.unknown())
|
|
152
271
|
]).optional()
|
|
272
|
+
}).register(z.globalRegistry, {
|
|
273
|
+
description: "Additional metadata associated with the error. May include arbitrary keys."
|
|
153
274
|
}).optional()
|
|
154
275
|
});
|
|
155
276
|
const zResponseErrorResponse = z.object({
|
|
@@ -157,109 +278,226 @@ const zResponseErrorResponse = z.object({
|
|
|
157
278
|
});
|
|
158
279
|
const zCartsRequest = z.object({
|
|
159
280
|
data: z.object({
|
|
160
|
-
description: z.string().
|
|
281
|
+
description: z.string().register(z.globalRegistry, {
|
|
282
|
+
description: "The cart description."
|
|
283
|
+
}).optional(),
|
|
161
284
|
discount_settings: zDiscountSettings.optional(),
|
|
162
285
|
inventory_settings: zInventorySettings.optional(),
|
|
163
286
|
item_settings: zItemSettings.optional(),
|
|
164
|
-
name: z.string().
|
|
287
|
+
name: z.string().register(z.globalRegistry, {
|
|
288
|
+
description: "The cart name provided by the shopper. A cart name must contain 1 to 255 characters. You cannot use whitespace characters, but special characters are permitted. For more information, see the [Safe Characters](/guides/Getting-Started/safe-characters) section."
|
|
289
|
+
}).optional(),
|
|
165
290
|
contact: zCartContact.optional(),
|
|
166
|
-
snapshot_date: z.string().
|
|
291
|
+
snapshot_date: z.string().register(z.globalRegistry, {
|
|
292
|
+
description: "This optional parameter sets a reference date for the cart. If this parameter is set, it allows the cart to act as one that might occur on that specified date. For example, such future carts might acquire future-enabled discounts, allowing users to test and validate future interactions with carts. The snapshot_date must be in the format 2026-02-21T15:07:25Z. By default, this parameter is left empty."
|
|
293
|
+
}).optional(),
|
|
167
294
|
custom_attributes: zCustomAttributes.optional(),
|
|
168
|
-
payment_intent_id: z.string().
|
|
295
|
+
payment_intent_id: z.string().register(z.globalRegistry, {
|
|
296
|
+
description: "To remove the Stripe payment intent from a cart, pass the empty value in the `payment_intent_id` field. You must use an empty value for this field. You cannot use this endpoint to directly update the cart to use an existing Payment Intent."
|
|
297
|
+
}).optional()
|
|
169
298
|
}).optional()
|
|
170
299
|
});
|
|
171
300
|
const zCustomDiscountResponse = z.object({
|
|
172
|
-
type: z.literal("custom_discount").
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
301
|
+
type: z.literal("custom_discount").register(z.globalRegistry, {
|
|
302
|
+
description: "Specifies the type of the resource. Always `custom_discount`."
|
|
303
|
+
}).optional(),
|
|
304
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
305
|
+
description: "Specifies the UUID of the custom discount."
|
|
306
|
+
}).optional(),
|
|
307
|
+
external_id: z.string().register(z.globalRegistry, {
|
|
308
|
+
description: "Specifies an external id for the custom discount."
|
|
309
|
+
}).optional(),
|
|
310
|
+
discount_engine: z.string().register(z.globalRegistry, {
|
|
311
|
+
description: "Specifies from where the custom discount is applied.\n"
|
|
312
|
+
}).optional(),
|
|
176
313
|
amount: zFormattedPriceData.optional(),
|
|
177
|
-
description: z.string().
|
|
178
|
-
|
|
314
|
+
description: z.string().register(z.globalRegistry, {
|
|
315
|
+
description: "Specifies a description for the custom discount."
|
|
316
|
+
}).optional(),
|
|
317
|
+
discount_code: z.string().register(z.globalRegistry, {
|
|
318
|
+
description: "Specifies the discount code used for the custom discount."
|
|
319
|
+
}).optional(),
|
|
179
320
|
relationships: z.object({
|
|
180
321
|
item: z.object({
|
|
181
322
|
data: z.object({
|
|
182
|
-
id: z.
|
|
323
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
324
|
+
description: "The cart item ID this discount is related to"
|
|
325
|
+
}).optional(),
|
|
183
326
|
type: z.enum(["cart_item", "custom_item"]).optional()
|
|
184
327
|
}).optional()
|
|
185
328
|
}).optional()
|
|
329
|
+
}).register(z.globalRegistry, {
|
|
330
|
+
description: "Relationships to other resources like cart items"
|
|
186
331
|
}).optional()
|
|
187
332
|
});
|
|
188
333
|
const zCondensedPromotionResponse = z.object({
|
|
189
|
-
type: z.literal("promotion").
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
334
|
+
type: z.literal("promotion").register(z.globalRegistry, {
|
|
335
|
+
description: "Specifies the type of the resource. Always `promotion`."
|
|
336
|
+
}).optional(),
|
|
337
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
338
|
+
description: "Specifies the UUID of the promotion."
|
|
339
|
+
}).readonly().optional(),
|
|
340
|
+
name: z.string().register(z.globalRegistry, {
|
|
341
|
+
description: "The name of the promotion."
|
|
342
|
+
}).optional(),
|
|
343
|
+
description: z.string().register(z.globalRegistry, {
|
|
344
|
+
description: "The description of the promotion."
|
|
345
|
+
}).optional(),
|
|
346
|
+
automatic: z.boolean().register(z.globalRegistry, {
|
|
347
|
+
description: "Whether the promotion is applied automatically."
|
|
348
|
+
}).optional(),
|
|
349
|
+
promotion_type: z.string().register(z.globalRegistry, {
|
|
350
|
+
description: "The type of promotion (for v1 promotions)."
|
|
351
|
+
}).optional(),
|
|
352
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
353
|
+
description: "The source of the promotion (for rule promotions)."
|
|
354
|
+
}).optional(),
|
|
355
|
+
start: z.iso.datetime().register(z.globalRegistry, {
|
|
356
|
+
description: "The start date and time of the promotion."
|
|
357
|
+
}).optional(),
|
|
358
|
+
end: z.iso.datetime().register(z.globalRegistry, {
|
|
359
|
+
description: "The end date and time of the promotion."
|
|
360
|
+
}).optional()
|
|
198
361
|
});
|
|
199
362
|
const zCartEntityResponse = z.object({
|
|
200
363
|
data: zCartResponse.optional(),
|
|
201
364
|
included: z.object({
|
|
202
365
|
custom_discounts: z.array(zCustomDiscountResponse).optional(),
|
|
203
366
|
promotions: z.array(zCondensedPromotionResponse).optional()
|
|
367
|
+
}).register(z.globalRegistry, {
|
|
368
|
+
description: "Related objects that are included in the response."
|
|
204
369
|
}).optional(),
|
|
205
370
|
meta: z.object({
|
|
206
|
-
payment_intent: z.record(z.unknown()).
|
|
371
|
+
payment_intent: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
372
|
+
description: "Payment intent details with nested structure including status and other Stripe payment intent fields"
|
|
373
|
+
}).optional()
|
|
374
|
+
}).register(z.globalRegistry, {
|
|
375
|
+
description: "Additional metadata for the cart response."
|
|
207
376
|
}).optional(),
|
|
208
|
-
errors: z.array(zResponseErrorItem).
|
|
377
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
378
|
+
description: "Array of error objects, if any errors occurred."
|
|
379
|
+
}).optional()
|
|
209
380
|
});
|
|
210
381
|
const zItemPriceData = z.object({
|
|
211
|
-
amount: z.number().
|
|
212
|
-
|
|
213
|
-
|
|
382
|
+
amount: z.number().register(z.globalRegistry, {
|
|
383
|
+
description: "The amount for this item as an integer."
|
|
384
|
+
}).readonly().optional(),
|
|
385
|
+
currency: z.string().register(z.globalRegistry, {
|
|
386
|
+
description: "The currency this item was added to the cart as."
|
|
387
|
+
}).readonly().optional(),
|
|
388
|
+
includes_tax: z.boolean().register(z.globalRegistry, {
|
|
389
|
+
description: "Whether or not this price is tax inclusive."
|
|
390
|
+
}).readonly().optional()
|
|
214
391
|
});
|
|
215
392
|
const zMoney = z.object({
|
|
216
|
-
amount: z.
|
|
217
|
-
|
|
218
|
-
|
|
393
|
+
amount: z.int().register(z.globalRegistry, {
|
|
394
|
+
description: "Amount in minor currency units (e.g., cents)."
|
|
395
|
+
}),
|
|
396
|
+
currency: z.string().register(z.globalRegistry, {
|
|
397
|
+
description: 'ISO 4217 currency code (e.g., "USD").'
|
|
398
|
+
}),
|
|
399
|
+
includes_tax: z.boolean().register(z.globalRegistry, {
|
|
400
|
+
description: "Whether the amount includes tax."
|
|
401
|
+
})
|
|
219
402
|
});
|
|
220
403
|
const zDiscount = z.object({
|
|
221
404
|
amount: zMoney,
|
|
222
|
-
code: z.string().
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
405
|
+
code: z.string().register(z.globalRegistry, {
|
|
406
|
+
description: "The discount code used, if applicable."
|
|
407
|
+
}).optional(),
|
|
408
|
+
id: z.string().register(z.globalRegistry, {
|
|
409
|
+
description: "Unique identifier for the discount."
|
|
410
|
+
}),
|
|
411
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
412
|
+
description: "The source or origin of the promotion, if applicable."
|
|
413
|
+
}).optional(),
|
|
414
|
+
is_cart_discount: z.boolean().register(z.globalRegistry, {
|
|
415
|
+
description: "Indicates whether the discount applies to the entire cart."
|
|
416
|
+
}).optional(),
|
|
417
|
+
ordinal: z.int().register(z.globalRegistry, {
|
|
418
|
+
description: "Order in which the discount was applied."
|
|
419
|
+
}).optional(),
|
|
420
|
+
promotion_action_id: z.string().register(z.globalRegistry, {
|
|
421
|
+
description: "Identifies the specific action within a multi-action rule promotion that produced this discount."
|
|
422
|
+
}).optional()
|
|
228
423
|
});
|
|
229
424
|
const zCartItemFormattedPriceData = z.object({
|
|
230
425
|
unit: zFormattedPriceData.optional(),
|
|
231
426
|
value: zFormattedPriceData.optional()
|
|
232
427
|
});
|
|
233
428
|
const zTimestamps = z.object({
|
|
234
|
-
created_at: z.string().
|
|
235
|
-
|
|
429
|
+
created_at: z.string().register(z.globalRegistry, {
|
|
430
|
+
description: "The date this was created."
|
|
431
|
+
}).optional(),
|
|
432
|
+
updated_at: z.string().register(z.globalRegistry, {
|
|
433
|
+
description: "The date this was last updated."
|
|
434
|
+
}).optional()
|
|
236
435
|
});
|
|
237
436
|
const zCartItemResponse = z.object({
|
|
238
|
-
id: z.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
437
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
438
|
+
description: "The unique identifier for the cart item."
|
|
439
|
+
}).readonly().optional(),
|
|
440
|
+
type: z.enum(["cart_item", "custom_item", "subscription_item", "promotion_item"]).register(z.globalRegistry, {
|
|
441
|
+
description: "The type of cart item."
|
|
442
|
+
}).readonly().optional(),
|
|
443
|
+
product_id: z.uuid().register(z.globalRegistry, {
|
|
444
|
+
description: "The unique ID of the product (for cart_item type)."
|
|
445
|
+
}).readonly().optional(),
|
|
446
|
+
promotion_id: z.uuid().register(z.globalRegistry, {
|
|
447
|
+
description: "The unique ID of the promotion (for promotion_item type)."
|
|
448
|
+
}).readonly().optional(),
|
|
449
|
+
subscription_offering_id: z.uuid().register(z.globalRegistry, {
|
|
450
|
+
description: "The unique ID of the subscription offering for subscription items."
|
|
451
|
+
}).readonly().optional(),
|
|
452
|
+
name: z.string().register(z.globalRegistry, {
|
|
453
|
+
description: "The name of this item"
|
|
454
|
+
}).readonly().optional(),
|
|
455
|
+
description: z.string().register(z.globalRegistry, {
|
|
456
|
+
description: "A description of the cart item."
|
|
457
|
+
}).readonly().optional(),
|
|
458
|
+
sku: z.string().register(z.globalRegistry, {
|
|
459
|
+
description: "The SKU of the cart item."
|
|
460
|
+
}).readonly().optional(),
|
|
461
|
+
slug: z.string().register(z.globalRegistry, {
|
|
462
|
+
description: "The slug of the cart item."
|
|
463
|
+
}).readonly().optional(),
|
|
464
|
+
catalog_id: z.uuid().register(z.globalRegistry, {
|
|
465
|
+
description: "The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set."
|
|
466
|
+
}).readonly().optional(),
|
|
467
|
+
catalog_source: z.string().register(z.globalRegistry, {
|
|
468
|
+
description: "The catalog source. Always `pim` or `legacy`."
|
|
469
|
+
}).readonly().optional(),
|
|
249
470
|
bundle_configuration: z.object({
|
|
250
|
-
selected_options: z.record(z.record(z.number())).optional(),
|
|
471
|
+
selected_options: z.record(z.string(), z.record(z.string(), z.number())).optional(),
|
|
251
472
|
component_products: z.array(
|
|
252
473
|
z.object({
|
|
253
|
-
id: z.string().
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
474
|
+
id: z.string().register(z.globalRegistry, {
|
|
475
|
+
description: "Product ID"
|
|
476
|
+
}).optional(),
|
|
477
|
+
type: z.string().register(z.globalRegistry, {
|
|
478
|
+
description: "Product type"
|
|
479
|
+
}).optional(),
|
|
480
|
+
attributes: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
481
|
+
description: "Product attributes as a generic object"
|
|
482
|
+
}).optional(),
|
|
483
|
+
meta: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
484
|
+
description: "Product meta information as a generic object"
|
|
485
|
+
}).optional(),
|
|
486
|
+
price: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
487
|
+
description: "Product price"
|
|
488
|
+
}).optional(),
|
|
489
|
+
relationships: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
490
|
+
description: "Product relationships as a generic object"
|
|
491
|
+
}).optional()
|
|
259
492
|
})
|
|
260
|
-
).
|
|
493
|
+
).register(z.globalRegistry, {
|
|
494
|
+
description: "Array of component products for bundle configuration"
|
|
495
|
+
}).optional()
|
|
496
|
+
}).register(z.globalRegistry, {
|
|
497
|
+
description: "Configuration for bundle products."
|
|
261
498
|
}).readonly().optional(),
|
|
262
499
|
components: z.record(
|
|
500
|
+
z.string(),
|
|
263
501
|
z.object({
|
|
264
502
|
name: z.string().optional(),
|
|
265
503
|
options: z.array(
|
|
@@ -270,26 +508,54 @@ const zCartItemResponse = z.object({
|
|
|
270
508
|
})
|
|
271
509
|
).optional()
|
|
272
510
|
})
|
|
273
|
-
).
|
|
511
|
+
).register(z.globalRegistry, {
|
|
512
|
+
description: "Components of the cart item for bundle products."
|
|
513
|
+
}).readonly().optional(),
|
|
274
514
|
image: z.object({
|
|
275
|
-
mime_type: z.string().
|
|
276
|
-
|
|
277
|
-
|
|
515
|
+
mime_type: z.string().register(z.globalRegistry, {
|
|
516
|
+
description: "The MIME type for the uploaded file."
|
|
517
|
+
}).readonly().optional(),
|
|
518
|
+
file_name: z.string().register(z.globalRegistry, {
|
|
519
|
+
description: "The name of the image file that was uploaded."
|
|
520
|
+
}).readonly().optional(),
|
|
521
|
+
href: z.string().register(z.globalRegistry, {
|
|
522
|
+
description: "The link to the image."
|
|
523
|
+
}).readonly().optional()
|
|
524
|
+
}).readonly().optional(),
|
|
525
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
526
|
+
description: "The quantity of the cart item."
|
|
527
|
+
}).readonly().optional(),
|
|
528
|
+
auto_add_quantity: z.int().register(z.globalRegistry, {
|
|
529
|
+
description: "The quantity automatically added (for gift items)."
|
|
530
|
+
}).readonly().optional(),
|
|
531
|
+
manage_stock: z.boolean().register(z.globalRegistry, {
|
|
532
|
+
description: "Whether or not the quantity of the item will be checked against inventory."
|
|
278
533
|
}).readonly().optional(),
|
|
279
|
-
quantity: z.number().int().readonly().optional(),
|
|
280
|
-
auto_add_quantity: z.number().int().readonly().optional(),
|
|
281
|
-
manage_stock: z.boolean().readonly().optional(),
|
|
282
534
|
unit_price: zItemPriceData.readonly().optional(),
|
|
283
535
|
value: zItemPriceData.readonly().optional(),
|
|
284
|
-
discounts: z.array(zDiscount).
|
|
285
|
-
|
|
536
|
+
discounts: z.array(zDiscount).register(z.globalRegistry, {
|
|
537
|
+
description: "Array of discounts applied to the cart item."
|
|
538
|
+
}).readonly().optional(),
|
|
539
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
540
|
+
description: "Custom inputs for personalized products."
|
|
541
|
+
}).readonly().optional(),
|
|
286
542
|
subscription_configuration: z.object({
|
|
287
|
-
plan: z.string().
|
|
288
|
-
|
|
543
|
+
plan: z.string().register(z.globalRegistry, {
|
|
544
|
+
description: "The subscription plan ID."
|
|
545
|
+
}).optional(),
|
|
546
|
+
pricing_option: z.string().register(z.globalRegistry, {
|
|
547
|
+
description: "The subscription pricing option ID."
|
|
548
|
+
}).optional()
|
|
549
|
+
}).register(z.globalRegistry, {
|
|
550
|
+
description: "Configuration for subscription items."
|
|
289
551
|
}).readonly().optional(),
|
|
290
552
|
links: z.object({
|
|
291
|
-
product: z.string().
|
|
292
|
-
|
|
553
|
+
product: z.string().register(z.globalRegistry, {
|
|
554
|
+
description: "A URL related to the resource."
|
|
555
|
+
}).optional(),
|
|
556
|
+
subscription_offering: z.string().register(z.globalRegistry, {
|
|
557
|
+
description: "A URL related to the subscription offering resource."
|
|
558
|
+
}).optional()
|
|
293
559
|
}).readonly().optional(),
|
|
294
560
|
meta: z.object({
|
|
295
561
|
display_price: z.object({
|
|
@@ -300,41 +566,82 @@ const zCartItemResponse = z.object({
|
|
|
300
566
|
without_discount: zCartItemFormattedPriceData.optional(),
|
|
301
567
|
original_price: zCartItemFormattedPriceData.optional(),
|
|
302
568
|
discounts: z.record(
|
|
569
|
+
z.string(),
|
|
303
570
|
z.object({
|
|
304
|
-
amount: z.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
571
|
+
amount: z.int().register(z.globalRegistry, {
|
|
572
|
+
description: "The discount amount."
|
|
573
|
+
}),
|
|
574
|
+
currency: z.string().register(z.globalRegistry, {
|
|
575
|
+
description: "The currency code."
|
|
576
|
+
}),
|
|
577
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
578
|
+
description: "The formatted discount amount."
|
|
579
|
+
}),
|
|
580
|
+
constituents: z.record(z.string(), zFormattedPriceData).register(z.globalRegistry, {
|
|
581
|
+
description: "The discount constituents."
|
|
582
|
+
}).optional()
|
|
308
583
|
})
|
|
309
|
-
).
|
|
584
|
+
).register(z.globalRegistry, {
|
|
585
|
+
description: "Detailed discount information."
|
|
586
|
+
}).optional()
|
|
310
587
|
}).optional(),
|
|
311
588
|
timestamps: zTimestamps.optional()
|
|
312
589
|
}).readonly().optional(),
|
|
313
590
|
relationships: z.object({
|
|
314
591
|
taxes: z.object({
|
|
315
592
|
data: z.array(zRelationshipItem).nullish()
|
|
593
|
+
}).register(z.globalRegistry, {
|
|
594
|
+
description: "Related tax items."
|
|
316
595
|
}).optional(),
|
|
317
596
|
custom_discounts: z.object({
|
|
318
597
|
data: z.array(zRelationshipItem).nullish()
|
|
598
|
+
}).register(z.globalRegistry, {
|
|
599
|
+
description: "Related custom discounts."
|
|
319
600
|
}).optional(),
|
|
320
601
|
promotions: z.object({
|
|
321
602
|
data: z.array(zRelationshipItem).nullish()
|
|
603
|
+
}).register(z.globalRegistry, {
|
|
604
|
+
description: "Related promotions."
|
|
322
605
|
}).optional()
|
|
606
|
+
}).register(z.globalRegistry, {
|
|
607
|
+
description: "Relationships to other resources."
|
|
608
|
+
}).readonly().optional(),
|
|
609
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
610
|
+
description: "The shipping group ID for this item."
|
|
611
|
+
}).readonly().optional(),
|
|
612
|
+
promotion_source: z.enum(["rule-promotion"]).register(z.globalRegistry, {
|
|
613
|
+
description: "The source of the promotion (for promotion items)."
|
|
614
|
+
}).readonly().optional(),
|
|
615
|
+
promotion_action_id: z.string().register(z.globalRegistry, {
|
|
616
|
+
description: "The action ID within the rule promotion that produced this promotion item."
|
|
617
|
+
}).readonly().optional(),
|
|
618
|
+
location: z.string().register(z.globalRegistry, {
|
|
619
|
+
description: "The stock location for this item."
|
|
323
620
|
}).readonly().optional(),
|
|
324
|
-
shipping_group_id: z.string().readonly().optional(),
|
|
325
|
-
promotion_source: z.enum(["rule-promotion"]).readonly().optional(),
|
|
326
|
-
promotion_action_id: z.string().readonly().optional(),
|
|
327
|
-
location: z.string().readonly().optional(),
|
|
328
621
|
custom_attributes: zCustomAttributes.readonly().optional()
|
|
329
622
|
});
|
|
330
623
|
const zTaxItemResponse = z.object({
|
|
331
|
-
type: z.literal("tax_item").
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
624
|
+
type: z.literal("tax_item").register(z.globalRegistry, {
|
|
625
|
+
description: "Specifies the type of the resource. Always `tax_item`."
|
|
626
|
+
}).optional(),
|
|
627
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
628
|
+
description: "Specifies the UUID of the tax item."
|
|
629
|
+
}).readonly().optional(),
|
|
630
|
+
jurisdiction: z.string().register(z.globalRegistry, {
|
|
631
|
+
description: "The jurisdiction for the tax item."
|
|
632
|
+
}).optional(),
|
|
633
|
+
code: z.string().register(z.globalRegistry, {
|
|
634
|
+
description: "The tax code for the tax item."
|
|
635
|
+
}).optional(),
|
|
636
|
+
name: z.string().register(z.globalRegistry, {
|
|
637
|
+
description: "The name of the tax item."
|
|
638
|
+
}).optional(),
|
|
639
|
+
rate: z.number().register(z.globalRegistry, {
|
|
640
|
+
description: "The tax rate as a decimal (e.g., 0.085 for 8.5%)."
|
|
641
|
+
}).optional(),
|
|
642
|
+
amount: z.int().register(z.globalRegistry, {
|
|
643
|
+
description: "The tax amount in the smallest currency unit."
|
|
644
|
+
}).optional()
|
|
338
645
|
});
|
|
339
646
|
const zCartItemCollectionResponse = z.object({
|
|
340
647
|
data: z.array(zCartItemResponse),
|
|
@@ -344,16 +651,22 @@ const zCartItemCollectionResponse = z.object({
|
|
|
344
651
|
z.object({
|
|
345
652
|
automatic: z.boolean().optional(),
|
|
346
653
|
description: z.string().optional(),
|
|
347
|
-
end: z.
|
|
348
|
-
id: z.
|
|
654
|
+
end: z.iso.datetime().optional(),
|
|
655
|
+
id: z.uuid().optional(),
|
|
349
656
|
name: z.string().optional(),
|
|
350
657
|
promotion_type: z.string().optional(),
|
|
351
|
-
promotion_source: z.string().
|
|
352
|
-
|
|
658
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
659
|
+
description: "The source of the promotion"
|
|
660
|
+
}).optional(),
|
|
661
|
+
start: z.iso.datetime().optional(),
|
|
353
662
|
type: z.literal("promotion").optional()
|
|
354
663
|
})
|
|
355
664
|
).optional(),
|
|
356
|
-
tax_items: z.array(zTaxItemResponse).
|
|
665
|
+
tax_items: z.array(zTaxItemResponse).register(z.globalRegistry, {
|
|
666
|
+
description: "Array of tax items included in the response."
|
|
667
|
+
}).optional()
|
|
668
|
+
}).register(z.globalRegistry, {
|
|
669
|
+
description: "Related objects that are included in the response."
|
|
357
670
|
}).optional(),
|
|
358
671
|
meta: z.object({
|
|
359
672
|
display_price: z.object({
|
|
@@ -372,48 +685,98 @@ const zCartItemCollectionResponse = z.object({
|
|
|
372
685
|
messages: z.array(
|
|
373
686
|
z.object({
|
|
374
687
|
source: z.object({
|
|
375
|
-
type: z.string(),
|
|
376
|
-
|
|
377
|
-
|
|
688
|
+
type: z.string().register(z.globalRegistry, {
|
|
689
|
+
description: "The type of the source item"
|
|
690
|
+
}),
|
|
691
|
+
id: z.string().register(z.globalRegistry, {
|
|
692
|
+
description: "The unique identifier of the source item"
|
|
693
|
+
}),
|
|
694
|
+
code: z.string().register(z.globalRegistry, {
|
|
695
|
+
description: "The promotion code (present when source type is promotion)"
|
|
696
|
+
}).optional()
|
|
697
|
+
}).register(z.globalRegistry, {
|
|
698
|
+
description: "Identifies the cart item that triggered this message"
|
|
378
699
|
}).optional(),
|
|
379
|
-
title: z.string(),
|
|
380
|
-
|
|
700
|
+
title: z.string().register(z.globalRegistry, {
|
|
701
|
+
description: "A short descriptive title for the message"
|
|
702
|
+
}),
|
|
703
|
+
description: z.string().register(z.globalRegistry, {
|
|
704
|
+
description: "A detailed description of the message"
|
|
705
|
+
})
|
|
381
706
|
})
|
|
382
|
-
).
|
|
707
|
+
).register(z.globalRegistry, {
|
|
708
|
+
description: "Optional array of informational messages that provide feedback about operations performed on the cart items, such as promotions added or discounts applied. This field is only present when there are relevant messages to display.\n"
|
|
709
|
+
}).optional(),
|
|
383
710
|
promotion_suggestions: z.array(
|
|
384
711
|
z.object({
|
|
385
712
|
bundle: z.array(
|
|
386
713
|
z.object({
|
|
387
|
-
auto_add_free_gift: z.boolean().
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
714
|
+
auto_add_free_gift: z.boolean().register(z.globalRegistry, {
|
|
715
|
+
description: "Whether to automatically add free gift"
|
|
716
|
+
}).optional(),
|
|
717
|
+
cart_item_id: z.string().register(z.globalRegistry, {
|
|
718
|
+
description: "Cart item ID for the target"
|
|
719
|
+
}).optional(),
|
|
720
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
721
|
+
description: "Quantity for the promotion"
|
|
722
|
+
}).optional(),
|
|
723
|
+
targets: z.array(z.string()).register(z.globalRegistry, {
|
|
724
|
+
description: "Array of target SKUs"
|
|
725
|
+
}).optional()
|
|
391
726
|
})
|
|
392
|
-
).
|
|
727
|
+
).register(z.globalRegistry, {
|
|
728
|
+
description: "Bundle configuration with promotion targets"
|
|
729
|
+
}).optional(),
|
|
393
730
|
code: z.string().optional(),
|
|
394
731
|
info: z.string().optional(),
|
|
395
732
|
message: z.string().optional(),
|
|
396
733
|
promotion_id: z.string().optional(),
|
|
397
|
-
auto_add: z.boolean().
|
|
734
|
+
auto_add: z.boolean().register(z.globalRegistry, {
|
|
735
|
+
description: "Whether this promotion should be automatically added"
|
|
736
|
+
}).optional(),
|
|
398
737
|
targets: z.array(
|
|
399
738
|
z.object({
|
|
400
|
-
cart_item_id: z.string().
|
|
401
|
-
|
|
402
|
-
|
|
739
|
+
cart_item_id: z.string().register(z.globalRegistry, {
|
|
740
|
+
description: "The cart item ID for this target"
|
|
741
|
+
}).optional(),
|
|
742
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
743
|
+
description: "The quantity for this target"
|
|
744
|
+
}).optional(),
|
|
745
|
+
skus: z.array(z.string()).register(z.globalRegistry, {
|
|
746
|
+
description: "Array of SKU codes for this target"
|
|
747
|
+
}).optional()
|
|
403
748
|
})
|
|
404
|
-
).
|
|
749
|
+
).register(z.globalRegistry, {
|
|
750
|
+
description: "Array of promotion targets (alternative structure)"
|
|
751
|
+
}).optional()
|
|
405
752
|
})
|
|
406
|
-
).
|
|
753
|
+
).register(z.globalRegistry, {
|
|
754
|
+
description: "Array of promotion suggestions"
|
|
755
|
+
}).optional()
|
|
756
|
+
}).register(z.globalRegistry, {
|
|
757
|
+
description: "Additional meta information about the cart items collection."
|
|
407
758
|
}).optional(),
|
|
408
|
-
errors: z.array(zResponseErrorItem).
|
|
759
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
760
|
+
description: "Array of error objects, if any errors occurred."
|
|
761
|
+
}).optional()
|
|
409
762
|
});
|
|
410
763
|
const zBulkUpdateCartsItemsCommon = z.object({
|
|
411
|
-
id: z.
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
764
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
765
|
+
description: "Specifies the ID of the cart item that you want to update in cart."
|
|
766
|
+
}).optional(),
|
|
767
|
+
quantity: z.int().gte(0).register(z.globalRegistry, {
|
|
768
|
+
description: "Specifies the amount of items to update in the cart."
|
|
769
|
+
}).optional(),
|
|
770
|
+
type: z.enum(["cart_item", "custom_item"]).register(z.globalRegistry, {
|
|
771
|
+
description: "The type of cart item being updated."
|
|
772
|
+
}).optional(),
|
|
773
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
774
|
+
description: "Specifies the custom text to be added to a product. See [custom inputs](https://elasticpath.dev/docs/pxm/products/ep-pxm-products-api/update-a-product#using-custom-inputs-attribute)."
|
|
775
|
+
}).optional(),
|
|
415
776
|
custom_attributes: zCustomAttributes.optional(),
|
|
416
|
-
shipping_group_id: z.
|
|
777
|
+
shipping_group_id: z.uuid().register(z.globalRegistry, {
|
|
778
|
+
description: "Specifies the shipping group ID for the cart item."
|
|
779
|
+
}).optional()
|
|
417
780
|
});
|
|
418
781
|
const zBulkUpdateCartsItemsWithQuantity = zBulkUpdateCartsItemsCommon.and(
|
|
419
782
|
z.object({
|
|
@@ -434,7 +797,9 @@ const zBulkUpdateCartsItemsWithCustomInputs = zBulkUpdateCartsItemsCommon.and(
|
|
|
434
797
|
})
|
|
435
798
|
);
|
|
436
799
|
const zUpdateAllOrNothingOptionsObject = z.object({
|
|
437
|
-
update_all_or_nothing: z.boolean().
|
|
800
|
+
update_all_or_nothing: z.boolean().register(z.globalRegistry, {
|
|
801
|
+
description: "When set to`true`, if an error occurs for any item, no items are updated in the cart. When set to `false`, valid items are updated in the cart and the items with errors are reported in the response. Default is `true`."
|
|
802
|
+
}).optional()
|
|
438
803
|
});
|
|
439
804
|
const zBulkUpdateCartsItems = z.object({
|
|
440
805
|
data: z.array(
|
|
@@ -447,76 +812,142 @@ const zBulkUpdateCartsItems = z.object({
|
|
|
447
812
|
options: zUpdateAllOrNothingOptionsObject.optional()
|
|
448
813
|
});
|
|
449
814
|
const zBaseItemObjectData = z.object({
|
|
450
|
-
quantity: z.number(),
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
815
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
816
|
+
description: "The number of items to add."
|
|
817
|
+
}),
|
|
818
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
819
|
+
description: "Specifies the ID of the product you want to add. (use this OR sku)"
|
|
820
|
+
}).optional(),
|
|
821
|
+
sku: z.string().register(z.globalRegistry, {
|
|
822
|
+
description: "Specifies the item SKU that you want to add. (use this OR id)"
|
|
823
|
+
}).optional(),
|
|
824
|
+
name: z.string().register(z.globalRegistry, {
|
|
825
|
+
description: "Optional name for the product item. If not provided, the product name from catalog will be used."
|
|
826
|
+
}).optional(),
|
|
827
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
828
|
+
description: "The custom text to be added to a product."
|
|
829
|
+
}).optional(),
|
|
455
830
|
bundle_configuration: z.object({
|
|
456
|
-
selected_options: z.record(z.unknown()).
|
|
457
|
-
|
|
831
|
+
selected_options: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
832
|
+
description: "Specifies selected options."
|
|
833
|
+
}).optional(),
|
|
834
|
+
component_products: z.array(z.unknown()).register(z.globalRegistry, {
|
|
835
|
+
description: "Array of component products for the selected options."
|
|
836
|
+
}).optional()
|
|
837
|
+
}).register(z.globalRegistry, {
|
|
838
|
+
description: "Object used to describe the bundle options selected."
|
|
839
|
+
}).optional(),
|
|
840
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
841
|
+
description: "Identifier for a Shipping Group"
|
|
842
|
+
}).optional(),
|
|
843
|
+
location: z.string().register(z.globalRegistry, {
|
|
844
|
+
description: "The slug of a stock location."
|
|
458
845
|
}).optional(),
|
|
459
|
-
shipping_group_id: z.string().optional(),
|
|
460
|
-
location: z.string().optional(),
|
|
461
846
|
custom_attributes: zCustomAttributes.optional()
|
|
462
847
|
});
|
|
463
848
|
const zCartItemObjectData = z.object({
|
|
464
|
-
type: z.literal("cart_item")
|
|
849
|
+
type: z.literal("cart_item").register(z.globalRegistry, {
|
|
850
|
+
description: "The type of object being returned. Must be `cart_item` for cart items."
|
|
851
|
+
})
|
|
465
852
|
}).and(zBaseItemObjectData);
|
|
466
853
|
const zCartItemObjectRequest = z.object({
|
|
467
854
|
data: zCartItemObjectData.optional()
|
|
468
855
|
});
|
|
469
856
|
const zSubscriptionItemObjectData = z.object({
|
|
470
|
-
type: z.literal("subscription_item"),
|
|
471
|
-
|
|
472
|
-
|
|
857
|
+
type: z.literal("subscription_item").register(z.globalRegistry, {
|
|
858
|
+
description: "The type of object being returned."
|
|
859
|
+
}),
|
|
860
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
861
|
+
description: "The number of items added to the cart."
|
|
862
|
+
}),
|
|
863
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
864
|
+
description: "Specifies the ID of the subscription offering you want to add to cart."
|
|
865
|
+
}),
|
|
473
866
|
subscription_configuration: z.object({
|
|
474
|
-
pricing_option: z.
|
|
475
|
-
|
|
867
|
+
pricing_option: z.uuid().register(z.globalRegistry, {
|
|
868
|
+
description: "The ID of the pricing option within the offering to use for the subscription."
|
|
869
|
+
}),
|
|
870
|
+
plan: z.uuid().register(z.globalRegistry, {
|
|
871
|
+
description: "The ID of the plan within the offering to use for the subscription."
|
|
872
|
+
})
|
|
873
|
+
}).register(z.globalRegistry, {
|
|
874
|
+
description: "Specifies how the subscription offering should be configured."
|
|
476
875
|
})
|
|
477
876
|
});
|
|
478
877
|
const zSubscriptionItemObject = z.object({
|
|
479
878
|
data: zSubscriptionItemObjectData.and(zCartItemResponse).optional()
|
|
480
879
|
});
|
|
481
880
|
const zCartMergeObject = z.object({
|
|
482
|
-
type: z.literal("cart_items"),
|
|
483
|
-
|
|
881
|
+
type: z.literal("cart_items").register(z.globalRegistry, {
|
|
882
|
+
description: "The type of object being returned. Must be `cart_items`."
|
|
883
|
+
}),
|
|
884
|
+
cart_id: z.uuid().register(z.globalRegistry, {
|
|
885
|
+
description: "The original cart to be merged from."
|
|
886
|
+
})
|
|
484
887
|
});
|
|
485
888
|
const zAddAllOrNothingOptionsObject = z.object({
|
|
486
|
-
add_all_or_nothing: z.boolean().
|
|
889
|
+
add_all_or_nothing: z.boolean().register(z.globalRegistry, {
|
|
890
|
+
description: "When `true`, if an error occurs for any item, no items are added to the cart. When `false`, valid items are added to the cart and the items with errors are reported in the response. Default is `false`."
|
|
891
|
+
}).optional()
|
|
487
892
|
});
|
|
488
893
|
const zCartMergeObjectRequest = z.object({
|
|
489
894
|
data: zCartMergeObject.optional(),
|
|
490
895
|
options: zAddAllOrNothingOptionsObject.optional()
|
|
491
896
|
});
|
|
492
897
|
const zCustomItemObjectData = z.object({
|
|
493
|
-
type: z.literal("custom_item"),
|
|
494
|
-
|
|
898
|
+
type: z.literal("custom_item").register(z.globalRegistry, {
|
|
899
|
+
description: "The type of object being returned. Must be `custom_item`."
|
|
900
|
+
}),
|
|
901
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
902
|
+
description: "The number of custom items to add to cart."
|
|
903
|
+
}),
|
|
495
904
|
price: z.object({
|
|
496
|
-
amount: z.number(),
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
905
|
+
amount: z.number().register(z.globalRegistry, {
|
|
906
|
+
description: "The unit price of the custom item."
|
|
907
|
+
}),
|
|
908
|
+
includes_tax: z.boolean().register(z.globalRegistry, {
|
|
909
|
+
description: "Set to`true` if relevant taxes have been included in the price, `false` if not. Defaults to `true`."
|
|
910
|
+
}).optional()
|
|
911
|
+
}),
|
|
912
|
+
description: z.string().register(z.globalRegistry, {
|
|
913
|
+
description: "A description of the custom item."
|
|
914
|
+
}).optional(),
|
|
915
|
+
sku: z.string().register(z.globalRegistry, {
|
|
916
|
+
description: "The `SKU` code to use for the custom item. See [best practices](https://elasticpath.dev/docs/commerce-cloud/carts/cart-items/add-custom-item-to-cart#best-practices) to use the `SKU` code."
|
|
917
|
+
}).optional(),
|
|
918
|
+
name: z.string().register(z.globalRegistry, {
|
|
919
|
+
description: "The name of the custom item."
|
|
920
|
+
}),
|
|
921
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
922
|
+
description: "The custom text to be added to a product."
|
|
923
|
+
}).optional(),
|
|
924
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
925
|
+
description: "Identifier for a created Cart Shipping Group"
|
|
926
|
+
}).optional(),
|
|
504
927
|
custom_attributes: zCustomAttributes.optional()
|
|
505
928
|
});
|
|
506
929
|
const zCustomItemObject = z.object({
|
|
507
930
|
data: zCustomItemObjectData.optional()
|
|
508
931
|
});
|
|
509
932
|
const zReOrderObject = z.object({
|
|
510
|
-
type: z.literal("order_items"),
|
|
511
|
-
|
|
933
|
+
type: z.literal("order_items").register(z.globalRegistry, {
|
|
934
|
+
description: "The type of resource being returned. Use `order_items`."
|
|
935
|
+
}),
|
|
936
|
+
order_id: z.uuid().register(z.globalRegistry, {
|
|
937
|
+
description: "The unique identifier of the order."
|
|
938
|
+
})
|
|
512
939
|
});
|
|
513
940
|
const zReOrderObjectRequest = z.object({
|
|
514
941
|
data: zReOrderObject.optional(),
|
|
515
942
|
options: zAddAllOrNothingOptionsObject.optional()
|
|
516
943
|
});
|
|
517
944
|
const zPromotionItemObjectData = z.object({
|
|
518
|
-
type: z.literal("promotion_item"),
|
|
519
|
-
|
|
945
|
+
type: z.literal("promotion_item").register(z.globalRegistry, {
|
|
946
|
+
description: "Specifies the type of resource, which is `promotion_item`."
|
|
947
|
+
}),
|
|
948
|
+
code: z.string().register(z.globalRegistry, {
|
|
949
|
+
description: "Specifies the promotion code. For more information about codes[].user[], see the [Create Promotion codes](/docs/api/promotions/create-promotion-codes) section."
|
|
950
|
+
})
|
|
520
951
|
});
|
|
521
952
|
const zPromotionItemObject = z.object({
|
|
522
953
|
data: zPromotionItemObjectData.optional()
|
|
@@ -535,49 +966,89 @@ const zBulkAddItemsRequest = z.object({
|
|
|
535
966
|
});
|
|
536
967
|
const zUpdateCartsItems = z.object({
|
|
537
968
|
data: z.object({
|
|
538
|
-
type: z.literal("cart_item").
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
969
|
+
type: z.literal("cart_item").register(z.globalRegistry, {
|
|
970
|
+
description: "The type of the cart item."
|
|
971
|
+
}).optional(),
|
|
972
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
973
|
+
description: "The unique identifier of the cart item."
|
|
974
|
+
}).optional(),
|
|
975
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
976
|
+
description: "The amount of products to add to cart."
|
|
977
|
+
}).optional(),
|
|
978
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
979
|
+
description: "The custom text to be added to a product."
|
|
980
|
+
}).optional(),
|
|
542
981
|
custom_attributes: zCustomAttributes.optional(),
|
|
543
|
-
shipping_group_id: z.
|
|
982
|
+
shipping_group_id: z.uuid().register(z.globalRegistry, {
|
|
983
|
+
description: "The unique identifier of the shipping group to be added to the cart."
|
|
984
|
+
}).optional()
|
|
544
985
|
}).optional()
|
|
545
986
|
});
|
|
546
987
|
const zCartsRelationshipsAccountsData = z.object({
|
|
547
988
|
data: z.array(
|
|
548
989
|
z.object({
|
|
549
|
-
id: z.string().
|
|
550
|
-
|
|
990
|
+
id: z.string().register(z.globalRegistry, {
|
|
991
|
+
description: "The ID of the account."
|
|
992
|
+
}).optional(),
|
|
993
|
+
type: z.string().register(z.globalRegistry, {
|
|
994
|
+
description: "The type of related object. Ensure that it is account."
|
|
995
|
+
}).optional()
|
|
551
996
|
})
|
|
552
997
|
).optional()
|
|
553
998
|
});
|
|
554
999
|
const zCartsRelationshipsCustomersData = z.object({
|
|
555
1000
|
data: z.array(
|
|
556
1001
|
z.object({
|
|
557
|
-
id: z.string().
|
|
558
|
-
|
|
1002
|
+
id: z.string().register(z.globalRegistry, {
|
|
1003
|
+
description: "The ID of the customer."
|
|
1004
|
+
}).optional(),
|
|
1005
|
+
type: z.string().register(z.globalRegistry, {
|
|
1006
|
+
description: "The type of related object. Ensure that it is customer."
|
|
1007
|
+
}).optional()
|
|
559
1008
|
})
|
|
560
1009
|
).optional()
|
|
561
1010
|
});
|
|
562
1011
|
const zCartsItemsTaxesCommon = z.object({
|
|
563
|
-
code: z.string().
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
1012
|
+
code: z.string().register(z.globalRegistry, {
|
|
1013
|
+
description: "A unique tax code in this jurisdiction."
|
|
1014
|
+
}).optional(),
|
|
1015
|
+
jurisdiction: z.string().register(z.globalRegistry, {
|
|
1016
|
+
description: "The relevant tax jurisdiction."
|
|
1017
|
+
}).optional(),
|
|
1018
|
+
name: z.string().register(z.globalRegistry, {
|
|
1019
|
+
description: "The name of the tax item."
|
|
1020
|
+
}).optional(),
|
|
1021
|
+
rate: z.number().register(z.globalRegistry, {
|
|
1022
|
+
description: "The tax rate as a decimal (12.5% -> 0.125). You must specify either `rate` or `amount`, but not both.\n"
|
|
1023
|
+
}).optional(),
|
|
1024
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1025
|
+
description: "The tax as an absolute amount in the smallest currency unit (e.g., $10 -> 1000). You must specify either `rate` or `amount`, but not both.\n"
|
|
1026
|
+
}).optional(),
|
|
1027
|
+
type: z.literal("tax_item").register(z.globalRegistry, {
|
|
1028
|
+
description: "The type of object being returned. Use `tax_item`."
|
|
1029
|
+
}),
|
|
1030
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1031
|
+
description: "The unique identifier for this tax item."
|
|
1032
|
+
}).readonly().optional()
|
|
570
1033
|
});
|
|
571
1034
|
const zCartsItemsTaxesWithRate = zCartsItemsTaxesCommon.and(
|
|
572
1035
|
z.object({
|
|
573
|
-
rate: z.number(),
|
|
574
|
-
|
|
1036
|
+
rate: z.number().register(z.globalRegistry, {
|
|
1037
|
+
description: "The tax rate as a decimal (12.5% -> 0.125). Required when using rate-based taxation.\n"
|
|
1038
|
+
}),
|
|
1039
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1040
|
+
description: "The tax as an absolute amount. Not allowed when rate is specified.\n"
|
|
1041
|
+
}).optional()
|
|
575
1042
|
})
|
|
576
1043
|
);
|
|
577
1044
|
const zCartsItemsTaxesWithAmount = zCartsItemsTaxesCommon.and(
|
|
578
1045
|
z.object({
|
|
579
|
-
amount: z.number(),
|
|
580
|
-
|
|
1046
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1047
|
+
description: "The tax as an absolute amount in the smallest currency unit (e.g., $10 -> 1000). Required when using amount-based taxation.\n"
|
|
1048
|
+
}),
|
|
1049
|
+
rate: z.number().register(z.globalRegistry, {
|
|
1050
|
+
description: "The tax rate as a decimal. Not allowed when amount is specified.\n"
|
|
1051
|
+
}).optional()
|
|
581
1052
|
})
|
|
582
1053
|
);
|
|
583
1054
|
const zCartsItemsTaxesObject = z.union([
|
|
@@ -591,8 +1062,12 @@ const zCartItemRelationship = z.object({
|
|
|
591
1062
|
relationships: z.object({
|
|
592
1063
|
item: z.object({
|
|
593
1064
|
data: z.object({
|
|
594
|
-
type: z.string(),
|
|
595
|
-
|
|
1065
|
+
type: z.string().register(z.globalRegistry, {
|
|
1066
|
+
description: "Specifies the type of item. For example, `custom_item` or `cart_item`."
|
|
1067
|
+
}),
|
|
1068
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1069
|
+
description: "Specifies the unique identifier of the `cart_item` or `custom_item` in the cart."
|
|
1070
|
+
})
|
|
596
1071
|
})
|
|
597
1072
|
})
|
|
598
1073
|
}).optional()
|
|
@@ -602,7 +1077,11 @@ const zCartsBulkTaxes = z.object({
|
|
|
602
1077
|
zCartsItemsTaxesObject.and(zCartItemRelationship).and(
|
|
603
1078
|
z.object({
|
|
604
1079
|
meta: z.object({
|
|
605
|
-
component_product_id: z.
|
|
1080
|
+
component_product_id: z.uuid().min(1).register(z.globalRegistry, {
|
|
1081
|
+
description: "The product ID of the bundle component the tax item applies to."
|
|
1082
|
+
}).optional()
|
|
1083
|
+
}).register(z.globalRegistry, {
|
|
1084
|
+
description: "Targets the tax item at a component product of the bundle the cart item holds, instead of at the cart item itself."
|
|
606
1085
|
}).optional()
|
|
607
1086
|
})
|
|
608
1087
|
)
|
|
@@ -619,27 +1098,47 @@ const zCartsCustomDiscountsObject = z.object({
|
|
|
619
1098
|
formatted: z.string().optional()
|
|
620
1099
|
})
|
|
621
1100
|
]),
|
|
622
|
-
description: z.string(),
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
1101
|
+
description: z.string().register(z.globalRegistry, {
|
|
1102
|
+
description: "Specifies a description for the custom discount."
|
|
1103
|
+
}),
|
|
1104
|
+
discount_code: z.string().register(z.globalRegistry, {
|
|
1105
|
+
description: "Specifies the discount code used for the custom discount."
|
|
1106
|
+
}),
|
|
1107
|
+
discount_engine: z.string().register(z.globalRegistry, {
|
|
1108
|
+
description: "Specifies from where the custom discount is applied. For example, Talon.one."
|
|
1109
|
+
}),
|
|
1110
|
+
external_id: z.string().register(z.globalRegistry, {
|
|
1111
|
+
description: "Specifies an external id for the custom discount."
|
|
1112
|
+
}),
|
|
1113
|
+
type: z.literal("custom_discount").register(z.globalRegistry, {
|
|
1114
|
+
description: "Specifies the type of the resource. Always `custom_discount`."
|
|
1115
|
+
}),
|
|
1116
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1117
|
+
description: "Specifies the UUID of the custom discount."
|
|
1118
|
+
}).optional(),
|
|
628
1119
|
relationships: z.object({
|
|
629
1120
|
item: z.object({
|
|
630
1121
|
data: z.object({
|
|
631
|
-
id: z.
|
|
1122
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1123
|
+
description: "The item ID this discount is related to"
|
|
1124
|
+
}).optional(),
|
|
632
1125
|
type: z.enum(["cart_item", "custom_item"]).optional()
|
|
633
1126
|
}).optional()
|
|
634
1127
|
}).optional()
|
|
1128
|
+
}).register(z.globalRegistry, {
|
|
1129
|
+
description: "Relationships to other resources like cart items"
|
|
635
1130
|
}).optional()
|
|
636
1131
|
});
|
|
637
1132
|
const zCustomDiscountRelationshipsCartItemRequest = z.object({
|
|
638
1133
|
relationships: z.object({
|
|
639
1134
|
item: z.object({
|
|
640
1135
|
data: z.object({
|
|
641
|
-
type: z.string(),
|
|
642
|
-
|
|
1136
|
+
type: z.string().register(z.globalRegistry, {
|
|
1137
|
+
description: "Specifies the type of item. For example, `custom_item` or `cart_item`."
|
|
1138
|
+
}),
|
|
1139
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1140
|
+
description: "Specifies the unique identifier of the `cart_item` or `custom_item` in the cart."
|
|
1141
|
+
})
|
|
643
1142
|
}).optional()
|
|
644
1143
|
}).optional()
|
|
645
1144
|
}).optional()
|
|
@@ -651,31 +1150,57 @@ const zCartsBulkCustomDiscounts = z.object({
|
|
|
651
1150
|
});
|
|
652
1151
|
const zCartsBulkCustomDiscountsResponse = z.object({
|
|
653
1152
|
data: zCartsCustomDiscountsObject.optional(),
|
|
654
|
-
errors: z.array(zResponseErrorItem).
|
|
1153
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
1154
|
+
description: "Array of validation or processing errors"
|
|
1155
|
+
}).optional()
|
|
655
1156
|
});
|
|
656
1157
|
const zCartsBulkCustomDiscountsCollectionResponse = z.object({
|
|
657
1158
|
data: z.array(zCartsCustomDiscountsObject).optional(),
|
|
658
|
-
errors: z.array(zResponseErrorItem).
|
|
1159
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
1160
|
+
description: "Array of validation or processing errors"
|
|
1161
|
+
}).optional()
|
|
659
1162
|
});
|
|
660
1163
|
const zCartsCustomDiscountsResponseObject = z.object({
|
|
661
1164
|
amount: z.object({
|
|
662
|
-
amount: z.number().
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
1165
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1166
|
+
description: "Specifies an amount to be applied for the custom discount. It must be less than zero."
|
|
1167
|
+
}).optional(),
|
|
1168
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1169
|
+
description: "The currency set for the custom discount."
|
|
1170
|
+
}).optional(),
|
|
1171
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
1172
|
+
description: "The formatted value for the custom discount."
|
|
1173
|
+
}).optional()
|
|
1174
|
+
}).optional(),
|
|
1175
|
+
description: z.string().register(z.globalRegistry, {
|
|
1176
|
+
description: "Specifies a description for the custom discount."
|
|
1177
|
+
}).optional(),
|
|
1178
|
+
discount_code: z.string().register(z.globalRegistry, {
|
|
1179
|
+
description: "Specifies the discount code used for the custom discount."
|
|
1180
|
+
}).optional(),
|
|
1181
|
+
discount_engine: z.string().register(z.globalRegistry, {
|
|
1182
|
+
description: "Specifies from where the custom discount is applied. For example, Talon.one."
|
|
1183
|
+
}).optional(),
|
|
1184
|
+
external_id: z.string().register(z.globalRegistry, {
|
|
1185
|
+
description: "Specifies an external id for the custom discount."
|
|
1186
|
+
}).optional(),
|
|
1187
|
+
type: z.literal("custom_discount").register(z.globalRegistry, {
|
|
1188
|
+
description: "Specifies the type of the resource. Always `custom_discount`."
|
|
1189
|
+
}).optional(),
|
|
1190
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1191
|
+
description: "Specifies the UUID of the custom discount."
|
|
1192
|
+
}).readonly().optional(),
|
|
672
1193
|
relationships: z.object({
|
|
673
1194
|
item: z.object({
|
|
674
1195
|
data: z.object({
|
|
675
|
-
id: z.
|
|
1196
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1197
|
+
description: "The item ID this discount is related to"
|
|
1198
|
+
}).optional(),
|
|
676
1199
|
type: z.enum(["cart_item", "custom_item"]).optional()
|
|
677
1200
|
}).optional()
|
|
678
1201
|
}).optional()
|
|
1202
|
+
}).register(z.globalRegistry, {
|
|
1203
|
+
description: "Relationships to other resources like cart items"
|
|
679
1204
|
}).optional()
|
|
680
1205
|
});
|
|
681
1206
|
const zCartsCustomDiscountsEntityResponse = z.object({
|
|
@@ -685,41 +1210,73 @@ const zCartsCustomDiscountsCollectionResponse = z.object({
|
|
|
685
1210
|
data: z.array(zCartsCustomDiscountsObject).optional()
|
|
686
1211
|
});
|
|
687
1212
|
const zAddressCommon = z.object({
|
|
688
|
-
first_name: z.string(),
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
1213
|
+
first_name: z.string().register(z.globalRegistry, {
|
|
1214
|
+
description: "First name of the recipient."
|
|
1215
|
+
}),
|
|
1216
|
+
last_name: z.string().register(z.globalRegistry, {
|
|
1217
|
+
description: "Last name of the recipient."
|
|
1218
|
+
}),
|
|
1219
|
+
company_name: z.string().register(z.globalRegistry, {
|
|
1220
|
+
description: "Company of the recipient."
|
|
1221
|
+
}).optional(),
|
|
1222
|
+
line_1: z.string().register(z.globalRegistry, {
|
|
1223
|
+
description: "First line of the address."
|
|
1224
|
+
}),
|
|
1225
|
+
line_2: z.string().register(z.globalRegistry, {
|
|
1226
|
+
description: "Second line of the address."
|
|
1227
|
+
}).optional(),
|
|
1228
|
+
line_3: z.string().max(255).register(z.globalRegistry, {
|
|
1229
|
+
description: "Third line of the address."
|
|
1230
|
+
}).optional(),
|
|
1231
|
+
city: z.string().register(z.globalRegistry, {
|
|
1232
|
+
description: "City of the address."
|
|
1233
|
+
}).optional(),
|
|
1234
|
+
postcode: z.string().register(z.globalRegistry, {
|
|
1235
|
+
description: "Post code of the address."
|
|
1236
|
+
}),
|
|
1237
|
+
county: z.string().register(z.globalRegistry, {
|
|
1238
|
+
description: "County of the address."
|
|
1239
|
+
}).optional(),
|
|
1240
|
+
country: z.string().register(z.globalRegistry, {
|
|
1241
|
+
description: "Country of the address."
|
|
1242
|
+
}),
|
|
1243
|
+
region: z.string().register(z.globalRegistry, {
|
|
1244
|
+
description: "State, province, or region of the address."
|
|
1245
|
+
}).optional()
|
|
699
1246
|
});
|
|
700
1247
|
const zAddressWithRegion = zAddressCommon.and(
|
|
701
1248
|
z.object({
|
|
702
|
-
region: z.string()
|
|
1249
|
+
region: z.string().register(z.globalRegistry, {
|
|
1250
|
+
description: "State, province, or region of the address."
|
|
1251
|
+
})
|
|
703
1252
|
})
|
|
704
1253
|
);
|
|
705
1254
|
const zAddressWithCounty = zAddressCommon.and(
|
|
706
1255
|
z.object({
|
|
707
|
-
county: z.string()
|
|
1256
|
+
county: z.string().register(z.globalRegistry, {
|
|
1257
|
+
description: "County of the address."
|
|
1258
|
+
})
|
|
708
1259
|
})
|
|
709
1260
|
);
|
|
710
1261
|
const zShippingAddress = z.intersection(
|
|
711
1262
|
z.union([zAddressWithRegion, zAddressWithCounty]),
|
|
712
1263
|
z.object({
|
|
713
|
-
phone_number: z.string().
|
|
714
|
-
|
|
1264
|
+
phone_number: z.string().register(z.globalRegistry, {
|
|
1265
|
+
description: "Phone number of the shipping recipient."
|
|
1266
|
+
}).optional(),
|
|
1267
|
+
instructions: z.string().register(z.globalRegistry, {
|
|
1268
|
+
description: "Delivery instructions."
|
|
1269
|
+
}).optional()
|
|
715
1270
|
})
|
|
716
1271
|
);
|
|
717
1272
|
const zDeliveryEstimate = z.object({
|
|
718
|
-
start: z.
|
|
719
|
-
end: z.
|
|
1273
|
+
start: z.iso.datetime().optional(),
|
|
1274
|
+
end: z.iso.datetime().optional()
|
|
720
1275
|
});
|
|
721
1276
|
const zSingleRelationship = z.object({
|
|
722
1277
|
data: zRelationshipItem.optional()
|
|
1278
|
+
}).register(z.globalRegistry, {
|
|
1279
|
+
description: "Single relationship"
|
|
723
1280
|
});
|
|
724
1281
|
const zDiscounts = z.array(zDiscount);
|
|
725
1282
|
const zShippingPriceResponse = z.object({
|
|
@@ -730,14 +1287,26 @@ const zShippingPriceResponse = z.object({
|
|
|
730
1287
|
discount: zFormattedPriceData.optional()
|
|
731
1288
|
});
|
|
732
1289
|
const zNonNegativeFormattedPriceData = z.object({
|
|
733
|
-
amount: z.number().gte(0).
|
|
734
|
-
|
|
735
|
-
|
|
1290
|
+
amount: z.number().gte(0).register(z.globalRegistry, {
|
|
1291
|
+
description: "The raw total. Must be non-negative."
|
|
1292
|
+
}).optional(),
|
|
1293
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1294
|
+
description: "The currency set for this amount."
|
|
1295
|
+
}).optional(),
|
|
1296
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
1297
|
+
description: "The formatted total based on the amount and currency."
|
|
1298
|
+
}).optional()
|
|
736
1299
|
});
|
|
737
1300
|
const zDiscountFormattedPriceData = z.object({
|
|
738
|
-
amount: z.number().lte(0).
|
|
739
|
-
|
|
740
|
-
|
|
1301
|
+
amount: z.number().lte(0).register(z.globalRegistry, {
|
|
1302
|
+
description: "The discount amount. Must be non-positive (zero or negative)."
|
|
1303
|
+
}).optional(),
|
|
1304
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1305
|
+
description: "The currency set for this amount."
|
|
1306
|
+
}).optional(),
|
|
1307
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
1308
|
+
description: "The formatted total based on the amount and currency."
|
|
1309
|
+
}).optional()
|
|
741
1310
|
});
|
|
742
1311
|
const zOrderPriceWrapperMeta = z.object({
|
|
743
1312
|
with_tax: zNonNegativeFormattedPriceData,
|
|
@@ -750,6 +1319,8 @@ const zOrderPriceWrapperMeta = z.object({
|
|
|
750
1319
|
without_discount: zNonNegativeFormattedPriceData,
|
|
751
1320
|
shipping: zNonNegativeFormattedPriceData,
|
|
752
1321
|
shipping_discount: zDiscountFormattedPriceData
|
|
1322
|
+
}).register(z.globalRegistry, {
|
|
1323
|
+
description: "Order pricing information."
|
|
753
1324
|
});
|
|
754
1325
|
const zShippingGroupMeta = z.object({
|
|
755
1326
|
shipping_display_price: zShippingPriceResponse.optional(),
|
|
@@ -763,11 +1334,13 @@ const zShippingGroupResponse = z.object({
|
|
|
763
1334
|
order_id: z.string().optional(),
|
|
764
1335
|
shipping_type: z.string().optional(),
|
|
765
1336
|
tracking_reference: z.string().optional(),
|
|
766
|
-
external_ref: z.string().max(64).
|
|
1337
|
+
external_ref: z.string().max(64).register(z.globalRegistry, {
|
|
1338
|
+
description: "An optional external ID reference for a shipping group. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1339
|
+
}).optional(),
|
|
767
1340
|
address: zShippingAddress.optional(),
|
|
768
1341
|
delivery_estimate: zDeliveryEstimate.optional(),
|
|
769
|
-
created_at: z.
|
|
770
|
-
updated_at: z.
|
|
1342
|
+
created_at: z.iso.datetime().optional(),
|
|
1343
|
+
updated_at: z.iso.datetime().optional(),
|
|
771
1344
|
relationships: z.object({
|
|
772
1345
|
cart: zSingleRelationship.optional(),
|
|
773
1346
|
order: zSingleRelationship.optional(),
|
|
@@ -788,7 +1361,9 @@ const zCreateShippingGroupRequest = z.object({
|
|
|
788
1361
|
type: z.literal("shipping_group").optional(),
|
|
789
1362
|
shipping_type: z.string().optional(),
|
|
790
1363
|
tracking_reference: z.string().optional(),
|
|
791
|
-
external_ref: z.string().max(64).
|
|
1364
|
+
external_ref: z.string().max(64).register(z.globalRegistry, {
|
|
1365
|
+
description: "An optional external ID reference for a shipping group. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters."
|
|
1366
|
+
}).optional(),
|
|
792
1367
|
shipping_price: zShippingPriceRequest.optional(),
|
|
793
1368
|
address: zShippingAddress.optional(),
|
|
794
1369
|
includes_tax: z.boolean().optional(),
|
|
@@ -796,36 +1371,66 @@ const zCreateShippingGroupRequest = z.object({
|
|
|
796
1371
|
}).optional()
|
|
797
1372
|
});
|
|
798
1373
|
const zOrderPriceData = z.object({
|
|
799
|
-
amount: z.number().
|
|
800
|
-
|
|
801
|
-
|
|
1374
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1375
|
+
description: "The amount for this item."
|
|
1376
|
+
}).optional(),
|
|
1377
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1378
|
+
description: "The currency this item."
|
|
1379
|
+
}).optional(),
|
|
1380
|
+
includes_tax: z.boolean().register(z.globalRegistry, {
|
|
1381
|
+
description: "Whether this price is tax inclusive."
|
|
1382
|
+
}).optional()
|
|
802
1383
|
});
|
|
803
1384
|
const zDiscountData = z.object({
|
|
804
1385
|
amount: zOrderPriceData.optional(),
|
|
805
1386
|
code: z.string().optional(),
|
|
806
|
-
id: z.
|
|
807
|
-
promotion_source: z.string().
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1387
|
+
id: z.uuid().readonly().optional(),
|
|
1388
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
1389
|
+
description: "The source or origin of the promotion, if applicable."
|
|
1390
|
+
}).optional(),
|
|
1391
|
+
is_cart_discount: z.boolean().register(z.globalRegistry, {
|
|
1392
|
+
description: "Indicates whether the discount applies to the entire cart."
|
|
1393
|
+
}).optional(),
|
|
1394
|
+
ordinal: z.int().register(z.globalRegistry, {
|
|
1395
|
+
description: "Order in which the discount was applied."
|
|
1396
|
+
}).optional(),
|
|
1397
|
+
promotion_action_id: z.string().register(z.globalRegistry, {
|
|
1398
|
+
description: "Identifies the specific action within a multi-action rule promotion that produced this discount."
|
|
1399
|
+
}).optional()
|
|
811
1400
|
});
|
|
812
1401
|
const zOrderItemFormattedUnitPriceData = z.object({
|
|
813
1402
|
unit: zFormattedPriceData.optional(),
|
|
814
1403
|
value: zFormattedPriceData.optional()
|
|
815
1404
|
});
|
|
816
1405
|
const zOrderItemResponse = z.object({
|
|
817
|
-
type: z.string().
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1406
|
+
type: z.string().register(z.globalRegistry, {
|
|
1407
|
+
description: "The type represents the object being returned."
|
|
1408
|
+
}).optional(),
|
|
1409
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1410
|
+
description: "The unique identifier for this order item."
|
|
1411
|
+
}).readonly().optional(),
|
|
1412
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
1413
|
+
description: "The quantity of this item were ordered."
|
|
1414
|
+
}).optional(),
|
|
1415
|
+
product_id: z.string().register(z.globalRegistry, {
|
|
1416
|
+
description: "The unique identifier for this order item."
|
|
1417
|
+
}).readonly().optional(),
|
|
1418
|
+
subscription_offering_id: z.uuid().register(z.globalRegistry, {
|
|
1419
|
+
description: "The unique identifier for the subscription offering for this order item."
|
|
1420
|
+
}).readonly().optional(),
|
|
1421
|
+
name: z.string().register(z.globalRegistry, {
|
|
1422
|
+
description: "The name of this order item."
|
|
1423
|
+
}).optional(),
|
|
1424
|
+
sku: z.string().register(z.globalRegistry, {
|
|
1425
|
+
description: "The SKU code for the order item."
|
|
1426
|
+
}).optional(),
|
|
1427
|
+
location: z.string().register(z.globalRegistry, {
|
|
1428
|
+
description: "The stock location for this order item."
|
|
1429
|
+
}).readonly().optional(),
|
|
825
1430
|
unit_price: zOrderPriceData.optional(),
|
|
826
1431
|
value: zOrderPriceData.optional(),
|
|
827
1432
|
discounts: z.array(zDiscountData).optional(),
|
|
828
|
-
links: z.record(z.unknown()).optional(),
|
|
1433
|
+
links: z.record(z.string(), z.unknown()).optional(),
|
|
829
1434
|
meta: z.object({
|
|
830
1435
|
display_price: z.object({
|
|
831
1436
|
with_tax: zOrderItemFormattedUnitPriceData.optional(),
|
|
@@ -834,17 +1439,27 @@ const zOrderItemResponse = z.object({
|
|
|
834
1439
|
discount: zOrderItemFormattedUnitPriceData.optional(),
|
|
835
1440
|
without_discount: zOrderItemFormattedUnitPriceData.optional(),
|
|
836
1441
|
discounts: z.record(
|
|
1442
|
+
z.string(),
|
|
837
1443
|
z.object({
|
|
838
1444
|
amount: z.number().optional(),
|
|
839
1445
|
currency: z.string().optional(),
|
|
840
1446
|
formatted: z.string().optional(),
|
|
841
1447
|
constituents: z.record(
|
|
1448
|
+
z.string(),
|
|
842
1449
|
z.object({
|
|
843
|
-
amount: z.number().
|
|
844
|
-
|
|
845
|
-
|
|
1450
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1451
|
+
description: "The discount amount"
|
|
1452
|
+
}).optional(),
|
|
1453
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1454
|
+
description: "The currency code"
|
|
1455
|
+
}).optional(),
|
|
1456
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
1457
|
+
description: "The formatted discount amount"
|
|
1458
|
+
}).optional()
|
|
846
1459
|
})
|
|
847
|
-
).
|
|
1460
|
+
).register(z.globalRegistry, {
|
|
1461
|
+
description: "Detailed breakdown of discount constituents by ID"
|
|
1462
|
+
}).optional()
|
|
848
1463
|
})
|
|
849
1464
|
).optional(),
|
|
850
1465
|
original_price: zOrderItemFormattedUnitPriceData.optional()
|
|
@@ -854,33 +1469,62 @@ const zOrderItemResponse = z.object({
|
|
|
854
1469
|
relationships: z.object({
|
|
855
1470
|
cart_item: z.object({
|
|
856
1471
|
data: z.object({
|
|
857
|
-
type: z.string().
|
|
858
|
-
|
|
1472
|
+
type: z.string().register(z.globalRegistry, {
|
|
1473
|
+
description: "The type represents the object being returned."
|
|
1474
|
+
}).optional(),
|
|
1475
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1476
|
+
description: "The unique identifier for this item."
|
|
1477
|
+
}).readonly().optional()
|
|
859
1478
|
}).optional()
|
|
860
1479
|
}).optional(),
|
|
861
1480
|
taxes: z.object({
|
|
862
1481
|
data: z.array(zRelationshipItem).nullish()
|
|
1482
|
+
}).register(z.globalRegistry, {
|
|
1483
|
+
description: "Related tax items."
|
|
863
1484
|
}).optional(),
|
|
864
1485
|
promotions: z.object({
|
|
865
1486
|
data: z.array(zRelationshipItem).nullish()
|
|
1487
|
+
}).register(z.globalRegistry, {
|
|
1488
|
+
description: "Related promotions."
|
|
866
1489
|
}).optional()
|
|
867
1490
|
}).optional(),
|
|
868
|
-
catalog_id: z.string().
|
|
869
|
-
|
|
1491
|
+
catalog_id: z.string().register(z.globalRegistry, {
|
|
1492
|
+
description: "The unique identifier of the catalog associated with the product is shown if `catalog_source=pim` is set."
|
|
1493
|
+
}).optional(),
|
|
1494
|
+
catalog_source: z.string().register(z.globalRegistry, {
|
|
1495
|
+
description: "The catalog source. Always `pim` or `legacy`."
|
|
1496
|
+
}).optional(),
|
|
870
1497
|
bundle_configuration: z.object({
|
|
871
|
-
selected_options: z.record(z.record(z.number())).optional(),
|
|
1498
|
+
selected_options: z.record(z.string(), z.record(z.string(), z.number())).optional(),
|
|
872
1499
|
component_products: z.array(
|
|
873
1500
|
z.object({
|
|
874
|
-
id: z.string().
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1501
|
+
id: z.string().register(z.globalRegistry, {
|
|
1502
|
+
description: "Component product ID"
|
|
1503
|
+
}).optional(),
|
|
1504
|
+
type: z.string().register(z.globalRegistry, {
|
|
1505
|
+
description: "Component product type"
|
|
1506
|
+
}).optional(),
|
|
1507
|
+
attributes: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
1508
|
+
description: "Product attributes as a generic object"
|
|
1509
|
+
}).optional(),
|
|
1510
|
+
meta: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
1511
|
+
description: "Product metadata as a generic object"
|
|
1512
|
+
}).optional(),
|
|
1513
|
+
price: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
1514
|
+
description: "Product price information as a generic object"
|
|
1515
|
+
}).optional(),
|
|
1516
|
+
relationships: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
1517
|
+
description: "Product relationships as a generic object"
|
|
1518
|
+
}).optional()
|
|
880
1519
|
})
|
|
881
|
-
).
|
|
1520
|
+
).register(z.globalRegistry, {
|
|
1521
|
+
description: "Array of component products for bundle configuration"
|
|
1522
|
+
}).optional()
|
|
1523
|
+
}).register(z.globalRegistry, {
|
|
1524
|
+
description: "Configuration for bundle products."
|
|
882
1525
|
}).optional(),
|
|
883
1526
|
components: z.record(
|
|
1527
|
+
z.string(),
|
|
884
1528
|
z.object({
|
|
885
1529
|
name: z.string().optional(),
|
|
886
1530
|
options: z.array(
|
|
@@ -891,30 +1535,54 @@ const zOrderItemResponse = z.object({
|
|
|
891
1535
|
})
|
|
892
1536
|
).optional()
|
|
893
1537
|
})
|
|
894
|
-
).
|
|
895
|
-
|
|
1538
|
+
).register(z.globalRegistry, {
|
|
1539
|
+
description: "Components of the bundle product."
|
|
1540
|
+
}).optional(),
|
|
1541
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
1542
|
+
description: "Custom inputs for the order item as a generic object"
|
|
1543
|
+
}).optional(),
|
|
896
1544
|
custom_attributes: zCustomAttributes.readonly().optional(),
|
|
897
|
-
shipping_group_id: z.string().
|
|
898
|
-
|
|
899
|
-
|
|
1545
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
1546
|
+
description: "The shipping group ID for the order item"
|
|
1547
|
+
}).optional(),
|
|
1548
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
1549
|
+
description: "The promotion source for the order item"
|
|
1550
|
+
}).optional(),
|
|
1551
|
+
promotion_action_id: z.string().register(z.globalRegistry, {
|
|
1552
|
+
description: "The action ID within the rule promotion that produced this promotion item."
|
|
1553
|
+
}).readonly().optional(),
|
|
900
1554
|
subscription_configuration: z.object({
|
|
901
|
-
plan: z.string().
|
|
902
|
-
|
|
1555
|
+
plan: z.string().register(z.globalRegistry, {
|
|
1556
|
+
description: "Subscription plan details"
|
|
1557
|
+
}).optional(),
|
|
1558
|
+
pricing_option: z.string().register(z.globalRegistry, {
|
|
1559
|
+
description: "Pricing option for the subscription"
|
|
1560
|
+
}).optional()
|
|
1561
|
+
}).register(z.globalRegistry, {
|
|
1562
|
+
description: "Subscription configuration for the order item"
|
|
903
1563
|
}).optional()
|
|
904
1564
|
});
|
|
905
1565
|
const zShippingGroupEntityResponse = z.object({
|
|
906
1566
|
data: zShippingGroupResponse.optional(),
|
|
907
1567
|
included: z.object({
|
|
908
|
-
items: z.array(zOrderItemResponse).
|
|
1568
|
+
items: z.array(zOrderItemResponse).register(z.globalRegistry, {
|
|
1569
|
+
description: "Array of order items associated with this shipping group."
|
|
1570
|
+
}).optional()
|
|
1571
|
+
}).register(z.globalRegistry, {
|
|
1572
|
+
description: "Related objects that are included in the response when using the include query parameter."
|
|
909
1573
|
}).optional(),
|
|
910
|
-
errors: z.array(zResponseErrorItem).
|
|
1574
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
1575
|
+
description: "Array of validation or processing errors"
|
|
1576
|
+
}).optional()
|
|
911
1577
|
});
|
|
912
1578
|
const zUpdateCartShippingGroupRequest = z.object({
|
|
913
1579
|
data: z.object({
|
|
914
1580
|
type: z.literal("shipping_group").optional(),
|
|
915
1581
|
shipping_type: z.string().optional(),
|
|
916
1582
|
tracking_reference: z.string().optional(),
|
|
917
|
-
external_ref: z.string().max(64).
|
|
1583
|
+
external_ref: z.string().max(64).register(z.globalRegistry, {
|
|
1584
|
+
description: "An optional external ID reference for a shipping group. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters."
|
|
1585
|
+
}).optional(),
|
|
918
1586
|
shipping_price: zShippingPriceRequest.optional(),
|
|
919
1587
|
address: zShippingAddress.optional(),
|
|
920
1588
|
includes_tax: z.boolean().optional(),
|
|
@@ -934,26 +1602,37 @@ const zDataBasePayments = z.object({
|
|
|
934
1602
|
"stripe",
|
|
935
1603
|
"stripe_payment_intents"
|
|
936
1604
|
]),
|
|
937
|
-
method: z.enum([
|
|
938
|
-
"authorize"
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
"
|
|
942
|
-
|
|
943
|
-
amount: z.number().optional()
|
|
1605
|
+
method: z.enum(["authorize", "purchase", "purchase_setup", "authorize_setup"]).register(z.globalRegistry, {
|
|
1606
|
+
description: "Specifies the transaction method, such as `purchase` or `authorize`."
|
|
1607
|
+
}),
|
|
1608
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1609
|
+
description: "The amount to be paid for the transaction."
|
|
1610
|
+
}).optional()
|
|
944
1611
|
});
|
|
945
1612
|
const zElasticPathPaymentsPoweredByStripePayment = z.object({
|
|
946
1613
|
data: zDataBasePayments.and(
|
|
947
1614
|
z.object({
|
|
948
|
-
gateway: z.literal("elastic_path_payments_stripe").
|
|
1615
|
+
gateway: z.literal("elastic_path_payments_stripe").register(z.globalRegistry, {
|
|
1616
|
+
description: "Specifies the gateway. You must use `elastic_path_payments_stripe`."
|
|
1617
|
+
}).optional(),
|
|
949
1618
|
options: z.object({
|
|
950
|
-
receipt_email: z.string().
|
|
1619
|
+
receipt_email: z.string().register(z.globalRegistry, {
|
|
1620
|
+
description: "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode."
|
|
1621
|
+
}).optional(),
|
|
951
1622
|
automatic_payment_methods: z.object({
|
|
952
|
-
enabled: z.boolean().
|
|
1623
|
+
enabled: z.boolean().register(z.globalRegistry, {
|
|
1624
|
+
description: "When set to true, it displays all enabled payment methods from the Stripe dashboard. When set to false, the Stripe default, which is card, is used."
|
|
1625
|
+
}).optional()
|
|
1626
|
+
}).register(z.globalRegistry, {
|
|
1627
|
+
description: "Parent object determining whether to use Stripe's `automatic_payment_methods` setting."
|
|
953
1628
|
}).optional()
|
|
954
1629
|
}).optional(),
|
|
955
|
-
payment_method_types: z.array(z.string()).
|
|
956
|
-
|
|
1630
|
+
payment_method_types: z.array(z.string()).register(z.globalRegistry, {
|
|
1631
|
+
description: "Specifies the Stripe payment method types configured for the store. See [Stripe Documentation](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_types)."
|
|
1632
|
+
}).optional(),
|
|
1633
|
+
payment: z.string().register(z.globalRegistry, {
|
|
1634
|
+
description: "Specifies the Stripe token or source."
|
|
1635
|
+
}).optional()
|
|
957
1636
|
})
|
|
958
1637
|
).optional()
|
|
959
1638
|
});
|
|
@@ -962,44 +1641,72 @@ const zCartPaymentUpdate = z.object({
|
|
|
962
1641
|
gateway: z.string(),
|
|
963
1642
|
method: z.string(),
|
|
964
1643
|
payment_method_types: z.array(z.string()),
|
|
965
|
-
amount: z.
|
|
966
|
-
options: z.record(z.unknown()).optional()
|
|
1644
|
+
amount: z.int(),
|
|
1645
|
+
options: z.record(z.string(), z.unknown()).optional()
|
|
967
1646
|
})
|
|
968
1647
|
});
|
|
969
1648
|
const zBillingAddress = z.union([zAddressWithRegion, zAddressWithCounty]);
|
|
970
1649
|
const zCustomerCheckout = z.object({
|
|
971
1650
|
data: z.object({
|
|
972
|
-
order_number: z.string().
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
name: z.string().optional()
|
|
1651
|
+
order_number: z.string().register(z.globalRegistry, {
|
|
1652
|
+
description: "A user-managed, optional field used as an alternative to the existing `order_id`. If provided, the order-number will be sent to Authorize.net instead of the `order_id`, and will appear as the invoice number in Authorize.net transactions."
|
|
1653
|
+
}).optional(),
|
|
1654
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1655
|
+
description: "An optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
978
1656
|
}).optional(),
|
|
1657
|
+
customer: z.object({
|
|
1658
|
+
id: z.string().register(z.globalRegistry, {
|
|
1659
|
+
description: "The ID of the customer."
|
|
1660
|
+
}).optional(),
|
|
1661
|
+
email: z.string().register(z.globalRegistry, {
|
|
1662
|
+
description: "The email of the customer."
|
|
1663
|
+
}).optional(),
|
|
1664
|
+
name: z.string().register(z.globalRegistry, {
|
|
1665
|
+
description: "The name of the customer."
|
|
1666
|
+
}).optional()
|
|
1667
|
+
}),
|
|
979
1668
|
billing_address: zBillingAddress.optional(),
|
|
980
1669
|
shipping_address: zShippingAddress.optional()
|
|
981
1670
|
}).optional()
|
|
982
1671
|
});
|
|
983
1672
|
const zAccountCheckout = z.object({
|
|
984
1673
|
data: z.object({
|
|
985
|
-
order_number: z.string().
|
|
986
|
-
|
|
1674
|
+
order_number: z.string().register(z.globalRegistry, {
|
|
1675
|
+
description: "A user-managed, optional field used as an alternative to the existing `order_id`. If provided, the order-number will be sent to Authorize.net instead of the `order_id`, and will appear as the invoice number in Authorize.net transactions."
|
|
1676
|
+
}).optional(),
|
|
1677
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1678
|
+
description: "An optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1679
|
+
}).optional(),
|
|
987
1680
|
account: z.object({
|
|
988
|
-
id: z.string().
|
|
989
|
-
|
|
1681
|
+
id: z.string().register(z.globalRegistry, {
|
|
1682
|
+
description: "The account ID."
|
|
1683
|
+
}).optional(),
|
|
1684
|
+
member_id: z.string().register(z.globalRegistry, {
|
|
1685
|
+
description: "The account member ID."
|
|
1686
|
+
}).optional()
|
|
990
1687
|
}).optional(),
|
|
991
1688
|
contact: z.object({
|
|
992
|
-
name: z.string().
|
|
993
|
-
|
|
994
|
-
|
|
1689
|
+
name: z.string().register(z.globalRegistry, {
|
|
1690
|
+
description: "The name of the account member."
|
|
1691
|
+
}).optional(),
|
|
1692
|
+
email: z.email().register(z.globalRegistry, {
|
|
1693
|
+
description: "The email address of the account member."
|
|
1694
|
+
}).optional()
|
|
1695
|
+
}),
|
|
995
1696
|
billing_address: zBillingAddress.optional(),
|
|
996
1697
|
shipping_address: zShippingAddress.optional()
|
|
997
1698
|
}).optional()
|
|
998
1699
|
});
|
|
999
1700
|
const zOrderTimestamps = z.object({
|
|
1000
|
-
created_at: z.string().
|
|
1001
|
-
|
|
1002
|
-
|
|
1701
|
+
created_at: z.string().register(z.globalRegistry, {
|
|
1702
|
+
description: "The date this order was created."
|
|
1703
|
+
}).optional(),
|
|
1704
|
+
updated_at: z.string().register(z.globalRegistry, {
|
|
1705
|
+
description: "The date this order was last updated."
|
|
1706
|
+
}).optional(),
|
|
1707
|
+
fully_paid_at: z.string().register(z.globalRegistry, {
|
|
1708
|
+
description: "The date this order was fully paid. Only present for orders with payment status 'paid'."
|
|
1709
|
+
}).optional()
|
|
1003
1710
|
});
|
|
1004
1711
|
const zOrderMeta = z.object({
|
|
1005
1712
|
timestamps: zOrderTimestamps.optional(),
|
|
@@ -1014,24 +1721,48 @@ const zOrderMeta = z.object({
|
|
|
1014
1721
|
without_discount: zNonNegativeFormattedPriceData.optional(),
|
|
1015
1722
|
shipping: zNonNegativeFormattedPriceData.optional(),
|
|
1016
1723
|
shipping_discount: zDiscountFormattedPriceData.optional()
|
|
1724
|
+
}).register(z.globalRegistry, {
|
|
1725
|
+
description: "Order pricing information including amounts, tax, discounts, and payment details."
|
|
1017
1726
|
}).optional(),
|
|
1018
|
-
is_manual: z.boolean().
|
|
1727
|
+
is_manual: z.boolean().register(z.globalRegistry, {
|
|
1728
|
+
description: "Specifies if the order was created manually."
|
|
1729
|
+
}).optional()
|
|
1019
1730
|
});
|
|
1020
1731
|
const zContact = z.object({
|
|
1021
|
-
email: z.string().
|
|
1022
|
-
|
|
1732
|
+
email: z.string().register(z.globalRegistry, {
|
|
1733
|
+
description: "The email address of the contact."
|
|
1734
|
+
}).optional(),
|
|
1735
|
+
name: z.string().register(z.globalRegistry, {
|
|
1736
|
+
description: "The name of the contact."
|
|
1737
|
+
}).optional()
|
|
1023
1738
|
});
|
|
1024
1739
|
const zCustomer = z.object({
|
|
1025
|
-
name: z.string().
|
|
1026
|
-
|
|
1027
|
-
|
|
1740
|
+
name: z.string().register(z.globalRegistry, {
|
|
1741
|
+
description: "The name of the customer."
|
|
1742
|
+
}).optional(),
|
|
1743
|
+
email: z.email().register(z.globalRegistry, {
|
|
1744
|
+
description: "The email address of the customer."
|
|
1745
|
+
}).optional(),
|
|
1746
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1747
|
+
description: "The unique identifier of the customer."
|
|
1748
|
+
}).optional()
|
|
1028
1749
|
});
|
|
1029
1750
|
const zOrderResponse = z.object({
|
|
1030
|
-
type: z.literal("order").
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1751
|
+
type: z.literal("order").register(z.globalRegistry, {
|
|
1752
|
+
description: "Specifies the type of object being returned. You must use `order`."
|
|
1753
|
+
}).optional(),
|
|
1754
|
+
order_number: z.string().register(z.globalRegistry, {
|
|
1755
|
+
description: "Specifies a user-managed, optional field used as an alternative to the existing `order_id`. If provided, the order-number will be sent to Authorize.net instead of the `order_id`, and will appear as the invoice number in Authorize.net transactions."
|
|
1756
|
+
}).optional(),
|
|
1757
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1758
|
+
description: "An optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1759
|
+
}).optional(),
|
|
1760
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1761
|
+
description: "Specifies the unique identifier of the order."
|
|
1762
|
+
}).readonly().optional(),
|
|
1763
|
+
status: z.enum(["complete", "incomplete", "cancelled", "processing"]).register(z.globalRegistry, {
|
|
1764
|
+
description: "Specifies the status of the order, such as `incomplete`, `complete`, `processing`, or `cancelled`."
|
|
1765
|
+
}).optional(),
|
|
1035
1766
|
payment: z.enum([
|
|
1036
1767
|
"authorized",
|
|
1037
1768
|
"paid",
|
|
@@ -1039,12 +1770,20 @@ const zOrderResponse = z.object({
|
|
|
1039
1770
|
"refunded",
|
|
1040
1771
|
"partially_paid",
|
|
1041
1772
|
"partially_authorized"
|
|
1042
|
-
]).
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1773
|
+
]).register(z.globalRegistry, {
|
|
1774
|
+
description: "Specifies the status of the payment, such as `unpaid`, `authorized`, `paid`, or `refunded`."
|
|
1775
|
+
}).optional(),
|
|
1776
|
+
shipping: z.enum(["unfulfilled", "fulfilled"]).register(z.globalRegistry, {
|
|
1777
|
+
description: "Specifies the status of the shipment, such as `fulfilled` or `unfulfilled`."
|
|
1778
|
+
}).optional(),
|
|
1779
|
+
anonymized: z.boolean().register(z.globalRegistry, {
|
|
1780
|
+
description: "Specifies if the order is anonymized."
|
|
1781
|
+
}).optional(),
|
|
1782
|
+
payment_intent_id: z.string().register(z.globalRegistry, {
|
|
1783
|
+
description: "Stripe Payment Intent ID. Please see Stripe's Payment Intent [documentation](https://docs.stripe.com/api/payment_intents) for more information on Payment Intents."
|
|
1784
|
+
}).optional(),
|
|
1046
1785
|
custom_attributes: zCustomAttributes.optional(),
|
|
1047
|
-
links: z.record(z.unknown()).optional(),
|
|
1786
|
+
links: z.record(z.string(), z.unknown()).optional(),
|
|
1048
1787
|
meta: zOrderMeta.optional(),
|
|
1049
1788
|
billing_address: zBillingAddress.optional(),
|
|
1050
1789
|
contact: zContact.optional(),
|
|
@@ -1063,12 +1802,24 @@ const zOrderResponse = z.object({
|
|
|
1063
1802
|
const zOrderEntityResponse = z.object({
|
|
1064
1803
|
data: zOrderResponse.optional(),
|
|
1065
1804
|
included: z.object({
|
|
1066
|
-
items: z.array(zOrderItemResponse).
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1805
|
+
items: z.array(zOrderItemResponse).register(z.globalRegistry, {
|
|
1806
|
+
description: "Array of order items included in the response."
|
|
1807
|
+
}).optional(),
|
|
1808
|
+
tax_items: z.array(zTaxItemResponse).register(z.globalRegistry, {
|
|
1809
|
+
description: "Array of tax items included in the response."
|
|
1810
|
+
}).optional(),
|
|
1811
|
+
custom_discounts: z.array(zCustomDiscountResponse).register(z.globalRegistry, {
|
|
1812
|
+
description: "Array of custom discounts included in the response."
|
|
1813
|
+
}).optional(),
|
|
1814
|
+
promotions: z.array(zCondensedPromotionResponse).register(z.globalRegistry, {
|
|
1815
|
+
description: "Array of promotions included in the response."
|
|
1816
|
+
}).optional()
|
|
1817
|
+
}).register(z.globalRegistry, {
|
|
1818
|
+
description: "Optional included data such as order items, tax items, custom discounts, and promotions.\n"
|
|
1070
1819
|
}).optional(),
|
|
1071
|
-
errors: z.array(zResponseErrorItem).
|
|
1820
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
1821
|
+
description: "Array of error objects, if any errors occurred."
|
|
1822
|
+
}).optional()
|
|
1072
1823
|
});
|
|
1073
1824
|
const zResponseMetaOrders = z.object({
|
|
1074
1825
|
page: zResponsePaginationPage.optional(),
|
|
@@ -1080,34 +1831,78 @@ const zOrderCollectionResponse = z.object({
|
|
|
1080
1831
|
meta: zResponseMetaOrders.optional()
|
|
1081
1832
|
});
|
|
1082
1833
|
const zOrdersAddressData = z.object({
|
|
1083
|
-
type: z.string(),
|
|
1084
|
-
|
|
1085
|
-
|
|
1834
|
+
type: z.string().register(z.globalRegistry, {
|
|
1835
|
+
description: 'The type of the resource. You must use "order".'
|
|
1836
|
+
}),
|
|
1837
|
+
order_number: z.string().register(z.globalRegistry, {
|
|
1838
|
+
description: "Specifies a user-managed, optional field used as an alternative to the existing order_id. If provided, the order-number will be sent to Authorize.net instead of the order_id, and will appear as the invoice number in Authorize.net transactions."
|
|
1839
|
+
}).optional(),
|
|
1840
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1841
|
+
description: "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1842
|
+
}).optional(),
|
|
1086
1843
|
shipping_address: z.object({
|
|
1087
|
-
first_name: z.string().
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1844
|
+
first_name: z.string().register(z.globalRegistry, {
|
|
1845
|
+
description: "Specifies the first name of the address holder."
|
|
1846
|
+
}).optional(),
|
|
1847
|
+
last_name: z.string().register(z.globalRegistry, {
|
|
1848
|
+
description: "Specifies the last name of the address holder."
|
|
1849
|
+
}).optional(),
|
|
1850
|
+
phone_number: z.string().register(z.globalRegistry, {
|
|
1851
|
+
description: "Specifies the phone number of the address holder."
|
|
1852
|
+
}).optional(),
|
|
1853
|
+
company_name: z.string().register(z.globalRegistry, {
|
|
1854
|
+
description: "Specifies the company name."
|
|
1855
|
+
}).optional(),
|
|
1856
|
+
line_1: z.string().register(z.globalRegistry, {
|
|
1857
|
+
description: "Specifies the first line of the address."
|
|
1858
|
+
}).optional(),
|
|
1859
|
+
line_2: z.string().register(z.globalRegistry, {
|
|
1860
|
+
description: "Specifies the second line of the address."
|
|
1861
|
+
}).optional(),
|
|
1862
|
+
line_3: z.string().max(255).register(z.globalRegistry, {
|
|
1863
|
+
description: "Specifies the third line of the address."
|
|
1864
|
+
}).optional(),
|
|
1865
|
+
city: z.string().register(z.globalRegistry, {
|
|
1866
|
+
description: "Specifies the name of the city in the shipping address."
|
|
1867
|
+
}).optional(),
|
|
1868
|
+
county: z.string().register(z.globalRegistry, {
|
|
1869
|
+
description: "Specifies the county of the shipping address."
|
|
1870
|
+
}).optional(),
|
|
1871
|
+
region: z.string().register(z.globalRegistry, {
|
|
1872
|
+
description: "Specifies the state, province, or region of the shipping address."
|
|
1873
|
+
}).optional(),
|
|
1874
|
+
postcode: z.string().register(z.globalRegistry, {
|
|
1875
|
+
description: "Specifies the postcode or ZIP code of the address."
|
|
1876
|
+
}).optional(),
|
|
1877
|
+
country: z.string().register(z.globalRegistry, {
|
|
1878
|
+
description: "Specifies the country in the shipping address."
|
|
1879
|
+
}).optional(),
|
|
1880
|
+
instructions: z.string().register(z.globalRegistry, {
|
|
1881
|
+
description: "Specifies any instructions provided with the shipping address."
|
|
1882
|
+
}).optional()
|
|
1100
1883
|
})
|
|
1101
1884
|
});
|
|
1102
1885
|
const zOrdersCancelData = z.object({
|
|
1103
|
-
status: z.string(),
|
|
1104
|
-
|
|
1105
|
-
|
|
1886
|
+
status: z.string().register(z.globalRegistry, {
|
|
1887
|
+
description: "The status of the order. You can only update the status to `cancelled`."
|
|
1888
|
+
}),
|
|
1889
|
+
type: z.string().register(z.globalRegistry, {
|
|
1890
|
+
description: "The type of the resource. You must use order."
|
|
1891
|
+
}),
|
|
1892
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1893
|
+
description: "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1894
|
+
}).optional()
|
|
1106
1895
|
});
|
|
1107
1896
|
const zOrdersFulfilledData = z.object({
|
|
1108
|
-
shipping: z.string(),
|
|
1109
|
-
|
|
1110
|
-
|
|
1897
|
+
shipping: z.string().register(z.globalRegistry, {
|
|
1898
|
+
description: "The shipping status of the order. You can only update the shipping status to `fulfilled`."
|
|
1899
|
+
}),
|
|
1900
|
+
type: z.string().register(z.globalRegistry, {
|
|
1901
|
+
description: "The type of the resource. You must use order."
|
|
1902
|
+
}),
|
|
1903
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
1904
|
+
description: "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
1905
|
+
}).optional()
|
|
1111
1906
|
});
|
|
1112
1907
|
const zOrdersUpdateRequest = z.object({
|
|
1113
1908
|
data: z.union([zOrdersAddressData, zOrdersCancelData, zOrdersFulfilledData]).optional()
|
|
@@ -1115,13 +1910,23 @@ const zOrdersUpdateRequest = z.object({
|
|
|
1115
1910
|
const zOrderItemCollectionResponse = z.object({
|
|
1116
1911
|
data: z.array(zOrderItemResponse).optional(),
|
|
1117
1912
|
included: z.object({
|
|
1118
|
-
tax_items: z.array(zTaxItemResponse).
|
|
1119
|
-
|
|
1120
|
-
|
|
1913
|
+
tax_items: z.array(zTaxItemResponse).register(z.globalRegistry, {
|
|
1914
|
+
description: "Array of tax items included in the response."
|
|
1915
|
+
}).optional(),
|
|
1916
|
+
custom_discounts: z.array(zCustomDiscountResponse).register(z.globalRegistry, {
|
|
1917
|
+
description: "Array of custom discounts included in the response."
|
|
1918
|
+
}).optional(),
|
|
1919
|
+
promotions: z.array(zCondensedPromotionResponse).register(z.globalRegistry, {
|
|
1920
|
+
description: "Array of promotions included in the response."
|
|
1921
|
+
}).optional()
|
|
1922
|
+
}).register(z.globalRegistry, {
|
|
1923
|
+
description: "Optional included data such as tax items, custom discounts, and promotions.\n"
|
|
1121
1924
|
}).optional()
|
|
1122
1925
|
});
|
|
1123
1926
|
const zOrdersAnonymizeData = z.object({
|
|
1124
|
-
order_ids: z.array(z.string()).
|
|
1927
|
+
order_ids: z.array(z.string()).register(z.globalRegistry, {
|
|
1928
|
+
description: "The unique identifiers of the orders to be anonymized. You can anonymize multiple orders at the same time."
|
|
1929
|
+
}).optional()
|
|
1125
1930
|
});
|
|
1126
1931
|
const zOrdersAnonymizeRequest = z.object({
|
|
1127
1932
|
data: zOrdersAnonymizeData.optional()
|
|
@@ -1130,14 +1935,28 @@ const zOrdersListResponse = z.object({
|
|
|
1130
1935
|
data: z.array(zOrderResponse)
|
|
1131
1936
|
});
|
|
1132
1937
|
const zFailureDetails = z.object({
|
|
1133
|
-
code: z.string().
|
|
1134
|
-
|
|
1938
|
+
code: z.string().register(z.globalRegistry, {
|
|
1939
|
+
description: "Machine-readable failure or error code from the payment gateway."
|
|
1940
|
+
}).optional(),
|
|
1941
|
+
reason: z.string().register(z.globalRegistry, {
|
|
1942
|
+
description: "Human-readable failure reason or error message from the payment gateway."
|
|
1943
|
+
}).optional()
|
|
1944
|
+
}).register(z.globalRegistry, {
|
|
1945
|
+
description: "Non-PII payment failure information from the payment gateway. Only present on failed transactions where the gateway provided structured failure details."
|
|
1135
1946
|
});
|
|
1136
1947
|
const zTransactionResponse = z.object({
|
|
1137
|
-
id: z.
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1948
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
1949
|
+
description: "The ID of the transaction."
|
|
1950
|
+
}).readonly().optional(),
|
|
1951
|
+
reference: z.string().register(z.globalRegistry, {
|
|
1952
|
+
description: "The payment gateway reference."
|
|
1953
|
+
}).optional(),
|
|
1954
|
+
name: z.string().register(z.globalRegistry, {
|
|
1955
|
+
description: "A custom name associated with the payment method."
|
|
1956
|
+
}).optional(),
|
|
1957
|
+
custom_reference: z.string().register(z.globalRegistry, {
|
|
1958
|
+
description: "A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field."
|
|
1959
|
+
}).optional(),
|
|
1141
1960
|
gateway: z.enum([
|
|
1142
1961
|
"adyen",
|
|
1143
1962
|
"authorize_net",
|
|
@@ -1150,31 +1969,69 @@ const zTransactionResponse = z.object({
|
|
|
1150
1969
|
"stripe",
|
|
1151
1970
|
"stripe_payment_intents",
|
|
1152
1971
|
"stripe_platform_account"
|
|
1153
|
-
]).
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1972
|
+
]).register(z.globalRegistry, {
|
|
1973
|
+
description: "The name of the payment gateway used."
|
|
1974
|
+
}).optional(),
|
|
1975
|
+
amount: z.number().register(z.globalRegistry, {
|
|
1976
|
+
description: "The amount for this transaction."
|
|
1977
|
+
}).optional(),
|
|
1978
|
+
refunded_amount: z.number().register(z.globalRegistry, {
|
|
1979
|
+
description: "The refunded amount."
|
|
1980
|
+
}).optional(),
|
|
1981
|
+
currency: z.string().register(z.globalRegistry, {
|
|
1982
|
+
description: "The transaction currency."
|
|
1983
|
+
}).optional(),
|
|
1984
|
+
transaction_type: z.enum(["purchase", "authorize", "capture", "refund"]).register(z.globalRegistry, {
|
|
1985
|
+
description: "The type of transaction, such as `purchase`, `capture`, `authorize` or `refund`."
|
|
1986
|
+
}).optional(),
|
|
1987
|
+
type: z.string().register(z.globalRegistry, {
|
|
1988
|
+
description: "The type of object being returned."
|
|
1989
|
+
}).optional(),
|
|
1990
|
+
status: z.string().register(z.globalRegistry, {
|
|
1991
|
+
description: "The status provided by the gateway for this transaction, such as `complete` or `failed`."
|
|
1992
|
+
}).optional(),
|
|
1160
1993
|
payment_details: z.object({
|
|
1161
|
-
detailed_status: z.string().
|
|
1994
|
+
detailed_status: z.string().register(z.globalRegistry, {
|
|
1995
|
+
description: "Detailed status from the payment gateway."
|
|
1996
|
+
}).optional()
|
|
1997
|
+
}).register(z.globalRegistry, {
|
|
1998
|
+
description: "Payment gateway specific details."
|
|
1162
1999
|
}).optional(),
|
|
1163
2000
|
failure_details: zFailureDetails.optional(),
|
|
1164
|
-
payment_intent: z.record(z.unknown()).
|
|
1165
|
-
|
|
1166
|
-
|
|
2001
|
+
payment_intent: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2002
|
+
description: "Payment intent details."
|
|
2003
|
+
}).optional(),
|
|
2004
|
+
capture_mechanism: z.enum(["automatic", "manual"]).register(z.globalRegistry, {
|
|
2005
|
+
description: "The mechanism used for capturing the transaction."
|
|
2006
|
+
}).optional(),
|
|
2007
|
+
refund_mechanism: z.enum(["automatic", "manual"]).register(z.globalRegistry, {
|
|
2008
|
+
description: "The mechanism used for refunding the transaction."
|
|
2009
|
+
}).optional(),
|
|
1167
2010
|
client_parameters: z.object({
|
|
1168
|
-
redirect_url: z.string().
|
|
1169
|
-
|
|
1170
|
-
|
|
2011
|
+
redirect_url: z.string().register(z.globalRegistry, {
|
|
2012
|
+
description: "URL to redirect the client after payment."
|
|
2013
|
+
}).optional(),
|
|
2014
|
+
secret: z.string().register(z.globalRegistry, {
|
|
2015
|
+
description: "Client secret for payment processing."
|
|
2016
|
+
}).optional(),
|
|
2017
|
+
token: z.string().register(z.globalRegistry, {
|
|
2018
|
+
description: "Client token for payment processing."
|
|
2019
|
+
}).optional()
|
|
2020
|
+
}).register(z.globalRegistry, {
|
|
2021
|
+
description: "Client-specific parameters for payment processing."
|
|
2022
|
+
}).optional(),
|
|
2023
|
+
next_actions: z.array(z.string()).register(z.globalRegistry, {
|
|
2024
|
+
description: "Array of next actions for the transaction."
|
|
1171
2025
|
}).optional(),
|
|
1172
|
-
next_actions: z.array(z.string()).optional(),
|
|
1173
2026
|
relationships: z.object({
|
|
1174
2027
|
order: z.object({
|
|
1175
2028
|
data: z.object({
|
|
1176
|
-
type: z.string().
|
|
1177
|
-
|
|
2029
|
+
type: z.string().register(z.globalRegistry, {
|
|
2030
|
+
description: "Represents the type of the object being returned. It is always `order`."
|
|
2031
|
+
}).optional(),
|
|
2032
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
2033
|
+
description: "The ID of the order."
|
|
2034
|
+
}).optional()
|
|
1178
2035
|
}).optional()
|
|
1179
2036
|
}).optional()
|
|
1180
2037
|
}).optional(),
|
|
@@ -1191,84 +2048,148 @@ const zTransactionEntityResponse = z.object({
|
|
|
1191
2048
|
});
|
|
1192
2049
|
const zDataAdyenPayment = zDataBasePayments.and(
|
|
1193
2050
|
z.object({
|
|
1194
|
-
gateway: z.literal("adyen"),
|
|
2051
|
+
gateway: z.literal("adyen").register(z.globalRegistry, {
|
|
2052
|
+
description: "Specifies the gateway. You must use `adyen`."
|
|
2053
|
+
}),
|
|
1195
2054
|
options: z.object({
|
|
1196
|
-
shopper_reference: z.string().
|
|
1197
|
-
|
|
2055
|
+
shopper_reference: z.string().register(z.globalRegistry, {
|
|
2056
|
+
description: "The shopper reference token associated with the saved payment method."
|
|
2057
|
+
}).optional(),
|
|
2058
|
+
recurring_processing_model: z.string().register(z.globalRegistry, {
|
|
2059
|
+
description: "Enter CardOnFile for a one-time purchase."
|
|
2060
|
+
}).optional()
|
|
1198
2061
|
}).optional(),
|
|
1199
|
-
payment: z.string()
|
|
2062
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2063
|
+
description: "The Adyen recurringDetailReference payment method identifier."
|
|
2064
|
+
})
|
|
1200
2065
|
})
|
|
1201
2066
|
);
|
|
1202
2067
|
const zDataAuthorizeNetPayment = zDataBasePayments.and(
|
|
1203
2068
|
z.object({
|
|
1204
|
-
gateway: z.literal("authorize_net"),
|
|
2069
|
+
gateway: z.literal("authorize_net").register(z.globalRegistry, {
|
|
2070
|
+
description: "Specifies the gateway. You must use `authorize_net`."
|
|
2071
|
+
}),
|
|
1205
2072
|
options: z.object({
|
|
1206
|
-
customer_payment_profile_id: z.string().
|
|
2073
|
+
customer_payment_profile_id: z.string().register(z.globalRegistry, {
|
|
2074
|
+
description: "The Authorize.net customer payment profile ID."
|
|
2075
|
+
}).optional()
|
|
1207
2076
|
}).optional(),
|
|
1208
|
-
payment: z.string()
|
|
2077
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2078
|
+
description: "The Authorize.net customer profile ID."
|
|
2079
|
+
})
|
|
1209
2080
|
})
|
|
1210
2081
|
);
|
|
1211
2082
|
const zDataBraintreePayment = zDataBasePayments.and(
|
|
1212
2083
|
z.object({
|
|
1213
|
-
gateway: z.literal("braintree"),
|
|
1214
|
-
|
|
2084
|
+
gateway: z.literal("braintree").register(z.globalRegistry, {
|
|
2085
|
+
description: "Specifies the gateway. You must use `braintree`."
|
|
2086
|
+
}),
|
|
2087
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2088
|
+
description: "The Braintree Customer ID that you want to bill."
|
|
2089
|
+
})
|
|
1215
2090
|
})
|
|
1216
2091
|
);
|
|
1217
2092
|
const zDataCardConnectPayment = zDataBasePayments.and(
|
|
1218
2093
|
z.object({
|
|
1219
|
-
gateway: z.literal("card_connect"),
|
|
1220
|
-
|
|
2094
|
+
gateway: z.literal("card_connect").register(z.globalRegistry, {
|
|
2095
|
+
description: "Specifies the gateway. You must use `card_connect`."
|
|
2096
|
+
}),
|
|
2097
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2098
|
+
description: "Enter account_id, profile_id from CardPointe API. For example, 1|16178397535388255208."
|
|
2099
|
+
})
|
|
1221
2100
|
})
|
|
1222
2101
|
);
|
|
1223
2102
|
const zDataCyberSourcePayment = zDataBasePayments.and(
|
|
1224
2103
|
z.object({
|
|
1225
|
-
gateway: z.literal("cyber_source"),
|
|
1226
|
-
|
|
2104
|
+
gateway: z.literal("cyber_source").register(z.globalRegistry, {
|
|
2105
|
+
description: "Specifies the gateway. You must use `cyber_source`."
|
|
2106
|
+
}),
|
|
2107
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2108
|
+
description: "The CyberSource token."
|
|
2109
|
+
})
|
|
1227
2110
|
})
|
|
1228
2111
|
);
|
|
1229
2112
|
const zDataManualPayment = zDataBasePayments.and(
|
|
1230
2113
|
z.object({
|
|
1231
|
-
gateway: z.literal("manual"),
|
|
2114
|
+
gateway: z.literal("manual").register(z.globalRegistry, {
|
|
2115
|
+
description: "Specifies the type of payment gateway. You must use `manual`."
|
|
2116
|
+
}),
|
|
1232
2117
|
paymentmethod_meta: z.object({
|
|
1233
|
-
custom_reference: z.string().
|
|
1234
|
-
|
|
2118
|
+
custom_reference: z.string().register(z.globalRegistry, {
|
|
2119
|
+
description: "A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend not to include personal information in this field."
|
|
2120
|
+
}).optional(),
|
|
2121
|
+
name: z.string().register(z.globalRegistry, {
|
|
2122
|
+
description: "A custom name associated with the payment method."
|
|
2123
|
+
}).optional()
|
|
1235
2124
|
}).optional()
|
|
1236
2125
|
})
|
|
1237
2126
|
);
|
|
1238
2127
|
const zDataPayPalExpressCheckoutPayment = zDataBasePayments.and(
|
|
1239
2128
|
z.object({
|
|
1240
|
-
gateway: z.literal("paypal_express_checkout"),
|
|
2129
|
+
gateway: z.literal("paypal_express_checkout").register(z.globalRegistry, {
|
|
2130
|
+
description: "Specifies the type of payment gateway. You must use `paypal_express_checkout`."
|
|
2131
|
+
}),
|
|
1241
2132
|
options: z.object({
|
|
1242
|
-
description: z.string().
|
|
1243
|
-
|
|
2133
|
+
description: z.string().register(z.globalRegistry, {
|
|
2134
|
+
description: "The description for the payment."
|
|
2135
|
+
}).optional(),
|
|
2136
|
+
soft_descriptor: z.string().register(z.globalRegistry, {
|
|
2137
|
+
description: "The descriptor appended to PayPal generated descriptor that is visible on the card statement of the payer."
|
|
2138
|
+
}).optional(),
|
|
1244
2139
|
application_context: z.object({
|
|
1245
|
-
brand_name: z.string().
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
2140
|
+
brand_name: z.string().register(z.globalRegistry, {
|
|
2141
|
+
description: "The label that overrides the business name in the PayPal account on the PayPal site."
|
|
2142
|
+
}).optional(),
|
|
2143
|
+
locale: z.string().register(z.globalRegistry, {
|
|
2144
|
+
description: "The locale pages that appear based on language and country code. PayPal supports a five-character code. For example, ja-JP."
|
|
2145
|
+
}).optional(),
|
|
2146
|
+
landing_page: z.string().register(z.globalRegistry, {
|
|
2147
|
+
description: "The type of landing page to show on the PayPal site for customer checkout. Use values LOGIN, BILLING, or NO_PREFERENCE."
|
|
2148
|
+
}).optional(),
|
|
2149
|
+
shipping_preference: z.string().register(z.globalRegistry, {
|
|
2150
|
+
description: "The shipping preference. Use SET_PROVIDED_ADDRESS value. This parameter does allow the user to change their address on PayPal site."
|
|
2151
|
+
}).optional(),
|
|
2152
|
+
user_action: z.string().register(z.globalRegistry, {
|
|
2153
|
+
description: "If you set `useraction=commit` in the query string, the flow redirects the buyer to the PayPal payment page and displays a Pay Now button. When the shopper clicks **Pay Now**, call `DoExpressCheckoutPayment` to complete the payment without additional interaction from the shopper. Choose this flow when you know the final payment amount when you initiate the checkout flow."
|
|
2154
|
+
}).optional(),
|
|
2155
|
+
return_url: z.string().register(z.globalRegistry, {
|
|
2156
|
+
description: "The callback URL for PayPal to redirect the user in the case of approved payment."
|
|
2157
|
+
}).optional(),
|
|
2158
|
+
cancel_url: z.string().register(z.globalRegistry, {
|
|
2159
|
+
description: "The callback URL for PayPal to redirect user in the case a cancelled payment."
|
|
2160
|
+
}).optional()
|
|
1252
2161
|
}).optional()
|
|
1253
2162
|
}).optional()
|
|
1254
2163
|
})
|
|
1255
2164
|
);
|
|
1256
2165
|
const zDataStripePayment = zDataBasePayments.and(
|
|
1257
2166
|
z.object({
|
|
1258
|
-
gateway: z.literal("stripe"),
|
|
2167
|
+
gateway: z.literal("stripe").register(z.globalRegistry, {
|
|
2168
|
+
description: "Specifies the type of payment gateway. You must use `stripe`."
|
|
2169
|
+
}),
|
|
1259
2170
|
options: z.object({
|
|
1260
|
-
receipt_email: z.string().
|
|
2171
|
+
receipt_email: z.string().register(z.globalRegistry, {
|
|
2172
|
+
description: "The option to provide an email for Stripe receipts. Specify live mode to access this feature."
|
|
2173
|
+
}).optional()
|
|
1261
2174
|
}).optional(),
|
|
1262
|
-
payment: z.string().
|
|
2175
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2176
|
+
description: "The Stripe token or source."
|
|
2177
|
+
}).optional()
|
|
1263
2178
|
})
|
|
1264
2179
|
);
|
|
1265
2180
|
const zDataStripePaymentIntentsPayment = zDataBasePayments.and(
|
|
1266
2181
|
z.object({
|
|
1267
|
-
gateway: z.literal("stripe_payment_intents"),
|
|
2182
|
+
gateway: z.literal("stripe_payment_intents").register(z.globalRegistry, {
|
|
2183
|
+
description: "Specifies the type of payment gateway. You must use `stripe_payment_intents`."
|
|
2184
|
+
}),
|
|
1268
2185
|
options: z.object({
|
|
1269
|
-
receipt_email: z.string().
|
|
2186
|
+
receipt_email: z.string().register(z.globalRegistry, {
|
|
2187
|
+
description: "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode."
|
|
2188
|
+
}).optional()
|
|
1270
2189
|
}).optional(),
|
|
1271
|
-
payment: z.string().
|
|
2190
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2191
|
+
description: "Specifies the Stripe token or source."
|
|
2192
|
+
}).optional()
|
|
1272
2193
|
})
|
|
1273
2194
|
);
|
|
1274
2195
|
const zDataPaymentObject = z.union([
|
|
@@ -1287,7 +2208,7 @@ const zPaymentsRequest = z.object({
|
|
|
1287
2208
|
data: zDataPaymentObject.optional()
|
|
1288
2209
|
});
|
|
1289
2210
|
const zOrdersTransactionsConfirmRequest = z.object({
|
|
1290
|
-
data: z.record(z.unknown()).optional()
|
|
2211
|
+
data: z.record(z.string(), z.unknown()).optional()
|
|
1291
2212
|
});
|
|
1292
2213
|
const zOrdersTransactionsCaptureRequest = z.object({
|
|
1293
2214
|
data: z.object({
|
|
@@ -1299,9 +2220,13 @@ const zOrdersTransactionsCaptureRequest = z.object({
|
|
|
1299
2220
|
});
|
|
1300
2221
|
const zOrdersTransactionsRefundRequest = z.object({
|
|
1301
2222
|
data: z.object({
|
|
1302
|
-
amount: z.number().
|
|
2223
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2224
|
+
description: "The amount value to be refunded. If this field is not provided, it will be considered as manual refund (Mark as Refunded) and the refund process must be manually handled via payment provider. If the amount value is same as payment value, then it will be treated as a full refund and sent to the payment provider to process refund automatically."
|
|
2225
|
+
}).optional(),
|
|
1303
2226
|
options: z.object({
|
|
1304
|
-
note: z.string().
|
|
2227
|
+
note: z.string().register(z.globalRegistry, {
|
|
2228
|
+
description: "Provides comments about the refund. It is used by PayPal Express."
|
|
2229
|
+
}).optional()
|
|
1305
2230
|
}).optional()
|
|
1306
2231
|
}).optional()
|
|
1307
2232
|
});
|
|
@@ -1313,8 +2238,10 @@ const zResponseData = z.object({
|
|
|
1313
2238
|
});
|
|
1314
2239
|
const zOrdersTransactionsCancelRequest = z.object({
|
|
1315
2240
|
data: z.object({
|
|
1316
|
-
options: z.record(z.unknown()).optional(),
|
|
1317
|
-
reason: z.string().
|
|
2241
|
+
options: z.record(z.string(), z.unknown()).optional(),
|
|
2242
|
+
reason: z.string().register(z.globalRegistry, {
|
|
2243
|
+
description: "Specifies the reason for canceling the transaction. The reason may include `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`."
|
|
2244
|
+
}).optional()
|
|
1318
2245
|
}).optional()
|
|
1319
2246
|
});
|
|
1320
2247
|
const zUpdateOrderShippingGroupRequest = z.object({
|
|
@@ -1322,37 +2249,73 @@ const zUpdateOrderShippingGroupRequest = z.object({
|
|
|
1322
2249
|
type: z.literal("shipping_group").optional(),
|
|
1323
2250
|
shipping_type: z.string().optional(),
|
|
1324
2251
|
tracking_reference: z.string().optional(),
|
|
1325
|
-
external_ref: z.string().max(64).
|
|
2252
|
+
external_ref: z.string().max(64).register(z.globalRegistry, {
|
|
2253
|
+
description: "An optional external ID reference for a shipping group. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters."
|
|
2254
|
+
}).optional(),
|
|
1326
2255
|
address: zShippingAddress.optional(),
|
|
1327
2256
|
delivery_estimate: zDeliveryEstimate.optional()
|
|
1328
2257
|
}).optional()
|
|
1329
2258
|
});
|
|
1330
2259
|
const zSettingsCart = z.object({
|
|
1331
2260
|
data: z.object({
|
|
1332
|
-
type: z.string(),
|
|
1333
|
-
|
|
1334
|
-
|
|
2261
|
+
type: z.string().register(z.globalRegistry, {
|
|
2262
|
+
description: "Describes the type of request payload you're sending. Set this value to `settings`."
|
|
2263
|
+
}),
|
|
2264
|
+
id: z.string().register(z.globalRegistry, {
|
|
2265
|
+
description: "The unique identifier for the cart settings."
|
|
2266
|
+
}).readonly().optional(),
|
|
2267
|
+
cart_expiry_days: z.int().register(z.globalRegistry, {
|
|
2268
|
+
description: "Indicates the number of days before a cart expires."
|
|
2269
|
+
}).optional(),
|
|
1335
2270
|
discounts: z.object({
|
|
1336
|
-
custom_discounts_enabled: z.boolean().
|
|
1337
|
-
|
|
2271
|
+
custom_discounts_enabled: z.boolean().register(z.globalRegistry, {
|
|
2272
|
+
description: "When `true`, custom discounts are enabled. Default is false. This setting only affects the new empty carts while the existing active carts will not be affected."
|
|
2273
|
+
}).optional(),
|
|
2274
|
+
use_rule_promotions: z.boolean().register(z.globalRegistry, {
|
|
2275
|
+
description: "When set to `true`, this parameter allows the cart to use rule promotions."
|
|
2276
|
+
}).optional()
|
|
1338
2277
|
}).optional(),
|
|
1339
2278
|
inventories: z.object({
|
|
1340
|
-
defer_inventory_check: z.boolean().
|
|
2279
|
+
defer_inventory_check: z.boolean().register(z.globalRegistry, {
|
|
2280
|
+
description: "When `true`, inventory checks are not performed when adding products to a cart but still occur on checkout as normal. Default is false. This setting only affects the new empty carts while the existing active carts will not be affected."
|
|
2281
|
+
}).optional()
|
|
1341
2282
|
}).optional(),
|
|
1342
2283
|
items: z.object({
|
|
1343
|
-
separate_items_by_location: z.boolean().
|
|
2284
|
+
separate_items_by_location: z.boolean().register(z.globalRegistry, {
|
|
2285
|
+
description: "When `true`, cart items with the same SKU but different locations are kept as separate line items instead of being merged. When `false` (default), items with the same SKU are merged and the location is updated to the most recent value."
|
|
2286
|
+
}).optional()
|
|
1344
2287
|
}).optional(),
|
|
1345
|
-
show_all_carts: z.boolean().
|
|
2288
|
+
show_all_carts: z.boolean().register(z.globalRegistry, {
|
|
2289
|
+
description: "When `true`, admins (users with admin scope) can retrieve all carts in the store via `GET /v2/carts`, regardless of customer or account associations. When `false`, admins can only see carts that are registered (associated with customers or accounts).\n\nFor new stores, this defaults to `true`. For existing stores created before this feature was introduced, this defaults to `false` to maintain backward compatibility.\n"
|
|
2290
|
+
}).optional()
|
|
1346
2291
|
}).optional()
|
|
1347
2292
|
});
|
|
1348
2293
|
const zCartItemObject = zCartItemObjectData.and(zCartItemResponse);
|
|
2294
|
+
const zCustomItemCartObject = zCartItemResponse.and(
|
|
2295
|
+
z.object({
|
|
2296
|
+
type: z.literal("custom_item"),
|
|
2297
|
+
quantity: z.int()
|
|
2298
|
+
})
|
|
2299
|
+
);
|
|
2300
|
+
const zSubscriptionItemCartObject = zCartItemResponse.and(
|
|
2301
|
+
z.object({
|
|
2302
|
+
type: z.literal("subscription_item"),
|
|
2303
|
+
quantity: z.int()
|
|
2304
|
+
})
|
|
2305
|
+
);
|
|
2306
|
+
const zPromotionItemCartObject = zCartItemResponse.and(
|
|
2307
|
+
z.object({
|
|
2308
|
+
type: z.literal("promotion_item"),
|
|
2309
|
+
quantity: z.int()
|
|
2310
|
+
})
|
|
2311
|
+
);
|
|
1349
2312
|
const zCartsResponse = z.object({
|
|
1350
2313
|
data: z.array(
|
|
1351
2314
|
z.union([
|
|
1352
2315
|
zCartItemObject,
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
2316
|
+
zCustomItemCartObject,
|
|
2317
|
+
zSubscriptionItemCartObject,
|
|
2318
|
+
zPromotionItemCartObject
|
|
1356
2319
|
])
|
|
1357
2320
|
).optional(),
|
|
1358
2321
|
meta: z.object({
|
|
@@ -1362,7 +2325,10 @@ const zCartsResponse = z.object({
|
|
|
1362
2325
|
tax: zFormattedPriceData.optional(),
|
|
1363
2326
|
discount: zFormattedPriceData.optional(),
|
|
1364
2327
|
without_discount: zFormattedPriceData.optional(),
|
|
2328
|
+
shipping: zFormattedPriceData.optional(),
|
|
2329
|
+
shipping_discount: zFormattedPriceData.optional(),
|
|
1365
2330
|
discounts: z.record(
|
|
2331
|
+
z.string(),
|
|
1366
2332
|
z.object({
|
|
1367
2333
|
amount: z.number().optional(),
|
|
1368
2334
|
currency: z.string().optional(),
|
|
@@ -1377,28 +2343,46 @@ const zCartItemsResponse = z.object({
|
|
|
1377
2343
|
data: z.array(
|
|
1378
2344
|
z.union([
|
|
1379
2345
|
zCartItemObject,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
2346
|
+
zCustomItemCartObject,
|
|
2347
|
+
zSubscriptionItemCartObject,
|
|
2348
|
+
zPromotionItemCartObject
|
|
1383
2349
|
])
|
|
1384
2350
|
).optional()
|
|
1385
2351
|
});
|
|
1386
2352
|
const zDataStripeConnectPayment = zDataBasePayments.and(
|
|
1387
2353
|
z.object({
|
|
1388
|
-
gateway: z.enum(["stripe_connect"]),
|
|
2354
|
+
gateway: z.enum(["stripe_connect"]).register(z.globalRegistry, {
|
|
2355
|
+
description: "Specifies the type of payment gateway. You must use `stripe_connect`."
|
|
2356
|
+
}),
|
|
1389
2357
|
options: z.object({
|
|
1390
|
-
receipt_email: z.string().
|
|
2358
|
+
receipt_email: z.string().register(z.globalRegistry, {
|
|
2359
|
+
description: "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode."
|
|
2360
|
+
}).optional()
|
|
1391
2361
|
}).optional(),
|
|
1392
|
-
payment: z.string().
|
|
2362
|
+
payment: z.string().register(z.globalRegistry, {
|
|
2363
|
+
description: "Specifies the Stripe token or source."
|
|
2364
|
+
}).optional()
|
|
1393
2365
|
})
|
|
1394
2366
|
);
|
|
1395
2367
|
const zCartsCustomDiscountsUpdateObject = z.object({
|
|
1396
|
-
amount: z.
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
2368
|
+
amount: z.int().lt(0).register(z.globalRegistry, {
|
|
2369
|
+
description: "Specifies an amount to be applied for the custom discount, in the currency's smallest unit. It must be less than zero."
|
|
2370
|
+
}).optional(),
|
|
2371
|
+
description: z.string().register(z.globalRegistry, {
|
|
2372
|
+
description: "Specifies a description for the custom discount."
|
|
2373
|
+
}).optional(),
|
|
2374
|
+
discount_code: z.string().register(z.globalRegistry, {
|
|
2375
|
+
description: "Specifies the discount code used for the custom discount."
|
|
2376
|
+
}).optional(),
|
|
2377
|
+
discount_engine: z.string().register(z.globalRegistry, {
|
|
2378
|
+
description: "Specifies from where the custom discount is applied. For example, Talon.one."
|
|
2379
|
+
}).optional(),
|
|
2380
|
+
external_id: z.string().register(z.globalRegistry, {
|
|
2381
|
+
description: "Specifies an external id for the custom discount."
|
|
2382
|
+
}).optional(),
|
|
2383
|
+
type: z.literal("custom_discount").register(z.globalRegistry, {
|
|
2384
|
+
description: "Specifies the type of the resource. Always `custom_discount`."
|
|
2385
|
+
})
|
|
1402
2386
|
});
|
|
1403
2387
|
const zCartsCustomDiscountsEntityRequest = z.object({
|
|
1404
2388
|
data: zCartsCustomDiscountsUpdateObject.optional()
|
|
@@ -1406,53 +2390,836 @@ const zCartsCustomDiscountsEntityRequest = z.object({
|
|
|
1406
2390
|
const zCartsCustomDiscountsCreateRequest = z.object({
|
|
1407
2391
|
data: zCartsCustomDiscountsObject
|
|
1408
2392
|
});
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1411
|
-
|
|
2393
|
+
const zCondensedPromotionResponseWritable = z.object({
|
|
2394
|
+
type: z.literal("promotion").register(z.globalRegistry, {
|
|
2395
|
+
description: "Specifies the type of the resource. Always `promotion`."
|
|
2396
|
+
}).optional(),
|
|
2397
|
+
name: z.string().register(z.globalRegistry, {
|
|
2398
|
+
description: "The name of the promotion."
|
|
2399
|
+
}).optional(),
|
|
2400
|
+
description: z.string().register(z.globalRegistry, {
|
|
2401
|
+
description: "The description of the promotion."
|
|
2402
|
+
}).optional(),
|
|
2403
|
+
automatic: z.boolean().register(z.globalRegistry, {
|
|
2404
|
+
description: "Whether the promotion is applied automatically."
|
|
2405
|
+
}).optional(),
|
|
2406
|
+
promotion_type: z.string().register(z.globalRegistry, {
|
|
2407
|
+
description: "The type of promotion (for v1 promotions)."
|
|
2408
|
+
}).optional(),
|
|
2409
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
2410
|
+
description: "The source of the promotion (for rule promotions)."
|
|
2411
|
+
}).optional(),
|
|
2412
|
+
start: z.iso.datetime().register(z.globalRegistry, {
|
|
2413
|
+
description: "The start date and time of the promotion."
|
|
2414
|
+
}).optional(),
|
|
2415
|
+
end: z.iso.datetime().register(z.globalRegistry, {
|
|
2416
|
+
description: "The end date and time of the promotion."
|
|
2417
|
+
}).optional()
|
|
1412
2418
|
});
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
2419
|
+
const zCartEntityResponseWritable = z.object({
|
|
2420
|
+
data: zCartResponse.optional(),
|
|
2421
|
+
included: z.object({
|
|
2422
|
+
custom_discounts: z.array(zCustomDiscountResponse).optional(),
|
|
2423
|
+
promotions: z.array(zCondensedPromotionResponseWritable).optional()
|
|
2424
|
+
}).register(z.globalRegistry, {
|
|
2425
|
+
description: "Related objects that are included in the response."
|
|
2426
|
+
}).optional(),
|
|
2427
|
+
meta: z.object({
|
|
2428
|
+
payment_intent: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2429
|
+
description: "Payment intent details with nested structure including status and other Stripe payment intent fields"
|
|
2430
|
+
}).optional()
|
|
2431
|
+
}).register(z.globalRegistry, {
|
|
2432
|
+
description: "Additional metadata for the cart response."
|
|
2433
|
+
}).optional(),
|
|
2434
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
2435
|
+
description: "Array of error objects, if any errors occurred."
|
|
2436
|
+
}).optional()
|
|
1418
2437
|
});
|
|
1419
|
-
const
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
2438
|
+
const zCartItemResponseWritable = z.record(z.string(), z.unknown());
|
|
2439
|
+
const zTaxItemResponseWritable = z.object({
|
|
2440
|
+
type: z.literal("tax_item").register(z.globalRegistry, {
|
|
2441
|
+
description: "Specifies the type of the resource. Always `tax_item`."
|
|
2442
|
+
}).optional(),
|
|
2443
|
+
jurisdiction: z.string().register(z.globalRegistry, {
|
|
2444
|
+
description: "The jurisdiction for the tax item."
|
|
2445
|
+
}).optional(),
|
|
2446
|
+
code: z.string().register(z.globalRegistry, {
|
|
2447
|
+
description: "The tax code for the tax item."
|
|
2448
|
+
}).optional(),
|
|
2449
|
+
name: z.string().register(z.globalRegistry, {
|
|
2450
|
+
description: "The name of the tax item."
|
|
2451
|
+
}).optional(),
|
|
2452
|
+
rate: z.number().register(z.globalRegistry, {
|
|
2453
|
+
description: "The tax rate as a decimal (e.g., 0.085 for 8.5%)."
|
|
2454
|
+
}).optional(),
|
|
2455
|
+
amount: z.int().register(z.globalRegistry, {
|
|
2456
|
+
description: "The tax amount in the smallest currency unit."
|
|
2457
|
+
}).optional()
|
|
1424
2458
|
});
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1427
|
-
|
|
2459
|
+
const zCartItemCollectionResponseWritable = z.object({
|
|
2460
|
+
data: z.array(zCartItemResponseWritable),
|
|
2461
|
+
included: z.object({
|
|
2462
|
+
custom_discounts: z.array(zCustomDiscountResponse).optional(),
|
|
2463
|
+
promotions: z.array(
|
|
2464
|
+
z.object({
|
|
2465
|
+
automatic: z.boolean().optional(),
|
|
2466
|
+
description: z.string().optional(),
|
|
2467
|
+
end: z.iso.datetime().optional(),
|
|
2468
|
+
id: z.uuid().optional(),
|
|
2469
|
+
name: z.string().optional(),
|
|
2470
|
+
promotion_type: z.string().optional(),
|
|
2471
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
2472
|
+
description: "The source of the promotion"
|
|
2473
|
+
}).optional(),
|
|
2474
|
+
start: z.iso.datetime().optional(),
|
|
2475
|
+
type: z.literal("promotion").optional()
|
|
2476
|
+
})
|
|
2477
|
+
).optional(),
|
|
2478
|
+
tax_items: z.array(zTaxItemResponseWritable).register(z.globalRegistry, {
|
|
2479
|
+
description: "Array of tax items included in the response."
|
|
2480
|
+
}).optional()
|
|
2481
|
+
}).register(z.globalRegistry, {
|
|
2482
|
+
description: "Related objects that are included in the response."
|
|
2483
|
+
}).optional(),
|
|
2484
|
+
meta: z.object({
|
|
2485
|
+
display_price: z.object({
|
|
2486
|
+
with_tax: zFormattedPriceData.optional(),
|
|
2487
|
+
without_tax: zFormattedPriceData.optional(),
|
|
2488
|
+
tax: zFormattedPriceData.optional(),
|
|
2489
|
+
discount: zFormattedPriceData.optional(),
|
|
2490
|
+
without_discount: zFormattedPriceData.optional(),
|
|
2491
|
+
shipping: zFormattedPriceData.optional(),
|
|
2492
|
+
shipping_discount: zFormattedPriceData.optional(),
|
|
2493
|
+
authorized: zFormattedPriceData.optional(),
|
|
2494
|
+
balance_owing: zFormattedPriceData.optional(),
|
|
2495
|
+
paid: zFormattedPriceData.optional()
|
|
2496
|
+
}).optional(),
|
|
2497
|
+
timestamps: zCartTimestamps.optional(),
|
|
2498
|
+
messages: z.array(
|
|
2499
|
+
z.object({
|
|
2500
|
+
source: z.object({
|
|
2501
|
+
type: z.string().register(z.globalRegistry, {
|
|
2502
|
+
description: "The type of the source item"
|
|
2503
|
+
}),
|
|
2504
|
+
id: z.string().register(z.globalRegistry, {
|
|
2505
|
+
description: "The unique identifier of the source item"
|
|
2506
|
+
}),
|
|
2507
|
+
code: z.string().register(z.globalRegistry, {
|
|
2508
|
+
description: "The promotion code (present when source type is promotion)"
|
|
2509
|
+
}).optional()
|
|
2510
|
+
}).register(z.globalRegistry, {
|
|
2511
|
+
description: "Identifies the cart item that triggered this message"
|
|
2512
|
+
}).optional(),
|
|
2513
|
+
title: z.string().register(z.globalRegistry, {
|
|
2514
|
+
description: "A short descriptive title for the message"
|
|
2515
|
+
}),
|
|
2516
|
+
description: z.string().register(z.globalRegistry, {
|
|
2517
|
+
description: "A detailed description of the message"
|
|
2518
|
+
})
|
|
2519
|
+
})
|
|
2520
|
+
).register(z.globalRegistry, {
|
|
2521
|
+
description: "Optional array of informational messages that provide feedback about operations performed on the cart items, such as promotions added or discounts applied. This field is only present when there are relevant messages to display.\n"
|
|
2522
|
+
}).optional(),
|
|
2523
|
+
promotion_suggestions: z.array(
|
|
2524
|
+
z.object({
|
|
2525
|
+
bundle: z.array(
|
|
2526
|
+
z.object({
|
|
2527
|
+
auto_add_free_gift: z.boolean().register(z.globalRegistry, {
|
|
2528
|
+
description: "Whether to automatically add free gift"
|
|
2529
|
+
}).optional(),
|
|
2530
|
+
cart_item_id: z.string().register(z.globalRegistry, {
|
|
2531
|
+
description: "Cart item ID for the target"
|
|
2532
|
+
}).optional(),
|
|
2533
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
2534
|
+
description: "Quantity for the promotion"
|
|
2535
|
+
}).optional(),
|
|
2536
|
+
targets: z.array(z.string()).register(z.globalRegistry, {
|
|
2537
|
+
description: "Array of target SKUs"
|
|
2538
|
+
}).optional()
|
|
2539
|
+
})
|
|
2540
|
+
).register(z.globalRegistry, {
|
|
2541
|
+
description: "Bundle configuration with promotion targets"
|
|
2542
|
+
}).optional(),
|
|
2543
|
+
code: z.string().optional(),
|
|
2544
|
+
info: z.string().optional(),
|
|
2545
|
+
message: z.string().optional(),
|
|
2546
|
+
promotion_id: z.string().optional(),
|
|
2547
|
+
auto_add: z.boolean().register(z.globalRegistry, {
|
|
2548
|
+
description: "Whether this promotion should be automatically added"
|
|
2549
|
+
}).optional(),
|
|
2550
|
+
targets: z.array(
|
|
2551
|
+
z.object({
|
|
2552
|
+
cart_item_id: z.string().register(z.globalRegistry, {
|
|
2553
|
+
description: "The cart item ID for this target"
|
|
2554
|
+
}).optional(),
|
|
2555
|
+
quantity: z.int().register(z.globalRegistry, {
|
|
2556
|
+
description: "The quantity for this target"
|
|
2557
|
+
}).optional(),
|
|
2558
|
+
skus: z.array(z.string()).register(z.globalRegistry, {
|
|
2559
|
+
description: "Array of SKU codes for this target"
|
|
2560
|
+
}).optional()
|
|
2561
|
+
})
|
|
2562
|
+
).register(z.globalRegistry, {
|
|
2563
|
+
description: "Array of promotion targets (alternative structure)"
|
|
2564
|
+
}).optional()
|
|
2565
|
+
})
|
|
2566
|
+
).register(z.globalRegistry, {
|
|
2567
|
+
description: "Array of promotion suggestions"
|
|
2568
|
+
}).optional()
|
|
2569
|
+
}).register(z.globalRegistry, {
|
|
2570
|
+
description: "Additional meta information about the cart items collection."
|
|
2571
|
+
}).optional(),
|
|
2572
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
2573
|
+
description: "Array of error objects, if any errors occurred."
|
|
2574
|
+
}).optional()
|
|
1428
2575
|
});
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
2576
|
+
const zSubscriptionItemObjectWritable = z.object({
|
|
2577
|
+
data: zSubscriptionItemObjectData.and(zCartItemResponseWritable).optional()
|
|
2578
|
+
});
|
|
2579
|
+
const zCartsItemsTaxesCommonWritable = z.object({
|
|
2580
|
+
code: z.string().register(z.globalRegistry, {
|
|
2581
|
+
description: "A unique tax code in this jurisdiction."
|
|
2582
|
+
}).optional(),
|
|
2583
|
+
jurisdiction: z.string().register(z.globalRegistry, {
|
|
2584
|
+
description: "The relevant tax jurisdiction."
|
|
2585
|
+
}).optional(),
|
|
2586
|
+
name: z.string().register(z.globalRegistry, {
|
|
2587
|
+
description: "The name of the tax item."
|
|
2588
|
+
}).optional(),
|
|
2589
|
+
rate: z.number().register(z.globalRegistry, {
|
|
2590
|
+
description: "The tax rate as a decimal (12.5% -> 0.125). You must specify either `rate` or `amount`, but not both.\n"
|
|
2591
|
+
}).optional(),
|
|
2592
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2593
|
+
description: "The tax as an absolute amount in the smallest currency unit (e.g., $10 -> 1000). You must specify either `rate` or `amount`, but not both.\n"
|
|
2594
|
+
}).optional(),
|
|
2595
|
+
type: z.literal("tax_item").register(z.globalRegistry, {
|
|
2596
|
+
description: "The type of object being returned. Use `tax_item`."
|
|
2597
|
+
})
|
|
2598
|
+
});
|
|
2599
|
+
const zCartsItemsTaxesWithRateWritable = zCartsItemsTaxesCommonWritable.and(
|
|
2600
|
+
z.object({
|
|
2601
|
+
rate: z.number().register(z.globalRegistry, {
|
|
2602
|
+
description: "The tax rate as a decimal (12.5% -> 0.125). Required when using rate-based taxation.\n"
|
|
2603
|
+
}),
|
|
2604
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2605
|
+
description: "The tax as an absolute amount. Not allowed when rate is specified.\n"
|
|
2606
|
+
}).optional()
|
|
2607
|
+
})
|
|
2608
|
+
);
|
|
2609
|
+
const zCartsItemsTaxesWithAmountWritable = zCartsItemsTaxesCommonWritable.and(
|
|
2610
|
+
z.object({
|
|
2611
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2612
|
+
description: "The tax as an absolute amount in the smallest currency unit (e.g., $10 -> 1000). Required when using amount-based taxation.\n"
|
|
2613
|
+
}),
|
|
2614
|
+
rate: z.number().register(z.globalRegistry, {
|
|
2615
|
+
description: "The tax rate as a decimal. Not allowed when amount is specified.\n"
|
|
2616
|
+
}).optional()
|
|
2617
|
+
})
|
|
2618
|
+
);
|
|
2619
|
+
const zCartsItemsTaxesObjectWritable = z.union([
|
|
2620
|
+
zCartsItemsTaxesWithRateWritable,
|
|
2621
|
+
zCartsItemsTaxesWithAmountWritable
|
|
2622
|
+
]);
|
|
2623
|
+
const zCartItemTaxesEntityResponseWritable = z.object({
|
|
2624
|
+
data: zCartsItemsTaxesObjectWritable
|
|
2625
|
+
});
|
|
2626
|
+
const zCartsBulkTaxesWritable = z.object({
|
|
2627
|
+
data: z.array(
|
|
2628
|
+
zCartsItemsTaxesObjectWritable.and(zCartItemRelationship).and(
|
|
2629
|
+
z.object({
|
|
2630
|
+
meta: z.object({
|
|
2631
|
+
component_product_id: z.uuid().min(1).register(z.globalRegistry, {
|
|
2632
|
+
description: "The product ID of the bundle component the tax item applies to."
|
|
2633
|
+
}).optional()
|
|
2634
|
+
}).register(z.globalRegistry, {
|
|
2635
|
+
description: "Targets the tax item at a component product of the bundle the cart item holds, instead of at the cart item itself."
|
|
2636
|
+
}).optional()
|
|
2637
|
+
})
|
|
2638
|
+
)
|
|
2639
|
+
).optional(),
|
|
2640
|
+
errors: z.array(zResponseErrorItem).optional(),
|
|
2641
|
+
options: zAddAllOrNothingOptionsObject.optional()
|
|
2642
|
+
});
|
|
2643
|
+
const zCartsCustomDiscountsResponseObjectWritable = z.object({
|
|
2644
|
+
amount: z.object({
|
|
2645
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2646
|
+
description: "Specifies an amount to be applied for the custom discount. It must be less than zero."
|
|
2647
|
+
}).optional(),
|
|
2648
|
+
currency: z.string().register(z.globalRegistry, {
|
|
2649
|
+
description: "The currency set for the custom discount."
|
|
2650
|
+
}).optional(),
|
|
2651
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
2652
|
+
description: "The formatted value for the custom discount."
|
|
2653
|
+
}).optional()
|
|
2654
|
+
}).optional(),
|
|
2655
|
+
description: z.string().register(z.globalRegistry, {
|
|
2656
|
+
description: "Specifies a description for the custom discount."
|
|
2657
|
+
}).optional(),
|
|
2658
|
+
discount_code: z.string().register(z.globalRegistry, {
|
|
2659
|
+
description: "Specifies the discount code used for the custom discount."
|
|
2660
|
+
}).optional(),
|
|
2661
|
+
discount_engine: z.string().register(z.globalRegistry, {
|
|
2662
|
+
description: "Specifies from where the custom discount is applied. For example, Talon.one."
|
|
2663
|
+
}).optional(),
|
|
2664
|
+
external_id: z.string().register(z.globalRegistry, {
|
|
2665
|
+
description: "Specifies an external id for the custom discount."
|
|
2666
|
+
}).optional(),
|
|
2667
|
+
type: z.literal("custom_discount").register(z.globalRegistry, {
|
|
2668
|
+
description: "Specifies the type of the resource. Always `custom_discount`."
|
|
2669
|
+
}).optional(),
|
|
2670
|
+
relationships: z.object({
|
|
2671
|
+
item: z.object({
|
|
2672
|
+
data: z.object({
|
|
2673
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
2674
|
+
description: "The item ID this discount is related to"
|
|
2675
|
+
}).optional(),
|
|
2676
|
+
type: z.enum(["cart_item", "custom_item"]).optional()
|
|
2677
|
+
}).optional()
|
|
2678
|
+
}).optional()
|
|
2679
|
+
}).register(z.globalRegistry, {
|
|
2680
|
+
description: "Relationships to other resources like cart items"
|
|
2681
|
+
}).optional()
|
|
2682
|
+
});
|
|
2683
|
+
const zDiscountDataWritable = z.object({
|
|
2684
|
+
amount: zOrderPriceData.optional(),
|
|
2685
|
+
code: z.string().optional(),
|
|
2686
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
2687
|
+
description: "The source or origin of the promotion, if applicable."
|
|
2688
|
+
}).optional(),
|
|
2689
|
+
is_cart_discount: z.boolean().register(z.globalRegistry, {
|
|
2690
|
+
description: "Indicates whether the discount applies to the entire cart."
|
|
2691
|
+
}).optional(),
|
|
2692
|
+
ordinal: z.int().register(z.globalRegistry, {
|
|
2693
|
+
description: "Order in which the discount was applied."
|
|
2694
|
+
}).optional(),
|
|
2695
|
+
promotion_action_id: z.string().register(z.globalRegistry, {
|
|
2696
|
+
description: "Identifies the specific action within a multi-action rule promotion that produced this discount."
|
|
2697
|
+
}).optional()
|
|
2698
|
+
});
|
|
2699
|
+
const zOrderItemResponseWritable = z.object({
|
|
2700
|
+
type: z.string().register(z.globalRegistry, {
|
|
2701
|
+
description: "The type represents the object being returned."
|
|
2702
|
+
}).optional(),
|
|
2703
|
+
quantity: z.number().register(z.globalRegistry, {
|
|
2704
|
+
description: "The quantity of this item were ordered."
|
|
2705
|
+
}).optional(),
|
|
2706
|
+
name: z.string().register(z.globalRegistry, {
|
|
2707
|
+
description: "The name of this order item."
|
|
2708
|
+
}).optional(),
|
|
2709
|
+
sku: z.string().register(z.globalRegistry, {
|
|
2710
|
+
description: "The SKU code for the order item."
|
|
2711
|
+
}).optional(),
|
|
2712
|
+
unit_price: zOrderPriceData.optional(),
|
|
2713
|
+
value: zOrderPriceData.optional(),
|
|
2714
|
+
discounts: z.array(zDiscountDataWritable).optional(),
|
|
2715
|
+
links: z.record(z.string(), z.unknown()).optional(),
|
|
2716
|
+
meta: z.object({
|
|
2717
|
+
display_price: z.object({
|
|
2718
|
+
with_tax: zOrderItemFormattedUnitPriceData.optional(),
|
|
2719
|
+
without_tax: zOrderItemFormattedUnitPriceData.optional(),
|
|
2720
|
+
tax: zOrderItemFormattedUnitPriceData.optional(),
|
|
2721
|
+
discount: zOrderItemFormattedUnitPriceData.optional(),
|
|
2722
|
+
without_discount: zOrderItemFormattedUnitPriceData.optional(),
|
|
2723
|
+
discounts: z.record(
|
|
2724
|
+
z.string(),
|
|
2725
|
+
z.object({
|
|
2726
|
+
amount: z.number().optional(),
|
|
2727
|
+
currency: z.string().optional(),
|
|
2728
|
+
formatted: z.string().optional(),
|
|
2729
|
+
constituents: z.record(
|
|
2730
|
+
z.string(),
|
|
2731
|
+
z.object({
|
|
2732
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2733
|
+
description: "The discount amount"
|
|
2734
|
+
}).optional(),
|
|
2735
|
+
currency: z.string().register(z.globalRegistry, {
|
|
2736
|
+
description: "The currency code"
|
|
2737
|
+
}).optional(),
|
|
2738
|
+
formatted: z.string().register(z.globalRegistry, {
|
|
2739
|
+
description: "The formatted discount amount"
|
|
2740
|
+
}).optional()
|
|
2741
|
+
})
|
|
2742
|
+
).register(z.globalRegistry, {
|
|
2743
|
+
description: "Detailed breakdown of discount constituents by ID"
|
|
2744
|
+
}).optional()
|
|
2745
|
+
})
|
|
2746
|
+
).optional(),
|
|
2747
|
+
original_price: zOrderItemFormattedUnitPriceData.optional()
|
|
2748
|
+
}).optional(),
|
|
2749
|
+
timestamps: zTimestamps.optional()
|
|
2750
|
+
}).optional(),
|
|
2751
|
+
relationships: z.object({
|
|
2752
|
+
cart_item: z.object({
|
|
2753
|
+
data: z.object({
|
|
2754
|
+
type: z.string().register(z.globalRegistry, {
|
|
2755
|
+
description: "The type represents the object being returned."
|
|
2756
|
+
}).optional()
|
|
2757
|
+
}).optional()
|
|
2758
|
+
}).optional(),
|
|
2759
|
+
taxes: z.object({
|
|
2760
|
+
data: z.array(zRelationshipItem).nullish()
|
|
2761
|
+
}).register(z.globalRegistry, {
|
|
2762
|
+
description: "Related tax items."
|
|
2763
|
+
}).optional(),
|
|
2764
|
+
promotions: z.object({
|
|
2765
|
+
data: z.array(zRelationshipItem).nullish()
|
|
2766
|
+
}).register(z.globalRegistry, {
|
|
2767
|
+
description: "Related promotions."
|
|
2768
|
+
}).optional()
|
|
2769
|
+
}).optional(),
|
|
2770
|
+
catalog_id: z.string().register(z.globalRegistry, {
|
|
2771
|
+
description: "The unique identifier of the catalog associated with the product is shown if `catalog_source=pim` is set."
|
|
2772
|
+
}).optional(),
|
|
2773
|
+
catalog_source: z.string().register(z.globalRegistry, {
|
|
2774
|
+
description: "The catalog source. Always `pim` or `legacy`."
|
|
2775
|
+
}).optional(),
|
|
2776
|
+
bundle_configuration: z.object({
|
|
2777
|
+
selected_options: z.record(z.string(), z.record(z.string(), z.number())).optional(),
|
|
2778
|
+
component_products: z.array(
|
|
2779
|
+
z.object({
|
|
2780
|
+
id: z.string().register(z.globalRegistry, {
|
|
2781
|
+
description: "Component product ID"
|
|
2782
|
+
}).optional(),
|
|
2783
|
+
type: z.string().register(z.globalRegistry, {
|
|
2784
|
+
description: "Component product type"
|
|
2785
|
+
}).optional(),
|
|
2786
|
+
attributes: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2787
|
+
description: "Product attributes as a generic object"
|
|
2788
|
+
}).optional(),
|
|
2789
|
+
meta: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2790
|
+
description: "Product metadata as a generic object"
|
|
2791
|
+
}).optional(),
|
|
2792
|
+
price: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2793
|
+
description: "Product price information as a generic object"
|
|
2794
|
+
}).optional(),
|
|
2795
|
+
relationships: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2796
|
+
description: "Product relationships as a generic object"
|
|
2797
|
+
}).optional()
|
|
2798
|
+
})
|
|
2799
|
+
).register(z.globalRegistry, {
|
|
2800
|
+
description: "Array of component products for bundle configuration"
|
|
2801
|
+
}).optional()
|
|
2802
|
+
}).register(z.globalRegistry, {
|
|
2803
|
+
description: "Configuration for bundle products."
|
|
2804
|
+
}).optional(),
|
|
2805
|
+
components: z.record(
|
|
2806
|
+
z.string(),
|
|
2807
|
+
z.object({
|
|
2808
|
+
name: z.string().optional(),
|
|
2809
|
+
options: z.array(
|
|
2810
|
+
z.object({
|
|
2811
|
+
id: z.string().optional(),
|
|
2812
|
+
quantity: z.number().optional(),
|
|
2813
|
+
type: z.string().optional()
|
|
2814
|
+
})
|
|
2815
|
+
).optional()
|
|
2816
|
+
})
|
|
2817
|
+
).register(z.globalRegistry, {
|
|
2818
|
+
description: "Components of the bundle product."
|
|
2819
|
+
}).optional(),
|
|
2820
|
+
custom_inputs: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
2821
|
+
description: "Custom inputs for the order item as a generic object"
|
|
2822
|
+
}).optional(),
|
|
2823
|
+
shipping_group_id: z.string().register(z.globalRegistry, {
|
|
2824
|
+
description: "The shipping group ID for the order item"
|
|
2825
|
+
}).optional(),
|
|
2826
|
+
promotion_source: z.string().register(z.globalRegistry, {
|
|
2827
|
+
description: "The promotion source for the order item"
|
|
2828
|
+
}).optional(),
|
|
2829
|
+
subscription_configuration: z.object({
|
|
2830
|
+
plan: z.string().register(z.globalRegistry, {
|
|
2831
|
+
description: "Subscription plan details"
|
|
2832
|
+
}).optional(),
|
|
2833
|
+
pricing_option: z.string().register(z.globalRegistry, {
|
|
2834
|
+
description: "Pricing option for the subscription"
|
|
2835
|
+
}).optional()
|
|
2836
|
+
}).register(z.globalRegistry, {
|
|
2837
|
+
description: "Subscription configuration for the order item"
|
|
2838
|
+
}).optional()
|
|
2839
|
+
});
|
|
2840
|
+
const zShippingGroupEntityResponseWritable = z.object({
|
|
2841
|
+
data: zShippingGroupResponse.optional(),
|
|
2842
|
+
included: z.object({
|
|
2843
|
+
items: z.array(zOrderItemResponseWritable).register(z.globalRegistry, {
|
|
2844
|
+
description: "Array of order items associated with this shipping group."
|
|
2845
|
+
}).optional()
|
|
2846
|
+
}).register(z.globalRegistry, {
|
|
2847
|
+
description: "Related objects that are included in the response when using the include query parameter."
|
|
2848
|
+
}).optional(),
|
|
2849
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
2850
|
+
description: "Array of validation or processing errors"
|
|
2851
|
+
}).optional()
|
|
2852
|
+
});
|
|
2853
|
+
const zOrderResponseWritable = z.object({
|
|
2854
|
+
type: z.literal("order").register(z.globalRegistry, {
|
|
2855
|
+
description: "Specifies the type of object being returned. You must use `order`."
|
|
2856
|
+
}).optional(),
|
|
2857
|
+
order_number: z.string().register(z.globalRegistry, {
|
|
2858
|
+
description: "Specifies a user-managed, optional field used as an alternative to the existing `order_id`. If provided, the order-number will be sent to Authorize.net instead of the `order_id`, and will appear as the invoice number in Authorize.net transactions."
|
|
2859
|
+
}).optional(),
|
|
2860
|
+
external_ref: z.string().register(z.globalRegistry, {
|
|
2861
|
+
description: "An optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and is not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system."
|
|
2862
|
+
}).optional(),
|
|
2863
|
+
status: z.enum(["complete", "incomplete", "cancelled", "processing"]).register(z.globalRegistry, {
|
|
2864
|
+
description: "Specifies the status of the order, such as `incomplete`, `complete`, `processing`, or `cancelled`."
|
|
2865
|
+
}).optional(),
|
|
2866
|
+
payment: z.enum([
|
|
2867
|
+
"authorized",
|
|
2868
|
+
"paid",
|
|
2869
|
+
"unpaid",
|
|
2870
|
+
"refunded",
|
|
2871
|
+
"partially_paid",
|
|
2872
|
+
"partially_authorized"
|
|
2873
|
+
]).register(z.globalRegistry, {
|
|
2874
|
+
description: "Specifies the status of the payment, such as `unpaid`, `authorized`, `paid`, or `refunded`."
|
|
2875
|
+
}).optional(),
|
|
2876
|
+
shipping: z.enum(["unfulfilled", "fulfilled"]).register(z.globalRegistry, {
|
|
2877
|
+
description: "Specifies the status of the shipment, such as `fulfilled` or `unfulfilled`."
|
|
2878
|
+
}).optional(),
|
|
2879
|
+
anonymized: z.boolean().register(z.globalRegistry, {
|
|
2880
|
+
description: "Specifies if the order is anonymized."
|
|
2881
|
+
}).optional(),
|
|
2882
|
+
payment_intent_id: z.string().register(z.globalRegistry, {
|
|
2883
|
+
description: "Stripe Payment Intent ID. Please see Stripe's Payment Intent [documentation](https://docs.stripe.com/api/payment_intents) for more information on Payment Intents."
|
|
2884
|
+
}).optional(),
|
|
2885
|
+
custom_attributes: zCustomAttributes.optional(),
|
|
2886
|
+
links: z.record(z.string(), z.unknown()).optional(),
|
|
2887
|
+
meta: zOrderMeta.optional(),
|
|
2888
|
+
billing_address: zBillingAddress.optional(),
|
|
2889
|
+
contact: zContact.optional(),
|
|
2890
|
+
customer: zCustomer.optional(),
|
|
2891
|
+
shipping_address: zShippingAddress.optional(),
|
|
2892
|
+
relationships: z.object({
|
|
2893
|
+
items: zRelationshipArray.optional(),
|
|
2894
|
+
custom_discounts: zRelationshipArray.optional(),
|
|
2895
|
+
promotions: zRelationshipArray.optional(),
|
|
2896
|
+
customer: zSingleRelationship.optional(),
|
|
2897
|
+
account: zSingleRelationship.optional(),
|
|
2898
|
+
account_member: zSingleRelationship.optional(),
|
|
2899
|
+
store: zSingleRelationship.optional()
|
|
2900
|
+
}).optional()
|
|
2901
|
+
});
|
|
2902
|
+
const zOrderEntityResponseWritable = z.object({
|
|
2903
|
+
data: zOrderResponseWritable.optional(),
|
|
2904
|
+
included: z.object({
|
|
2905
|
+
items: z.array(zOrderItemResponseWritable).register(z.globalRegistry, {
|
|
2906
|
+
description: "Array of order items included in the response."
|
|
2907
|
+
}).optional(),
|
|
2908
|
+
tax_items: z.array(zTaxItemResponseWritable).register(z.globalRegistry, {
|
|
2909
|
+
description: "Array of tax items included in the response."
|
|
2910
|
+
}).optional(),
|
|
2911
|
+
custom_discounts: z.array(zCustomDiscountResponse).register(z.globalRegistry, {
|
|
2912
|
+
description: "Array of custom discounts included in the response."
|
|
2913
|
+
}).optional(),
|
|
2914
|
+
promotions: z.array(zCondensedPromotionResponseWritable).register(z.globalRegistry, {
|
|
2915
|
+
description: "Array of promotions included in the response."
|
|
2916
|
+
}).optional()
|
|
2917
|
+
}).register(z.globalRegistry, {
|
|
2918
|
+
description: "Optional included data such as order items, tax items, custom discounts, and promotions.\n"
|
|
2919
|
+
}).optional(),
|
|
2920
|
+
errors: z.array(zResponseErrorItem).register(z.globalRegistry, {
|
|
2921
|
+
description: "Array of error objects, if any errors occurred."
|
|
2922
|
+
}).optional()
|
|
2923
|
+
});
|
|
2924
|
+
const zOrderCollectionResponseWritable = z.object({
|
|
2925
|
+
data: z.array(zOrderResponseWritable).optional(),
|
|
2926
|
+
links: zResponsePageLinks.optional(),
|
|
2927
|
+
meta: zResponseMetaOrders.optional()
|
|
2928
|
+
});
|
|
2929
|
+
const zOrderItemCollectionResponseWritable = z.object({
|
|
2930
|
+
data: z.array(zOrderItemResponseWritable).optional(),
|
|
2931
|
+
included: z.object({
|
|
2932
|
+
tax_items: z.array(zTaxItemResponseWritable).register(z.globalRegistry, {
|
|
2933
|
+
description: "Array of tax items included in the response."
|
|
2934
|
+
}).optional(),
|
|
2935
|
+
custom_discounts: z.array(zCustomDiscountResponse).register(z.globalRegistry, {
|
|
2936
|
+
description: "Array of custom discounts included in the response."
|
|
2937
|
+
}).optional(),
|
|
2938
|
+
promotions: z.array(zCondensedPromotionResponseWritable).register(z.globalRegistry, {
|
|
2939
|
+
description: "Array of promotions included in the response."
|
|
2940
|
+
}).optional()
|
|
2941
|
+
}).register(z.globalRegistry, {
|
|
2942
|
+
description: "Optional included data such as tax items, custom discounts, and promotions.\n"
|
|
2943
|
+
}).optional()
|
|
2944
|
+
});
|
|
2945
|
+
const zOrdersListResponseWritable = z.object({
|
|
2946
|
+
data: z.array(zOrderResponseWritable)
|
|
2947
|
+
});
|
|
2948
|
+
const zTransactionResponseWritable = z.object({
|
|
2949
|
+
reference: z.string().register(z.globalRegistry, {
|
|
2950
|
+
description: "The payment gateway reference."
|
|
2951
|
+
}).optional(),
|
|
2952
|
+
name: z.string().register(z.globalRegistry, {
|
|
2953
|
+
description: "A custom name associated with the payment method."
|
|
2954
|
+
}).optional(),
|
|
2955
|
+
custom_reference: z.string().register(z.globalRegistry, {
|
|
2956
|
+
description: "A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field."
|
|
2957
|
+
}).optional(),
|
|
2958
|
+
gateway: z.enum([
|
|
2959
|
+
"adyen",
|
|
2960
|
+
"authorize_net",
|
|
2961
|
+
"braintree",
|
|
2962
|
+
"card_connect",
|
|
2963
|
+
"cyber_source",
|
|
2964
|
+
"elastic_path_payments_stripe",
|
|
2965
|
+
"manual",
|
|
2966
|
+
"paypal_express_checkout",
|
|
2967
|
+
"stripe",
|
|
2968
|
+
"stripe_payment_intents",
|
|
2969
|
+
"stripe_platform_account"
|
|
2970
|
+
]).register(z.globalRegistry, {
|
|
2971
|
+
description: "The name of the payment gateway used."
|
|
2972
|
+
}).optional(),
|
|
2973
|
+
amount: z.number().register(z.globalRegistry, {
|
|
2974
|
+
description: "The amount for this transaction."
|
|
2975
|
+
}).optional(),
|
|
2976
|
+
refunded_amount: z.number().register(z.globalRegistry, {
|
|
2977
|
+
description: "The refunded amount."
|
|
2978
|
+
}).optional(),
|
|
2979
|
+
currency: z.string().register(z.globalRegistry, {
|
|
2980
|
+
description: "The transaction currency."
|
|
2981
|
+
}).optional(),
|
|
2982
|
+
transaction_type: z.enum(["purchase", "authorize", "capture", "refund"]).register(z.globalRegistry, {
|
|
2983
|
+
description: "The type of transaction, such as `purchase`, `capture`, `authorize` or `refund`."
|
|
2984
|
+
}).optional(),
|
|
2985
|
+
type: z.string().register(z.globalRegistry, {
|
|
2986
|
+
description: "The type of object being returned."
|
|
2987
|
+
}).optional(),
|
|
2988
|
+
status: z.string().register(z.globalRegistry, {
|
|
2989
|
+
description: "The status provided by the gateway for this transaction, such as `complete` or `failed`."
|
|
2990
|
+
}).optional(),
|
|
2991
|
+
payment_details: z.object({
|
|
2992
|
+
detailed_status: z.string().register(z.globalRegistry, {
|
|
2993
|
+
description: "Detailed status from the payment gateway."
|
|
2994
|
+
}).optional()
|
|
2995
|
+
}).register(z.globalRegistry, {
|
|
2996
|
+
description: "Payment gateway specific details."
|
|
2997
|
+
}).optional(),
|
|
2998
|
+
failure_details: zFailureDetails.optional(),
|
|
2999
|
+
payment_intent: z.record(z.string(), z.unknown()).register(z.globalRegistry, {
|
|
3000
|
+
description: "Payment intent details."
|
|
3001
|
+
}).optional(),
|
|
3002
|
+
capture_mechanism: z.enum(["automatic", "manual"]).register(z.globalRegistry, {
|
|
3003
|
+
description: "The mechanism used for capturing the transaction."
|
|
3004
|
+
}).optional(),
|
|
3005
|
+
refund_mechanism: z.enum(["automatic", "manual"]).register(z.globalRegistry, {
|
|
3006
|
+
description: "The mechanism used for refunding the transaction."
|
|
3007
|
+
}).optional(),
|
|
3008
|
+
client_parameters: z.object({
|
|
3009
|
+
redirect_url: z.string().register(z.globalRegistry, {
|
|
3010
|
+
description: "URL to redirect the client after payment."
|
|
3011
|
+
}).optional(),
|
|
3012
|
+
secret: z.string().register(z.globalRegistry, {
|
|
3013
|
+
description: "Client secret for payment processing."
|
|
3014
|
+
}).optional(),
|
|
3015
|
+
token: z.string().register(z.globalRegistry, {
|
|
3016
|
+
description: "Client token for payment processing."
|
|
3017
|
+
}).optional()
|
|
3018
|
+
}).register(z.globalRegistry, {
|
|
3019
|
+
description: "Client-specific parameters for payment processing."
|
|
3020
|
+
}).optional(),
|
|
3021
|
+
next_actions: z.array(z.string()).register(z.globalRegistry, {
|
|
3022
|
+
description: "Array of next actions for the transaction."
|
|
3023
|
+
}).optional(),
|
|
3024
|
+
relationships: z.object({
|
|
3025
|
+
order: z.object({
|
|
3026
|
+
data: z.object({
|
|
3027
|
+
type: z.string().register(z.globalRegistry, {
|
|
3028
|
+
description: "Represents the type of the object being returned. It is always `order`."
|
|
3029
|
+
}).optional(),
|
|
3030
|
+
id: z.uuid().register(z.globalRegistry, {
|
|
3031
|
+
description: "The ID of the order."
|
|
3032
|
+
}).optional()
|
|
3033
|
+
}).optional()
|
|
3034
|
+
}).optional()
|
|
3035
|
+
}).optional(),
|
|
3036
|
+
meta: z.object({
|
|
3037
|
+
display_price: zFormattedPriceData.optional(),
|
|
3038
|
+
display_refunded_amount: z.object({
|
|
3039
|
+
total: zFormattedPriceData.optional()
|
|
3040
|
+
}).optional(),
|
|
3041
|
+
timestamps: zTimestamps.optional()
|
|
3042
|
+
}).optional()
|
|
3043
|
+
});
|
|
3044
|
+
const zTransactionEntityResponseWritable = z.object({
|
|
3045
|
+
data: zTransactionResponseWritable
|
|
3046
|
+
});
|
|
3047
|
+
const zTransactionListResponseWritable = z.object({
|
|
3048
|
+
data: z.array(zTransactionResponseWritable)
|
|
3049
|
+
});
|
|
3050
|
+
const zSettingsCartWritable = z.object({
|
|
3051
|
+
data: z.object({
|
|
3052
|
+
type: z.string().register(z.globalRegistry, {
|
|
3053
|
+
description: "Describes the type of request payload you're sending. Set this value to `settings`."
|
|
3054
|
+
}),
|
|
3055
|
+
cart_expiry_days: z.int().register(z.globalRegistry, {
|
|
3056
|
+
description: "Indicates the number of days before a cart expires."
|
|
3057
|
+
}).optional(),
|
|
3058
|
+
discounts: z.object({
|
|
3059
|
+
custom_discounts_enabled: z.boolean().register(z.globalRegistry, {
|
|
3060
|
+
description: "When `true`, custom discounts are enabled. Default is false. This setting only affects the new empty carts while the existing active carts will not be affected."
|
|
3061
|
+
}).optional(),
|
|
3062
|
+
use_rule_promotions: z.boolean().register(z.globalRegistry, {
|
|
3063
|
+
description: "When set to `true`, this parameter allows the cart to use rule promotions."
|
|
3064
|
+
}).optional()
|
|
3065
|
+
}).optional(),
|
|
3066
|
+
inventories: z.object({
|
|
3067
|
+
defer_inventory_check: z.boolean().register(z.globalRegistry, {
|
|
3068
|
+
description: "When `true`, inventory checks are not performed when adding products to a cart but still occur on checkout as normal. Default is false. This setting only affects the new empty carts while the existing active carts will not be affected."
|
|
3069
|
+
}).optional()
|
|
3070
|
+
}).optional(),
|
|
3071
|
+
items: z.object({
|
|
3072
|
+
separate_items_by_location: z.boolean().register(z.globalRegistry, {
|
|
3073
|
+
description: "When `true`, cart items with the same SKU but different locations are kept as separate line items instead of being merged. When `false` (default), items with the same SKU are merged and the location is updated to the most recent value."
|
|
3074
|
+
}).optional()
|
|
3075
|
+
}).optional(),
|
|
3076
|
+
show_all_carts: z.boolean().register(z.globalRegistry, {
|
|
3077
|
+
description: "When `true`, admins (users with admin scope) can retrieve all carts in the store via `GET /v2/carts`, regardless of customer or account associations. When `false`, admins can only see carts that are registered (associated with customers or accounts).\n\nFor new stores, this defaults to `true`. For existing stores created before this feature was introduced, this defaults to `false` to maintain backward compatibility.\n"
|
|
3078
|
+
}).optional()
|
|
3079
|
+
}).optional()
|
|
3080
|
+
});
|
|
3081
|
+
const zCartItemObjectWritable = zCartItemObjectData.and(
|
|
3082
|
+
zCartItemResponseWritable
|
|
3083
|
+
);
|
|
3084
|
+
const zCustomItemCartObjectWritable = zCartItemResponseWritable.and(
|
|
3085
|
+
z.object({
|
|
3086
|
+
type: z.literal("custom_item"),
|
|
3087
|
+
quantity: z.int()
|
|
3088
|
+
})
|
|
3089
|
+
);
|
|
3090
|
+
const zSubscriptionItemCartObjectWritable = zCartItemResponseWritable.and(
|
|
3091
|
+
z.object({
|
|
3092
|
+
type: z.literal("subscription_item"),
|
|
3093
|
+
quantity: z.int()
|
|
3094
|
+
})
|
|
3095
|
+
);
|
|
3096
|
+
const zPromotionItemCartObjectWritable = zCartItemResponseWritable.and(
|
|
3097
|
+
z.object({
|
|
3098
|
+
type: z.literal("promotion_item"),
|
|
3099
|
+
quantity: z.int()
|
|
3100
|
+
})
|
|
3101
|
+
);
|
|
3102
|
+
const zCartsResponseWritable = z.object({
|
|
3103
|
+
data: z.array(
|
|
3104
|
+
z.union([
|
|
3105
|
+
zCartItemObjectWritable,
|
|
3106
|
+
zCustomItemCartObjectWritable,
|
|
3107
|
+
zSubscriptionItemCartObjectWritable,
|
|
3108
|
+
zPromotionItemCartObjectWritable
|
|
3109
|
+
])
|
|
3110
|
+
).optional(),
|
|
3111
|
+
meta: z.object({
|
|
3112
|
+
display_price: z.object({
|
|
3113
|
+
with_tax: zFormattedPriceData.optional(),
|
|
3114
|
+
without_tax: zFormattedPriceData.optional(),
|
|
3115
|
+
tax: zFormattedPriceData.optional(),
|
|
3116
|
+
discount: zFormattedPriceData.optional(),
|
|
3117
|
+
without_discount: zFormattedPriceData.optional(),
|
|
3118
|
+
shipping: zFormattedPriceData.optional(),
|
|
3119
|
+
shipping_discount: zFormattedPriceData.optional(),
|
|
3120
|
+
discounts: z.record(
|
|
3121
|
+
z.string(),
|
|
3122
|
+
z.object({
|
|
3123
|
+
amount: z.number().optional(),
|
|
3124
|
+
currency: z.string().optional(),
|
|
3125
|
+
formatted: z.string().optional()
|
|
3126
|
+
})
|
|
3127
|
+
).optional()
|
|
3128
|
+
}).optional(),
|
|
3129
|
+
timestamps: zCartTimestamps.optional()
|
|
3130
|
+
}).optional()
|
|
3131
|
+
});
|
|
3132
|
+
const zCartItemsResponseWritable = z.object({
|
|
3133
|
+
data: z.array(
|
|
3134
|
+
z.union([
|
|
3135
|
+
zCartItemObjectWritable,
|
|
3136
|
+
zCustomItemCartObjectWritable,
|
|
3137
|
+
zSubscriptionItemCartObjectWritable,
|
|
3138
|
+
zPromotionItemCartObjectWritable
|
|
3139
|
+
])
|
|
3140
|
+
).optional()
|
|
3141
|
+
});
|
|
3142
|
+
const zGetCartsHeaders = z.object({
|
|
3143
|
+
"EP-Account-Management-Authentication-Token": z.string().register(z.globalRegistry, {
|
|
3144
|
+
description: "An Account Management Authentication token to access a specific account's carts."
|
|
3145
|
+
}).optional(),
|
|
3146
|
+
"X-Moltin-Customer-Token": z.string().register(z.globalRegistry, {
|
|
3147
|
+
description: "A customer token to access a specific customer's carts."
|
|
3148
|
+
}).optional()
|
|
3149
|
+
});
|
|
3150
|
+
const zGetCartsQuery = z.object({
|
|
3151
|
+
include: z.array(z.literal("custom_discounts")).register(z.globalRegistry, {
|
|
3152
|
+
description: "A comma-separated list of resources to include. See [Characteristics of Include Parameter](/guides/Getting-Started/includes#characteristics-of-include-parameter)."
|
|
3153
|
+
}).optional(),
|
|
3154
|
+
"page[limit]": z.int().gte(1).lte(100).register(z.globalRegistry, {
|
|
3155
|
+
description: "The maximum number of records per page."
|
|
3156
|
+
}).optional().default(20),
|
|
3157
|
+
"page[offset]": z.int().gte(0).lte(1e4).register(z.globalRegistry, {
|
|
3158
|
+
description: "The number of records to offset the results by."
|
|
3159
|
+
}).optional().default(0),
|
|
3160
|
+
filter: z.string().register(z.globalRegistry, {
|
|
3161
|
+
description: 'Filter expression for searching carts. For more information about filtering, see [Filtering](/guides/Getting-Started/filtering).\n\n:::note\nFiltering is only supported when using **client credentials** (admin) authentication. When using a **customer token** (`X-Moltin-Customer-Token`) or **account token** (`EP-Account-Management-Authentication-Token`), the `filter` parameter is ignored and all carts associated with the customer or account are returned.\n:::\n\n**Supported Fields:**\n- `account_ids`: Filter carts by associated account ID (UUID format)\n- `name`: Filter carts by cart name (case-insensitive)\n\n**Supported Operators:**\n- `contains(field,value)`: Contains value in array field\n- `ilike(field,value)`: Case-insensitive string matching\n\n**Examples:**\n- `contains(account_ids,"c24e5698-3b54-491b-9225-559c7a9cf2b2")` - Find carts associated with a specific account\n- `ilike(name,"Shopping Cart")` - Find carts with name matching "Shopping Cart" (case-insensitive)\n- `ilike(name,"*cart*")` - Find carts with names containing "cart" (wildcard search)\n\n**Combining Filters:**\nYou can combine multiple filters using the `:`, and `|` operator for and and or respectively:\n- `contains(account_ids,"abc123"):ilike(name,"Holiday Cart")` - Find carts matching both conditions\n- `contains(account_ids,"abc123")|ilike(name,"Holiday Cart")` - Find carts matching either condition.\n'
|
|
3162
|
+
}).optional()
|
|
3163
|
+
});
|
|
3164
|
+
const zGetCartsResponse = zCartCollectionResponse;
|
|
3165
|
+
const zCreateACartBody = zCartsRequest;
|
|
3166
|
+
const zCreateACartHeaders = z.object({
|
|
3167
|
+
"EP-Account-Management-Authentication-Token": z.string().register(z.globalRegistry, {
|
|
3168
|
+
description: "An Account Management Authentication token for the account to be associated with the cart."
|
|
3169
|
+
}).optional(),
|
|
3170
|
+
"X-Moltin-Customer-Token": z.string().register(z.globalRegistry, {
|
|
3171
|
+
description: "A customer token for the customer to be associated with the cart."
|
|
3172
|
+
}).optional()
|
|
3173
|
+
});
|
|
3174
|
+
const zCreateACartResponse = zCartEntityResponse;
|
|
3175
|
+
const zDeleteACartPath = z.object({
|
|
3176
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3177
|
+
description: "The unique identifier of the cart that you want to delete."
|
|
3178
|
+
})
|
|
3179
|
+
});
|
|
3180
|
+
const zDeleteACartResponse = z.void().register(z.globalRegistry, {
|
|
3181
|
+
description: "No Content"
|
|
3182
|
+
});
|
|
3183
|
+
const zGetACartPath = z.object({
|
|
3184
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3185
|
+
description: "The unique identifier for this cart that you created."
|
|
3186
|
+
})
|
|
1432
3187
|
});
|
|
1433
3188
|
const zGetACartQuery = z.object({
|
|
1434
|
-
include: z.array(z.enum(["custom_discounts", "promotions"])).
|
|
3189
|
+
include: z.array(z.enum(["custom_discounts", "promotions"])).register(z.globalRegistry, {
|
|
3190
|
+
description: "A comma-separated list of resources to include. See [Characteristics of Include Parameter](/guides/Getting-Started/includes#characteristics-of-include-parameter)."
|
|
3191
|
+
}).optional()
|
|
1435
3192
|
});
|
|
1436
3193
|
const zGetACartResponse = zCartEntityResponse;
|
|
1437
3194
|
const zUpdateACartBody = zCartsRequest;
|
|
1438
3195
|
const zUpdateACartPath = z.object({
|
|
1439
|
-
cartID: z.string()
|
|
3196
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3197
|
+
description: "The unique identifier of a cart created by you."
|
|
3198
|
+
})
|
|
1440
3199
|
});
|
|
1441
3200
|
const zUpdateACartResponse = zCartEntityResponse;
|
|
1442
3201
|
const zDeleteAllCartItemsPath = z.object({
|
|
1443
|
-
cartID: z.string()
|
|
3202
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3203
|
+
description: "The unique identifier of the cart created by you."
|
|
3204
|
+
})
|
|
3205
|
+
});
|
|
3206
|
+
const zDeleteAllCartItemsResponse = z.void().register(z.globalRegistry, {
|
|
3207
|
+
description: "No Content"
|
|
1444
3208
|
});
|
|
1445
|
-
const zDeleteAllCartItemsResponse = z.void();
|
|
1446
3209
|
const zGetCartItemsPath = z.object({
|
|
1447
|
-
cartID: z.string()
|
|
3210
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3211
|
+
description: "The unique identifier of the cart that you created."
|
|
3212
|
+
})
|
|
1448
3213
|
});
|
|
1449
3214
|
const zGetCartItemsQuery = z.object({
|
|
1450
|
-
include: z.array(z.enum(["tax_items", "custom_discounts", "promotions"])).
|
|
3215
|
+
include: z.array(z.enum(["tax_items", "custom_discounts", "promotions"])).register(z.globalRegistry, {
|
|
3216
|
+
description: "A comma-separated list of related resources to include in the response."
|
|
3217
|
+
}).optional()
|
|
1451
3218
|
});
|
|
1452
3219
|
const zGetCartItemsResponse = zCartItemsResponse;
|
|
1453
3220
|
const zManageCartsBody = z.union([
|
|
1454
3221
|
zCartItemObjectRequest,
|
|
1455
|
-
|
|
3222
|
+
zSubscriptionItemObjectWritable,
|
|
1456
3223
|
zCartMergeObjectRequest,
|
|
1457
3224
|
zCustomItemObject,
|
|
1458
3225
|
zReOrderObjectRequest,
|
|
@@ -1460,276 +3227,474 @@ const zManageCartsBody = z.union([
|
|
|
1460
3227
|
zBulkAddItemsRequest
|
|
1461
3228
|
]);
|
|
1462
3229
|
const zManageCartsPath = z.object({
|
|
1463
|
-
cartID: z.string()
|
|
3230
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3231
|
+
description: "The unique identifier of the cart that you created."
|
|
3232
|
+
})
|
|
1464
3233
|
});
|
|
1465
3234
|
const zManageCartsResponse = zCartsResponse;
|
|
1466
3235
|
const zBulkUpdateItemsInCartBody = zBulkUpdateCartsItems;
|
|
1467
3236
|
const zBulkUpdateItemsInCartPath = z.object({
|
|
1468
|
-
cartID: z.string()
|
|
3237
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3238
|
+
description: "The unique identifier of the cart that you created."
|
|
3239
|
+
})
|
|
1469
3240
|
});
|
|
1470
3241
|
const zBulkUpdateItemsInCartResponse = zCartItemCollectionResponse;
|
|
1471
3242
|
const zDeleteACartItemPath = z.object({
|
|
1472
|
-
cartID: z.string(),
|
|
1473
|
-
|
|
3243
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3244
|
+
description: "The unique identifier of the cart created by you."
|
|
3245
|
+
}),
|
|
3246
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3247
|
+
description: "The unique identifier of the cart that you want to delete."
|
|
3248
|
+
})
|
|
1474
3249
|
});
|
|
1475
3250
|
const zDeleteACartItemResponse = zCartsResponse;
|
|
1476
3251
|
const zUpdateACartItemBody = zUpdateCartsItems;
|
|
1477
3252
|
const zUpdateACartItemPath = z.object({
|
|
1478
|
-
cartID: z.string(),
|
|
1479
|
-
|
|
3253
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3254
|
+
description: "A unique identifier of the cart that you created."
|
|
3255
|
+
}),
|
|
3256
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3257
|
+
description: "A unique identifier of the cart item."
|
|
3258
|
+
})
|
|
1480
3259
|
});
|
|
1481
3260
|
const zUpdateACartItemResponse = zCartsResponse;
|
|
1482
3261
|
const zDeleteAccountCartAssociationBody = zCartsRelationshipsAccountsData;
|
|
1483
3262
|
const zDeleteAccountCartAssociationHeaders = z.object({
|
|
1484
|
-
"EP-Account-Management-Authentication-Token": z.string().
|
|
3263
|
+
"EP-Account-Management-Authentication-Token": z.string().register(z.globalRegistry, {
|
|
3264
|
+
description: "An Account Management Authentication token to access a specific account's carts."
|
|
3265
|
+
}).optional()
|
|
1485
3266
|
});
|
|
1486
3267
|
const zDeleteAccountCartAssociationPath = z.object({
|
|
1487
|
-
cartID: z.string()
|
|
3268
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3269
|
+
description: "The ID for the cart created by the account."
|
|
3270
|
+
})
|
|
3271
|
+
});
|
|
3272
|
+
const zDeleteAccountCartAssociationResponse = z.void().register(z.globalRegistry, {
|
|
3273
|
+
description: "No Content"
|
|
1488
3274
|
});
|
|
1489
|
-
const zDeleteAccountCartAssociationResponse = z.void();
|
|
1490
3275
|
const zCreateAccountCartAssociationBody = zCartsRelationshipsAccountsData;
|
|
1491
3276
|
const zCreateAccountCartAssociationHeaders = z.object({
|
|
1492
|
-
"EP-Account-Management-Authentication-Token": z.string().
|
|
3277
|
+
"EP-Account-Management-Authentication-Token": z.string().register(z.globalRegistry, {
|
|
3278
|
+
description: "An Account Management Authentication token to access a specific account's carts."
|
|
3279
|
+
}).optional()
|
|
1493
3280
|
});
|
|
1494
3281
|
const zCreateAccountCartAssociationPath = z.object({
|
|
1495
|
-
cartID: z.string()
|
|
3282
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3283
|
+
description: "The ID for the cart created by the account. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters)."
|
|
3284
|
+
})
|
|
1496
3285
|
});
|
|
1497
3286
|
const zCreateAccountCartAssociationResponse = z.union([
|
|
1498
3287
|
zCartsRelationshipsAccountsData,
|
|
1499
|
-
z.void()
|
|
3288
|
+
z.void().register(z.globalRegistry, {
|
|
3289
|
+
description: "No Content is sent back in case the account has already been associated to the cart."
|
|
3290
|
+
})
|
|
1500
3291
|
]);
|
|
1501
3292
|
const zDeleteCustomerCartAssociationBody = zCartsRelationshipsCustomersData;
|
|
1502
3293
|
const zDeleteCustomerCartAssociationHeaders = z.object({
|
|
1503
|
-
"X-Moltin-Customer-Token": z.string().
|
|
3294
|
+
"X-Moltin-Customer-Token": z.string().register(z.globalRegistry, {
|
|
3295
|
+
description: "A customer token to access a specific customer's carts."
|
|
3296
|
+
}).optional()
|
|
1504
3297
|
});
|
|
1505
3298
|
const zDeleteCustomerCartAssociationPath = z.object({
|
|
1506
|
-
cartID: z.string()
|
|
3299
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3300
|
+
description: "The ID for the cart created by the customer."
|
|
3301
|
+
})
|
|
3302
|
+
});
|
|
3303
|
+
const zDeleteCustomerCartAssociationResponse = z.void().register(z.globalRegistry, {
|
|
3304
|
+
description: "No Content"
|
|
1507
3305
|
});
|
|
1508
|
-
const zDeleteCustomerCartAssociationResponse = z.void();
|
|
1509
3306
|
const zCreateCustomerCartAssociationBody = zCartsRelationshipsCustomersData;
|
|
1510
3307
|
const zCreateCustomerCartAssociationHeaders = z.object({
|
|
1511
|
-
"X-Moltin-Customer-Token": z.string().
|
|
3308
|
+
"X-Moltin-Customer-Token": z.string().register(z.globalRegistry, {
|
|
3309
|
+
description: "A customer token to access a specific customer's carts."
|
|
3310
|
+
}).optional()
|
|
1512
3311
|
});
|
|
1513
3312
|
const zCreateCustomerCartAssociationPath = z.object({
|
|
1514
|
-
cartID: z.string()
|
|
3313
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3314
|
+
description: "The ID for the cart created by the customer. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters)."
|
|
3315
|
+
})
|
|
1515
3316
|
});
|
|
1516
3317
|
const zCreateCustomerCartAssociationResponse = z.union([
|
|
1517
3318
|
zCartsRelationshipsCustomersData,
|
|
1518
|
-
z.void()
|
|
3319
|
+
z.void().register(z.globalRegistry, {
|
|
3320
|
+
description: "No Content"
|
|
3321
|
+
})
|
|
1519
3322
|
]);
|
|
1520
3323
|
const zDeleteAPromotionViaPromotionCodePath = z.object({
|
|
1521
|
-
cartID: z.string(),
|
|
1522
|
-
|
|
3324
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3325
|
+
description: "Specifies the unique identifier of a cart created by you."
|
|
3326
|
+
}),
|
|
3327
|
+
promoCode: z.string().register(z.globalRegistry, {
|
|
3328
|
+
description: "Specifies the promotion code to be deleted."
|
|
3329
|
+
})
|
|
3330
|
+
});
|
|
3331
|
+
const zDeleteAPromotionViaPromotionCodeResponse = z.void().register(z.globalRegistry, {
|
|
3332
|
+
description: "No Content"
|
|
1523
3333
|
});
|
|
1524
|
-
const
|
|
1525
|
-
const zAddTaxItemToCartBody = zCartItemTaxesEntityResponse;
|
|
3334
|
+
const zAddTaxItemToCartBody = zCartItemTaxesEntityResponseWritable;
|
|
1526
3335
|
const zAddTaxItemToCartPath = z.object({
|
|
1527
|
-
cartID: z.string(),
|
|
1528
|
-
|
|
3336
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3337
|
+
description: "The unique identifier of the cart."
|
|
3338
|
+
}),
|
|
3339
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3340
|
+
description: "The unique identifier of the cart item."
|
|
3341
|
+
})
|
|
1529
3342
|
});
|
|
1530
3343
|
const zAddTaxItemToCartResponse = zCartItemTaxesEntityResponse;
|
|
1531
|
-
const zAddTaxItemToCartItemComponentBody =
|
|
3344
|
+
const zAddTaxItemToCartItemComponentBody = zCartItemTaxesEntityResponseWritable;
|
|
1532
3345
|
const zAddTaxItemToCartItemComponentPath = z.object({
|
|
1533
|
-
cartID: z.string(),
|
|
1534
|
-
|
|
1535
|
-
|
|
3346
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3347
|
+
description: "The unique identifier of the cart."
|
|
3348
|
+
}),
|
|
3349
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3350
|
+
description: "The unique identifier of the cart item."
|
|
3351
|
+
}),
|
|
3352
|
+
productID: z.string().register(z.globalRegistry, {
|
|
3353
|
+
description: "The unique identifier of the component product within the bundle."
|
|
3354
|
+
})
|
|
1536
3355
|
});
|
|
1537
3356
|
const zAddTaxItemToCartItemComponentResponse = zCartItemTaxesEntityResponse;
|
|
1538
3357
|
const zDeleteTaxItemFromCartItemComponentPath = z.object({
|
|
1539
|
-
cartID: z.string(),
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
3358
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3359
|
+
description: "The unique identifier of the cart."
|
|
3360
|
+
}),
|
|
3361
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3362
|
+
description: "The unique identifier of the cart item."
|
|
3363
|
+
}),
|
|
3364
|
+
productID: z.string().register(z.globalRegistry, {
|
|
3365
|
+
description: "The unique identifier of the component product within the bundle."
|
|
3366
|
+
}),
|
|
3367
|
+
taxitemID: z.string().register(z.globalRegistry, {
|
|
3368
|
+
description: "The unique identifier of the tax item on the component product."
|
|
3369
|
+
})
|
|
1543
3370
|
});
|
|
1544
|
-
const zDeleteTaxItemFromCartItemComponentResponse = z.void()
|
|
1545
|
-
|
|
3371
|
+
const zDeleteTaxItemFromCartItemComponentResponse = z.void().register(z.globalRegistry, {
|
|
3372
|
+
description: "No Content"
|
|
3373
|
+
});
|
|
3374
|
+
const zUpdateTaxItemFromCartItemComponentBody = zCartItemTaxesEntityResponseWritable;
|
|
1546
3375
|
const zUpdateTaxItemFromCartItemComponentPath = z.object({
|
|
1547
|
-
cartID: z.string(),
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
3376
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3377
|
+
description: "The unique identifier of the cart."
|
|
3378
|
+
}),
|
|
3379
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3380
|
+
description: "The unique identifier of the cart item."
|
|
3381
|
+
}),
|
|
3382
|
+
productID: z.string().register(z.globalRegistry, {
|
|
3383
|
+
description: "The unique identifier of the component product within the bundle."
|
|
3384
|
+
}),
|
|
3385
|
+
taxitemID: z.string().register(z.globalRegistry, {
|
|
3386
|
+
description: "The unique identifier of the tax item on the component product."
|
|
3387
|
+
})
|
|
1551
3388
|
});
|
|
1552
3389
|
const zUpdateTaxItemFromCartItemComponentResponse = zCartItemTaxesEntityResponse;
|
|
1553
3390
|
const zBulkDeleteTaxItemsFromCartPath = z.object({
|
|
1554
|
-
cartID: z.string()
|
|
3391
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3392
|
+
description: "The unique identifier of the cart."
|
|
3393
|
+
})
|
|
3394
|
+
});
|
|
3395
|
+
const zBulkDeleteTaxItemsFromCartResponse = z.void().register(z.globalRegistry, {
|
|
3396
|
+
description: "No Content"
|
|
1555
3397
|
});
|
|
1556
|
-
const
|
|
1557
|
-
const zBulkAddTaxItemsToCartBody = zCartsBulkTaxes;
|
|
3398
|
+
const zBulkAddTaxItemsToCartBody = zCartsBulkTaxesWritable;
|
|
1558
3399
|
const zBulkAddTaxItemsToCartPath = z.object({
|
|
1559
|
-
cartID: z.string()
|
|
3400
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3401
|
+
description: "The unique identifier of the cart."
|
|
3402
|
+
})
|
|
1560
3403
|
});
|
|
1561
3404
|
const zBulkAddTaxItemsToCartResponse = zCartsBulkTaxes;
|
|
1562
3405
|
const zDeleteATaxItemPath = z.object({
|
|
1563
|
-
cartID: z.string(),
|
|
1564
|
-
|
|
1565
|
-
|
|
3406
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3407
|
+
description: "The unique identifier of the cart."
|
|
3408
|
+
}),
|
|
3409
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3410
|
+
description: "The unique identifier of the cart item."
|
|
3411
|
+
}),
|
|
3412
|
+
taxitemID: z.string().register(z.globalRegistry, {
|
|
3413
|
+
description: "The unique identifier of the tax item."
|
|
3414
|
+
})
|
|
1566
3415
|
});
|
|
1567
|
-
const zDeleteATaxItemResponse = z.void()
|
|
1568
|
-
|
|
3416
|
+
const zDeleteATaxItemResponse = z.void().register(z.globalRegistry, {
|
|
3417
|
+
description: "No Content"
|
|
3418
|
+
});
|
|
3419
|
+
const zUpdateATaxItemBody = zCartItemTaxesEntityResponseWritable;
|
|
1569
3420
|
const zUpdateATaxItemPath = z.object({
|
|
1570
|
-
cartID: z.string(),
|
|
1571
|
-
|
|
1572
|
-
|
|
3421
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3422
|
+
description: "The unique identifier of the cart."
|
|
3423
|
+
}),
|
|
3424
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3425
|
+
description: "The unique identifier of the cart item."
|
|
3426
|
+
}),
|
|
3427
|
+
taxitemID: z.string().register(z.globalRegistry, {
|
|
3428
|
+
description: "The unique identifier of the tax item."
|
|
3429
|
+
})
|
|
1573
3430
|
});
|
|
1574
3431
|
const zUpdateATaxItemResponse = zCartItemTaxesEntityResponse;
|
|
1575
3432
|
const zBulkDeleteCustomDiscountsFromCartPath = z.object({
|
|
1576
|
-
cartID: z.string()
|
|
3433
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3434
|
+
description: "Specifies the unique ID for the cart."
|
|
3435
|
+
})
|
|
3436
|
+
});
|
|
3437
|
+
const zBulkDeleteCustomDiscountsFromCartResponse = z.void().register(z.globalRegistry, {
|
|
3438
|
+
description: "No Content"
|
|
1577
3439
|
});
|
|
1578
|
-
const zBulkDeleteCustomDiscountsFromCartResponse = z.void();
|
|
1579
3440
|
const zBulkAddCustomDiscountsToCartBody = zCartsBulkCustomDiscounts;
|
|
1580
3441
|
const zBulkAddCustomDiscountsToCartPath = z.object({
|
|
1581
|
-
cartID: z.string()
|
|
3442
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3443
|
+
description: "Specifies the system generated ID for the cart that the shopper created."
|
|
3444
|
+
})
|
|
1582
3445
|
});
|
|
1583
3446
|
const zBulkAddCustomDiscountsToCartResponse = z.union([
|
|
1584
3447
|
zCartsBulkCustomDiscountsResponse,
|
|
1585
3448
|
zCartsBulkCustomDiscountsCollectionResponse
|
|
1586
3449
|
]);
|
|
1587
3450
|
const zDeleteCustomDiscountFromCartPath = z.object({
|
|
1588
|
-
cartID: z.string(),
|
|
1589
|
-
|
|
3451
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3452
|
+
description: "Specifies the unique ID for the cart."
|
|
3453
|
+
}),
|
|
3454
|
+
customdiscountID: z.string().register(z.globalRegistry, {
|
|
3455
|
+
description: "Specifies the ID for the custom discount to be deleted."
|
|
3456
|
+
})
|
|
3457
|
+
});
|
|
3458
|
+
const zDeleteCustomDiscountFromCartResponse = z.void().register(z.globalRegistry, {
|
|
3459
|
+
description: "No Content"
|
|
1590
3460
|
});
|
|
1591
|
-
const zDeleteCustomDiscountFromCartResponse = z.void();
|
|
1592
3461
|
const zUpdateCustomDiscountForCartBody = zCartsCustomDiscountsEntityRequest;
|
|
1593
3462
|
const zUpdateCustomDiscountForCartPath = z.object({
|
|
1594
|
-
cartID: z.string(),
|
|
1595
|
-
|
|
3463
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3464
|
+
description: "Specifies the unique ID for the cart."
|
|
3465
|
+
}),
|
|
3466
|
+
customdiscountID: z.string().register(z.globalRegistry, {
|
|
3467
|
+
description: "Specifies the ID for the custom discount to be updated."
|
|
3468
|
+
})
|
|
1596
3469
|
});
|
|
1597
3470
|
const zUpdateCustomDiscountForCartResponse = zCartsCustomDiscountsEntityResponse;
|
|
1598
3471
|
const zAddCustomDiscountToCartItemBody = zCartsCustomDiscountsCreateRequest;
|
|
1599
3472
|
const zAddCustomDiscountToCartItemPath = z.object({
|
|
1600
|
-
cartID: z.string(),
|
|
1601
|
-
|
|
3473
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3474
|
+
description: "Specifies the ID for the cart."
|
|
3475
|
+
}),
|
|
3476
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3477
|
+
description: "Specifies the unique identifier for the cart item."
|
|
3478
|
+
})
|
|
1602
3479
|
});
|
|
1603
3480
|
const zAddCustomDiscountToCartItemResponse = z.union([
|
|
1604
3481
|
zCartsCustomDiscountsCollectionResponse,
|
|
1605
3482
|
zCartsCustomDiscountsEntityResponse
|
|
1606
3483
|
]);
|
|
1607
3484
|
const zDeleteCustomDiscountFromCartItemPath = z.object({
|
|
1608
|
-
cartID: z.string(),
|
|
1609
|
-
|
|
1610
|
-
|
|
3485
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3486
|
+
description: "Specifies the ID for the cart."
|
|
3487
|
+
}),
|
|
3488
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3489
|
+
description: "Specifies the ID for the cart item."
|
|
3490
|
+
}),
|
|
3491
|
+
customdiscountID: z.string().register(z.globalRegistry, {
|
|
3492
|
+
description: "Specifies the ID for the custom discount to be deleted."
|
|
3493
|
+
})
|
|
3494
|
+
});
|
|
3495
|
+
const zDeleteCustomDiscountFromCartItemResponse = z.void().register(z.globalRegistry, {
|
|
3496
|
+
description: "No Content"
|
|
1611
3497
|
});
|
|
1612
|
-
const zDeleteCustomDiscountFromCartItemResponse = z.void();
|
|
1613
3498
|
const zUpdateCustomDiscountForCartItemBody = zCartsCustomDiscountsEntityRequest;
|
|
1614
3499
|
const zUpdateCustomDiscountForCartItemPath = z.object({
|
|
1615
|
-
cartID: z.string(),
|
|
1616
|
-
|
|
1617
|
-
|
|
3500
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3501
|
+
description: "Specifies the ID for the cart."
|
|
3502
|
+
}),
|
|
3503
|
+
cartitemID: z.string().register(z.globalRegistry, {
|
|
3504
|
+
description: "Specifies the ID for the cart item."
|
|
3505
|
+
}),
|
|
3506
|
+
customdiscountID: z.string().register(z.globalRegistry, {
|
|
3507
|
+
description: "Specifies the ID for the custom discount to be updated."
|
|
3508
|
+
})
|
|
1618
3509
|
});
|
|
1619
3510
|
const zUpdateCustomDiscountForCartItemResponse = zCartsCustomDiscountsEntityResponse;
|
|
1620
3511
|
const zGetShippingGroupsPath = z.object({
|
|
1621
|
-
cartID: z.string()
|
|
3512
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3513
|
+
description: "The ID of the cart"
|
|
3514
|
+
})
|
|
1622
3515
|
});
|
|
1623
3516
|
const zGetShippingGroupsResponse = z.object({
|
|
1624
3517
|
data: z.array(zShippingGroupResponse).optional()
|
|
3518
|
+
}).register(z.globalRegistry, {
|
|
3519
|
+
description: "A list of shipping groups"
|
|
1625
3520
|
});
|
|
1626
3521
|
const zCreateShippingGroupBody = zCreateShippingGroupRequest;
|
|
1627
3522
|
const zCreateShippingGroupPath = z.object({
|
|
1628
|
-
cartID: z.string()
|
|
3523
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3524
|
+
description: "The ID of the cart"
|
|
3525
|
+
})
|
|
1629
3526
|
});
|
|
1630
3527
|
const zCreateShippingGroupResponse = zShippingGroupEntityResponse;
|
|
1631
3528
|
const zDeleteCartShippingGroupPath = z.object({
|
|
1632
|
-
cartId: z.string(),
|
|
1633
|
-
|
|
3529
|
+
cartId: z.string().register(z.globalRegistry, {
|
|
3530
|
+
description: "The ID of the cart"
|
|
3531
|
+
}),
|
|
3532
|
+
shippingGroupId: z.string().register(z.globalRegistry, {
|
|
3533
|
+
description: "The ID of the shipping group to delete"
|
|
3534
|
+
})
|
|
3535
|
+
});
|
|
3536
|
+
const zDeleteCartShippingGroupResponse = z.void().register(z.globalRegistry, {
|
|
3537
|
+
description: "Successfully deleted the shipping group"
|
|
1634
3538
|
});
|
|
1635
|
-
const zDeleteCartShippingGroupResponse = z.void();
|
|
1636
3539
|
const zGetShippingGroupByIdPath = z.object({
|
|
1637
|
-
cartId: z.string(),
|
|
1638
|
-
|
|
3540
|
+
cartId: z.string().register(z.globalRegistry, {
|
|
3541
|
+
description: "The ID of the cart"
|
|
3542
|
+
}),
|
|
3543
|
+
shippingGroupId: z.string().register(z.globalRegistry, {
|
|
3544
|
+
description: "The ID of the shipping group"
|
|
3545
|
+
})
|
|
1639
3546
|
});
|
|
1640
3547
|
const zGetShippingGroupByIdResponse = z.object({
|
|
1641
3548
|
data: zShippingGroupResponse.optional()
|
|
3549
|
+
}).register(z.globalRegistry, {
|
|
3550
|
+
description: "Shipping group details"
|
|
1642
3551
|
});
|
|
1643
3552
|
const zUpdateShippingGroupBody = zUpdateCartShippingGroupRequest;
|
|
1644
3553
|
const zUpdateShippingGroupPath = z.object({
|
|
1645
|
-
cartId: z.string(),
|
|
1646
|
-
|
|
3554
|
+
cartId: z.string().register(z.globalRegistry, {
|
|
3555
|
+
description: "The ID of the cart"
|
|
3556
|
+
}),
|
|
3557
|
+
shippingGroupId: z.string().register(z.globalRegistry, {
|
|
3558
|
+
description: "The ID of the shipping group"
|
|
3559
|
+
})
|
|
1647
3560
|
});
|
|
1648
3561
|
const zUpdateShippingGroupResponse = zShippingGroupEntityResponse;
|
|
1649
3562
|
const zCreateCartPaymentIntentBody = zElasticPathPaymentsPoweredByStripePayment;
|
|
1650
3563
|
const zCreateCartPaymentIntentPath = z.object({
|
|
1651
|
-
cartID: z.string()
|
|
3564
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3565
|
+
description: "The universally unique identifier of the cart for which you want to create a payment intent."
|
|
3566
|
+
})
|
|
1652
3567
|
});
|
|
1653
3568
|
const zCreateCartPaymentIntentResponse = zCartEntityResponse;
|
|
1654
3569
|
const zUpdateCartPaymentIntentBody = zCartPaymentUpdate;
|
|
1655
3570
|
const zUpdateCartPaymentIntentPath = z.object({
|
|
1656
|
-
cartID: z.string(),
|
|
1657
|
-
|
|
3571
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3572
|
+
description: "The unique identifier of the cart."
|
|
3573
|
+
}),
|
|
3574
|
+
paymentIntentID: z.string().register(z.globalRegistry, {
|
|
3575
|
+
description: "The unique identifier of the payment intent."
|
|
3576
|
+
})
|
|
1658
3577
|
});
|
|
1659
3578
|
const zUpdateCartPaymentIntentResponse = zCartEntityResponse;
|
|
1660
3579
|
const zCheckoutApiBody = z.union([zCustomerCheckout, zAccountCheckout]);
|
|
1661
3580
|
const zCheckoutApiHeaders = z.object({
|
|
1662
|
-
"EP-Account-Management-Authentication-Token": z.string().
|
|
3581
|
+
"EP-Account-Management-Authentication-Token": z.string().register(z.globalRegistry, {
|
|
3582
|
+
description: "An account management authentication token that identifies the authenticated account member."
|
|
3583
|
+
}).optional()
|
|
1663
3584
|
});
|
|
1664
3585
|
const zCheckoutApiPath = z.object({
|
|
1665
|
-
cartID: z.string()
|
|
3586
|
+
cartID: z.string().register(z.globalRegistry, {
|
|
3587
|
+
description: "The ID of the cart that you want to checkout."
|
|
3588
|
+
})
|
|
1666
3589
|
});
|
|
1667
3590
|
const zCheckoutApiResponse = zOrderEntityResponse;
|
|
1668
3591
|
const zGetCustomerOrdersHeaders = z.object({
|
|
1669
|
-
"x-moltin-customer-token": z.string().
|
|
3592
|
+
"x-moltin-customer-token": z.string().register(z.globalRegistry, {
|
|
3593
|
+
description: "A customer token to access a specific customer's orders."
|
|
3594
|
+
}).optional()
|
|
1670
3595
|
});
|
|
1671
3596
|
const zGetCustomerOrdersQuery = z.object({
|
|
1672
|
-
include: z.string().
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
3597
|
+
include: z.string().register(z.globalRegistry, {
|
|
3598
|
+
description: "Comma-delimited string of entities to include (items, tax_items, custom_discounts, promotions)."
|
|
3599
|
+
}).optional(),
|
|
3600
|
+
"page[limit]": z.int().gte(1).lte(100).register(z.globalRegistry, {
|
|
3601
|
+
description: "The maximum number of records per page."
|
|
3602
|
+
}).optional().default(20),
|
|
3603
|
+
"page[offset]": z.int().gte(0).lte(1e4).register(z.globalRegistry, {
|
|
3604
|
+
description: "The number of records to offset the results by."
|
|
3605
|
+
}).optional().default(0),
|
|
3606
|
+
filter: z.string().register(z.globalRegistry, {
|
|
3607
|
+
description: "Filter expression for searching orders. See filtering documentation for available operators and attributes."
|
|
3608
|
+
}).optional()
|
|
1676
3609
|
});
|
|
1677
3610
|
const zGetCustomerOrdersResponse = zOrderCollectionResponse;
|
|
1678
3611
|
const zGetAnOrderPath = z.object({
|
|
1679
|
-
orderID: z.string()
|
|
3612
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3613
|
+
description: "The ID of the order."
|
|
3614
|
+
})
|
|
1680
3615
|
});
|
|
1681
3616
|
const zGetAnOrderQuery = z.object({
|
|
1682
|
-
include: z.string().
|
|
3617
|
+
include: z.string().register(z.globalRegistry, {
|
|
3618
|
+
description: "Comma-delimited string of entities to include (items, tax_items, custom_discounts, promotions)."
|
|
3619
|
+
}).optional()
|
|
1683
3620
|
});
|
|
1684
3621
|
const zGetAnOrderResponse = zOrderEntityResponse;
|
|
1685
3622
|
const zUpdateAnOrderBody = zOrdersUpdateRequest;
|
|
1686
3623
|
const zUpdateAnOrderPath = z.object({
|
|
1687
|
-
orderID: z.string()
|
|
3624
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3625
|
+
description: "The unique identifier of the order."
|
|
3626
|
+
})
|
|
1688
3627
|
});
|
|
1689
3628
|
const zUpdateAnOrderResponse = zOrderEntityResponse;
|
|
1690
3629
|
const zGetOrderItemsPath = z.object({
|
|
1691
|
-
orderID: z.string()
|
|
3630
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3631
|
+
description: "The ID of the order."
|
|
3632
|
+
})
|
|
1692
3633
|
});
|
|
1693
3634
|
const zGetOrderItemsQuery = z.object({
|
|
1694
|
-
include: z.string().
|
|
3635
|
+
include: z.string().register(z.globalRegistry, {
|
|
3636
|
+
description: "Comma-delimited string of entities to include (tax_items, custom_discounts, promotions)."
|
|
3637
|
+
}).optional()
|
|
1695
3638
|
});
|
|
1696
3639
|
const zGetOrderItemsResponse = zOrderItemCollectionResponse;
|
|
1697
3640
|
const zAnonymizeOrdersBody = zOrdersAnonymizeRequest.and(z.unknown());
|
|
1698
3641
|
const zAnonymizeOrdersResponse = zOrdersListResponse;
|
|
1699
3642
|
const zConfirmOrderPath = z.object({
|
|
1700
|
-
orderID: z.string()
|
|
3643
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3644
|
+
description: "The unique identifier of the order to confirm."
|
|
3645
|
+
})
|
|
1701
3646
|
});
|
|
1702
3647
|
const zConfirmOrderResponse = zTransactionEntityResponse;
|
|
1703
3648
|
const zPaymentSetupBody = zPaymentsRequest;
|
|
1704
3649
|
const zPaymentSetupPath = z.object({
|
|
1705
|
-
orderID: z.string()
|
|
3650
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3651
|
+
description: "The Universally Unique Identifier (UUID) of the order you want to pay for."
|
|
3652
|
+
})
|
|
1706
3653
|
});
|
|
1707
3654
|
const zPaymentSetupResponse = zTransactionEntityResponse;
|
|
1708
3655
|
const zConfirmPaymentBody = zOrdersTransactionsConfirmRequest;
|
|
1709
3656
|
const zConfirmPaymentPath = z.object({
|
|
1710
|
-
orderID: z.string(),
|
|
1711
|
-
|
|
3657
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3658
|
+
description: "The unique identifier of the order."
|
|
3659
|
+
}),
|
|
3660
|
+
transactionID: z.string().register(z.globalRegistry, {
|
|
3661
|
+
description: "The unique identifier of the transaction."
|
|
3662
|
+
})
|
|
1712
3663
|
});
|
|
1713
3664
|
const zConfirmPaymentResponse = zTransactionEntityResponse;
|
|
1714
3665
|
const zCaptureATransactionBody = zOrdersTransactionsCaptureRequest;
|
|
1715
3666
|
const zCaptureATransactionPath = z.object({
|
|
1716
|
-
orderID: z.string(),
|
|
1717
|
-
|
|
3667
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3668
|
+
description: "The UUID of the order."
|
|
3669
|
+
}),
|
|
3670
|
+
transactionID: z.string().register(z.globalRegistry, {
|
|
3671
|
+
description: "The UUID of the transaction to capture."
|
|
3672
|
+
})
|
|
1718
3673
|
});
|
|
1719
3674
|
const zCaptureATransactionResponse = zTransactionEntityResponse;
|
|
1720
3675
|
const zRefundATransactionBody = zOrdersTransactionsRefundRequest;
|
|
1721
3676
|
const zRefundATransactionPath = z.object({
|
|
1722
|
-
orderID: z.string(),
|
|
1723
|
-
|
|
3677
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3678
|
+
description: "The UUID of the order."
|
|
3679
|
+
}),
|
|
3680
|
+
transactionID: z.string().register(z.globalRegistry, {
|
|
3681
|
+
description: "The UUID of the transaction you want to refund."
|
|
3682
|
+
})
|
|
1724
3683
|
});
|
|
1725
3684
|
const zRefundATransactionResponse = zTransactionEntityResponse;
|
|
1726
3685
|
const zGetOrderTransactionsPath = z.object({
|
|
1727
|
-
orderID: z.string()
|
|
3686
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3687
|
+
description: "The unique identifier of the order."
|
|
3688
|
+
})
|
|
1728
3689
|
});
|
|
1729
3690
|
const zGetOrderTransactionsResponse = zTransactionListResponse;
|
|
1730
3691
|
const zGetATransactionPath = z.object({
|
|
1731
|
-
orderID: z.string(),
|
|
1732
|
-
|
|
3692
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3693
|
+
description: "The unique identifier of the order that you require transactions for."
|
|
3694
|
+
}),
|
|
3695
|
+
transactionID: z.string().register(z.globalRegistry, {
|
|
3696
|
+
description: "The unique identifier of the transaction."
|
|
3697
|
+
})
|
|
1733
3698
|
});
|
|
1734
3699
|
const zGetATransactionResponse = zResponseData.and(
|
|
1735
3700
|
z.object({
|
|
@@ -1738,21 +3703,33 @@ const zGetATransactionResponse = zResponseData.and(
|
|
|
1738
3703
|
);
|
|
1739
3704
|
const zCancelATransactionBody = zOrdersTransactionsCancelRequest;
|
|
1740
3705
|
const zCancelATransactionPath = z.object({
|
|
1741
|
-
orderID: z.string(),
|
|
1742
|
-
|
|
3706
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3707
|
+
description: "The unique identifier of the order."
|
|
3708
|
+
}),
|
|
3709
|
+
transactionID: z.string().register(z.globalRegistry, {
|
|
3710
|
+
description: "The unique identifier of the transaction to be canceled or voided."
|
|
3711
|
+
})
|
|
1743
3712
|
});
|
|
1744
3713
|
const zCancelATransactionResponse = zTransactionEntityResponse;
|
|
1745
3714
|
const zGetOrderShippingGroupsPath = z.object({
|
|
1746
|
-
orderID: z.string()
|
|
3715
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3716
|
+
description: "The ID of the order"
|
|
3717
|
+
})
|
|
1747
3718
|
});
|
|
1748
3719
|
const zGetOrderShippingGroupsResponse = z.object({
|
|
1749
3720
|
data: z.array(zShippingGroupResponse).optional()
|
|
3721
|
+
}).register(z.globalRegistry, {
|
|
3722
|
+
description: "A list of shipping groups"
|
|
1750
3723
|
});
|
|
1751
3724
|
const zCreateOrderShippingGroupBody = z.object({
|
|
1752
3725
|
data: z.object({
|
|
1753
3726
|
type: z.literal("shipping_group"),
|
|
1754
|
-
shipping_type: z.string().
|
|
1755
|
-
|
|
3727
|
+
shipping_type: z.string().register(z.globalRegistry, {
|
|
3728
|
+
description: "The shipping type for this group"
|
|
3729
|
+
}).optional(),
|
|
3730
|
+
tracking_reference: z.string().register(z.globalRegistry, {
|
|
3731
|
+
description: "Tracking reference for the shipment"
|
|
3732
|
+
}).optional(),
|
|
1756
3733
|
address: z.object({
|
|
1757
3734
|
first_name: z.string().optional(),
|
|
1758
3735
|
last_name: z.string().optional(),
|
|
@@ -1768,41 +3745,61 @@ const zCreateOrderShippingGroupBody = z.object({
|
|
|
1768
3745
|
instructions: z.string().optional()
|
|
1769
3746
|
}).optional(),
|
|
1770
3747
|
delivery_estimate: z.object({
|
|
1771
|
-
start: z.
|
|
1772
|
-
end: z.
|
|
3748
|
+
start: z.iso.datetime().optional(),
|
|
3749
|
+
end: z.iso.datetime().optional()
|
|
1773
3750
|
}).optional()
|
|
1774
3751
|
}).optional()
|
|
3752
|
+
}).register(z.globalRegistry, {
|
|
3753
|
+
description: "Shipping group details"
|
|
1775
3754
|
});
|
|
1776
3755
|
const zCreateOrderShippingGroupPath = z.object({
|
|
1777
|
-
orderID: z.string()
|
|
3756
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3757
|
+
description: "The ID of the order"
|
|
3758
|
+
})
|
|
1778
3759
|
});
|
|
1779
3760
|
const zCreateOrderShippingGroupResponse = z.object({
|
|
1780
3761
|
data: zShippingGroupResponse.optional()
|
|
3762
|
+
}).register(z.globalRegistry, {
|
|
3763
|
+
description: "Shipping group created"
|
|
1781
3764
|
});
|
|
1782
3765
|
const zGetShippingGroupsByIdPath = z.object({
|
|
1783
|
-
orderID: z.string(),
|
|
1784
|
-
|
|
3766
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3767
|
+
description: "The ID of the order"
|
|
3768
|
+
}),
|
|
3769
|
+
shippingGroupID: z.string().register(z.globalRegistry, {
|
|
3770
|
+
description: "The ID of the shipping group"
|
|
3771
|
+
})
|
|
1785
3772
|
});
|
|
1786
3773
|
const zGetShippingGroupsByIdQuery = z.object({
|
|
1787
|
-
include: z.literal("items").
|
|
3774
|
+
include: z.literal("items").register(z.globalRegistry, {
|
|
3775
|
+
description: "A comma-separated list of related resources to include in the response."
|
|
3776
|
+
}).optional()
|
|
1788
3777
|
});
|
|
1789
3778
|
const zGetShippingGroupsByIdResponse = zShippingGroupEntityResponse;
|
|
1790
3779
|
const zPutShippingGroupByIdBody = zUpdateOrderShippingGroupRequest;
|
|
1791
3780
|
const zPutShippingGroupByIdPath = z.object({
|
|
1792
|
-
orderID: z.string(),
|
|
1793
|
-
|
|
3781
|
+
orderID: z.string().register(z.globalRegistry, {
|
|
3782
|
+
description: "The ID of the order"
|
|
3783
|
+
}),
|
|
3784
|
+
shippingGroupID: z.string().register(z.globalRegistry, {
|
|
3785
|
+
description: "The ID of the shipping group"
|
|
3786
|
+
})
|
|
1794
3787
|
});
|
|
1795
3788
|
const zPutShippingGroupByIdResponse = zShippingGroupEntityResponse;
|
|
1796
3789
|
const zGetV2SettingsCartResponse = zSettingsCart;
|
|
1797
|
-
const zPutV2SettingsCartBody =
|
|
3790
|
+
const zPutV2SettingsCartBody = zSettingsCartWritable;
|
|
1798
3791
|
const zPutV2SettingsCartResponse = zSettingsCart;
|
|
1799
3792
|
const zGetV2SettingsCartStoreIdPath = z.object({
|
|
1800
|
-
storeID: z.string()
|
|
3793
|
+
storeID: z.string().register(z.globalRegistry, {
|
|
3794
|
+
description: "The store ID."
|
|
3795
|
+
})
|
|
1801
3796
|
});
|
|
1802
3797
|
const zGetV2SettingsCartStoreIdResponse = zSettingsCart;
|
|
1803
|
-
const zPutV2SettingsCartStoreIdBody =
|
|
3798
|
+
const zPutV2SettingsCartStoreIdBody = zSettingsCartWritable;
|
|
1804
3799
|
const zPutV2SettingsCartStoreIdPath = z.object({
|
|
1805
|
-
storeID: z.string()
|
|
3800
|
+
storeID: z.string().register(z.globalRegistry, {
|
|
3801
|
+
description: "The store ID."
|
|
3802
|
+
})
|
|
1806
3803
|
});
|
|
1807
3804
|
const zPutV2SettingsCartStoreIdResponse = zSettingsCart;
|
|
1808
3805
|
export {
|
|
@@ -1853,16 +3850,22 @@ export {
|
|
|
1853
3850
|
zCartCollectionResponse,
|
|
1854
3851
|
zCartContact,
|
|
1855
3852
|
zCartEntityResponse,
|
|
3853
|
+
zCartEntityResponseWritable,
|
|
1856
3854
|
zCartItemBulkCustomDiscountObject,
|
|
1857
3855
|
zCartItemCollectionResponse,
|
|
3856
|
+
zCartItemCollectionResponseWritable,
|
|
1858
3857
|
zCartItemFormattedPriceData,
|
|
1859
3858
|
zCartItemObject,
|
|
1860
3859
|
zCartItemObjectData,
|
|
1861
3860
|
zCartItemObjectRequest,
|
|
3861
|
+
zCartItemObjectWritable,
|
|
1862
3862
|
zCartItemRelationship,
|
|
1863
3863
|
zCartItemResponse,
|
|
3864
|
+
zCartItemResponseWritable,
|
|
1864
3865
|
zCartItemTaxesEntityResponse,
|
|
3866
|
+
zCartItemTaxesEntityResponseWritable,
|
|
1865
3867
|
zCartItemsResponse,
|
|
3868
|
+
zCartItemsResponseWritable,
|
|
1866
3869
|
zCartMergeObject,
|
|
1867
3870
|
zCartMergeObjectRequest,
|
|
1868
3871
|
zCartPaymentUpdate,
|
|
@@ -1872,26 +3875,34 @@ export {
|
|
|
1872
3875
|
zCartsBulkCustomDiscountsCollectionResponse,
|
|
1873
3876
|
zCartsBulkCustomDiscountsResponse,
|
|
1874
3877
|
zCartsBulkTaxes,
|
|
3878
|
+
zCartsBulkTaxesWritable,
|
|
1875
3879
|
zCartsCustomDiscountsCollectionResponse,
|
|
1876
3880
|
zCartsCustomDiscountsCreateRequest,
|
|
1877
3881
|
zCartsCustomDiscountsEntityRequest,
|
|
1878
3882
|
zCartsCustomDiscountsEntityResponse,
|
|
1879
3883
|
zCartsCustomDiscountsObject,
|
|
1880
3884
|
zCartsCustomDiscountsResponseObject,
|
|
3885
|
+
zCartsCustomDiscountsResponseObjectWritable,
|
|
1881
3886
|
zCartsCustomDiscountsUpdateObject,
|
|
1882
3887
|
zCartsItemsTaxesCommon,
|
|
3888
|
+
zCartsItemsTaxesCommonWritable,
|
|
1883
3889
|
zCartsItemsTaxesObject,
|
|
3890
|
+
zCartsItemsTaxesObjectWritable,
|
|
1884
3891
|
zCartsItemsTaxesWithAmount,
|
|
3892
|
+
zCartsItemsTaxesWithAmountWritable,
|
|
1885
3893
|
zCartsItemsTaxesWithRate,
|
|
3894
|
+
zCartsItemsTaxesWithRateWritable,
|
|
1886
3895
|
zCartsRelationshipsAccountsData,
|
|
1887
3896
|
zCartsRelationshipsCustomersData,
|
|
1888
3897
|
zCartsRequest,
|
|
1889
3898
|
zCartsResponse,
|
|
3899
|
+
zCartsResponseWritable,
|
|
1890
3900
|
zCheckoutApiBody,
|
|
1891
3901
|
zCheckoutApiHeaders,
|
|
1892
3902
|
zCheckoutApiPath,
|
|
1893
3903
|
zCheckoutApiResponse,
|
|
1894
3904
|
zCondensedPromotionResponse,
|
|
3905
|
+
zCondensedPromotionResponseWritable,
|
|
1895
3906
|
zConfirmOrderPath,
|
|
1896
3907
|
zConfirmOrderResponse,
|
|
1897
3908
|
zConfirmPaymentBody,
|
|
@@ -1922,6 +3933,8 @@ export {
|
|
|
1922
3933
|
zCustomAttributes,
|
|
1923
3934
|
zCustomDiscountRelationshipsCartItemRequest,
|
|
1924
3935
|
zCustomDiscountResponse,
|
|
3936
|
+
zCustomItemCartObject,
|
|
3937
|
+
zCustomItemCartObjectWritable,
|
|
1925
3938
|
zCustomItemObject,
|
|
1926
3939
|
zCustomItemObjectData,
|
|
1927
3940
|
zCustomer,
|
|
@@ -1967,6 +3980,7 @@ export {
|
|
|
1967
3980
|
zDeliveryEstimate,
|
|
1968
3981
|
zDiscount,
|
|
1969
3982
|
zDiscountData,
|
|
3983
|
+
zDiscountDataWritable,
|
|
1970
3984
|
zDiscountFormattedPriceData,
|
|
1971
3985
|
zDiscountSettings,
|
|
1972
3986
|
zDiscounts,
|
|
@@ -2016,14 +4030,19 @@ export {
|
|
|
2016
4030
|
zMoney,
|
|
2017
4031
|
zNonNegativeFormattedPriceData,
|
|
2018
4032
|
zOrderCollectionResponse,
|
|
4033
|
+
zOrderCollectionResponseWritable,
|
|
2019
4034
|
zOrderEntityResponse,
|
|
4035
|
+
zOrderEntityResponseWritable,
|
|
2020
4036
|
zOrderItemCollectionResponse,
|
|
4037
|
+
zOrderItemCollectionResponseWritable,
|
|
2021
4038
|
zOrderItemFormattedUnitPriceData,
|
|
2022
4039
|
zOrderItemResponse,
|
|
4040
|
+
zOrderItemResponseWritable,
|
|
2023
4041
|
zOrderMeta,
|
|
2024
4042
|
zOrderPriceData,
|
|
2025
4043
|
zOrderPriceWrapperMeta,
|
|
2026
4044
|
zOrderResponse,
|
|
4045
|
+
zOrderResponseWritable,
|
|
2027
4046
|
zOrderTimestamps,
|
|
2028
4047
|
zOrdersAddressData,
|
|
2029
4048
|
zOrdersAnonymizeData,
|
|
@@ -2031,6 +4050,7 @@ export {
|
|
|
2031
4050
|
zOrdersCancelData,
|
|
2032
4051
|
zOrdersFulfilledData,
|
|
2033
4052
|
zOrdersListResponse,
|
|
4053
|
+
zOrdersListResponseWritable,
|
|
2034
4054
|
zOrdersTransactionsCancelRequest,
|
|
2035
4055
|
zOrdersTransactionsCaptureRequest,
|
|
2036
4056
|
zOrdersTransactionsConfirmRequest,
|
|
@@ -2040,6 +4060,8 @@ export {
|
|
|
2040
4060
|
zPaymentSetupPath,
|
|
2041
4061
|
zPaymentSetupResponse,
|
|
2042
4062
|
zPaymentsRequest,
|
|
4063
|
+
zPromotionItemCartObject,
|
|
4064
|
+
zPromotionItemCartObjectWritable,
|
|
2043
4065
|
zPromotionItemObject,
|
|
2044
4066
|
zPromotionItemObjectData,
|
|
2045
4067
|
zPutShippingGroupByIdBody,
|
|
@@ -2066,20 +4088,29 @@ export {
|
|
|
2066
4088
|
zResponsePaginationPage,
|
|
2067
4089
|
zResponsePaginationResults,
|
|
2068
4090
|
zSettingsCart,
|
|
4091
|
+
zSettingsCartWritable,
|
|
2069
4092
|
zShippingAddress,
|
|
2070
4093
|
zShippingGroupEntityResponse,
|
|
4094
|
+
zShippingGroupEntityResponseWritable,
|
|
2071
4095
|
zShippingGroupMeta,
|
|
2072
4096
|
zShippingGroupResponse,
|
|
2073
4097
|
zShippingPriceRequest,
|
|
2074
4098
|
zShippingPriceResponse,
|
|
2075
4099
|
zSingleRelationship,
|
|
4100
|
+
zSubscriptionItemCartObject,
|
|
4101
|
+
zSubscriptionItemCartObjectWritable,
|
|
2076
4102
|
zSubscriptionItemObject,
|
|
2077
4103
|
zSubscriptionItemObjectData,
|
|
4104
|
+
zSubscriptionItemObjectWritable,
|
|
2078
4105
|
zTaxItemResponse,
|
|
4106
|
+
zTaxItemResponseWritable,
|
|
2079
4107
|
zTimestamps,
|
|
2080
4108
|
zTransactionEntityResponse,
|
|
4109
|
+
zTransactionEntityResponseWritable,
|
|
2081
4110
|
zTransactionListResponse,
|
|
4111
|
+
zTransactionListResponseWritable,
|
|
2082
4112
|
zTransactionResponse,
|
|
4113
|
+
zTransactionResponseWritable,
|
|
2083
4114
|
zUpdateACartBody,
|
|
2084
4115
|
zUpdateACartItemBody,
|
|
2085
4116
|
zUpdateACartItemPath,
|