@djust-b2b/djust-front-sdk 1.13.0 → 1.14.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/lib/index.d.ts +7 -4
- package/lib/interfaces/models/customer-user.d.ts +6 -0
- package/lib/interfaces/models/order.d.ts +96 -0
- package/lib/services/auth/index.d.ts +12 -13
- package/lib/services/auth/index.js +12 -13
- package/lib/services/commercial-order/definitions.d.ts +20 -3
- package/lib/services/commercial-order/index.d.ts +361 -15
- package/lib/services/commercial-order/index.js +397 -33
- package/lib/services/customer-account/index.d.ts +1781 -23
- package/lib/services/customer-account/index.js +1780 -45
- package/lib/services/customer-user/definitions.d.ts +3 -1
- package/lib/services/customer-user/index.d.ts +2 -2
- package/lib/services/logistic-order/definitions.d.ts +16 -1
- package/lib/services/logistic-order/index.d.ts +799 -28
- package/lib/services/logistic-order/index.js +823 -28
- package/lib/services/navigation-category/index.d.ts +122 -3
- package/lib/services/navigation-category/index.js +122 -3
- package/package.json +1 -1
|
@@ -12,24 +12,58 @@ exports.getLogisticOrderApprovers = getLogisticOrderApprovers;
|
|
|
12
12
|
exports.updateLogisticOrderBillingInformation = updateLogisticOrderBillingInformation;
|
|
13
13
|
exports.cancelLogisticOrder = cancelLogisticOrder;
|
|
14
14
|
exports.confirmLogisticOrderReception = confirmLogisticOrderReception;
|
|
15
|
+
exports.createLogisticOrder = createLogisticOrder;
|
|
15
16
|
exports.disapproveLogisticOrder = disapproveLogisticOrder;
|
|
16
17
|
exports.getLogisticOrderDocuments = getLogisticOrderDocuments;
|
|
17
18
|
exports.getLogisticOrderDocumentUrl = getLogisticOrderDocumentUrl;
|
|
18
19
|
exports.getLogisticOrderLines = getLogisticOrderLines;
|
|
20
|
+
exports.updateOnHoldLogisticOrderLines = updateOnHoldLogisticOrderLines;
|
|
19
21
|
exports.updateLogisticOrderLineCustomFields = updateLogisticOrderLineCustomFields;
|
|
22
|
+
exports.updateOnHoldLogisticOrderLine = updateOnHoldLogisticOrderLine;
|
|
20
23
|
exports.updateLogisticOrderShippingAddress = updateLogisticOrderShippingAddress;
|
|
21
24
|
exports.getLogisticOrderShippingInformation = getLogisticOrderShippingInformation;
|
|
22
25
|
exports.updateLogisticOrderShippingInformation = updateLogisticOrderShippingInformation;
|
|
23
26
|
exports.updateLogisticOrderShippingType = updateLogisticOrderShippingType;
|
|
24
27
|
exports.createLogisticOrderThread = createLogisticOrderThread;
|
|
25
28
|
exports.getLogisticOrderReview = getLogisticOrderReview;
|
|
26
|
-
exports.
|
|
29
|
+
exports.addLogisticOrderReview = addLogisticOrderReview;
|
|
27
30
|
exports.getThreadReasonTypes = getThreadReasonTypes;
|
|
28
31
|
exports.getThreadSubReasons = getThreadSubReasons;
|
|
29
32
|
const parameters_validation_1 = require("../../helpers/parameters-validation");
|
|
30
33
|
const fetch_instance_1 = require("../../settings/fetch-instance");
|
|
31
34
|
/**
|
|
32
|
-
*
|
|
35
|
+
* 🚚 Gets logistic orders.
|
|
36
|
+
*
|
|
37
|
+
* This function retrieves all logistic orders. The parameter locale is mandatory and validated
|
|
38
|
+
* before the request is executed.
|
|
39
|
+
*
|
|
40
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders [ORDER-550]`
|
|
41
|
+
*
|
|
42
|
+
* | Parameter | Type | Required | Description |
|
|
43
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
44
|
+
* | `approvalIds` | `string` | ❌ | The IDs of the users responsible for the approval of the logistic order. |
|
|
45
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
46
|
+
* | `logisticStatus` | `OrderLogisticStatusType[]` | ❌ | The statuses of the logistic orders you want to retrieve . |
|
|
47
|
+
* | `incident` | `boolean` | ❌ | Whether you want to retrieve incidents or not. |
|
|
48
|
+
* | `paymentOptions` | `PaymentOption[]` | ❌ | The types of payment (e.g., `BANK WIRE`, `CREDIT_CARD`). |
|
|
49
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
50
|
+
* | `page` | `integer` | ❌ | The page number you want to retrieve. |
|
|
51
|
+
* | `size` | `integer` | ❌ | The size of the page you want to retrieve. |
|
|
52
|
+
* | `sort` | `string` | ❌ | The order how you want to retrieve the custom fields. |
|
|
53
|
+
*
|
|
54
|
+
* 📤 **Returns**:
|
|
55
|
+
* A `Promise` resolving to a single `GetLogisticOrdersResponse` object representing the page of logistic orders.
|
|
56
|
+
*
|
|
57
|
+
* 🛠 **Example usage**:
|
|
58
|
+
* ```ts
|
|
59
|
+
* const orders = await getLogisticOrders({
|
|
60
|
+
* locale: "fr",
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param {GetLogisticOrdersParameters} params - The parameters for the request.
|
|
65
|
+
* @throws {Error} If `locale` is missing.
|
|
66
|
+
* @returns {Promise<GetLogisticOrdersResponse>} A promise resolving to the response containing page object.
|
|
33
67
|
*/
|
|
34
68
|
async function getLogisticOrders({ approvalIds, locale, logisticStatus, incident, paymentOptions, nbPreviewLines, page, size, sort, }) {
|
|
35
69
|
(0, parameters_validation_1.required)({ locale });
|
|
@@ -51,7 +85,36 @@ async function getLogisticOrders({ approvalIds, locale, logisticStatus, incident
|
|
|
51
85
|
return data;
|
|
52
86
|
}
|
|
53
87
|
/**
|
|
54
|
-
* Get logistic order custom fields
|
|
88
|
+
* 🚚 Get logistic order's custom fields.
|
|
89
|
+
*
|
|
90
|
+
* This function retrieves custom fields of logistic orders, identified by
|
|
91
|
+
* the `customFieldIds`. This parameter is mandatory and validated
|
|
92
|
+
* before the request is executed.
|
|
93
|
+
*
|
|
94
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/custom-fields [ORDER-553]`
|
|
95
|
+
*
|
|
96
|
+
* | Parameter | Type | Required | Description |
|
|
97
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
98
|
+
* | `customFieldIds` | `string[]` | ✅ | The list of custom fields' ID you want to retrieve. |
|
|
99
|
+
* | `page` | `integer` | ❌ | The page number you want to retrieve. |
|
|
100
|
+
* | `size` | `integer` | ❌ | The size of the page you want to retrieve. |
|
|
101
|
+
* | `sort` | `string` | ❌ | The order how you want to retrieve the custom fields. |
|
|
102
|
+
*
|
|
103
|
+
* 📤 **Returns**:
|
|
104
|
+
* A `Promise` resolving to a single `GetLogisticOrderCustomFieldsResponse` object representing the page of custom fields.
|
|
105
|
+
*
|
|
106
|
+
* 🛠 **Example usage**:
|
|
107
|
+
* ```ts
|
|
108
|
+
* const customFields = await getLogisticOrderCustomFields({
|
|
109
|
+
* customFieldIds: ["customFieldId1", "customFieldId2"],
|
|
110
|
+
* page: 1,
|
|
111
|
+
* size: 20,
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param {GetLogisticOrderCustomFieldsParameters} params - The parameters for the request.
|
|
116
|
+
* @throws {Error} If `customFieldIds` is missing.
|
|
117
|
+
* @returns {Promise<GetLogisticOrderCustomFieldsResponse>} A promise resolving to the response containing the page object.
|
|
55
118
|
*/
|
|
56
119
|
async function getLogisticOrderCustomFields({ customFieldIds, page, size, sort, }) {
|
|
57
120
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
@@ -67,7 +130,36 @@ async function getLogisticOrderCustomFields({ customFieldIds, page, size, sort,
|
|
|
67
130
|
return data;
|
|
68
131
|
}
|
|
69
132
|
/**
|
|
70
|
-
* Get logistic order
|
|
133
|
+
* 🚚 Get logistic order lines' custom fields.
|
|
134
|
+
*
|
|
135
|
+
* This function retrieves custom fields of logistic order lines, identified by
|
|
136
|
+
* the `customFieldIds`. This parameter is mandatory and validated
|
|
137
|
+
* before the request is executed.
|
|
138
|
+
*
|
|
139
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/lines/custom-fields [ORDER-554]`
|
|
140
|
+
*
|
|
141
|
+
* | Parameter | Type | Required | Description |
|
|
142
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
143
|
+
* | `customFieldIds` | `string[]` | ✅ | The list of custom fields' ID you want to retrieve. |
|
|
144
|
+
* | `page` | `integer` | ❌ | The page number you want to retrieve. |
|
|
145
|
+
* | `size` | `integer` | ❌ | The size of the page you want to retrieve. |
|
|
146
|
+
* | `sort` | `string` | ❌ | The order how you want to retrieve the custom fields. |
|
|
147
|
+
*
|
|
148
|
+
* 📤 **Returns**:
|
|
149
|
+
* A `Promise` resolving to a single `GetLogisticOrderLineCustomFieldsResponse` object representing the page of custom fields.
|
|
150
|
+
*
|
|
151
|
+
* 🛠 **Example usage**:
|
|
152
|
+
* ```ts
|
|
153
|
+
* const customFields = await updateLogisticOrderCustomFields({
|
|
154
|
+
* customFieldIds: ["customFieldId1", "customFieldId2"],
|
|
155
|
+
* page: 1,
|
|
156
|
+
* size: 20,
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @param {GetLogisticOrderLineCustomFieldsParameters} params - The parameters for the request.
|
|
161
|
+
* @throws {Error} If `customFieldIds` is missing.
|
|
162
|
+
* @returns {Promise<GetLogisticOrderLineCustomFieldsResponse>} A promise resolving to the response containing the page object.
|
|
71
163
|
*/
|
|
72
164
|
async function getLogisticOrderLineCustomFields({ customFieldIds, page, size, sort, }) {
|
|
73
165
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
@@ -83,7 +175,34 @@ async function getLogisticOrderLineCustomFields({ customFieldIds, page, size, so
|
|
|
83
175
|
return data;
|
|
84
176
|
}
|
|
85
177
|
/**
|
|
86
|
-
*
|
|
178
|
+
* 🚚 Gets a specific logistic order.
|
|
179
|
+
*
|
|
180
|
+
* This function retrieves a specific logistic order, identified by
|
|
181
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
182
|
+
* before the request is executed.
|
|
183
|
+
*
|
|
184
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId} [ORDER-501]`
|
|
185
|
+
*
|
|
186
|
+
* | Parameter | Type | Required | Description |
|
|
187
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
188
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to retrieve. |
|
|
189
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
190
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
191
|
+
*
|
|
192
|
+
* 📤 **Returns**:
|
|
193
|
+
* A `Promise` resolving to a single `GetLogisticOrderResponse` object representing the logistic order.
|
|
194
|
+
*
|
|
195
|
+
* 🛠 **Example usage**:
|
|
196
|
+
* ```ts
|
|
197
|
+
* const order = await getLogisticOrder({
|
|
198
|
+
* orderId: "logisticOrder1",
|
|
199
|
+
* locale: "fr",
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @param {GetLogisticOrderParameters} params - The parameters for the request.
|
|
204
|
+
* @throws {Error} If `orderId` is missing.
|
|
205
|
+
* @returns {Promise<GetLogisticOrderResponse>} A promise resolving to the response containing the logistic order.
|
|
87
206
|
*/
|
|
88
207
|
async function getLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
89
208
|
(0, parameters_validation_1.required)({ orderId, locale });
|
|
@@ -98,7 +217,35 @@ async function getLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
|
98
217
|
return data;
|
|
99
218
|
}
|
|
100
219
|
/**
|
|
101
|
-
*
|
|
220
|
+
* 🚚 Updates a specific logistic order's custom fields.
|
|
221
|
+
*
|
|
222
|
+
* This function updates the custom fields of a specific logistic order, identified by
|
|
223
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
224
|
+
* before the request is executed.
|
|
225
|
+
*
|
|
226
|
+
* 🛠 **Endpoint**: `PATCH /v1/shop/logistic-orders/${orderId} [ORDER-205]`
|
|
227
|
+
*
|
|
228
|
+
* | Parameter | Type | Required | Description |
|
|
229
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
230
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the custom fields. |
|
|
231
|
+
* | `customFields` | `CustomFieldValueObject[]` | ✅ | The custom fields with value and externalId. |
|
|
232
|
+
* | `locale` | `string` | ❌ | The locale in which to return the logistic order. |
|
|
233
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
234
|
+
*
|
|
235
|
+
* 📤 **Returns**:
|
|
236
|
+
* A `Promise` resolving to a single `UpdateOrderLogisticCustomFieldResponse` object representing the logistic order.
|
|
237
|
+
*
|
|
238
|
+
* 🛠 **Example usage**:
|
|
239
|
+
* ```ts
|
|
240
|
+
* const order = await updateLogisticOrderCustomFields({
|
|
241
|
+
* orderId: "logisticOrder1",
|
|
242
|
+
* customFields: [{ customFieldId: "externalId1", customFieldValue: "value1" }, { customFieldId: "externalId2", customFieldValue: "value2" }],
|
|
243
|
+
* });
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @param {UpdateOrderLogisticCustomFieldParameters} params - The parameters for the request.
|
|
247
|
+
* @throws {Error} If `orderId` or `customFields` is missing.
|
|
248
|
+
* @returns {Promise<UpdateOrderLogisticCustomFieldResponse>} A promise resolving to the response containing the logistic order.
|
|
102
249
|
*/
|
|
103
250
|
async function updateLogisticOrderCustomFields({ orderId, locale, nbPreviewLines, customFields, }) {
|
|
104
251
|
(0, parameters_validation_1.required)({ orderId, customFields });
|
|
@@ -114,7 +261,31 @@ async function updateLogisticOrderCustomFields({ orderId, locale, nbPreviewLines
|
|
|
114
261
|
return data;
|
|
115
262
|
}
|
|
116
263
|
/**
|
|
117
|
-
*
|
|
264
|
+
* 🚚 Gets a specific logistic order's accounting documents.
|
|
265
|
+
*
|
|
266
|
+
* This function retrieves the accounting documents of a specific logistic order, identified by
|
|
267
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
268
|
+
* before the request is executed.
|
|
269
|
+
*
|
|
270
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/accounting-documents [ORDER-551]`
|
|
271
|
+
*
|
|
272
|
+
* | Parameter | Type | Required | Description |
|
|
273
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
274
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the accounting documents. |
|
|
275
|
+
*
|
|
276
|
+
* 📤 **Returns**:
|
|
277
|
+
* A `Promise` resolving to a single `GetLogisticOrderAccountingDocumentsResponse` object representing the list of accounting documents of the logistic order.
|
|
278
|
+
*
|
|
279
|
+
* 🛠 **Example usage**:
|
|
280
|
+
* ```ts
|
|
281
|
+
* const accountingDocuments = await getLogisticOrderAccountingDocuments({
|
|
282
|
+
* orderId: "logisticOrder1",
|
|
283
|
+
* });
|
|
284
|
+
* ```
|
|
285
|
+
*
|
|
286
|
+
* @param {GetLogisticOrderAccountingDocumentsParameters} params - The parameters for the request.
|
|
287
|
+
* @throws {Error} If `orderId` is missing.
|
|
288
|
+
* @returns {Promise<GetLogisticOrderAccountingDocumentsResponse>} A promise resolving to the response containing the list of accounting documents.
|
|
118
289
|
*/
|
|
119
290
|
async function getLogisticOrderAccountingDocuments({ orderId, }) {
|
|
120
291
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -125,7 +296,33 @@ async function getLogisticOrderAccountingDocuments({ orderId, }) {
|
|
|
125
296
|
return data;
|
|
126
297
|
}
|
|
127
298
|
/**
|
|
128
|
-
*
|
|
299
|
+
* 🚚 Gets specific accounting document urls of a specific logistic order.
|
|
300
|
+
*
|
|
301
|
+
* This function retrieves specific accounting document urls of a specific logistic order, both identified by
|
|
302
|
+
* the `orderId` and the `documentId`. Both parameters are mandatory and validated
|
|
303
|
+
* before the request is executed.
|
|
304
|
+
*
|
|
305
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/accounting-documents/{documentId} [ORDER-506]`
|
|
306
|
+
*
|
|
307
|
+
* | Parameter | Type | Required | Description |
|
|
308
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
309
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the accounting documents. |
|
|
310
|
+
* | `documentId` | `string` | ✅ | The ID of the accounting document to be downloaded. |
|
|
311
|
+
*
|
|
312
|
+
* 📤 **Returns**:
|
|
313
|
+
* A `Promise` resolving to a single `GetLogisticOrderAccountingDocumentsResponse` object representing the list of accounting document's urls.
|
|
314
|
+
*
|
|
315
|
+
* 🛠 **Example usage**:
|
|
316
|
+
* ```ts
|
|
317
|
+
* const accountingDocumentUrls = await getLogisticOrderAccountingDocumentUrl({
|
|
318
|
+
* orderId: "logisticOrder1",
|
|
319
|
+
* documentId: "document1",
|
|
320
|
+
* });
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @param {GetLogisticOrderAccountingDocumentUrlParameters} params - The parameters for the request.
|
|
324
|
+
* @throws {Error} If `orderId` or `documentId` is missing.
|
|
325
|
+
* @returns {Promise<string[]>} A promise resolving to the response containing the list of document's urls.
|
|
129
326
|
*/
|
|
130
327
|
async function getLogisticOrderAccountingDocumentUrl({ orderId, documentId, }) {
|
|
131
328
|
(0, parameters_validation_1.required)({ orderId, documentId });
|
|
@@ -136,7 +333,33 @@ async function getLogisticOrderAccountingDocumentUrl({ orderId, documentId, }) {
|
|
|
136
333
|
return data;
|
|
137
334
|
}
|
|
138
335
|
/**
|
|
139
|
-
*
|
|
336
|
+
* 🚚 Approves a logistic order.
|
|
337
|
+
*
|
|
338
|
+
* This function approves a specific logistic order, identified by the `orderId`. The parameters `orderId` and `locale` are mandatory and validated
|
|
339
|
+
* before the request is executed.
|
|
340
|
+
*
|
|
341
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/approve [ORDER-200]`
|
|
342
|
+
*
|
|
343
|
+
* | Parameter | Type | Required | Description |
|
|
344
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
345
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to approve. |
|
|
346
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
347
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
348
|
+
*
|
|
349
|
+
* 📤 **Returns**:
|
|
350
|
+
* A `Promise` resolving to a single `ApproveLogisticOrderResponse` object representing the logistic order approved.
|
|
351
|
+
*
|
|
352
|
+
* 🛠 **Example usage**:
|
|
353
|
+
* ```ts
|
|
354
|
+
* const order = await approveLogisticOrder({
|
|
355
|
+
* orderId: "logisticOrder1",
|
|
356
|
+
* locale: "fr",
|
|
357
|
+
* });
|
|
358
|
+
* ```
|
|
359
|
+
*
|
|
360
|
+
* @param {ApproveLogisticOrderParameters} params - The parameters for the request.
|
|
361
|
+
* @throws {Error} If `orderId` or `locale` is missing.
|
|
362
|
+
* @returns {Promise<ApproveLogisticOrderResponse>} A promise resolving to the response containing the logistic order.
|
|
140
363
|
*/
|
|
141
364
|
async function approveLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
142
365
|
(0, parameters_validation_1.required)({ orderId, locale });
|
|
@@ -151,7 +374,30 @@ async function approveLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
|
151
374
|
return data;
|
|
152
375
|
}
|
|
153
376
|
/**
|
|
154
|
-
*
|
|
377
|
+
* 🚚 Gets a logistic order's approvers.
|
|
378
|
+
*
|
|
379
|
+
* This function retrieves the users able to approve a specific logistic order, identified by the `orderId`. This parameter is mandatory and validated
|
|
380
|
+
* before the request is executed.
|
|
381
|
+
*
|
|
382
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/approvers [ORDER-556]`
|
|
383
|
+
*
|
|
384
|
+
* | Parameter | Type | Required | Description |
|
|
385
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
386
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the approvers. |
|
|
387
|
+
*
|
|
388
|
+
* 📤 **Returns**:
|
|
389
|
+
* A `Promise` resolving to a single `ApproveLogisticOrderResponse` object representing a list of approval objects, a combination of a user, the logistic order and an approval status.
|
|
390
|
+
*
|
|
391
|
+
* 🛠 **Example usage**:
|
|
392
|
+
* ```ts
|
|
393
|
+
* const approvalObjects = await getLogisticOrderApprovers({
|
|
394
|
+
* orderId: "logisticOrder1",
|
|
395
|
+
* });
|
|
396
|
+
* ```
|
|
397
|
+
*
|
|
398
|
+
* @param {GetLogisticOrderApproversParameters} params - The parameters for the request.
|
|
399
|
+
* @throws {Error} If `orderId` is missing.
|
|
400
|
+
* @returns {Promise<GetLogisticOrderApproversResponse>} A promise resolving to the response containing a list of approval objects.
|
|
155
401
|
*/
|
|
156
402
|
async function getLogisticOrderApprovers({ orderId, }) {
|
|
157
403
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -162,7 +408,32 @@ async function getLogisticOrderApprovers({ orderId, }) {
|
|
|
162
408
|
return data;
|
|
163
409
|
}
|
|
164
410
|
/**
|
|
165
|
-
*
|
|
411
|
+
* 🚚 Updates a logistic order's billing information.
|
|
412
|
+
*
|
|
413
|
+
* This function updates the billing information of a specific logistic order, both identified by the `orderId` and the `billingAddressId`. Both parameters are mandatory and validated
|
|
414
|
+
* before the request is executed.
|
|
415
|
+
*
|
|
416
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/billing-information [ORDER-209]`
|
|
417
|
+
*
|
|
418
|
+
* | Parameter | Type | Required | Description |
|
|
419
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
420
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the billing information. |
|
|
421
|
+
* | `billingAddressId`| `string` | ✅ | The ID of the billing address you want to add to the logistic order. |
|
|
422
|
+
*
|
|
423
|
+
* 📤 **Returns**:
|
|
424
|
+
* A `Promise` resolving when the billing information of the logistic order is updated.
|
|
425
|
+
*
|
|
426
|
+
* 🛠 **Example usage**:
|
|
427
|
+
* ```ts
|
|
428
|
+
* await updateLogisticOrderBillingInformation({
|
|
429
|
+
* orderId: "logisticOrder1",
|
|
430
|
+
* billingAddressId: "address1",
|
|
431
|
+
* });
|
|
432
|
+
* ```
|
|
433
|
+
*
|
|
434
|
+
* @param {UpdateLogisticOrderBillingInformationParameters} params - The parameters for the request.
|
|
435
|
+
* @throws {Error} If `orderId` or `billingAddressId` is missing.
|
|
436
|
+
* @returns {Promise<void>} A promise resolving when the billing information is updated.
|
|
166
437
|
*/
|
|
167
438
|
async function updateLogisticOrderBillingInformation({ orderId, billingAddressId, }) {
|
|
168
439
|
(0, parameters_validation_1.required)({ orderId, billingAddressId });
|
|
@@ -173,7 +444,33 @@ async function updateLogisticOrderBillingInformation({ orderId, billingAddressId
|
|
|
173
444
|
});
|
|
174
445
|
}
|
|
175
446
|
/**
|
|
176
|
-
*
|
|
447
|
+
* 🚚 Cancels a logistic order.
|
|
448
|
+
*
|
|
449
|
+
* This function cancels a specific logistic order, identified by the `orderId`. The parameters `orderId` and `locale` are mandatory and validated
|
|
450
|
+
* before the request is executed.
|
|
451
|
+
*
|
|
452
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/cancel [ORDER-201]`
|
|
453
|
+
*
|
|
454
|
+
* | Parameter | Type | Required | Description |
|
|
455
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
456
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to cancel. |
|
|
457
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
458
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
459
|
+
*
|
|
460
|
+
* 📤 **Returns**:
|
|
461
|
+
* A `Promise` resolving to a single `CancelLogisticOrderResponse` object representing the logistic order cancelled.
|
|
462
|
+
*
|
|
463
|
+
* 🛠 **Example usage**:
|
|
464
|
+
* ```ts
|
|
465
|
+
* const order = await cancelLogisticOrder({
|
|
466
|
+
* orderId: "logisticOrder1",
|
|
467
|
+
* locale: "fr",
|
|
468
|
+
* });
|
|
469
|
+
* ```
|
|
470
|
+
*
|
|
471
|
+
* @param {CancelLogisticOrderParameters} params - The parameters for the request.
|
|
472
|
+
* @throws {Error} If `orderId` or `locale` is missing.
|
|
473
|
+
* @returns {Promise<CancelLogisticOrderResponse>} A promise resolving to the response containing the logistic order.
|
|
177
474
|
*/
|
|
178
475
|
async function cancelLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
179
476
|
(0, parameters_validation_1.required)({ orderId, locale });
|
|
@@ -188,7 +485,33 @@ async function cancelLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
|
188
485
|
return data;
|
|
189
486
|
}
|
|
190
487
|
/**
|
|
191
|
-
*
|
|
488
|
+
* 🚚 Confirms reception of logistic order.
|
|
489
|
+
*
|
|
490
|
+
* This function confirms the reception of a specific logistic order, identified by the `orderId`. The parameters `orderId` and `locale` are mandatory and validated
|
|
491
|
+
* before the request is executed.
|
|
492
|
+
*
|
|
493
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/confirm-reception [ORDER-203]`
|
|
494
|
+
*
|
|
495
|
+
* | Parameter | Type | Required | Description |
|
|
496
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
497
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to confirm reception. |
|
|
498
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
499
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
500
|
+
*
|
|
501
|
+
* 📤 **Returns**:
|
|
502
|
+
* A `Promise` resolving to a single `ConfirmLogisticOrderReceptionResponse` object representing the logistic order received.
|
|
503
|
+
*
|
|
504
|
+
* 🛠 **Example usage**:
|
|
505
|
+
* ```ts
|
|
506
|
+
* const order = await confirmLogisticOrderReception({
|
|
507
|
+
* orderId: "logisticOrder1",
|
|
508
|
+
* locale: "fr",
|
|
509
|
+
* });
|
|
510
|
+
* ```
|
|
511
|
+
*
|
|
512
|
+
* @param {ConfirmLogisticOrderReceptionParameters} params - The parameters for the request.
|
|
513
|
+
* @throws {Error} If `orderId` or `locale` is missing.
|
|
514
|
+
* @returns {Promise<ConfirmLogisticOrderReceptionResponse>} A promise resolving to the response containing the logistic order.
|
|
192
515
|
*/
|
|
193
516
|
async function confirmLogisticOrderReception({ orderId, locale, nbPreviewLines, }) {
|
|
194
517
|
(0, parameters_validation_1.required)({ orderId, locale });
|
|
@@ -203,7 +526,66 @@ async function confirmLogisticOrderReception({ orderId, locale, nbPreviewLines,
|
|
|
203
526
|
return data;
|
|
204
527
|
}
|
|
205
528
|
/**
|
|
206
|
-
*
|
|
529
|
+
* 🚚 Update a DRAFT_ORDER_ON_HOLD logistic order to CREATED.
|
|
530
|
+
*
|
|
531
|
+
* This function updates the status of a specific logistic order, identified by the `orderId`, from DRAFT_ORDER_ON_HOLD to CREATED. The parameter `orderId` is mandatory and validated
|
|
532
|
+
* before the request is executed.
|
|
533
|
+
*
|
|
534
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/created [ORDER-220]`
|
|
535
|
+
*
|
|
536
|
+
* | Parameter | Type | Required | Description |
|
|
537
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
538
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to pass to CREATED. |
|
|
539
|
+
*
|
|
540
|
+
* 📤 **Returns**:
|
|
541
|
+
* A `Promise` resolving when the logistic order's status is passed to CREATED.
|
|
542
|
+
*
|
|
543
|
+
* 🛠 **Example usage**:
|
|
544
|
+
* ```ts
|
|
545
|
+
* await createLogisticOrder({
|
|
546
|
+
* orderId: "logisticOrder1",
|
|
547
|
+
* });
|
|
548
|
+
* ```
|
|
549
|
+
*
|
|
550
|
+
* @param {CreateLogisticOrderParameters} params - The parameters for the request.
|
|
551
|
+
* @throws {Error} If `orderId` or `locale` is missing.
|
|
552
|
+
* @returns {Promise<void>} A promise resolving when the logistic order is created.
|
|
553
|
+
*/
|
|
554
|
+
async function createLogisticOrder({ orderId, }) {
|
|
555
|
+
(0, parameters_validation_1.required)({ orderId });
|
|
556
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
557
|
+
method: "PUT",
|
|
558
|
+
path: `/v1/shop/logistic-orders/${orderId}/created`,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* 🚚 Disapproves a logistic order.
|
|
563
|
+
*
|
|
564
|
+
* This function disapproves a specific logistic order, identified by the `orderId`. The parameters `orderId` and `locale` are mandatory and validated
|
|
565
|
+
* before the request is executed.
|
|
566
|
+
*
|
|
567
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/disapprove [ORDER-204]`
|
|
568
|
+
*
|
|
569
|
+
* | Parameter | Type | Required | Description |
|
|
570
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
571
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order you want to disapprove. |
|
|
572
|
+
* | `locale` | `string` | ✅ | The locale in which to return the logistic order. |
|
|
573
|
+
* | `nbPreviewLines` | `integer` | ❌ | The number of lines to display in the logistic order. |
|
|
574
|
+
*
|
|
575
|
+
* 📤 **Returns**:
|
|
576
|
+
* A `Promise` resolving to a single `DisapproveLogisticOrderResponse` object representing the logistic order disapproved.
|
|
577
|
+
*
|
|
578
|
+
* 🛠 **Example usage**:
|
|
579
|
+
* ```ts
|
|
580
|
+
* const order = await disapproveLogisticOrder({
|
|
581
|
+
* orderId: "logisticOrder1",
|
|
582
|
+
* locale: "fr",
|
|
583
|
+
* });
|
|
584
|
+
* ```
|
|
585
|
+
*
|
|
586
|
+
* @param {DisapproveLogisticOrderParameters} params - The parameters for the request.
|
|
587
|
+
* @throws {Error} If `orderId` or `locale` is missing.
|
|
588
|
+
* @returns {Promise<DisapproveLogisticOrderResponse>} A promise resolving to the response containing the logistic order.
|
|
207
589
|
*/
|
|
208
590
|
async function disapproveLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
209
591
|
(0, parameters_validation_1.required)({ orderId, locale });
|
|
@@ -218,7 +600,32 @@ async function disapproveLogisticOrder({ orderId, locale, nbPreviewLines, }) {
|
|
|
218
600
|
return data;
|
|
219
601
|
}
|
|
220
602
|
/**
|
|
221
|
-
*
|
|
603
|
+
* 🚚 Gets a specific logistic order's documents.
|
|
604
|
+
*
|
|
605
|
+
* This function retrieves the documents of a specific logistic order, identified by
|
|
606
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
607
|
+
* before the request is executed.
|
|
608
|
+
*
|
|
609
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/documents [ORDER-552]`
|
|
610
|
+
*
|
|
611
|
+
* | Parameter | Type | Required | Description |
|
|
612
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
613
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the documents. |
|
|
614
|
+
* | `idType` | `OrderIdType` | ❌ | The type of order ID (e.g., `DJUST_ID`, `EXTERNAL_ID`, `REFERENCE`). |
|
|
615
|
+
*
|
|
616
|
+
* 📤 **Returns**:
|
|
617
|
+
* A `Promise` resolving to a single `GetLogisticOrderDocumentsParameters` object representing the list of documents of the logistic order.
|
|
618
|
+
*
|
|
619
|
+
* 🛠 **Example usage**:
|
|
620
|
+
* ```ts
|
|
621
|
+
* const documents = await getLogisticOrderDocuments({
|
|
622
|
+
* orderId: "logisticOrder1",
|
|
623
|
+
* });
|
|
624
|
+
* ```
|
|
625
|
+
*
|
|
626
|
+
* @param {GetLogisticOrderDocumentsParameters} params - The parameters for the request.
|
|
627
|
+
* @throws {Error} If `orderId` is missing.
|
|
628
|
+
* @returns {Promise<GetLogisticOrderDocumentsParameters>} A promise resolving to the response containing the list of documents.
|
|
222
629
|
*/
|
|
223
630
|
async function getLogisticOrderDocuments({ orderId, idType, }) {
|
|
224
631
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -232,7 +639,33 @@ async function getLogisticOrderDocuments({ orderId, idType, }) {
|
|
|
232
639
|
return data;
|
|
233
640
|
}
|
|
234
641
|
/**
|
|
235
|
-
*
|
|
642
|
+
* 🚚 Gets specific document urls of a specific logistic order.
|
|
643
|
+
*
|
|
644
|
+
* This function retrieves specific document urls of a specific logistic order, both identified by
|
|
645
|
+
* the `orderId` and the `documentId`. Both parameters are mandatory and validated
|
|
646
|
+
* before the request is executed.
|
|
647
|
+
*
|
|
648
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/documents/{documentId} [ORDER-508]`
|
|
649
|
+
*
|
|
650
|
+
* | Parameter | Type | Required | Description |
|
|
651
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
652
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the documents. |
|
|
653
|
+
* | `documentId` | `string` | ✅ | The ID of the document to be downloaded. |
|
|
654
|
+
*
|
|
655
|
+
* 📤 **Returns**:
|
|
656
|
+
* A `Promise` resolving to a single `GetLogisticOrderAccountingDocumentsResponse` object representing the list of document's urls.
|
|
657
|
+
*
|
|
658
|
+
* 🛠 **Example usage**:
|
|
659
|
+
* ```ts
|
|
660
|
+
* const documentUrls = await getLogisticOrderDocumentUrl({
|
|
661
|
+
* orderId: "logisticOrder1",
|
|
662
|
+
* documentId: "document1",
|
|
663
|
+
* });
|
|
664
|
+
* ```
|
|
665
|
+
*
|
|
666
|
+
* @param {GetLogisticOrderAccountingDocumentUrlParameters} params - The parameters for the request.
|
|
667
|
+
* @throws {Error} If `orderId` or `documentId` is missing.
|
|
668
|
+
* @returns {Promise<string[]>} A promise resolving to the response containing the list of document's urls.
|
|
236
669
|
*/
|
|
237
670
|
async function getLogisticOrderDocumentUrl({ orderId, documentId, }) {
|
|
238
671
|
(0, parameters_validation_1.required)({ orderId, documentId });
|
|
@@ -243,7 +676,35 @@ async function getLogisticOrderDocumentUrl({ orderId, documentId, }) {
|
|
|
243
676
|
return data;
|
|
244
677
|
}
|
|
245
678
|
/**
|
|
246
|
-
*
|
|
679
|
+
* 🚚 Gets order lines of a specific logistic order.
|
|
680
|
+
*
|
|
681
|
+
* This function retrieves the order lines of a specific logistic order, identified by
|
|
682
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
683
|
+
* before the request is executed.
|
|
684
|
+
*
|
|
685
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/lines [ORDER-555]`
|
|
686
|
+
*
|
|
687
|
+
* | Parameter | Type | Required | Description |
|
|
688
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
689
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the order lines. |
|
|
690
|
+
* | `page` | `integer` | ❌ | The page number you want to retrieve. |
|
|
691
|
+
* | `size` | `integer` | ❌ | The size of the page you want to retrieve. |
|
|
692
|
+
* | `sort` | `string` | ❌ | The order how you want to retrieve the custom fields. |
|
|
693
|
+
* | `locale` | `string` | ❌ | The locale in which to return the logistic order lines. |
|
|
694
|
+
*
|
|
695
|
+
* 📤 **Returns**:
|
|
696
|
+
* A `Promise` resolving to a single `GetLogisticOrderLinesResponse` object representing the page of logistic order lines.
|
|
697
|
+
*
|
|
698
|
+
* 🛠 **Example usage**:
|
|
699
|
+
* ```ts
|
|
700
|
+
* const logisticOrderLines = await getLogisticOrderLines({
|
|
701
|
+
* orderId: "logisticOrder1",
|
|
702
|
+
* });
|
|
703
|
+
* ```
|
|
704
|
+
*
|
|
705
|
+
* @param {GetLogisticOrderLinesParameters} params - The parameters for the request.
|
|
706
|
+
* @throws {Error} If `orderId` is missing.
|
|
707
|
+
* @returns {Promise<GetLogisticOrderLinesResponse>} A promise resolving to the response containing the page object.
|
|
247
708
|
*/
|
|
248
709
|
async function getLogisticOrderLines({ orderId, page, size, sort, locale, }) {
|
|
249
710
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -260,7 +721,85 @@ async function getLogisticOrderLines({ orderId, page, size, sort, locale, }) {
|
|
|
260
721
|
return data;
|
|
261
722
|
}
|
|
262
723
|
/**
|
|
263
|
-
*
|
|
724
|
+
* 🚚 Updates order lines of a specific DRAFT_ORDER_ON_HOLD logistic order.
|
|
725
|
+
*
|
|
726
|
+
* This function updates the confirmed quantity and custom field values of the order lines of a specific logistic order, identified by
|
|
727
|
+
* the `orderId`. This parameter, as well as the `lines`, is mandatory and validated before the request is executed.
|
|
728
|
+
*
|
|
729
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/lines [ORDER-250]`
|
|
730
|
+
*
|
|
731
|
+
* | Parameter | Type | Required | Description |
|
|
732
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
733
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the lines. |
|
|
734
|
+
* | `lines` | `OrderLogisticLineUpdate[]` | ✅ | The lines you want to update. |
|
|
735
|
+
*
|
|
736
|
+
* 📤 **Returns**:
|
|
737
|
+
* A `Promise` resolving to a single `UpdateOnHoldLogisticOrderLinesResponse` object representing the error report for each lines that failed to update.
|
|
738
|
+
*
|
|
739
|
+
* 🛠 **Example usage**:
|
|
740
|
+
* ```ts
|
|
741
|
+
* const errorReport = await updateOnHoldLogisticOrderLines({
|
|
742
|
+
* orderId: "logisticOrder1",
|
|
743
|
+
* lines: [
|
|
744
|
+
{
|
|
745
|
+
"customFields": [
|
|
746
|
+
{
|
|
747
|
+
"customFieldId": "customField1",
|
|
748
|
+
"customFieldValue": "value1"
|
|
749
|
+
}
|
|
750
|
+
],
|
|
751
|
+
"id": "orderLine1",
|
|
752
|
+
"quantity": 1,
|
|
753
|
+
"updateAction": "ADD_QUANTITY"
|
|
754
|
+
}
|
|
755
|
+
]
|
|
756
|
+
* });
|
|
757
|
+
* ```
|
|
758
|
+
*
|
|
759
|
+
* @param {UpdateOnHoldLogisticOrderLinesParameters} params - The parameters for the request.
|
|
760
|
+
* @throws {Error} If `orderId` or `lines` is missing.
|
|
761
|
+
* @returns {Promise<UpdateOnHoldLogisticOrderLinesResponse>} A promise resolving to the response containing the error report.
|
|
762
|
+
*/
|
|
763
|
+
async function updateOnHoldLogisticOrderLines({ orderId, lines, }) {
|
|
764
|
+
(0, parameters_validation_1.required)({ orderId, lines });
|
|
765
|
+
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
766
|
+
method: "GET",
|
|
767
|
+
path: `/v1/shop/logistic-orders/${orderId}/lines`,
|
|
768
|
+
body: JSON.stringify(lines),
|
|
769
|
+
});
|
|
770
|
+
return data;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* 🚚 Updates specific logistic order line's customFields.
|
|
774
|
+
*
|
|
775
|
+
* This function updates a specific logistic order line's customFields, identified by both
|
|
776
|
+
* the `orderId` and the `lineId`. These parameters, as well as the `customFields` is mandatory and validated
|
|
777
|
+
* before the request is executed.
|
|
778
|
+
*
|
|
779
|
+
* 🛠 **Endpoint**: `PATCH /v1/shop/logistic-orders/${orderId}/lines/${lineId} [ORDER-206]`
|
|
780
|
+
*
|
|
781
|
+
* | Parameter | Type | Required | Description |
|
|
782
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
783
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update an order line. |
|
|
784
|
+
* | `lineId` | `string` | ✅ | The ID of the logistic order line you want to update. |
|
|
785
|
+
* | `customFields` | `CustomFieldValueObject[]` | ✅ | The custom fields to add with value and externalId. |
|
|
786
|
+
* | `locale` | `string` | ❌ | The locale in which to return the logistic order lines. |
|
|
787
|
+
*
|
|
788
|
+
* 📤 **Returns**:
|
|
789
|
+
* A `Promise` resolving to a single `UpdateLogisticOrderLineCustomFieldsResponse` object representing the updated logistic order line.
|
|
790
|
+
*
|
|
791
|
+
* 🛠 **Example usage**:
|
|
792
|
+
* ```ts
|
|
793
|
+
* const newLogisticOrderLine = await updateLogisticOrderLineCustomFields({
|
|
794
|
+
* orderId: "logisticOrder1",
|
|
795
|
+
* lineId: "logisticOrderLine1",
|
|
796
|
+
* customFields: [{externalId: "cf1", value: "value1"}, {externalId: "cf2", value: "value2"}]
|
|
797
|
+
* });
|
|
798
|
+
* ```
|
|
799
|
+
*
|
|
800
|
+
* @param {UpdateLogisticOrderLineCustomFieldsParameters} params - The parameters for the request.
|
|
801
|
+
* @throws {Error} If `orderId` or `lineId` is missing.
|
|
802
|
+
* @returns {Promise<UpdateLogisticOrderLineCustomFieldsResponse>} A promise resolving to the response containing the logistic order line.
|
|
264
803
|
*/
|
|
265
804
|
async function updateLogisticOrderLineCustomFields({ orderId, lineId, locale, customFields, }) {
|
|
266
805
|
(0, parameters_validation_1.required)({ orderId, lineId, customFields });
|
|
@@ -275,7 +814,69 @@ async function updateLogisticOrderLineCustomFields({ orderId, lineId, locale, cu
|
|
|
275
814
|
return data;
|
|
276
815
|
}
|
|
277
816
|
/**
|
|
278
|
-
*
|
|
817
|
+
* 🚚 Updates order line of a specific DRAFT_ORDER_ON_HOLD logistic order.
|
|
818
|
+
*
|
|
819
|
+
* This function updates the confirmed quantity of a specific order line of a specific logistic order, both identified by
|
|
820
|
+
* the `orderId` and the `orderLineId`. Both parameters, as well as the `quantity`, are mandatory and validated before the request is executed.
|
|
821
|
+
*
|
|
822
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/lines/${orderLineId} [ORDER-218]`
|
|
823
|
+
*
|
|
824
|
+
* | Parameter | Type | Required | Description |
|
|
825
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
826
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the lines. |
|
|
827
|
+
* | `orderLineId` | `string` | ✅ | The ID of the logistic order line you want to update. |
|
|
828
|
+
* | `quantity` | `number` | ✅ | The lines you want to update. |
|
|
829
|
+
*
|
|
830
|
+
* 📤 **Returns**:
|
|
831
|
+
* A `Promise` resolving when the logistic order line is updated.
|
|
832
|
+
*
|
|
833
|
+
* 🛠 **Example usage**:
|
|
834
|
+
* ```ts
|
|
835
|
+
* await updateOnHoldLogisticOrderLine({
|
|
836
|
+
* orderId: "logisticOrder1",
|
|
837
|
+
* orderLineId: "logisticOrderLine1",
|
|
838
|
+
* quantity: 1
|
|
839
|
+
* ```
|
|
840
|
+
*
|
|
841
|
+
* @param {UpdateOnHoldLogisticOrderLineParameters} params - The parameters for the request.
|
|
842
|
+
* @throws {Error} If `orderId`, `orderLineId` or `quantity` is missing.
|
|
843
|
+
* @returns {Promise<void>} A promise resolving when the logistic order line is updated.
|
|
844
|
+
*/
|
|
845
|
+
async function updateOnHoldLogisticOrderLine({ orderId, orderLineId, quantity, }) {
|
|
846
|
+
(0, parameters_validation_1.required)({ orderId, orderLineId, quantity });
|
|
847
|
+
await (0, fetch_instance_1.enhancedFetch)({
|
|
848
|
+
method: "GET",
|
|
849
|
+
path: `/v1/shop/logistic-orders/${orderId}/lines/${orderLineId}`,
|
|
850
|
+
body: JSON.stringify(quantity),
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* 🚚 Updates a logistic order's shipping address.
|
|
855
|
+
*
|
|
856
|
+
* This function updates the shipping address of a specific logistic order, both identified by the `orderId` and the `shippingAddressId`. Both parameters are mandatory and validated
|
|
857
|
+
* before the request is executed.
|
|
858
|
+
*
|
|
859
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/shipping-address [ORDER-210]`
|
|
860
|
+
*
|
|
861
|
+
* | Parameter | Type | Required | Description |
|
|
862
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
863
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the shipping address. |
|
|
864
|
+
* | `shippingAddressId`| `string` | ✅ | The ID of the shipping address you want to set to the logistic order. |
|
|
865
|
+
*
|
|
866
|
+
* 📤 **Returns**:
|
|
867
|
+
* A `Promise` resolving when the shipping address of the logistic order is set.
|
|
868
|
+
*
|
|
869
|
+
* 🛠 **Example usage**:
|
|
870
|
+
* ```ts
|
|
871
|
+
* await updateLogisticOrderShippingAddress({
|
|
872
|
+
* orderId: "logisticOrder1",
|
|
873
|
+
* shippingAddressId: "address1",
|
|
874
|
+
* });
|
|
875
|
+
* ```
|
|
876
|
+
*
|
|
877
|
+
* @param {UpdateLogisticOrderShippingInformationParameters} params - The parameters for the request.
|
|
878
|
+
* @throws {Error} If `orderId` or `shippingAddressId` is missing.
|
|
879
|
+
* @returns {Promise<void>} A promise resolving when the shipping address of the logistic order is set.
|
|
279
880
|
*/
|
|
280
881
|
async function updateLogisticOrderShippingAddress({ orderId, shippingAddressId, }) {
|
|
281
882
|
(0, parameters_validation_1.required)({ orderId, shippingAddressId });
|
|
@@ -286,7 +887,30 @@ async function updateLogisticOrderShippingAddress({ orderId, shippingAddressId,
|
|
|
286
887
|
});
|
|
287
888
|
}
|
|
288
889
|
/**
|
|
289
|
-
*
|
|
890
|
+
* 🚚 Gets a logistic order's shipping information.
|
|
891
|
+
*
|
|
892
|
+
* This function retrieves the shipping information of a specific logistic order, identified by the `orderId`. This parameter is mandatory and validated
|
|
893
|
+
* before the request is executed.
|
|
894
|
+
*
|
|
895
|
+
* 🛠 **Endpoint**: `GET /v1/shop/logistic-orders/${orderId}/shipping-information [ORDER-502]`
|
|
896
|
+
*
|
|
897
|
+
* | Parameter | Type | Required | Description |
|
|
898
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
899
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the shipping information. |
|
|
900
|
+
*
|
|
901
|
+
* 📤 **Returns**:
|
|
902
|
+
* A `Promise` resolving to a single `GetLogisticOrderShippingAddressResponse` object representing the array of the logistic order's shipping information.
|
|
903
|
+
*
|
|
904
|
+
* 🛠 **Example usage**:
|
|
905
|
+
* ```ts
|
|
906
|
+
* const shippingInformation = await getLogisticOrderShippingInformation({
|
|
907
|
+
* orderId: "logisticOrder1",
|
|
908
|
+
* });
|
|
909
|
+
* ```
|
|
910
|
+
*
|
|
911
|
+
* @param {GetLogisticOrderShippingAddressParameters} params - The parameters for the request.
|
|
912
|
+
* @throws {Error} If `orderId` is missing.
|
|
913
|
+
* @returns {Promise<GetLogisticOrderShippingAddressResponse>} A promise resolving to the response containing the array of shipping information.
|
|
290
914
|
*/
|
|
291
915
|
async function getLogisticOrderShippingInformation({ orderId, }) {
|
|
292
916
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -297,7 +921,33 @@ async function getLogisticOrderShippingInformation({ orderId, }) {
|
|
|
297
921
|
return data;
|
|
298
922
|
}
|
|
299
923
|
/**
|
|
300
|
-
*
|
|
924
|
+
* 🚚 Updates a logistic order's shipping information.
|
|
925
|
+
*
|
|
926
|
+
* This function updates the shipping information of a specific logistic order, identified by the `orderId`. This parameter, as well as the `shippingAddressId` and the `shippingType`, are mandatory and validated
|
|
927
|
+
* before the request is executed.
|
|
928
|
+
*
|
|
929
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/shipping-information [ORDER-214]`
|
|
930
|
+
*
|
|
931
|
+
* | Parameter | Type | Required | Description |
|
|
932
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
933
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the shipping information. |
|
|
934
|
+
* | `shippingAddressId`| `string` | ✅ | The ID of the shipping address you want to add to the logistic order. |
|
|
935
|
+
* | `shippingType` | `string` | ✅ | The type of shipping address to be added with the shipping address. |
|
|
936
|
+
*
|
|
937
|
+
* 📤 **Returns**:
|
|
938
|
+
* A `Promise` resolving when the shipping information of the logistic order is updated.
|
|
939
|
+
*
|
|
940
|
+
* 🛠 **Example usage**:
|
|
941
|
+
* ```ts
|
|
942
|
+
* await updateLogisticOrderShippingInformation({
|
|
943
|
+
* orderId: "logisticOrder1",
|
|
944
|
+
* shippingAddressId: "address1",
|
|
945
|
+
* });
|
|
946
|
+
* ```
|
|
947
|
+
*
|
|
948
|
+
* @param {UpdateLogisticOrderShippingInformationParameters} params - The parameters for the request.
|
|
949
|
+
* @throws {Error} If `orderId` or `shippingAddressId` is missing.
|
|
950
|
+
* @returns {Promise<void>} A promise resolving when the shipping information is updated.
|
|
301
951
|
*/
|
|
302
952
|
async function updateLogisticOrderShippingInformation({ orderId, shippingAddressId, shippingType, }) {
|
|
303
953
|
(0, parameters_validation_1.required)({ orderId, shippingAddressId, shippingType });
|
|
@@ -308,7 +958,32 @@ async function updateLogisticOrderShippingInformation({ orderId, shippingAddress
|
|
|
308
958
|
});
|
|
309
959
|
}
|
|
310
960
|
/**
|
|
311
|
-
*
|
|
961
|
+
* 🚚 Updates a logistic order's shipping type.
|
|
962
|
+
*
|
|
963
|
+
* This function updates the shipping type of a specific logistic order, both identified by the `orderId` and the `shippingType`. Both parameters are mandatory and validated
|
|
964
|
+
* before the request is executed.
|
|
965
|
+
*
|
|
966
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/logistic-orders/${orderId}/shipping-information [ORDER-211]`
|
|
967
|
+
*
|
|
968
|
+
* | Parameter | Type | Required | Description |
|
|
969
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
970
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to update the shipping type. |
|
|
971
|
+
* | `shippingType` | `string` | ✅ | The shipping type you want to set to the logistic order. |
|
|
972
|
+
*
|
|
973
|
+
* 📤 **Returns**:
|
|
974
|
+
* A `Promise` resolving when the shipping type of the logistic order is set.
|
|
975
|
+
*
|
|
976
|
+
* 🛠 **Example usage**:
|
|
977
|
+
* ```ts
|
|
978
|
+
* await updateLogisticOrderShippingType({
|
|
979
|
+
* orderId: "logisticOrder1",
|
|
980
|
+
* shippingType: "shipping_type",
|
|
981
|
+
* });
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @param {UpdateLogisticOrderShippingTypeParameters} params - The parameters for the request.
|
|
985
|
+
* @throws {Error} If `orderId` or `shippingType` is missing.
|
|
986
|
+
* @returns {Promise<void>} A promise resolving when the shipping type of the logistic order is set.
|
|
312
987
|
*/
|
|
313
988
|
async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
|
|
314
989
|
(0, parameters_validation_1.required)({ orderId, shippingType });
|
|
@@ -319,7 +994,37 @@ async function updateLogisticOrderShippingType({ orderId, shippingType, }) {
|
|
|
319
994
|
});
|
|
320
995
|
}
|
|
321
996
|
/**
|
|
322
|
-
*
|
|
997
|
+
* 🚚 Creates a thread on a specific logistic order.
|
|
998
|
+
*
|
|
999
|
+
* This function creates a thread on a specific logistic order, identified by
|
|
1000
|
+
* the `orderId`. This parameter, as well as the `lineId`, the `message` and the `reasonCode`, is mandatory and validated
|
|
1001
|
+
* before the request is executed.
|
|
1002
|
+
*
|
|
1003
|
+
* 🛠 **Endpoint**: `POST /v1/shop/logistic-orders/${orderId}/threads [ORDER-100]`
|
|
1004
|
+
*
|
|
1005
|
+
* | Parameter | Type | Required | Description |
|
|
1006
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1007
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order for which you want to create a thread. |
|
|
1008
|
+
* | `lineId` | `string` | ✅ | The ID of the logistic order line involved in the thread. |
|
|
1009
|
+
* | `message` | `string` | ✅ | A message to add comments on the thread. |
|
|
1010
|
+
* | `reasonCode` | `string` | ✅ | The code indentifying the type of thread. |
|
|
1011
|
+
*
|
|
1012
|
+
* 📤 **Returns**:
|
|
1013
|
+
* A `Promise` resolving when the thread is created.
|
|
1014
|
+
*
|
|
1015
|
+
* 🛠 **Example usage**:
|
|
1016
|
+
* ```ts
|
|
1017
|
+
* await createLogisticOrderThread({
|
|
1018
|
+
* orderId: "logisticOrder1",
|
|
1019
|
+
* lineId: "logisticOrderLine1",
|
|
1020
|
+
* message: "This is a message",
|
|
1021
|
+
* reasonCode: "REFUND"
|
|
1022
|
+
* });
|
|
1023
|
+
* ```
|
|
1024
|
+
*
|
|
1025
|
+
* @param {CreateLogisticOrderThreadParameters} params - The parameters for the request.
|
|
1026
|
+
* @throws {Error} If `orderId`, `lineId`, `message` or `reasonCode` is missing.
|
|
1027
|
+
* @returns {Promise<void>} A promise resolving when the thread is created.
|
|
323
1028
|
*/
|
|
324
1029
|
async function createLogisticOrderThread({ orderId, lineId, message, reasonCode, }) {
|
|
325
1030
|
(0, parameters_validation_1.required)({ orderId, lineId, message, reasonCode });
|
|
@@ -330,7 +1035,31 @@ async function createLogisticOrderThread({ orderId, lineId, message, reasonCode,
|
|
|
330
1035
|
});
|
|
331
1036
|
}
|
|
332
1037
|
/**
|
|
333
|
-
*
|
|
1038
|
+
* 🚚 Gets a specific logistic order's review.
|
|
1039
|
+
*
|
|
1040
|
+
* This function retrieves a specific logistic order line's review, identified by
|
|
1041
|
+
* the `orderId`. This parameter is mandatory and validated
|
|
1042
|
+
* before the request is executed.
|
|
1043
|
+
*
|
|
1044
|
+
* 🛠 **Endpoint**: `GET /v1/shop/rating-orders/${orderId} [ORDER-504]`
|
|
1045
|
+
*
|
|
1046
|
+
* | Parameter | Type | Required | Description |
|
|
1047
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1048
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1049
|
+
*
|
|
1050
|
+
* 📤 **Returns**:
|
|
1051
|
+
* A `Promise` resolving to a single `GetLogisticOrderReviewResponse` object representing the review of the logistic order.
|
|
1052
|
+
*
|
|
1053
|
+
* 🛠 **Example usage**:
|
|
1054
|
+
* ```ts
|
|
1055
|
+
* const review = await getLogisticOrderReview({
|
|
1056
|
+
* orderId: "logisticOrder1",
|
|
1057
|
+
* });
|
|
1058
|
+
* ```
|
|
1059
|
+
*
|
|
1060
|
+
* @param {GetLogisticOrderReviewParameters} params - The parameters for the request.
|
|
1061
|
+
* @throws {Error} If `orderId` is missing.
|
|
1062
|
+
* @returns {Promise<GetLogisticOrderReviewResponse>} A promise resolving to a response containing the review of the logistic order.
|
|
334
1063
|
*/
|
|
335
1064
|
async function getLogisticOrderReview({ orderId, }) {
|
|
336
1065
|
(0, parameters_validation_1.required)({ orderId });
|
|
@@ -341,9 +1070,37 @@ async function getLogisticOrderReview({ orderId, }) {
|
|
|
341
1070
|
return data;
|
|
342
1071
|
}
|
|
343
1072
|
/**
|
|
344
|
-
*
|
|
1073
|
+
* 🚚 Adds a rewiew on a specific logistic order.
|
|
1074
|
+
*
|
|
1075
|
+
* This function adds a review on a specific logistic order, identified by
|
|
1076
|
+
* the `orderId`. This parameter, as well as the `comment` and `grade`, is mandatory and validated
|
|
1077
|
+
* before the request is executed.
|
|
1078
|
+
*
|
|
1079
|
+
* 🛠 **Endpoint**: `PUT /v1/shop/rating-orders/${orderId} [ORDER-219]`
|
|
1080
|
+
*
|
|
1081
|
+
* | Parameter | Type | Required | Description |
|
|
1082
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1083
|
+
* | `orderId` | `string` | ✅ | The ID of the logistic order of which you want to retrieve the review. |
|
|
1084
|
+
* | `comment` | `string` | ✅ | A comment on how the logistic order as realized. |
|
|
1085
|
+
* | `grade` | `number` | ✅ | A grade to rate the logistic order. |
|
|
1086
|
+
*
|
|
1087
|
+
* 📤 **Returns**:
|
|
1088
|
+
* A `Promise` resolving to a single `AddLogisticOrderReviewResponse` object representing the review of the logistic order.
|
|
1089
|
+
*
|
|
1090
|
+
* 🛠 **Example usage**:
|
|
1091
|
+
* ```ts
|
|
1092
|
+
* const review = await addLogisticOrderReview({
|
|
1093
|
+
* orderId: "logisticOrder1",
|
|
1094
|
+
* comment: "This was a bad order",
|
|
1095
|
+
* grade: 0,
|
|
1096
|
+
* });
|
|
1097
|
+
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* @param {AddLogisticOrderReviewParameters} params - The parameters for the request.
|
|
1100
|
+
* @throws {Error} If `orderId`, `comment` or `grade` is missing.
|
|
1101
|
+
* @returns {Promise<AddLogisticOrderReviewResponse>} A promise resolving to a response containing the review of the logistic order.
|
|
345
1102
|
*/
|
|
346
|
-
async function
|
|
1103
|
+
async function addLogisticOrderReview({ orderId, comment, grade, }) {
|
|
347
1104
|
(0, parameters_validation_1.required)({ orderId, comment, grade });
|
|
348
1105
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
349
1106
|
method: "PUT",
|
|
@@ -353,7 +1110,21 @@ async function addLogisitcOrderReview({ orderId, comment, grade, }) {
|
|
|
353
1110
|
return data;
|
|
354
1111
|
}
|
|
355
1112
|
/**
|
|
356
|
-
*
|
|
1113
|
+
* 🚚 Gets thread reason types.
|
|
1114
|
+
*
|
|
1115
|
+
* This function retrieves all the thread reason types. No parameters for this request.
|
|
1116
|
+
*
|
|
1117
|
+
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types [ORDER-550]`
|
|
1118
|
+
*
|
|
1119
|
+
* 📤 **Returns**:
|
|
1120
|
+
* A `Promise` resolving to a single `GetThreadReasonTypesResponse` object representing the array of reason types.
|
|
1121
|
+
*
|
|
1122
|
+
* 🛠 **Example usage**:
|
|
1123
|
+
* ```ts
|
|
1124
|
+
* const reasonTypes = await getThreadReasonTypes();
|
|
1125
|
+
* ```
|
|
1126
|
+
*
|
|
1127
|
+
* @returns {Promise<GetThreadReasonTypesResponse>} A promise resolving to a response containing the array of reason types.
|
|
357
1128
|
*/
|
|
358
1129
|
async function getThreadReasonTypes() {
|
|
359
1130
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|
|
@@ -363,7 +1134,31 @@ async function getThreadReasonTypes() {
|
|
|
363
1134
|
return data;
|
|
364
1135
|
}
|
|
365
1136
|
/**
|
|
366
|
-
*
|
|
1137
|
+
* 🚚 Gets thread subreasons.
|
|
1138
|
+
*
|
|
1139
|
+
* This function retrieves all the subreasons under a reason type, identified by
|
|
1140
|
+
* the `reasonType`. This parameter is mandatory and validated
|
|
1141
|
+
* before the request is executed.
|
|
1142
|
+
*
|
|
1143
|
+
* 🛠 **Endpoint**: `GET /v1/shop/threads/reason-types/${reasonType}/sub-reasons [ORDER-551]`
|
|
1144
|
+
*
|
|
1145
|
+
* | Parameter | Type | Required | Description |
|
|
1146
|
+
* |-------------------|---------------------------------|------------|------------------------------------------|
|
|
1147
|
+
* | `reasonType` | `string` | ✅ | The type of thread reasons. |
|
|
1148
|
+
*
|
|
1149
|
+
* 📤 **Returns**:
|
|
1150
|
+
* A `Promise` resolving to a single `GetThreadSubReasonsResponse` object representing the array of subreasons.
|
|
1151
|
+
*
|
|
1152
|
+
* 🛠 **Example usage**:
|
|
1153
|
+
* ```ts
|
|
1154
|
+
* const subreasons = await getThreadSubReasons({
|
|
1155
|
+
* reasonType: "REFUND",
|
|
1156
|
+
* });
|
|
1157
|
+
* ```
|
|
1158
|
+
*
|
|
1159
|
+
* @param {GetThreadSubReasonsParameters} params - The parameters for the request.
|
|
1160
|
+
* @throws {Error} If `reasonType` is missing.
|
|
1161
|
+
* @returns {Promise<GetThreadSubReasonsResponse>} A promise resolving to a response containing the array of subreasons.
|
|
367
1162
|
*/
|
|
368
1163
|
async function getThreadSubReasons({ reasonType, }) {
|
|
369
1164
|
const { data } = await (0, fetch_instance_1.enhancedFetch)({
|