@djust-b2b/djust-front-sdk 1.15.0 → 1.16.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 -7
- package/lib/services/auth/definitions.requests.d.ts +21 -0
- package/lib/services/auth/definitions.requests.js +2 -0
- package/lib/services/auth/index.d.ts +146 -120
- package/lib/services/auth/index.js +144 -119
- package/lib/services/cart/index.d.ts +185 -254
- package/lib/services/cart/index.js +198 -257
- package/lib/services/custom-field/index.d.ts +55 -100
- package/lib/services/custom-field/index.js +55 -105
- package/lib/services/customer-user/index.d.ts +107 -125
- package/lib/services/customer-user/index.js +107 -125
- package/lib/services/navigation-category/index.d.ts +68 -119
- package/lib/services/navigation-category/index.js +68 -119
- package/lib/services/product/index.d.ts +296 -1687
- package/lib/services/product/index.js +312 -1706
- package/lib/services/product-variant/index.d.ts +53 -160
- package/lib/services/product-variant/index.js +53 -160
- package/package.json +1 -1
|
@@ -1,388 +1,319 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* @document documents/cart.md
|
|
5
|
-
*/
|
|
6
1
|
import { CreateCartParameters, DeleteCartsResponse, DeleteCartParameters, GetCartParameters, GetCartResponse, GetCartsParameters, GetCartsResponse, UpdateCartParameters, InitializeOrdersFromCartParameters, GetCartLinesParameters, DeleteCartLinesResponse, DeleteCartLinesParameters, GetCartLinesResponse, UpdateCartLinesResponse, UpdateCartLinesParameters, UpdateCartLinesByVariantParameters, UpdateCartLinesByVariantResponse } from "./definitions";
|
|
7
2
|
/**
|
|
8
3
|
* CART ENDPOINT
|
|
9
4
|
*/
|
|
10
5
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Deletes all carts associated with the user.
|
|
6
|
+
* 🛒 Deletes all carts associated with the user.
|
|
13
7
|
*
|
|
14
8
|
* This function sends a request to delete all carts of the logged-in user.
|
|
15
9
|
*
|
|
16
|
-
*
|
|
10
|
+
* 🛠 **Endpoint**: `DELETE /v2/shop/carts [cART135]`
|
|
11
|
+
*
|
|
12
|
+
* 📤 **Returns**:
|
|
13
|
+
* A `Promise` resolving to an array of `DeleteCartsResponse` objects, containing the details of the deleted carts.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* ```typescript
|
|
15
|
+
* 🛠 **Example usage**:
|
|
16
|
+
* ```ts
|
|
21
17
|
* const deletedCarts = await deleteCarts();
|
|
22
18
|
* ```
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* [
|
|
26
|
-
* {
|
|
27
|
-
* "id": "cart1",
|
|
28
|
-
* "detail": "Deleted successfully"
|
|
29
|
-
* },
|
|
30
|
-
* {
|
|
31
|
-
* "id": "cart2",
|
|
32
|
-
* "detail": "Deleted successfully"
|
|
33
|
-
* }
|
|
34
|
-
* ]
|
|
35
|
-
* ```
|
|
19
|
+
*
|
|
20
|
+
* @returns {Promise<DeleteCartsResponse>} - An array of objects containing the details of the deleted carts.
|
|
36
21
|
*/
|
|
37
22
|
export declare function deleteCarts(): Promise<DeleteCartsResponse>;
|
|
38
23
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Retrieves all active carts of the logged-in user.
|
|
24
|
+
* 🛒 Retrieves all active carts of the logged-in user.
|
|
41
25
|
*
|
|
42
26
|
* This function allows fetching the list of active carts based on the provided parameters.
|
|
43
27
|
*
|
|
44
|
-
*
|
|
45
|
-
* #### currency - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
28
|
+
* 🛠 **Endpoint**: `GET /v2/shop/carts [cART550]`
|
|
46
29
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
30
|
+
* | Parameter | Type | Required | Description |
|
|
31
|
+
* |------------------|----------------------|------------|------------------------------------------------------------|
|
|
32
|
+
* | `currency` | `string` | ✅ | The currency in which to display the carts. |
|
|
33
|
+
* | `pageable` | `object` | ✅ | The pagination parameters. |
|
|
34
|
+
* | `status` | `string[]` | ❌ | The status of the carts to retrieve. |
|
|
35
|
+
* | `type` | `string[]` | ❌ | The type of carts to retrieve. |
|
|
49
36
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
37
|
+
* 📤 **Returns**:
|
|
38
|
+
* A `Promise` resolving to a `GetCartsResponse` object, containing the list of carts and pagination information.
|
|
52
39
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
40
|
+
* 🛠 **Example usage**:
|
|
41
|
+
* ```ts
|
|
42
|
+
* const carts = await getCarts({ currency: 'USD', pageable: { page: 1, size: 10 } });
|
|
43
|
+
* ```
|
|
55
44
|
*
|
|
56
|
-
* The
|
|
45
|
+
* @param {GetCartsParameters} params - The parameters for retrieving the carts, including:
|
|
46
|
+
* - `currency` - The currency in which to display the carts.
|
|
47
|
+
* - `pageable` - The pagination parameters.
|
|
48
|
+
* - `status` - The status of the carts to retrieve.
|
|
49
|
+
* - `type` - The type of carts to retrieve.
|
|
57
50
|
*
|
|
58
51
|
* @returns {Promise<GetCartsResponse>} - An object containing the list of carts and pagination information.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* #### input
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const carts = await getCarts({ currency: 'USD', pageable: { page: 1, size: 10 } });
|
|
64
|
-
* ```
|
|
65
|
-
* #### output
|
|
66
|
-
* ```json
|
|
67
|
-
* {
|
|
68
|
-
* carts: [
|
|
69
|
-
* {
|
|
70
|
-
* id: 'cart1',
|
|
71
|
-
* name: 'My Cart'
|
|
72
|
-
* },
|
|
73
|
-
* {
|
|
74
|
-
* id: 'cart2',
|
|
75
|
-
* name: 'Another Cart'
|
|
76
|
-
* }
|
|
77
|
-
* ],
|
|
78
|
-
* page: 1,
|
|
79
|
-
* size: 10,
|
|
80
|
-
* totalElement: 2
|
|
81
|
-
* }
|
|
82
|
-
* ```
|
|
83
52
|
*/
|
|
84
53
|
export declare function getCarts(params: GetCartsParameters): Promise<GetCartsResponse>;
|
|
85
54
|
/**
|
|
86
|
-
*
|
|
87
|
-
* Creates a new cart.
|
|
55
|
+
* 🛒 Creates a new cart.
|
|
88
56
|
*
|
|
89
57
|
* This function sends a request to create a new cart with the specified name.
|
|
90
58
|
*
|
|
91
|
-
*
|
|
92
|
-
* #### name - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
59
|
+
* 🛠 **Endpoint**: `POST /v2/shop/carts [cART100]`
|
|
93
60
|
*
|
|
94
|
-
*
|
|
61
|
+
* | Parameter | Type | Required | Description |
|
|
62
|
+
* |------------|----------|------------|---------------------------------|
|
|
63
|
+
* | `name` | `string` | ✅ | The name of the cart to create. |
|
|
95
64
|
*
|
|
96
|
-
*
|
|
65
|
+
* 📤 **Returns**:
|
|
66
|
+
* A `Promise` resolving to a `GetCartResponse` object, confirming the creation of the cart.
|
|
97
67
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* ```typescript
|
|
68
|
+
* 🛠 **Example usage**:
|
|
69
|
+
* ```ts
|
|
101
70
|
* await createCart({ name: 'New Cart' });
|
|
102
71
|
* ```
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* }
|
|
108
|
-
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param {CreateCartParameters} params - The parameters for creating the cart:
|
|
74
|
+
* - `name` - The name of the cart to create.
|
|
75
|
+
*
|
|
76
|
+
* @returns {Promise<GetCartResponse>} - A promise that resolves when the cart is created.
|
|
109
77
|
*/
|
|
110
78
|
export declare function createCart(params: CreateCartParameters): Promise<GetCartResponse>;
|
|
111
79
|
/**
|
|
112
|
-
*
|
|
113
|
-
* Deletes a specific cart.
|
|
80
|
+
* 🗑️ Deletes a specific cart.
|
|
114
81
|
*
|
|
115
82
|
* This function sends a request to delete the cart identified by its ID.
|
|
116
83
|
*
|
|
117
|
-
*
|
|
118
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
84
|
+
* 🛠 **Endpoint**: `DELETE /v2/shop/carts/{cartId} [cART300]`
|
|
119
85
|
*
|
|
120
|
-
*
|
|
86
|
+
* | Parameter | Type | Required | Description |
|
|
87
|
+
* |------------|----------|------------|----------------------------------|
|
|
88
|
+
* | `cartId` | `string` | ✅ | The ID of the cart to delete. |
|
|
121
89
|
*
|
|
122
|
-
*
|
|
90
|
+
* 📤 **Returns**:
|
|
91
|
+
* A `Promise<void>` that resolves when the cart is successfully deleted.
|
|
123
92
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* ```typescript
|
|
93
|
+
* 🛠 **Example usage**:
|
|
94
|
+
* ```ts
|
|
127
95
|
* await deleteCart({ cartId: 'cart1' });
|
|
128
96
|
* ```
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
97
|
+
*
|
|
98
|
+
* @param {DeleteCartParameters} params - The parameters to identify the cart to delete:
|
|
99
|
+
* - `cartId` - The ID of the cart to delete.
|
|
100
|
+
*
|
|
101
|
+
* @returns {Promise<void>} - A promise that resolves when the cart is deleted.
|
|
135
102
|
*/
|
|
136
103
|
export declare function deleteCart(params: DeleteCartParameters): Promise<void>;
|
|
137
104
|
/**
|
|
138
|
-
*
|
|
139
|
-
* Retrieves the details of a specific cart.
|
|
105
|
+
* 🛒 Retrieves the details of a specific cart.
|
|
140
106
|
*
|
|
141
107
|
* This function allows fetching the information of a cart based on its ID.
|
|
142
108
|
*
|
|
143
|
-
*
|
|
144
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
109
|
+
* 🛠 **Endpoint**: `GET /v2/shop/carts/{cartId} [cART500]`
|
|
145
110
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
111
|
+
* | Parameter | Type | Required | Description |
|
|
112
|
+
* |-----------------|-----------|------------|-------------------------------------------------|
|
|
113
|
+
* | `cartId` | `string` | ✅ | The ID of the cart to retrieve. |
|
|
114
|
+
* | `currency` | `string` | ✅ | The currency in which to display the cart. |
|
|
115
|
+
* | `nbFirstLines` | `number[]`| ❌ | The number of lines to retrieve. |
|
|
148
116
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
117
|
+
* 📤 **Returns**:
|
|
118
|
+
* A `Promise<GetCartResponse>` containing the details of the requested cart.
|
|
151
119
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @returns {Promise<GetCartResponse>} - An object containing the details of the cart.
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* #### input
|
|
158
|
-
* ```typescript
|
|
120
|
+
* 🛠 **Example usage**:
|
|
121
|
+
* ```ts
|
|
159
122
|
* const cartDetails = await getCart({ cartId: 'cart1', currency: 'USD' });
|
|
160
123
|
* ```
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* {
|
|
169
|
-
* "productName": "Product A",
|
|
170
|
-
* "quantity": 2
|
|
171
|
-
* }
|
|
172
|
-
* ]
|
|
173
|
-
* }
|
|
174
|
-
* ```
|
|
124
|
+
*
|
|
125
|
+
* @param {GetCartParameters} params - The parameters for identifying the cart:
|
|
126
|
+
* - `cartId` - The ID of the cart to retrieve.
|
|
127
|
+
* - `currency` - The currency in which to display the cart.
|
|
128
|
+
* - `nbFirstLines` - (Optional) The number of lines to retrieve.
|
|
129
|
+
*
|
|
130
|
+
* @returns {Promise<GetCartResponse>} - A promise resolving to the cart details.
|
|
175
131
|
*/
|
|
176
132
|
export declare function getCart(params: GetCartParameters): Promise<GetCartResponse>;
|
|
177
133
|
/**
|
|
178
|
-
*
|
|
179
|
-
* Updates an existing cart.
|
|
134
|
+
* ✏️ Updates an existing cart.
|
|
180
135
|
*
|
|
181
136
|
* This function sends a request to update the name of a cart identified by its ID.
|
|
182
137
|
*
|
|
183
|
-
*
|
|
184
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
138
|
+
* 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId} [cART200]`
|
|
185
139
|
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
140
|
+
* | Parameter | Type | Required | Description |
|
|
141
|
+
* |------------|----------|------------|---------------------------------------|
|
|
142
|
+
* | `cartId` | `string` | ✅ | The ID of the cart to update. |
|
|
143
|
+
* | `name` | `string` | ✅ | The new name of the cart. |
|
|
188
144
|
*
|
|
189
|
-
*
|
|
145
|
+
* 📤 **Returns**:
|
|
146
|
+
* A `Promise<void>` that resolves when the cart is successfully updated.
|
|
190
147
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* #### input
|
|
195
|
-
* ```typescript
|
|
148
|
+
* 🛠 **Example usage**:
|
|
149
|
+
* ```ts
|
|
196
150
|
* await updateCart({ cartId: 'cart1', name: 'Updated Cart Name' });
|
|
197
151
|
* ```
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
152
|
+
*
|
|
153
|
+
* @param {UpdateCartParameters} params - The parameters for updating the cart:
|
|
154
|
+
* - `cartId` - The ID of the cart to update.
|
|
155
|
+
* - `name` - The new name of the cart.
|
|
156
|
+
*
|
|
157
|
+
* @returns {Promise<void>} - A promise that resolves when the update is successful.
|
|
204
158
|
*/
|
|
205
159
|
export declare function updateCart(params: UpdateCartParameters): Promise<void>;
|
|
206
160
|
/**
|
|
207
|
-
*
|
|
208
|
-
* Initializes orders from a cart.
|
|
161
|
+
* 🛒 Initializes orders from a cart.
|
|
209
162
|
*
|
|
210
163
|
* This function sends a request to initialize an order from a specified cart.
|
|
211
164
|
*
|
|
212
|
-
*
|
|
213
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
165
|
+
* 🛠 **Endpoint**: `POST /v2/shop/carts/{cartId}/initialize-orders [cART101]`
|
|
214
166
|
*
|
|
215
|
-
*
|
|
167
|
+
* | Parameter | Type | Required | Description |
|
|
168
|
+
* |------------|----------|------------|------------------------------------------|
|
|
169
|
+
* | `cartId` | `string` | ✅ | The ID of the cart to initialize orders. |
|
|
216
170
|
*
|
|
217
|
-
*
|
|
171
|
+
* 📤 **Returns**:
|
|
172
|
+
* A `Promise<string>` containing the business ID of the created order.
|
|
218
173
|
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* ```typescript
|
|
174
|
+
* 🛠 **Example usage**:
|
|
175
|
+
* ```ts
|
|
222
176
|
* const orderId = await initializeOrdersFromCart({ cartId: 'cart1' });
|
|
223
177
|
* ```
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* }
|
|
229
|
-
* ```
|
|
178
|
+
*
|
|
179
|
+
* @param {InitializeOrdersFromCartParameters} params - Parameters for initializing orders:
|
|
180
|
+
* - `cartId` - The ID of the cart to initialize orders from.
|
|
181
|
+
*
|
|
182
|
+
* @returns {Promise<string>} - The business ID of the created order.
|
|
230
183
|
*/
|
|
231
184
|
export declare function initializeOrdersFromCart(params: InitializeOrdersFromCartParameters): Promise<string>;
|
|
232
185
|
/**
|
|
233
|
-
*
|
|
234
|
-
*/
|
|
235
|
-
/**
|
|
236
|
-
* APICODE(cART350)
|
|
237
|
-
* Deletes lines from a cart.
|
|
186
|
+
* 🗑️ Deletes lines from a cart.
|
|
238
187
|
*
|
|
239
188
|
* This function sends a request to delete specific lines from a cart.
|
|
240
189
|
*
|
|
241
|
-
*
|
|
242
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
243
|
-
*
|
|
244
|
-
* The ID of the cart.
|
|
245
|
-
* #### `lineIdsToDelete` - `string[]` | <strong style={{ color: 'red' }}>required</strong>
|
|
190
|
+
* 🛠 **Endpoint**: `DELETE /v2/shop/carts/{cartId}/lines [cART350]`
|
|
246
191
|
*
|
|
247
|
-
*
|
|
192
|
+
* | Parameter | Type | Required | Description |
|
|
193
|
+
* |--------------------|------------|------------|--------------------------------------|
|
|
194
|
+
* | `cartId` | `string` | ✅ | The ID of the cart. |
|
|
195
|
+
* | `lineIdsToDelete` | `string[]` | ✅ | The IDs of the lines to delete. |
|
|
248
196
|
*
|
|
249
|
-
*
|
|
197
|
+
* 📤 **Returns**:
|
|
198
|
+
* A `Promise<DeleteCartLinesResponse>` containing details about the deleted lines.
|
|
250
199
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* ```json
|
|
258
|
-
* {
|
|
259
|
-
* "singleWarningReportDto": []
|
|
260
|
-
* }
|
|
200
|
+
* 🛠 **Example usage**:
|
|
201
|
+
* ```ts
|
|
202
|
+
* const response = await deleteCartLines({
|
|
203
|
+
* cartId: 'cart1',
|
|
204
|
+
* lineIdsToDelete: ['line1', 'line2']
|
|
205
|
+
* });
|
|
261
206
|
* ```
|
|
207
|
+
*
|
|
208
|
+
* @param {DeleteCartLinesParameters} params - Parameters for deleting cart lines:
|
|
209
|
+
* - `cartId` - The ID of the cart.
|
|
210
|
+
* - `lineIdsToDelete` - The IDs of the lines to delete.
|
|
211
|
+
*
|
|
212
|
+
* @returns {Promise<DeleteCartLinesResponse>} - Response with details about the deleted lines.
|
|
262
213
|
*/
|
|
263
214
|
export declare function deleteCartLines(params: DeleteCartLinesParameters): Promise<DeleteCartLinesResponse>;
|
|
264
215
|
/**
|
|
265
|
-
*
|
|
266
|
-
* Fetches the lines of a shopping cart based on the provided parameters.
|
|
216
|
+
* 📋 Fetches the lines of a shopping cart.
|
|
267
217
|
*
|
|
268
218
|
* This function retrieves detailed information about the items (lines) in a shopping cart.
|
|
269
219
|
* It supports filtering by supplier, product variant, or offer price and handles pagination.
|
|
270
220
|
*
|
|
271
|
-
*
|
|
272
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
273
|
-
*
|
|
274
|
-
* The ID of the cart.
|
|
275
|
-
* #### currency - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
276
|
-
*
|
|
277
|
-
* The currency in which prices should be returned (e.g., "USD").
|
|
278
|
-
* #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
|
|
279
|
-
*
|
|
280
|
-
* Pagination details, such as page number and size.
|
|
281
|
-
* #### supplierId - `string[]`
|
|
221
|
+
* 🛠 **Endpoint**: `GET /v2/shop/carts/{cartId}/lines [cART551]`
|
|
282
222
|
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
223
|
+
* | Parameter | Type | Required | Description |
|
|
224
|
+
* |---------------------|------------|------------|------------------------------------------|
|
|
225
|
+
* | `cartId` | `string` | ✅ | The ID of the cart. |
|
|
226
|
+
* | `currency` | `string` | ✅ | The currency in which prices are shown. |
|
|
227
|
+
* | `pageable` | `object` | ✅ | Pagination details (page number, size). |
|
|
228
|
+
* | `supplierId` | `string[]` | ❌ | Filter by specific supplier IDs. |
|
|
229
|
+
* | `productVariantId` | `string[]` | ❌ | Filter by specific product variants. |
|
|
230
|
+
* | `offerPriceId` | `string[]` | ❌ | Filter by specific offer price IDs. |
|
|
285
231
|
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
232
|
+
* 📤 **Returns**:
|
|
233
|
+
* A `Promise<GetCartLinesResponse>` containing the lines of the cart.
|
|
288
234
|
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* @returns {Promise<GetCartLinesResponse>} - A promise resolving to the response containing cart lines information.
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* #### input
|
|
295
|
-
* ```typescript
|
|
235
|
+
* 🛠 **Example usage**:
|
|
236
|
+
* ```ts
|
|
296
237
|
* const cartLines = await getCartLines({
|
|
297
238
|
* cartId: 'cart1',
|
|
298
239
|
* currency: 'USD',
|
|
299
240
|
* pageable: { page: 1, size: 10 },
|
|
300
|
-
* supplierId: ['supplier1']
|
|
301
|
-
* productVariantId: ['variant1'],
|
|
302
|
-
* offerPriceId: ['offer1']
|
|
241
|
+
* supplierId: ['supplier1']
|
|
303
242
|
* });
|
|
304
243
|
* ```
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* "totalItems": 1,
|
|
316
|
-
* "totalPages": 1
|
|
317
|
-
* }
|
|
318
|
-
* ```
|
|
244
|
+
*
|
|
245
|
+
* @param {GetCartLinesParameters} params - Parameters for fetching cart lines:
|
|
246
|
+
* - `cartId` - The ID of the cart.
|
|
247
|
+
* - `currency` - The currency for prices.
|
|
248
|
+
* - `pageable` - Pagination details.
|
|
249
|
+
* - `supplierId` (optional) - Supplier IDs for filtering.
|
|
250
|
+
* - `productVariantId` (optional) - Product variant IDs for filtering.
|
|
251
|
+
* - `offerPriceId` (optional) - Offer price IDs for filtering.
|
|
252
|
+
*
|
|
253
|
+
* @returns {Promise<GetCartLinesResponse>} - Response containing cart lines information.
|
|
319
254
|
*/
|
|
320
255
|
export declare function getCartLines(params: GetCartLinesParameters): Promise<GetCartLinesResponse>;
|
|
321
256
|
/**
|
|
322
|
-
*
|
|
323
|
-
* Updates the lines of a cart.
|
|
324
|
-
*
|
|
325
|
-
* This function sends a request to update the lines of a specified cart.
|
|
257
|
+
* ✏️ Updates the lines of a cart.
|
|
326
258
|
*
|
|
327
|
-
*
|
|
328
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
259
|
+
* This function sends a request to update specific lines of a shopping cart.
|
|
329
260
|
*
|
|
330
|
-
*
|
|
331
|
-
* #### `linesToUpdate` - `object[]` | <strong style={{ color: 'red' }}>required</strong>
|
|
261
|
+
* 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId}/lines [cART150]`
|
|
332
262
|
*
|
|
333
|
-
*
|
|
263
|
+
* | Parameter | Type | Required | Description |
|
|
264
|
+
* |-------------------|------------|------------|----------------------------------------|
|
|
265
|
+
* | `cartId` | `string` | ✅ | The ID of the cart. |
|
|
266
|
+
* | `linesToUpdate` | `object[]` | ✅ | Details of the lines to update. |
|
|
334
267
|
*
|
|
335
|
-
*
|
|
268
|
+
* 📤 **Returns**:
|
|
269
|
+
* A `Promise<UpdateCartLinesResponse>` containing the updated lines' information.
|
|
336
270
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* ```typescript
|
|
271
|
+
* 🛠 **Example usage**:
|
|
272
|
+
* ```ts
|
|
340
273
|
* const response = await updateCartLines({
|
|
341
274
|
* cartId: 'cart1',
|
|
342
275
|
* linesToUpdate: [
|
|
343
276
|
* { offerPriceId: 'line1', quantity: 3, updateAction: 'update' }
|
|
344
|
-
* ]
|
|
277
|
+
* ]
|
|
345
278
|
* });
|
|
346
279
|
* ```
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
280
|
+
*
|
|
281
|
+
* @param {UpdateCartLinesParameters} params - Parameters for updating cart lines:
|
|
282
|
+
* - `cartId` - The ID of the cart.
|
|
283
|
+
* - `linesToUpdate` - Details of the lines to update.
|
|
284
|
+
*
|
|
285
|
+
* @returns {Promise<UpdateCartLinesResponse>} - Response with details about the updated lines.
|
|
353
286
|
*/
|
|
354
287
|
export declare function updateCartLines(params: UpdateCartLinesParameters): Promise<UpdateCartLinesResponse>;
|
|
355
288
|
/**
|
|
356
|
-
*
|
|
357
|
-
* Updates the lines of a cart by variant.
|
|
289
|
+
* ✏️ Updates the lines of a cart by variant.
|
|
358
290
|
*
|
|
359
|
-
* This function sends a request to update
|
|
291
|
+
* This function sends a request to update cart lines based on product variants.
|
|
360
292
|
*
|
|
361
|
-
*
|
|
362
|
-
* #### cartId - `string` | <strong style={{ color: 'red' }}>required</strong>
|
|
293
|
+
* 🛠 **Endpoint**: `PUT /v2/shop/carts/{cartId}/lines-by-variant [cART151]`
|
|
363
294
|
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
295
|
+
* | Parameter | Type | Required | Description |
|
|
296
|
+
* |-------------------|------------|------------|----------------------------------------|
|
|
297
|
+
* | `cartId` | `string` | ✅ | The ID of the cart. |
|
|
298
|
+
* | `linesToUpdate` | `object[]` | ✅ | Details of the lines to update. |
|
|
366
299
|
*
|
|
367
|
-
*
|
|
300
|
+
* 📤 **Returns**:
|
|
301
|
+
* A `Promise<UpdateCartLinesByVariantResponse>` containing the updated lines' information.
|
|
368
302
|
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* @example
|
|
372
|
-
* #### input
|
|
373
|
-
* ```typescript
|
|
303
|
+
* 🛠 **Example usage**:
|
|
304
|
+
* ```ts
|
|
374
305
|
* const response = await updateCartLinesByVariant({
|
|
375
306
|
* cartId: 'cart1',
|
|
376
307
|
* linesToUpdate: [
|
|
377
308
|
* { offerPriceId: 'variant1', quantity: 2, updateAction: 'update' }
|
|
378
|
-
* ]
|
|
309
|
+
* ]
|
|
379
310
|
* });
|
|
380
311
|
* ```
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
312
|
+
*
|
|
313
|
+
* @param {UpdateCartLinesByVariantParameters} params - Parameters for updating cart lines by variant:
|
|
314
|
+
* - `cartId` - The ID of the cart.
|
|
315
|
+
* - `linesToUpdate` - Details of the lines to update.
|
|
316
|
+
*
|
|
317
|
+
* @returns {Promise<UpdateCartLinesByVariantResponse>} - Response with details about the updated lines by variant.
|
|
387
318
|
*/
|
|
388
319
|
export declare function updateCartLinesByVariant(params: UpdateCartLinesByVariantParameters): Promise<UpdateCartLinesByVariantResponse>;
|