@xedo/sdk 0.1.0 → 0.2.3
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 +35 -4
- package/dist/index.cjs +40 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +846 -84
- package/dist/index.d.ts +846 -84
- package/dist/index.js +40 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,823 @@
|
|
|
1
|
+
interface components {
|
|
2
|
+
schemas: {
|
|
3
|
+
DevApiErrorEnvelopeDto: {
|
|
4
|
+
/** @example false */
|
|
5
|
+
success: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @description Stable machine-readable error code. Safe to switch on in client code.
|
|
8
|
+
* @example PRODUCT_NOT_FOUND
|
|
9
|
+
*/
|
|
10
|
+
code: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description Human-readable error message, translated when applicable.
|
|
13
|
+
* @example Product not found
|
|
14
|
+
*/
|
|
15
|
+
message: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description Field-level validation errors, present when the error stems from input validation.
|
|
18
|
+
* @example {
|
|
19
|
+
* "name": [
|
|
20
|
+
* "name should not be empty"
|
|
21
|
+
* ]
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
errors?: Record<string, never>;
|
|
25
|
+
/**
|
|
26
|
+
* @description Contextual data attached to the error. For example, a PAYMENT_INIT_FAILED response carries the `cartPublicId` of the created cart so the payment can be retried via POST /v1/carts/{publicId}/pay.
|
|
27
|
+
* @example {
|
|
28
|
+
* "cartPublicId": "CART-XPK39ZQA01"
|
|
29
|
+
* }
|
|
30
|
+
*/
|
|
31
|
+
data?: Record<string, never>;
|
|
32
|
+
};
|
|
33
|
+
DevApiSuccessEnvelopeDto: {
|
|
34
|
+
/** @example true */
|
|
35
|
+
success: boolean;
|
|
36
|
+
data: Record<string, never>;
|
|
37
|
+
};
|
|
38
|
+
PingPayload: {
|
|
39
|
+
/** @example 42 */
|
|
40
|
+
marketplaceId: number;
|
|
41
|
+
/** @example 2026-05-26T13:14:15.000Z */
|
|
42
|
+
timestamp: string;
|
|
43
|
+
};
|
|
44
|
+
DevApiPaginatedEnvelopeDto: {
|
|
45
|
+
/** @example true */
|
|
46
|
+
success: boolean;
|
|
47
|
+
data: unknown[][];
|
|
48
|
+
/**
|
|
49
|
+
* @description Total rows matching the query
|
|
50
|
+
* @example 42
|
|
51
|
+
*/
|
|
52
|
+
total: number;
|
|
53
|
+
/**
|
|
54
|
+
* @description Index (1-based) of the first row returned
|
|
55
|
+
* @example 1
|
|
56
|
+
*/
|
|
57
|
+
start: number;
|
|
58
|
+
/**
|
|
59
|
+
* @description Index (1-based) of the last row returned
|
|
60
|
+
* @example 10
|
|
61
|
+
*/
|
|
62
|
+
end: number;
|
|
63
|
+
};
|
|
64
|
+
DevApiProductCollectionDto: {
|
|
65
|
+
/** @example Fast food */
|
|
66
|
+
name: string;
|
|
67
|
+
/** @example fast-food */
|
|
68
|
+
slug: string;
|
|
69
|
+
};
|
|
70
|
+
DevApiProductGalleryMediaDto: {
|
|
71
|
+
/** @example 1 */
|
|
72
|
+
id: number;
|
|
73
|
+
/** @example https://cdn.xedoapp.com/products/gallery/abc.jpg */
|
|
74
|
+
publicUrl: string;
|
|
75
|
+
/**
|
|
76
|
+
* @example image
|
|
77
|
+
* @enum {string}
|
|
78
|
+
*/
|
|
79
|
+
type: "image" | "video";
|
|
80
|
+
/** @example Burger close-up */
|
|
81
|
+
altText?: string;
|
|
82
|
+
};
|
|
83
|
+
DevApiProductVariationOptionDto: {
|
|
84
|
+
/** @example OPT_ABC123 */
|
|
85
|
+
publicId: string;
|
|
86
|
+
/** @example XL */
|
|
87
|
+
name: string;
|
|
88
|
+
/** @example 500 */
|
|
89
|
+
priceAdjustment?: number;
|
|
90
|
+
/**
|
|
91
|
+
* @example fixed
|
|
92
|
+
* @enum {string}
|
|
93
|
+
*/
|
|
94
|
+
priceAdjustmentType?: "fixed" | "percentage";
|
|
95
|
+
galleryMedias: components["schemas"]["DevApiProductGalleryMediaDto"][];
|
|
96
|
+
};
|
|
97
|
+
DevApiProductVariationDto: {
|
|
98
|
+
/** @example VAR_ABC123 */
|
|
99
|
+
publicId: string;
|
|
100
|
+
/** @example Taille */
|
|
101
|
+
variationTypeName: string;
|
|
102
|
+
options: components["schemas"]["DevApiProductVariationOptionDto"][];
|
|
103
|
+
};
|
|
104
|
+
DevApiProductCombinationDto: {
|
|
105
|
+
/** @example COMB_ABC123 */
|
|
106
|
+
publicId: string;
|
|
107
|
+
/**
|
|
108
|
+
* @description Public ids of the options forming this combination.
|
|
109
|
+
* @example [
|
|
110
|
+
* "OPT_ABC123",
|
|
111
|
+
* "OPT_DEF456"
|
|
112
|
+
* ]
|
|
113
|
+
*/
|
|
114
|
+
optionPublicIds: string[];
|
|
115
|
+
/** @example 10 */
|
|
116
|
+
stockQuantity: number;
|
|
117
|
+
/** @example 500 */
|
|
118
|
+
priceAdjustment?: number;
|
|
119
|
+
/**
|
|
120
|
+
* @example fixed
|
|
121
|
+
* @enum {string}
|
|
122
|
+
*/
|
|
123
|
+
priceAdjustmentType?: "fixed" | "percentage";
|
|
124
|
+
};
|
|
125
|
+
DevApiProductDto: {
|
|
126
|
+
/** @example 6528412905 */
|
|
127
|
+
publicId: string;
|
|
128
|
+
/** @example Burger */
|
|
129
|
+
name: string;
|
|
130
|
+
/** @example burger */
|
|
131
|
+
slug: string;
|
|
132
|
+
/** @example 10.5 */
|
|
133
|
+
price: number;
|
|
134
|
+
/** @example Delicious beef burger. */
|
|
135
|
+
description?: string;
|
|
136
|
+
/** @example https://cdn.xedoapp.com/products/cover/abc.jpg */
|
|
137
|
+
coverUrl?: string | null;
|
|
138
|
+
/** @example true */
|
|
139
|
+
enabled: boolean;
|
|
140
|
+
collection: components["schemas"]["DevApiProductCollectionDto"];
|
|
141
|
+
/**
|
|
142
|
+
* Format: date-time
|
|
143
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
144
|
+
*/
|
|
145
|
+
createdAt: string;
|
|
146
|
+
/**
|
|
147
|
+
* Format: date-time
|
|
148
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
149
|
+
*/
|
|
150
|
+
updatedAt: string;
|
|
151
|
+
/** @example Nutritional information */
|
|
152
|
+
productSheet?: string;
|
|
153
|
+
/** @example 100 */
|
|
154
|
+
stockQuantity: number;
|
|
155
|
+
/** @example true */
|
|
156
|
+
trackStock: boolean;
|
|
157
|
+
/** @example false */
|
|
158
|
+
allowBackorder: boolean;
|
|
159
|
+
/** @example 10 */
|
|
160
|
+
lowStockThreshold?: number | null;
|
|
161
|
+
/**
|
|
162
|
+
* @description Percentage paid online for split payment. Null falls back to the marketplace default.
|
|
163
|
+
* @example 30
|
|
164
|
+
*/
|
|
165
|
+
splitOnlinePaymentPercentage?: number | null;
|
|
166
|
+
/** @description Product gallery (image / video). Returned on detail endpoints. */
|
|
167
|
+
galleryMedias?: components["schemas"]["DevApiProductGalleryMediaDto"][];
|
|
168
|
+
/** @description Variations (e.g. Size, Color) and their options. */
|
|
169
|
+
variations?: components["schemas"]["DevApiProductVariationDto"][];
|
|
170
|
+
/** @description Combinations (SKUs) with per-combination stock and pricing. */
|
|
171
|
+
combinations?: components["schemas"]["DevApiProductCombinationDto"][];
|
|
172
|
+
};
|
|
173
|
+
DevApiCollectionDto: {
|
|
174
|
+
/** @example 9023748120 */
|
|
175
|
+
publicId: string;
|
|
176
|
+
/** @example Fast food */
|
|
177
|
+
name: string;
|
|
178
|
+
/** @example fast-food */
|
|
179
|
+
slug: string;
|
|
180
|
+
/** @example Quick bites & street food. */
|
|
181
|
+
description?: string;
|
|
182
|
+
/** @example https://cdn.xedoapp.com/collections/cover/abc.jpg */
|
|
183
|
+
coverUrl?: string | null;
|
|
184
|
+
/**
|
|
185
|
+
* Format: date-time
|
|
186
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
187
|
+
*/
|
|
188
|
+
createdAt: string;
|
|
189
|
+
/**
|
|
190
|
+
* Format: date-time
|
|
191
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
192
|
+
*/
|
|
193
|
+
updatedAt: string;
|
|
194
|
+
};
|
|
195
|
+
DevApiOrderCustomerDto: {
|
|
196
|
+
/** @example Jean */
|
|
197
|
+
firstName?: string;
|
|
198
|
+
/** @example Kouassi */
|
|
199
|
+
lastName?: string;
|
|
200
|
+
/** @example jean@example.com */
|
|
201
|
+
email?: string;
|
|
202
|
+
/** @example +225 07 12 34 56 78 */
|
|
203
|
+
phone?: string;
|
|
204
|
+
};
|
|
205
|
+
DevApiOrderPaymentDto: {
|
|
206
|
+
/** @example PAY-2024-001 */
|
|
207
|
+
reference: string;
|
|
208
|
+
/** @example 125000 */
|
|
209
|
+
amount: number;
|
|
210
|
+
/**
|
|
211
|
+
* @description Online portion amount (split payment only).
|
|
212
|
+
* @example 37500
|
|
213
|
+
*/
|
|
214
|
+
onlineAmount?: number | null;
|
|
215
|
+
/**
|
|
216
|
+
* @example success
|
|
217
|
+
* @enum {string}
|
|
218
|
+
*/
|
|
219
|
+
status: "pending" | "processing" | "success" | "failed";
|
|
220
|
+
/**
|
|
221
|
+
* @example external_wallet
|
|
222
|
+
* @enum {string}
|
|
223
|
+
*/
|
|
224
|
+
method: "external_wallet" | "loyalty_card" | "pay_on_delivery" | "split_payment";
|
|
225
|
+
};
|
|
226
|
+
DevApiOrderListItemDto: {
|
|
227
|
+
/**
|
|
228
|
+
* @description Order internal id
|
|
229
|
+
* @example 1
|
|
230
|
+
*/
|
|
231
|
+
id: number;
|
|
232
|
+
/**
|
|
233
|
+
* @description Public id (cart publicId).
|
|
234
|
+
* @example ORD-XPK39ZQA01
|
|
235
|
+
*/
|
|
236
|
+
publicId: string;
|
|
237
|
+
customer: components["schemas"]["DevApiOrderCustomerDto"];
|
|
238
|
+
/** @example 5 */
|
|
239
|
+
itemsCount: number;
|
|
240
|
+
/** @example 125000 */
|
|
241
|
+
orderAmount: number;
|
|
242
|
+
/** @example 1000 */
|
|
243
|
+
deliveryCost: number;
|
|
244
|
+
payment: components["schemas"]["DevApiOrderPaymentDto"];
|
|
245
|
+
/** @enum {string|null} */
|
|
246
|
+
deliveryType?: "DELIVERY" | "PICKUP" | null;
|
|
247
|
+
/** @enum {string|null} */
|
|
248
|
+
orderStatus?: "PREPARING" | "IN_DELIVERY" | "DELIVERED" | "READY_FOR_PICKUP" | "PICKED_UP" | null;
|
|
249
|
+
/**
|
|
250
|
+
* @description Developer-supplied metadata attached at cart creation.
|
|
251
|
+
* @example {
|
|
252
|
+
* "internalOrderId": "ORD-12345"
|
|
253
|
+
* }
|
|
254
|
+
*/
|
|
255
|
+
meta?: Record<string, never> | null;
|
|
256
|
+
/**
|
|
257
|
+
* Format: date-time
|
|
258
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
259
|
+
*/
|
|
260
|
+
createdAt: string;
|
|
261
|
+
/**
|
|
262
|
+
* Format: date-time
|
|
263
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
264
|
+
*/
|
|
265
|
+
updatedAt: string;
|
|
266
|
+
};
|
|
267
|
+
DevApiOrderItemCombinationDto: {
|
|
268
|
+
/** @example SKU-XL-RED */
|
|
269
|
+
sku: string;
|
|
270
|
+
/**
|
|
271
|
+
* @example [
|
|
272
|
+
* "XL",
|
|
273
|
+
* "Red"
|
|
274
|
+
* ]
|
|
275
|
+
*/
|
|
276
|
+
optionNames: string[];
|
|
277
|
+
/** @example 500 */
|
|
278
|
+
priceAdjustment?: number;
|
|
279
|
+
/**
|
|
280
|
+
* @example fixed
|
|
281
|
+
* @enum {string}
|
|
282
|
+
*/
|
|
283
|
+
priceAdjustmentType?: "fixed" | "percentage";
|
|
284
|
+
};
|
|
285
|
+
DevApiOrderItemDto: {
|
|
286
|
+
/**
|
|
287
|
+
* @description Cart item internal id
|
|
288
|
+
* @example 1
|
|
289
|
+
*/
|
|
290
|
+
id: number;
|
|
291
|
+
/** @example 283 */
|
|
292
|
+
productId: number;
|
|
293
|
+
/** @example Samsung Galaxy A54 */
|
|
294
|
+
name: string;
|
|
295
|
+
/** @example samsung-galaxy-a54 */
|
|
296
|
+
slug: string;
|
|
297
|
+
/** @example 125000 */
|
|
298
|
+
price: number;
|
|
299
|
+
/** @example 1 */
|
|
300
|
+
quantity: number;
|
|
301
|
+
/** @example 125000 */
|
|
302
|
+
lineTotal: number;
|
|
303
|
+
/** @example https://cdn.xedoapp.com/products/cover/abc.jpg */
|
|
304
|
+
coverUrl?: string | null;
|
|
305
|
+
/** @example COMB_ABC123 */
|
|
306
|
+
combinationPublicId?: string;
|
|
307
|
+
combination?: components["schemas"]["DevApiOrderItemCombinationDto"];
|
|
308
|
+
};
|
|
309
|
+
DevApiOrderTotalsDto: {
|
|
310
|
+
/** @example 125000 */
|
|
311
|
+
subtotal: number;
|
|
312
|
+
/** @example 1000 */
|
|
313
|
+
deliveryFees: number;
|
|
314
|
+
/** @example 126000 */
|
|
315
|
+
total: number;
|
|
316
|
+
};
|
|
317
|
+
DevApiOrderDeliveryInfoDto: {
|
|
318
|
+
/** @example 1 */
|
|
319
|
+
areaId: number;
|
|
320
|
+
/** @example Cocody, Angré 7ème tranche */
|
|
321
|
+
areaName: string;
|
|
322
|
+
/** @example 1000 */
|
|
323
|
+
deliveryCost: number;
|
|
324
|
+
};
|
|
325
|
+
DevApiOrderDeliveryDto: {
|
|
326
|
+
/**
|
|
327
|
+
* @example DELIVERY
|
|
328
|
+
* @enum {string}
|
|
329
|
+
*/
|
|
330
|
+
deliveryType: "DELIVERY" | "PICKUP";
|
|
331
|
+
deliveryInfo?: components["schemas"]["DevApiOrderDeliveryInfoDto"] | null;
|
|
332
|
+
/** @example Appeler 30 minutes avant la livraison */
|
|
333
|
+
additionalDetails?: string | null;
|
|
334
|
+
/**
|
|
335
|
+
* @example PREPARING
|
|
336
|
+
* @enum {string}
|
|
337
|
+
*/
|
|
338
|
+
orderStatus: "PREPARING" | "IN_DELIVERY" | "DELIVERED" | "READY_FOR_PICKUP" | "PICKED_UP";
|
|
339
|
+
};
|
|
340
|
+
DevApiOrderDetailDto: {
|
|
341
|
+
/**
|
|
342
|
+
* @description Order internal id
|
|
343
|
+
* @example 1
|
|
344
|
+
*/
|
|
345
|
+
id: number;
|
|
346
|
+
/** @example ORD-XPK39ZQA01 */
|
|
347
|
+
publicId: string;
|
|
348
|
+
/**
|
|
349
|
+
* @example PAYMENT_COMPLETED
|
|
350
|
+
* @enum {string}
|
|
351
|
+
*/
|
|
352
|
+
status: "DRAFT" | "PENDING_PAYMENT" | "ABANDONED" | "PAYMENT_FAILED" | "PAYMENT_COMPLETED";
|
|
353
|
+
customer: components["schemas"]["DevApiOrderCustomerDto"];
|
|
354
|
+
items: components["schemas"]["DevApiOrderItemDto"][];
|
|
355
|
+
totals: components["schemas"]["DevApiOrderTotalsDto"];
|
|
356
|
+
payment: components["schemas"]["DevApiOrderPaymentDto"];
|
|
357
|
+
delivery?: components["schemas"]["DevApiOrderDeliveryDto"] | null;
|
|
358
|
+
/**
|
|
359
|
+
* @description Developer-supplied metadata attached at cart creation.
|
|
360
|
+
* @example {
|
|
361
|
+
* "internalOrderId": "ORD-12345"
|
|
362
|
+
* }
|
|
363
|
+
*/
|
|
364
|
+
meta?: Record<string, never> | null;
|
|
365
|
+
/**
|
|
366
|
+
* Format: date-time
|
|
367
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
368
|
+
*/
|
|
369
|
+
createdAt: string;
|
|
370
|
+
/**
|
|
371
|
+
* Format: date-time
|
|
372
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
373
|
+
*/
|
|
374
|
+
updatedAt: string;
|
|
375
|
+
};
|
|
376
|
+
DevApiCartCustomerDto: {
|
|
377
|
+
/** @example Jean */
|
|
378
|
+
firstName?: string;
|
|
379
|
+
/** @example Kouassi */
|
|
380
|
+
lastName?: string;
|
|
381
|
+
/** @example jean@example.com */
|
|
382
|
+
email?: string;
|
|
383
|
+
/** @example +225 07 12 34 56 78 */
|
|
384
|
+
phone?: string;
|
|
385
|
+
};
|
|
386
|
+
DevApiCartListItemDto: {
|
|
387
|
+
/**
|
|
388
|
+
* @description Cart internal id
|
|
389
|
+
* @example 1
|
|
390
|
+
*/
|
|
391
|
+
id: number;
|
|
392
|
+
/** @example CART-XPK39ZQA01 */
|
|
393
|
+
publicId: string;
|
|
394
|
+
customer: components["schemas"]["DevApiCartCustomerDto"];
|
|
395
|
+
/** @example 5 */
|
|
396
|
+
itemsCount: number;
|
|
397
|
+
/** @example 125000 */
|
|
398
|
+
cartAmount: number;
|
|
399
|
+
/** @example 1000 */
|
|
400
|
+
deliveryCost: number;
|
|
401
|
+
/** @enum {string} */
|
|
402
|
+
status: "PENDING_PAYMENT" | "ABANDONED" | "PAYMENT_FAILED" | "PAYMENT_COMPLETED";
|
|
403
|
+
/** @enum {string|null} */
|
|
404
|
+
deliveryType?: "DELIVERY" | "PICKUP" | null;
|
|
405
|
+
/** @enum {string|null} */
|
|
406
|
+
orderStatus?: "PREPARING" | "IN_DELIVERY" | "DELIVERED" | "READY_FOR_PICKUP" | "PICKED_UP" | null;
|
|
407
|
+
/**
|
|
408
|
+
* @description Developer-supplied metadata attached at cart creation.
|
|
409
|
+
* @example {
|
|
410
|
+
* "internalOrderId": "ORD-12345"
|
|
411
|
+
* }
|
|
412
|
+
*/
|
|
413
|
+
meta?: Record<string, never> | null;
|
|
414
|
+
/**
|
|
415
|
+
* Format: date-time
|
|
416
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
417
|
+
*/
|
|
418
|
+
createdAt: string;
|
|
419
|
+
/**
|
|
420
|
+
* Format: date-time
|
|
421
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
422
|
+
*/
|
|
423
|
+
updatedAt: string;
|
|
424
|
+
};
|
|
425
|
+
DevApiCartItemCombinationDto: {
|
|
426
|
+
/** @example SKU-XL-RED */
|
|
427
|
+
sku: string;
|
|
428
|
+
/**
|
|
429
|
+
* @example [
|
|
430
|
+
* "XL",
|
|
431
|
+
* "Red"
|
|
432
|
+
* ]
|
|
433
|
+
*/
|
|
434
|
+
optionNames: string[];
|
|
435
|
+
/** @example 500 */
|
|
436
|
+
priceAdjustment?: number;
|
|
437
|
+
/**
|
|
438
|
+
* @example fixed
|
|
439
|
+
* @enum {string}
|
|
440
|
+
*/
|
|
441
|
+
priceAdjustmentType?: "fixed" | "percentage";
|
|
442
|
+
};
|
|
443
|
+
DevApiCartItemDto: {
|
|
444
|
+
/**
|
|
445
|
+
* @description Cart item internal id
|
|
446
|
+
* @example 1
|
|
447
|
+
*/
|
|
448
|
+
id: number;
|
|
449
|
+
/** @example 283 */
|
|
450
|
+
productId: number;
|
|
451
|
+
/** @example Samsung Galaxy A54 */
|
|
452
|
+
name: string;
|
|
453
|
+
/** @example samsung-galaxy-a54 */
|
|
454
|
+
slug: string;
|
|
455
|
+
/** @example 125000 */
|
|
456
|
+
price: number;
|
|
457
|
+
/** @example 1 */
|
|
458
|
+
quantity: number;
|
|
459
|
+
/** @example 125000 */
|
|
460
|
+
lineTotal: number;
|
|
461
|
+
/** @example https://cdn.xedoapp.com/products/cover/abc.jpg */
|
|
462
|
+
coverUrl?: string | null;
|
|
463
|
+
/** @example COMB_ABC123 */
|
|
464
|
+
combinationPublicId?: string;
|
|
465
|
+
combination?: components["schemas"]["DevApiCartItemCombinationDto"];
|
|
466
|
+
};
|
|
467
|
+
DevApiCartTotalsDto: {
|
|
468
|
+
/** @example 125000 */
|
|
469
|
+
subtotal: number;
|
|
470
|
+
/** @example 1000 */
|
|
471
|
+
deliveryFees: number;
|
|
472
|
+
/** @example 126000 */
|
|
473
|
+
total: number;
|
|
474
|
+
};
|
|
475
|
+
DevApiCartDeliveryInfoDto: {
|
|
476
|
+
/** @example 1 */
|
|
477
|
+
areaId: number;
|
|
478
|
+
/** @example Cocody, Angré 7ème tranche */
|
|
479
|
+
areaName: string;
|
|
480
|
+
/** @example 1000 */
|
|
481
|
+
deliveryCost: number;
|
|
482
|
+
};
|
|
483
|
+
DevApiCartDeliveryDto: {
|
|
484
|
+
/**
|
|
485
|
+
* @example DELIVERY
|
|
486
|
+
* @enum {string}
|
|
487
|
+
*/
|
|
488
|
+
deliveryType: "DELIVERY" | "PICKUP";
|
|
489
|
+
deliveryInfo?: components["schemas"]["DevApiCartDeliveryInfoDto"] | null;
|
|
490
|
+
/** @example Appeler 30 minutes avant */
|
|
491
|
+
additionalDetails?: string | null;
|
|
492
|
+
/**
|
|
493
|
+
* @example PREPARING
|
|
494
|
+
* @enum {string}
|
|
495
|
+
*/
|
|
496
|
+
orderStatus: "PREPARING" | "IN_DELIVERY" | "DELIVERED" | "READY_FOR_PICKUP" | "PICKED_UP";
|
|
497
|
+
};
|
|
498
|
+
DevApiCartDetailDto: {
|
|
499
|
+
/**
|
|
500
|
+
* @description Cart internal id
|
|
501
|
+
* @example 1
|
|
502
|
+
*/
|
|
503
|
+
id: number;
|
|
504
|
+
/** @example CART-XPK39ZQA01 */
|
|
505
|
+
publicId: string;
|
|
506
|
+
/** @enum {string} */
|
|
507
|
+
status: "PENDING_PAYMENT" | "ABANDONED" | "PAYMENT_FAILED" | "PAYMENT_COMPLETED";
|
|
508
|
+
customer: components["schemas"]["DevApiCartCustomerDto"];
|
|
509
|
+
items: components["schemas"]["DevApiCartItemDto"][];
|
|
510
|
+
totals: components["schemas"]["DevApiCartTotalsDto"];
|
|
511
|
+
delivery?: components["schemas"]["DevApiCartDeliveryDto"] | null;
|
|
512
|
+
/**
|
|
513
|
+
* @description Developer-supplied metadata attached at cart creation.
|
|
514
|
+
* @example {
|
|
515
|
+
* "internalOrderId": "ORD-12345"
|
|
516
|
+
* }
|
|
517
|
+
*/
|
|
518
|
+
meta?: Record<string, never> | null;
|
|
519
|
+
/**
|
|
520
|
+
* Format: date-time
|
|
521
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
522
|
+
*/
|
|
523
|
+
createdAt: string;
|
|
524
|
+
/**
|
|
525
|
+
* Format: date-time
|
|
526
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
527
|
+
*/
|
|
528
|
+
updatedAt: string;
|
|
529
|
+
};
|
|
530
|
+
DevApiCheckoutPreviewResponseDto: {
|
|
531
|
+
/** @example 250000 */
|
|
532
|
+
subtotal: number;
|
|
533
|
+
/** @example 1000 */
|
|
534
|
+
deliveryCost: number;
|
|
535
|
+
/** @example 251000 */
|
|
536
|
+
total: number;
|
|
537
|
+
/**
|
|
538
|
+
* @description Set only when paymentMethod = split_payment.
|
|
539
|
+
* @example 150000
|
|
540
|
+
*/
|
|
541
|
+
onlineAmount?: number | null;
|
|
542
|
+
/**
|
|
543
|
+
* @description Set only when paymentMethod = split_payment.
|
|
544
|
+
* @example 101000
|
|
545
|
+
*/
|
|
546
|
+
onDeliveryAmount?: number | null;
|
|
547
|
+
};
|
|
548
|
+
DevApiCheckoutItemDto: {
|
|
549
|
+
/** @example 9023748120 */
|
|
550
|
+
publicProductId: string;
|
|
551
|
+
/** @example 2 */
|
|
552
|
+
quantity: number;
|
|
553
|
+
/** @example COMB_ABC123 */
|
|
554
|
+
combinationPublicId?: string;
|
|
555
|
+
};
|
|
556
|
+
DevApiCheckoutDeliveryDto: {
|
|
557
|
+
/**
|
|
558
|
+
* @example DELIVERY
|
|
559
|
+
* @enum {string}
|
|
560
|
+
*/
|
|
561
|
+
deliveryType: "DELIVERY" | "PICKUP";
|
|
562
|
+
/**
|
|
563
|
+
* @description Required when deliveryType = DELIVERY.
|
|
564
|
+
* @example 1
|
|
565
|
+
*/
|
|
566
|
+
deliveryAreaId?: number;
|
|
567
|
+
};
|
|
568
|
+
DevApiCheckoutPreviewDto: {
|
|
569
|
+
items: components["schemas"]["DevApiCheckoutItemDto"][];
|
|
570
|
+
delivery: components["schemas"]["DevApiCheckoutDeliveryDto"];
|
|
571
|
+
/**
|
|
572
|
+
* @example external_wallet
|
|
573
|
+
* @enum {string}
|
|
574
|
+
*/
|
|
575
|
+
paymentMethod: "external_wallet" | "split_payment";
|
|
576
|
+
};
|
|
577
|
+
DevApiCheckoutTotalsDto: {
|
|
578
|
+
/** @example 250000 */
|
|
579
|
+
subtotal: number;
|
|
580
|
+
/** @example 1000 */
|
|
581
|
+
deliveryCost: number;
|
|
582
|
+
/** @example 251000 */
|
|
583
|
+
total: number;
|
|
584
|
+
/** @example 150000 */
|
|
585
|
+
onlineAmount?: number | null;
|
|
586
|
+
/** @example 101000 */
|
|
587
|
+
onDeliveryAmount?: number | null;
|
|
588
|
+
};
|
|
589
|
+
DevApiCheckoutPaymentDto: {
|
|
590
|
+
/** @example PAY-XPK39ZQA01 */
|
|
591
|
+
reference: string;
|
|
592
|
+
/** @example pending */
|
|
593
|
+
status: string;
|
|
594
|
+
};
|
|
595
|
+
DevApiCheckoutCreateResponseDto: {
|
|
596
|
+
/** @example CART-XPK39ZQA01 */
|
|
597
|
+
publicId: string;
|
|
598
|
+
/** @example PENDING_PAYMENT */
|
|
599
|
+
status: string;
|
|
600
|
+
totals: components["schemas"]["DevApiCheckoutTotalsDto"];
|
|
601
|
+
payment: components["schemas"]["DevApiCheckoutPaymentDto"];
|
|
602
|
+
/** @example https://checkout.moneroo.io/abc-def */
|
|
603
|
+
checkoutUrl: string;
|
|
604
|
+
};
|
|
605
|
+
DevApiCheckoutCustomerDto: {
|
|
606
|
+
/** @example Jean */
|
|
607
|
+
firstName: string;
|
|
608
|
+
/** @example Kouassi */
|
|
609
|
+
lastName: string;
|
|
610
|
+
/** @example jean@example.com */
|
|
611
|
+
email: string;
|
|
612
|
+
/** @example +225 07 12 34 56 78 */
|
|
613
|
+
phone: string;
|
|
614
|
+
};
|
|
615
|
+
DevApiCheckoutCreateDto: {
|
|
616
|
+
customer: components["schemas"]["DevApiCheckoutCustomerDto"];
|
|
617
|
+
items: components["schemas"]["DevApiCheckoutItemDto"][];
|
|
618
|
+
delivery: components["schemas"]["DevApiCheckoutDeliveryDto"];
|
|
619
|
+
/**
|
|
620
|
+
* @example external_wallet
|
|
621
|
+
* @enum {string}
|
|
622
|
+
*/
|
|
623
|
+
paymentMethod: "external_wallet" | "split_payment";
|
|
624
|
+
/**
|
|
625
|
+
* @description URL to redirect the customer to after the payment provider checkout. Must be HTTPS.
|
|
626
|
+
* @example https://my-app.com/after-checkout
|
|
627
|
+
*/
|
|
628
|
+
returnUrl: string;
|
|
629
|
+
/** @example Appeler 30 min avant */
|
|
630
|
+
additionalDetails?: string;
|
|
631
|
+
/**
|
|
632
|
+
* @description Free-form JSON payload returned as-is in every cart/order response. Use it to attach your own identifiers (e.g. internalOrderId).
|
|
633
|
+
* @example {
|
|
634
|
+
* "internalOrderId": "ORD-12345",
|
|
635
|
+
* "source": "mobile-app"
|
|
636
|
+
* }
|
|
637
|
+
*/
|
|
638
|
+
meta?: Record<string, never>;
|
|
639
|
+
};
|
|
640
|
+
DevApiCheckoutRetryPayResponseDto: {
|
|
641
|
+
payment: components["schemas"]["DevApiCheckoutPaymentDto"];
|
|
642
|
+
/** @example https://checkout.moneroo.io/abc-def */
|
|
643
|
+
checkoutUrl: string;
|
|
644
|
+
};
|
|
645
|
+
DevApiCheckoutRetryPayDto: {
|
|
646
|
+
/** @example https://my-app.com/after-checkout */
|
|
647
|
+
returnUrl: string;
|
|
648
|
+
};
|
|
649
|
+
DevApiDeliveryAreaDto: {
|
|
650
|
+
/**
|
|
651
|
+
* @description Identifier to pass as `delivery.deliveryAreaId` when creating a cart.
|
|
652
|
+
* @example 1
|
|
653
|
+
*/
|
|
654
|
+
id: number;
|
|
655
|
+
/** @example Cocody */
|
|
656
|
+
name: string;
|
|
657
|
+
/**
|
|
658
|
+
* @description Delivery cost for this area.
|
|
659
|
+
* @example 1000
|
|
660
|
+
*/
|
|
661
|
+
deliveryCost: number;
|
|
662
|
+
};
|
|
663
|
+
DevApiBusinessCategoryDto: {
|
|
664
|
+
/** @example 3 */
|
|
665
|
+
id: number;
|
|
666
|
+
/** @example Restauration */
|
|
667
|
+
name: string;
|
|
668
|
+
};
|
|
669
|
+
DevApiMarketplaceProfileDto: {
|
|
670
|
+
/** @example ma-boutique */
|
|
671
|
+
slug: string;
|
|
672
|
+
/** @example true */
|
|
673
|
+
enabled: boolean;
|
|
674
|
+
businessCategory?: components["schemas"]["DevApiBusinessCategoryDto"] | null;
|
|
675
|
+
/** @example +225 07 12 34 56 78 */
|
|
676
|
+
whatsappPhoneNumber?: string | null;
|
|
677
|
+
/** @example true */
|
|
678
|
+
enablePayOnDelivery: boolean;
|
|
679
|
+
/** @example true */
|
|
680
|
+
enableSplitPayment: boolean;
|
|
681
|
+
/**
|
|
682
|
+
* @description Default percentage paid online for split payment. Null if split payment is disabled.
|
|
683
|
+
* @example 30
|
|
684
|
+
*/
|
|
685
|
+
defaultOnlineSplitPaymentPercentage?: number | null;
|
|
686
|
+
/**
|
|
687
|
+
* @description Whether the delivery cost is paid online or on delivery in a split payment.
|
|
688
|
+
* @example on_delivery
|
|
689
|
+
* @enum {string}
|
|
690
|
+
*/
|
|
691
|
+
splitPaymentDeliveryCostHandling: "online" | "on_delivery";
|
|
692
|
+
/**
|
|
693
|
+
* Format: date-time
|
|
694
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
695
|
+
*/
|
|
696
|
+
createdAt: string;
|
|
697
|
+
/**
|
|
698
|
+
* Format: date-time
|
|
699
|
+
* @example 2026-05-26T13:14:15.000Z
|
|
700
|
+
*/
|
|
701
|
+
updatedAt: string;
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
responses: never;
|
|
705
|
+
parameters: never;
|
|
706
|
+
requestBodies: never;
|
|
707
|
+
headers: never;
|
|
708
|
+
pathItems: never;
|
|
709
|
+
}
|
|
710
|
+
|
|
1
711
|
/**
|
|
2
|
-
* Public
|
|
712
|
+
* Public type surface for the Xedo SDK.
|
|
3
713
|
*
|
|
4
714
|
* The Xedo Developer API returns its resource payloads inside a generic
|
|
5
|
-
* envelope (`{ success, data }`).
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
715
|
+
* envelope (`{ success, data }`). Since the API v1 spec now describes every
|
|
716
|
+
* entity in detail, these public types are derived directly from the generated
|
|
717
|
+
* mirror of `openapi.json` (`./generated.ts`, do not edit by hand) so they stay
|
|
718
|
+
* in sync on every `npm run generate`. Only cross-cutting helpers (pagination,
|
|
719
|
+
* list params, rate-limit) are hand-written here.
|
|
10
720
|
*/
|
|
11
|
-
|
|
721
|
+
|
|
722
|
+
type Schemas = components['schemas'];
|
|
723
|
+
/** A free-form JSON object (e.g. the developer-supplied `meta` payload). */
|
|
12
724
|
type JsonObject = {
|
|
13
725
|
[key: string]: unknown;
|
|
14
726
|
};
|
|
727
|
+
/**
|
|
728
|
+
* `meta` is a free-form JSON object, but openapi-typescript renders the spec's
|
|
729
|
+
* loose `object` as `Record<string, never>`. Swap it back to {@link JsonObject}.
|
|
730
|
+
*/
|
|
731
|
+
type WithMeta<T> = Omit<T, 'meta'> & {
|
|
732
|
+
meta?: JsonObject | null;
|
|
733
|
+
};
|
|
15
734
|
/** Sort direction shared by every paginated list endpoint. */
|
|
16
735
|
type SortOrder = 'asc' | 'desc';
|
|
736
|
+
/** Lifecycle status of an order. */
|
|
737
|
+
type OrderStatus = Schemas['DevApiOrderDetailDto']['status'];
|
|
738
|
+
/** Lifecycle status of a cart (orders that are not yet paid). */
|
|
739
|
+
type CartStatus = Schemas['DevApiCartDetailDto']['status'];
|
|
740
|
+
/** Fulfillment status once an order is being prepared/shipped. */
|
|
741
|
+
type FulfillmentStatus = Schemas['DevApiOrderDeliveryDto']['orderStatus'];
|
|
742
|
+
/** Delivery mode of a cart/order. */
|
|
743
|
+
type DeliveryType = Schemas['DevApiOrderDeliveryDto']['deliveryType'];
|
|
744
|
+
/** Payment status of an order. */
|
|
745
|
+
type PaymentStatus = Schemas['DevApiOrderPaymentDto']['status'];
|
|
746
|
+
/** Payment method as reported on a paid order (read side). */
|
|
747
|
+
type OrderPaymentMethod = Schemas['DevApiOrderPaymentDto']['method'];
|
|
748
|
+
/** How a per-option/combination price is adjusted. */
|
|
749
|
+
type PriceAdjustmentType = NonNullable<Schemas['DevApiProductCombinationDto']['priceAdjustmentType']>;
|
|
750
|
+
/** Gallery media kind. */
|
|
751
|
+
type MediaType = Schemas['DevApiProductGalleryMediaDto']['type'];
|
|
17
752
|
/** Result of `GET /v1/ping` — use it to validate an API key end to end. */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
753
|
+
type PingResult = Schemas['PingPayload'];
|
|
754
|
+
/** The lightweight collection reference embedded on a product. */
|
|
755
|
+
type ProductCollection = Schemas['DevApiProductCollectionDto'];
|
|
756
|
+
/** A gallery image or video attached to a product/variation option. */
|
|
757
|
+
type ProductGalleryMedia = Schemas['DevApiProductGalleryMediaDto'];
|
|
758
|
+
/** One selectable option (e.g. "XL") of a product variation. */
|
|
759
|
+
type ProductVariationOption = Schemas['DevApiProductVariationOptionDto'];
|
|
760
|
+
/** A product variation axis (e.g. "Size") and its options. */
|
|
761
|
+
type ProductVariation = Schemas['DevApiProductVariationDto'];
|
|
762
|
+
/** A combination (SKU) with its own stock and pricing. */
|
|
763
|
+
type ProductCombination = Schemas['DevApiProductCombinationDto'];
|
|
22
764
|
/** A product from the merchant catalogue (`GET /v1/products`). */
|
|
23
|
-
type Product =
|
|
765
|
+
type Product = Schemas['DevApiProductDto'];
|
|
24
766
|
/** A collection / category of products (`GET /v1/collections`). */
|
|
25
|
-
type Collection =
|
|
26
|
-
/**
|
|
27
|
-
type
|
|
28
|
-
/**
|
|
29
|
-
type
|
|
767
|
+
type Collection = Schemas['DevApiCollectionDto'];
|
|
768
|
+
/** Customer details attached to an order. */
|
|
769
|
+
type OrderCustomer = Schemas['DevApiOrderCustomerDto'];
|
|
770
|
+
/** Payment details of a paid order. */
|
|
771
|
+
type OrderPayment = Schemas['DevApiOrderPaymentDto'];
|
|
772
|
+
/** A single line item of an order. */
|
|
773
|
+
type OrderItem = Schemas['DevApiOrderItemDto'];
|
|
774
|
+
/** Computed monetary totals of an order. */
|
|
775
|
+
type OrderTotals = Schemas['DevApiOrderTotalsDto'];
|
|
776
|
+
/** Delivery information of an order. */
|
|
777
|
+
type OrderDelivery = Schemas['DevApiOrderDeliveryDto'];
|
|
778
|
+
/** A row in `GET /v1/orders` (summary). */
|
|
779
|
+
type OrderListItem = WithMeta<Schemas['DevApiOrderListItemDto']>;
|
|
780
|
+
/** A full order from `GET /v1/orders/{publicId}`. */
|
|
781
|
+
type Order = WithMeta<Schemas['DevApiOrderDetailDto']>;
|
|
782
|
+
/** Customer details attached to a cart. */
|
|
783
|
+
type CartCustomer = Schemas['DevApiCartCustomerDto'];
|
|
784
|
+
/** A single line item of a cart. */
|
|
785
|
+
type CartItem = Schemas['DevApiCartItemDto'];
|
|
786
|
+
/** Computed monetary totals of a cart. */
|
|
787
|
+
type CartTotals = Schemas['DevApiCartTotalsDto'];
|
|
788
|
+
/** Delivery information of a cart. */
|
|
789
|
+
type CartDelivery = Schemas['DevApiCartDeliveryDto'];
|
|
790
|
+
/** A row in `GET /v1/carts` (summary). `DRAFT` carts are never exposed. */
|
|
791
|
+
type CartListItem = WithMeta<Schemas['DevApiCartListItemDto']>;
|
|
792
|
+
/** A full cart from `GET /v1/carts/{publicId}`. `DRAFT` carts are never exposed. */
|
|
793
|
+
type Cart = WithMeta<Schemas['DevApiCartDetailDto']>;
|
|
30
794
|
/** Computed totals returned by `POST /v1/carts/preview` (nothing persisted). */
|
|
31
|
-
type CheckoutPreview =
|
|
795
|
+
type CheckoutPreview = Schemas['DevApiCheckoutPreviewResponseDto'];
|
|
796
|
+
/** Totals carried on a created cart. */
|
|
797
|
+
type CheckoutTotals = Schemas['DevApiCheckoutTotalsDto'];
|
|
798
|
+
/** Payment handle carried on a created cart. */
|
|
799
|
+
type CheckoutPayment = Schemas['DevApiCheckoutPaymentDto'];
|
|
32
800
|
/**
|
|
33
|
-
* Returned by `POST /v1/carts
|
|
34
|
-
*
|
|
801
|
+
* Returned by `POST /v1/carts`. Always carries the hosted `checkoutUrl` to
|
|
802
|
+
* redirect the customer to.
|
|
35
803
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
804
|
+
type CheckoutResult = Schemas['DevApiCheckoutCreateResponseDto'];
|
|
805
|
+
/** Returned by `POST /v1/carts/{publicId}/pay`. */
|
|
806
|
+
type CheckoutRetryResult = Schemas['DevApiCheckoutRetryPayResponseDto'];
|
|
807
|
+
/** A delivery area (`GET /v1/delivery-areas`). */
|
|
808
|
+
type DeliveryArea = Schemas['DevApiDeliveryAreaDto'];
|
|
809
|
+
/** The merchant's business category. */
|
|
810
|
+
type BusinessCategory = Schemas['DevApiBusinessCategoryDto'];
|
|
811
|
+
/** The marketplace profile (`GET /v1/marketplace`). */
|
|
812
|
+
type MarketplaceProfile = Schemas['DevApiMarketplaceProfileDto'];
|
|
813
|
+
type CheckoutItem = Schemas['DevApiCheckoutItemDto'];
|
|
814
|
+
type CheckoutDelivery = Schemas['DevApiCheckoutDeliveryDto'];
|
|
815
|
+
type CheckoutCustomer = Schemas['DevApiCheckoutCustomerDto'];
|
|
816
|
+
/** Payment method accepted when creating a cart (write side). */
|
|
817
|
+
type PaymentMethod = Schemas['DevApiCheckoutCreateDto']['paymentMethod'];
|
|
818
|
+
type CheckoutPreviewInput = Schemas['DevApiCheckoutPreviewDto'];
|
|
819
|
+
type CheckoutCreateInput = WithMeta<Schemas['DevApiCheckoutCreateDto']>;
|
|
820
|
+
type CheckoutRetryPayInput = Schemas['DevApiCheckoutRetryPayDto'];
|
|
39
821
|
/** Shared cursor parameters for every paginated list endpoint. */
|
|
40
822
|
interface ListParams {
|
|
41
823
|
/** Page number (1-based). */
|
|
@@ -96,46 +878,6 @@ interface RateLimitInfo {
|
|
|
96
878
|
remaining: number | null;
|
|
97
879
|
reset: number | null;
|
|
98
880
|
}
|
|
99
|
-
interface CheckoutItem {
|
|
100
|
-
/** e.g. "PRD-XPK39ZQA01". */
|
|
101
|
-
publicProductId: string;
|
|
102
|
-
/** Quantity, >= 1. */
|
|
103
|
-
quantity: number;
|
|
104
|
-
/** SKU public id, when the product has variations. */
|
|
105
|
-
combinationPublicId?: string;
|
|
106
|
-
}
|
|
107
|
-
interface CheckoutDelivery {
|
|
108
|
-
deliveryType: 'DELIVERY' | 'PICKUP';
|
|
109
|
-
/** Required when `deliveryType === 'DELIVERY'`. */
|
|
110
|
-
deliveryAreaId?: number;
|
|
111
|
-
}
|
|
112
|
-
interface CheckoutCustomer {
|
|
113
|
-
firstName: string;
|
|
114
|
-
lastName: string;
|
|
115
|
-
email: string;
|
|
116
|
-
phone: string;
|
|
117
|
-
}
|
|
118
|
-
type PaymentMethod = 'external_wallet' | 'split_payment';
|
|
119
|
-
interface CheckoutPreviewInput {
|
|
120
|
-
items: CheckoutItem[];
|
|
121
|
-
delivery: CheckoutDelivery;
|
|
122
|
-
paymentMethod: PaymentMethod;
|
|
123
|
-
}
|
|
124
|
-
interface CheckoutCreateInput extends CheckoutPreviewInput {
|
|
125
|
-
customer: CheckoutCustomer;
|
|
126
|
-
/** HTTPS is mandatory. */
|
|
127
|
-
returnUrl: string;
|
|
128
|
-
additionalDetails?: string;
|
|
129
|
-
/**
|
|
130
|
-
* Free JSON payload echoed back, unchanged, in every cart/order response.
|
|
131
|
-
* Use it to correlate a Xedo order with your own state (`internalOrderId`,
|
|
132
|
-
* `source`, `templateId`, …).
|
|
133
|
-
*/
|
|
134
|
-
meta?: Record<string, unknown>;
|
|
135
|
-
}
|
|
136
|
-
interface CheckoutRetryPayInput {
|
|
137
|
-
returnUrl: string;
|
|
138
|
-
}
|
|
139
881
|
|
|
140
882
|
type FetchLike = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
141
883
|
interface TransportOptions {
|
|
@@ -186,12 +928,12 @@ declare abstract class Resource {
|
|
|
186
928
|
|
|
187
929
|
declare class Carts extends Resource {
|
|
188
930
|
/**
|
|
189
|
-
* `GET /v1/carts` — one page of carts. `DRAFT` carts are
|
|
190
|
-
* the API.
|
|
931
|
+
* `GET /v1/carts` — one page of carts (summary rows). `DRAFT` carts are
|
|
932
|
+
* never exposed by the API.
|
|
191
933
|
*/
|
|
192
|
-
list(params?: CartListParams): Promise<PaginatedResult<
|
|
193
|
-
/** Async iterator over every cart across all pages. */
|
|
194
|
-
listAll(params?: CartListParams): AsyncGenerator<
|
|
934
|
+
list(params?: CartListParams): Promise<PaginatedResult<CartListItem>>;
|
|
935
|
+
/** Async iterator over every cart (summary row) across all pages. */
|
|
936
|
+
listAll(params?: CartListParams): AsyncGenerator<CartListItem>;
|
|
195
937
|
/** `GET /v1/carts/{publicId}`. */
|
|
196
938
|
retrieve(publicId: string, opts?: RequestOptions): Promise<Cart>;
|
|
197
939
|
/** `POST /v1/carts/preview` — compute totals without persisting anything. */
|
|
@@ -206,14 +948,18 @@ declare class Carts extends Resource {
|
|
|
206
948
|
* `POST /v1/carts/{publicId}/pay` — relaunch payment initialization after a
|
|
207
949
|
* `502 PAYMENT_INIT_FAILED`.
|
|
208
950
|
*/
|
|
209
|
-
pay(publicId: string, input: CheckoutRetryPayInput, opts?: RequestOptions): Promise<
|
|
951
|
+
pay(publicId: string, input: CheckoutRetryPayInput, opts?: RequestOptions): Promise<CheckoutRetryResult>;
|
|
210
952
|
/**
|
|
211
953
|
* Convenience wrapper around the 502 checkout flow: create the cart, and if
|
|
212
954
|
* the payment provider could not be reached (`PAYMENT_INIT_FAILED`), retry
|
|
213
955
|
* `pay()` once with the same `returnUrl`. Stays transparent — it logs the
|
|
214
956
|
* code and never swallows a definitive failure.
|
|
957
|
+
*
|
|
958
|
+
* Returns a {@link CheckoutResult} on the happy path, or a
|
|
959
|
+
* {@link CheckoutRetryResult} when the retry succeeded — both carry
|
|
960
|
+
* `checkoutUrl` and `payment`.
|
|
215
961
|
*/
|
|
216
|
-
createAndPay(input: CheckoutCreateInput, opts?: RequestOptions): Promise<CheckoutResult>;
|
|
962
|
+
createAndPay(input: CheckoutCreateInput, opts?: RequestOptions): Promise<CheckoutResult | CheckoutRetryResult>;
|
|
217
963
|
}
|
|
218
964
|
|
|
219
965
|
declare class Collections extends Resource {
|
|
@@ -227,11 +973,27 @@ declare class Collections extends Resource {
|
|
|
227
973
|
retrieveBySlug(slug: string, opts?: RequestOptions): Promise<Collection>;
|
|
228
974
|
}
|
|
229
975
|
|
|
976
|
+
declare class DeliveryAreas extends Resource {
|
|
977
|
+
/**
|
|
978
|
+
* `GET /v1/delivery-areas` — every delivery area configured by the merchant.
|
|
979
|
+
* Use a returned `id` as `delivery.deliveryAreaId` when creating a cart.
|
|
980
|
+
*/
|
|
981
|
+
list(opts?: RequestOptions): Promise<DeliveryArea[]>;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
declare class Marketplace extends Resource {
|
|
985
|
+
/**
|
|
986
|
+
* `GET /v1/marketplace` — the merchant's marketplace profile: enabled
|
|
987
|
+
* payment methods, split-payment configuration, business category, …
|
|
988
|
+
*/
|
|
989
|
+
retrieve(opts?: RequestOptions): Promise<MarketplaceProfile>;
|
|
990
|
+
}
|
|
991
|
+
|
|
230
992
|
declare class Orders extends Resource {
|
|
231
|
-
/** `GET /v1/orders` — one page of paid orders. */
|
|
232
|
-
list(params?: OrderListParams): Promise<PaginatedResult<
|
|
233
|
-
/** Async iterator over every order across all pages. */
|
|
234
|
-
listAll(params?: OrderListParams): AsyncGenerator<
|
|
993
|
+
/** `GET /v1/orders` — one page of paid orders (summary rows). */
|
|
994
|
+
list(params?: OrderListParams): Promise<PaginatedResult<OrderListItem>>;
|
|
995
|
+
/** Async iterator over every order (summary row) across all pages. */
|
|
996
|
+
listAll(params?: OrderListParams): AsyncGenerator<OrderListItem>;
|
|
235
997
|
/** `GET /v1/orders/{publicId}`. */
|
|
236
998
|
retrieve(publicId: string, opts?: RequestOptions): Promise<Order>;
|
|
237
999
|
/**
|
|
@@ -254,9 +1016,13 @@ declare class Products extends Resource {
|
|
|
254
1016
|
}
|
|
255
1017
|
|
|
256
1018
|
interface XedoOptions {
|
|
257
|
-
/** Developer API key: `
|
|
1019
|
+
/** Developer API key: an opaque `xdk_…` string. */
|
|
258
1020
|
apiKey: string;
|
|
259
|
-
/**
|
|
1021
|
+
/**
|
|
1022
|
+
* Override the API base URL. Defaults to the production marketplace URL.
|
|
1023
|
+
* The base URL alone selects Production vs Sandbox — the key is opaque and
|
|
1024
|
+
* carries no environment. See https://developers.xedoapp.com/introduction/environments
|
|
1025
|
+
*/
|
|
260
1026
|
baseUrl?: string;
|
|
261
1027
|
/** Max automatic retries on `429`. Defaults to 4. */
|
|
262
1028
|
maxRetries?: number;
|
|
@@ -266,7 +1032,7 @@ interface XedoOptions {
|
|
|
266
1032
|
fetch?: FetchLike;
|
|
267
1033
|
/**
|
|
268
1034
|
* Escape hatch to run in a browser. Strongly discouraged: your
|
|
269
|
-
* `
|
|
1035
|
+
* `xdk_…` key would be exposed in the client bundle.
|
|
270
1036
|
*/
|
|
271
1037
|
dangerouslyAllowBrowser?: boolean;
|
|
272
1038
|
}
|
|
@@ -284,14 +1050,10 @@ declare class Xedo {
|
|
|
284
1050
|
readonly collections: Collections;
|
|
285
1051
|
readonly orders: Orders;
|
|
286
1052
|
readonly carts: Carts;
|
|
287
|
-
|
|
1053
|
+
readonly deliveryAreas: DeliveryAreas;
|
|
1054
|
+
readonly marketplace: Marketplace;
|
|
288
1055
|
private readonly transport;
|
|
289
1056
|
constructor(options: XedoOptions);
|
|
290
|
-
/**
|
|
291
|
-
* The environment inferred from the key prefix. The rest of the key is
|
|
292
|
-
* treated as opaque.
|
|
293
|
-
*/
|
|
294
|
-
get environment(): 'test' | 'live' | 'unknown';
|
|
295
1057
|
/** Rate-limit headers from the most recent response, for monitoring. */
|
|
296
1058
|
get lastRateLimit(): RateLimitInfo | null;
|
|
297
1059
|
/** `GET /v1/ping` — validate the API key end to end. */
|
|
@@ -359,4 +1121,4 @@ declare class XedoPaymentInitError extends XedoError {
|
|
|
359
1121
|
declare class XedoConnectionError extends XedoError {
|
|
360
1122
|
}
|
|
361
1123
|
|
|
362
|
-
export { type Cart, type CartListParams, type CheckoutCreateInput, type CheckoutCustomer, type CheckoutDelivery, type CheckoutItem, type CheckoutPreview, type CheckoutPreviewInput, type CheckoutResult, type CheckoutRetryPayInput, type Collection, type CollectionListParams, type FetchLike, type JsonObject, type ListParams, type Order, type OrderListParams, type PaginatedResult, type PaymentMethod, type PingResult, type Product, type ProductListParams, type RateLimitInfo, type RequestOptions, type RetrieveOptions, type SortOrder, Xedo, XedoAuthError, XedoConflictError, XedoConnectionError, XedoError, type XedoErrorParams, XedoNotFoundError, type XedoOptions, XedoPaymentInitError, XedoRateLimitError, XedoStockError, XedoValidationError };
|
|
1124
|
+
export { type BusinessCategory, type Cart, type CartCustomer, type CartDelivery, type CartItem, type CartListItem, type CartListParams, type CartStatus, type CartTotals, type CheckoutCreateInput, type CheckoutCustomer, type CheckoutDelivery, type CheckoutItem, type CheckoutPayment, type CheckoutPreview, type CheckoutPreviewInput, type CheckoutResult, type CheckoutRetryPayInput, type CheckoutRetryResult, type CheckoutTotals, type Collection, type CollectionListParams, type DeliveryArea, type DeliveryType, type FetchLike, type FulfillmentStatus, type JsonObject, type ListParams, type MarketplaceProfile, type MediaType, type Order, type OrderCustomer, type OrderDelivery, type OrderItem, type OrderListItem, type OrderListParams, type OrderPayment, type OrderPaymentMethod, type OrderStatus, type OrderTotals, type PaginatedResult, type PaymentMethod, type PaymentStatus, type PingResult, type PriceAdjustmentType, type Product, type ProductCollection, type ProductCombination, type ProductGalleryMedia, type ProductListParams, type ProductVariation, type ProductVariationOption, type RateLimitInfo, type RequestOptions, type RetrieveOptions, type SortOrder, Xedo, XedoAuthError, XedoConflictError, XedoConnectionError, XedoError, type XedoErrorParams, XedoNotFoundError, type XedoOptions, XedoPaymentInitError, XedoRateLimitError, XedoStockError, XedoValidationError };
|