@djust-b2b/djust-front-sdk 1.15.1 → 1.17.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.
@@ -21,80 +21,20 @@ exports.updateCustomerAccountOrganisationUser = updateCustomerAccountOrganisatio
21
21
  const parameters_validation_1 = require("../../helpers/parameters-validation");
22
22
  const fetch_instance_1 = require("../../settings/fetch-instance");
23
23
  /**
24
- * ## Get customer accounts details
25
- * ### APICODE(ACCOUNT-501)
24
+ * 📄 Get customer account details.
26
25
  *
27
- * @returns {Promise<GetCustomerAccountsResponse>} - The response with the customer account details
26
+ * This function retrieves the detailed information of a customer account, including addresses, main contacts, custom fields, and more.
28
27
  *
29
- * @example
30
- * ### input
31
- * ```typescript
28
+ * 🛠 **Endpoint**: `GET /v1/shop/customer-accounts`
29
+ *
30
+ * 📤 **Returns**:
31
+ * A `Promise<GetCustomerAccountResponse>` containing the customer account details.
32
+ *
33
+ * 🛠 **Example usage**:
34
+ * ```ts
32
35
  * const response = await getCustomerAccount();
36
+ * console.log(response);
33
37
  * ```
34
- * ### output
35
- * ```json
36
- * {
37
- * "accountManager": "string",
38
- * "addresses": [
39
- * {
40
- * "additionalAddress": "string",
41
- * "address": "string",
42
- * "billing": true,
43
- * "city": "string",
44
- * "company": "string",
45
- * "country": "string",
46
- * "externalId": "string",
47
- * "fullName": "string",
48
- * "id": "string",
49
- * "label": "string",
50
- * "phone": "string",
51
- * "shipping": true,
52
- * "state": "string",
53
- * "zipcode": "string"
54
- * }
55
- * ],
56
- * "businessRegistrationNumber": "string",
57
- * "companyRegistrationName": "string",
58
- * "customFieldValues": [
59
- * {
60
- * "customField": {
61
- * "externalId": "string",
62
- * "id": "string",
63
- * "name": {
64
- * "additionalProp1": "string",
65
- * "additionalProp2": "string",
66
- * "additionalProp3": "string"
67
- * },
68
- * "type": "LONG_TEXT"
69
- * },
70
- * "value": {}
71
- * }
72
- * ],
73
- * "customerTags": [
74
- * {
75
- * "id": "string",
76
- * "name": "string"
77
- * }
78
- * ],
79
- * "externalId": "string",
80
- * "id": "string",
81
- * "mainContacts": [
82
- * {
83
- * "civility": "MR",
84
- * "email": "string",
85
- * "firstName": "string",
86
- * "id": "string",
87
- * "lastName": "string",
88
- * "status": "ACTIVE"
89
- * }
90
- * ],
91
- * "name": "string",
92
- * "paymentType": "ON_ACCEPTANCE",
93
- * "status": "ACTIVE",
94
- * "vatNumber": "string",
95
- * "website": "string"
96
- * }
97
- *
98
38
  */
99
39
  async function getCustomerAccount() {
100
40
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
@@ -104,23 +44,28 @@ async function getCustomerAccount() {
104
44
  return data;
105
45
  }
106
46
  /**
107
- * ## Create a customer account
108
- * ### API CODE (ACCOUNT-100)
109
- * @param {CreateCustomerAccountParameters} params - The parameters for creating a customer account, including:
110
- * #### createAddressRequests - `object[]` | <strong style={{ color: 'red' }}>required</strong>
111
- * #### createCustomerUserRequest - `object` | <strong style={{ color: 'red' }}>required</strong>
112
- * #### createObjectCustomerAccountRequest - `object` | <strong style={{ color: 'red' }}>required</strong>
113
- * #### customFieldValues - `object[]` | <strong style={{ color: 'red' }}>required</strong>
114
- * #### customerTagList - `string[]` | <strong style={{ color: 'red' }}>required</strong>
115
- * #### fromFO - `boolean` | <strong style={{ color: 'red' }}>required</strong>
116
- * #### legalUser - `object[]` | <strong style={{ color: 'red' }}>required</strong>
117
- *
118
- * @return {Promise<CreateCustomerAccountResponse>} - The response with the customer account details
119
- *
120
- * @example
121
- * #### input
122
- * ```typescript
123
- * const response = await createCustomerAccount({
47
+ * 📄 Creates a new customer account.
48
+ *
49
+ * This function allows the creation of a new customer account with relevant details including addresses, user information, and custom fields.
50
+ *
51
+ * 🛠 **Endpoint**: `POST /v1/shop/customer-accounts`
52
+ *
53
+ * | Parameter | Type | Required | Description |
54
+ * |-----------------------------------|--------------------------------|----------|-------------|
55
+ * | `createAddressRequests` | `object[]` | | List of addresses to create, including `address`, `city`, `country`, `billing`, and `shipping` status. |
56
+ * | `createCustomerUserRequest` | `object` | | Contains user details such as `email`, `firstName`, `lastName`, `groups`, `password`, and `phone`. |
57
+ * | `createObjectCustomerAccountRequest` | `object` | ✅ | Main account details including `accountManager`, `businessRegistrationNumber`, `companyRegistrationName`, `externalId`, `name`, `vatNumber`, and `website`. |
58
+ * | `customFieldValues` | `object[]` | ✅ | List of custom fields with their `customFieldId` and `customFieldValue`. |
59
+ * | `customerTagList` | `string[]` | ✅ | List of customer tags. |
60
+ * | `fromFO` | `boolean` | ✅ | Flag indicating if the account is created from the front-office (FO). |
61
+ * | `legalUser` | `object[]` | ✅ | Information about the legal user including `birthday`, `countryOfResidence`, `email`, `firstName`, `lastName`, and `nationality`. |
62
+
63
+ * 📤 **Returns**:
64
+ * A `Promise<CreateCustomerAccountResponse>` containing the details of the created customer account.
65
+ *
66
+ * 🛠 **Example usage**:
67
+ * ```ts
68
+ * const response = await createCustomerAccount({
124
69
  * createAddressRequests: [
125
70
  * {
126
71
  * additionalAddress: "string",
@@ -148,16 +93,16 @@ async function getCustomerAccount() {
148
93
  * customFieldValue: 'string'
149
94
  * }
150
95
  * ],
151
- * externalId: string;
152
- * firstName: string;
153
- * groups: string[];
154
- * lastName: string;
155
- * mainOrganisationsId: string;
156
- * mainSubOrganisationsId: string;
157
- * organisationsIds: ['id1', 'id2'];
158
- * password: string;
159
- * phone: string;
160
- * subOrganisationsIds: ['id1', 'id2'];
96
+ * externalId: "string",
97
+ * firstName: "string",
98
+ * groups: ["group1", "group2"],
99
+ * lastName: "string",
100
+ * mainOrganisationsId: "orgId",
101
+ * mainSubOrganisationsId: "subOrgId",
102
+ * organisationsIds: ['orgId1', 'orgId2'],
103
+ * password: "password123",
104
+ * phone: "123456789",
105
+ * subOrganisationsIds: ['subOrgId1', 'subOrgId2']
161
106
  * },
162
107
  * createObjectCustomerAccountRequest: {
163
108
  * accountManager: "string",
@@ -170,87 +115,25 @@ async function getCustomerAccount() {
170
115
  * },
171
116
  * customFieldValues: [
172
117
  * {
173
- * customFieldId: string,
174
- * customFieldValue: string
118
+ * customFieldId: "string",
119
+ * customFieldValue: "value"
175
120
  * }
176
121
  * ],
177
- * customerTagList: ['stribg 1', 'string 2'],
122
+ * customerTagList: ["tag1", "tag2"],
178
123
  * fromFO: true,
179
- * legalUser: {
180
- * birthday: "2024-12-11T09:46:27.656Z",
181
- * countryOfResidence: "FR",
182
- * email: "string",
183
- * firstName: "string",
184
- * id: "string",
185
- * lastName: "string",
186
- * nationality: "FR"
187
- * },
188
- * });
124
+ * legalUser: [
125
+ * {
126
+ * birthday: "2024-12-11T09:46:27.656Z",
127
+ * countryOfResidence: "FR",
128
+ * email: "user@example.com",
129
+ * firstName: "John",
130
+ * id: "userId",
131
+ * lastName: "Doe",
132
+ * nationality: "FR"
133
+ * }
134
+ * ],
135
+ * });
189
136
  * ```
190
- * #### output
191
- * Response - <strong style={{ color: 'green' }}>201</strong> - Created
192
- * ```json
193
- * {
194
- * "accountManager": "string",
195
- * "addresses": [
196
- * {
197
- * "additionalAddress": "string",
198
- * "address": "string",
199
- * "billing": true,
200
- * "city": "string",
201
- * "company": "string",
202
- * "country": "string",
203
- * "externalId": "string",
204
- * "fullName": "string",
205
- * "id": "string",
206
- * "label": "string",
207
- * "phone": "string",
208
- * "shipping": true,
209
- * "state": "string",
210
- * "zipcode": "string"
211
- * }
212
- * ],
213
- * "businessRegistrationNumber": "string",
214
- * "companyRegistrationName": "string",
215
- * "customFieldValues": [
216
- * {
217
- * "customField": {
218
- * "externalId": "string",
219
- * "id": "string",
220
- * "name": {
221
- * "additionalProp1": "string",
222
- * "additionalProp2": "string",
223
- * "additionalProp3": "string"
224
- * },
225
- * "type": "LONG_TEXT"
226
- * },
227
- * "value": {}
228
- * }
229
- * ],
230
- * "customerTags": [
231
- * {
232
- * "id": "string",
233
- * "name": "string"
234
- * }
235
- * ],
236
- * "externalId": "string",
237
- * "id": "string",
238
- * "mainContacts": [
239
- * {
240
- * "civility": "MR",
241
- * "email": "string",
242
- * "firstName": "string",
243
- * "id": "string",
244
- * "lastName": "string",
245
- * "status": "ACTIVE"
246
- * }
247
- * ],
248
- * "name": "string",
249
- * "paymentType": "ON_ACCEPTANCE",
250
- * "status": "ACTIVE",
251
- * "vatNumber": "string",
252
- * "website": "string"
253
- * }
254
137
  */
255
138
  async function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, }) {
256
139
  (0, parameters_validation_1.required)({
@@ -278,114 +161,16 @@ async function createCustomerAccount({ createAddressRequests, createCustomerUser
278
161
  return data;
279
162
  }
280
163
  /**
281
- * ## Update a customer account
282
- * ### API CODE (ACCOUNT-201)
283
- *
284
- * @param {UpdateCustomerAccountParameters} params - The parameters for updating a customer account, including:
285
- * #### accountManager - `string`
286
- * #### businessRegistrationNumber - `string`
287
- * #### companyRegistrationName - `string`
288
- * #### customFieldValues - `object[]`
289
- * #### customerTagList - `string[]`
290
- * #### legalUser - `object[]`
291
- * #### name - `string`
292
- * #### vatNumber - `string`
293
- * #### website - `string`
294
- *
295
- * @return {Promise<UpdateCustomerAccountResponse>} - The response with the updated customer account details
296
- *
297
- * @example
298
- * #### input
299
- * ```typescript
300
- * const response = await updateCustomerAccount({
301
- * accountManager: "string",
302
- * businessRegistrationNumber: "string",
303
- * companyRegistrationName: "string",
304
- * customFieldValues: [
305
- * {
306
- * customFieldId: 'string',
307
- * customFieldValue: 'string'
308
- * }
309
- * ],
310
- * customerTagList: ['stribg 1', 'string 2'],
311
- * legalUser: {
312
- * birthday: "2024-12-11T09:46:27.656Z",
313
- * countryOfResidence: "FR",
314
- * email: "string",
315
- * firstName: "string",
316
- * id: "string",
317
- * lastName: "string",
318
- * nationality: "FR"
319
- * },
320
- * name: "string",
321
- * vatNumber: "string",
322
- * website: "string"
323
- * });
324
- * ```
325
- * #### output
326
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
327
- * ```json
328
- * {
329
- * "accountManager": "string",
330
- * "addresses": [
331
- * {
332
- * "additionalAddress": "string",
333
- * "address": "string",
334
- * "billing": true,
335
- * "city": "string",
336
- * "company": "string",
337
- * "country": "string",
338
- * "externalId": "string",
339
- * "fullName": "string",
340
- * "id": "string",
341
- * "label": "string",
342
- * "phone": "string",
343
- * "shipping": true,
344
- * "state": "string",
345
- * "zipcode": "string"
346
- * }
347
- * ],
348
- * "businessRegistrationNumber": "string",
349
- * "companyRegistrationName": "string",
350
- * "customFieldValues": [
351
- * {
352
- * "customField": {
353
- * "externalId": "string",
354
- * "id": "string",
355
- * "name": {
356
- * "additionalProp1": "string",
357
- * "additionalProp2": "string",
358
- * "additionalProp3": "string"
359
- * },
360
- * "type": "LONG_TEXT"
361
- * },
362
- * "value": {}
363
- * }
364
- * ],
365
- * "customerTags": [
366
- * {
367
- * "id": "string",
368
- * "name": "string"
369
- * }
370
- * ],
371
- * "externalId": "string",
372
- * "id": "string",
373
- * "mainContacts": [
374
- * {
375
- * "civility": "MR",
376
- * "email": "string",
377
- * "firstName": "string",
378
- * "id": "string",
379
- * "lastName": "string",
380
- * "status": "ACTIVE"
381
- * }
382
- * ],
383
- * "name": "string",
384
- * "paymentType": "ON_ACCEPTANCE",
385
- * "status": "ACTIVE",
386
- * "vatNumber": "string",
387
- * "website": "string"
388
- * }
164
+ * 📄 Update customer account details.
165
+ *
166
+ * This function allows you to update the details of an existing customer account, including account manager, registration details, tags, and more.
167
+ *
168
+ * 🛠 **Endpoint**: `PUT /v1/shop/customer-accounts`
169
+ *
170
+ * 📤 **Returns**:
171
+ * A `Promise<UpdateCustomerAccountResponse>` containing the updated customer account details.
172
+ *
173
+ * console.log(response);
389
174
  * ```
390
175
  */
391
176
  async function updateCustomerAccount({ accountManager, businessRegistrationNumber, companyRegistrationName, customFieldValues, customerTagList, legalUser, name, vatNumber, website, }) {
@@ -407,41 +192,24 @@ async function updateCustomerAccount({ accountManager, businessRegistrationNumbe
407
192
  return data;
408
193
  }
409
194
  /**
410
- * ## Get a customer account's addresses
411
- * ### APICODE(ACCOUNT-500)
195
+ * 📄 Get customer account's addresses.
412
196
  *
413
- * @param {GetCustomerAccountAddressesParameters} params - The parameters for the function
414
- * #### shipping - `boolean`
415
- * #### billing - `boolean`
197
+ * This function retrieves the addresses associated with a specific customer account, including shipping and billing addresses.
416
198
  *
417
- * @returns {Promise<GetCustomerAccountAddressesResponse>} - The response with the customer account addresses
199
+ * 🛠 **Endpoint**: `GET /v1/shop/customer-accounts/addresses`
418
200
  *
419
- * @example
420
- * ### input
421
- * ```typescript
201
+ * | Parameter | Type | Required | Description |
202
+ * |---------------|-----------|----------|------------------------------------------------------|
203
+ * | `shipping` | `boolean` | ✅ | Flag to include shipping address. |
204
+ * | `billing` | `boolean` | ✅ | Flag to include billing address. |
205
+ *
206
+ * 📤 **Returns**:
207
+ * A `Promise<GetCustomerAccountAddressesResponse>` containing the addresses associated with the customer account.
208
+ *
209
+ * 🛠 **Example usage**:
210
+ * ```ts
422
211
  * const response = await getCustomerAccountAddresses({ shipping: true, billing: true });
423
- * ```
424
- * ### output
425
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
426
- * ```json
427
- * [
428
- * {
429
- * "additionalAddress": "string",
430
- * "address": "string",
431
- * "billing": true,
432
- * "city": "string",
433
- * "company": "string",
434
- * "country": "string",
435
- * "externalId": "string",
436
- * "fullName": "string",
437
- * "id": "string",
438
- * "label": "string",
439
- * "phone": "string",
440
- * "shipping": true,
441
- * "state": "string",
442
- * "zipcode": "string"
443
- * }
444
- * ]
212
+ * console.log(response);
445
213
  * ```
446
214
  */
447
215
  async function getCustomerAccountAddresses({ shipping, billing, }) {
@@ -456,28 +224,33 @@ async function getCustomerAccountAddresses({ shipping, billing, }) {
456
224
  return data;
457
225
  }
458
226
  /**
459
- * ## Create an address for a customer account
460
- * ### APICODE(ADDRESS-100)
461
- * @param {CreateCustomerAccountAddressParameters} params - The parameters for the function
462
- * #### additionalAddress - `string`
463
- * #### address - `string` | <strong style={{ color: 'red' }}>required</strong>
464
- * #### billing - `boolean`
465
- * #### city - `string` | <strong style={{ color: 'red' }}>required</strong>
466
- * #### company - `string`
467
- * #### country - `string` | <strong style={{ color: 'red' }}>required</strong>
468
- * #### externalId - `string`
469
- * #### fullName - `string` | <strong style={{ color: 'red' }}>required</strong>
470
- * #### label - `string`
471
- * #### phone - `string`
472
- * #### shipping - `boolean`
473
- * #### state - `string`
474
- * #### zipcode - `string` | <strong style={{ color: 'red' }}>required</strong>
475
- *
476
- * @returns {Promise<CreateCustomerAccountAddressResponse>} - The response with the customer account address
477
- *
478
- * @example
479
- * ### input
480
- * ```typescript
227
+ * 📄 Create an address for a customer account.
228
+ *
229
+ * This function creates a new address for a specific customer account, with optional fields like shipping and billing flags.
230
+ *
231
+ * 🛠 **Endpoint**: `POST /v1/shop/customer-accounts/addresses`
232
+ *
233
+ * | Parameter | Type | Required | Description |
234
+ * |---------------------|-----------|----------|------------------------------------------------------|
235
+ * | `additionalAddress` | `string` | | Additional address line. |
236
+ * | `address` | `string` | ✅ | The main address of the customer. |
237
+ * | `billing` | `boolean` | ❌ | Flag indicating if it's a billing address. |
238
+ * | `city` | `string` | ✅ | The city of the customer address. |
239
+ * | `company` | `string` | ❌ | The company name associated with the address. |
240
+ * | `country` | `string` | ✅ | The country of the customer address. |
241
+ * | `externalId` | `string` | ❌ | External ID for the address. |
242
+ * | `fullName` | `string` | | The full name of the person associated with the address. |
243
+ * | `label` | `string` | ❌ | Label for the address. |
244
+ * | `phone` | `string` | ❌ | Phone number associated with the address. |
245
+ * | `shipping` | `boolean` | ❌ | Flag indicating if it's a shipping address. |
246
+ * | `state` | `string` | ❌ | The state/province of the customer address. |
247
+ * | `zipcode` | `string` | ✅ | The postal code for the customer address. |
248
+ *
249
+ * 📤 **Returns**:
250
+ * A `Promise<CreateCustomerAccountAddressResponse>` containing the created customer account address.
251
+ *
252
+ * 🛠 **Example usage**:
253
+ * ```ts
481
254
  * const response = await createCustomerAccountAddress({
482
255
  * additionalAddress: "string",
483
256
  * address: "string",
@@ -493,26 +266,7 @@ async function getCustomerAccountAddresses({ shipping, billing, }) {
493
266
  * state: "string",
494
267
  * zipcode: "string"
495
268
  * });
496
- * ```
497
- * ### output
498
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
499
- * ```json
500
- * {
501
- * "additionalAddress": "string",
502
- * "address": "string",
503
- * "billing": true,
504
- * "city": "string",
505
- * "company": "string",
506
- * "country": "string",
507
- * "externalId": "string",
508
- * "fullName": "string",
509
- * "id": "string",
510
- * "label": "string",
511
- * "phone": "string",
512
- * "shipping": true,
513
- * "state": "string",
514
- * "zipcode": "string"
515
- * }
269
+ * console.log(response);
516
270
  * ```
517
271
  */
518
272
  async function createCustomerAccountAddress({ additionalAddress, address, billing, city, company, country, externalId, fullName, label, phone, shipping, state, zipcode, }) {
@@ -539,23 +293,22 @@ async function createCustomerAccountAddress({ additionalAddress, address, billin
539
293
  return data;
540
294
  }
541
295
  /**
296
+ * 🗑️ Delete an address from a customer account.
542
297
  *
543
- * ## Delete an address from a customer account
544
- * ### APICODE(ADDRESS-300)
545
- * @param {DeleteCustomerAccountAddressParameters} params - The parameters for the function
546
- * #### addressId - `string` | <strong style={{ color: 'red' }}>required</strong>
298
+ * This function deletes a specific address from a customer's account based on the provided address ID.
547
299
  *
548
- * @returns {Promise<void>} - The response with the customer account address
300
+ * 🛠 **Endpoint**: `DELETE /v1/shop/customer-accounts/addresses/{addressId}`
549
301
  *
550
- * @example
551
- * ### input
552
- * ```typescript
553
- * const response = await deleteCustomerAccountAddress({ addressId: "string" });
554
- * ```
555
- * ### output
556
- * Response - <strong style={{ color: 'green' }}>204</strong> - No Content
557
- * ```json
302
+ * | Parameter | Type | Required | Description |
303
+ * |-------------|----------|----------|----------------------------------|
304
+ * | `addressId` | `string` | ✅ | The ID of the address to delete. |
305
+ *
306
+ * 📤 **Returns**: `Promise<void>` - No content response indicating successful deletion.
558
307
  *
308
+ * 🛠 **Example usage**:
309
+ * ```ts
310
+ * const response = await deleteCustomerAccountAddress({ addressId: "string" });
311
+ * console.log(response); // No content response
559
312
  * ```
560
313
  */
561
314
  async function deleteCustomerAccountAddress({ addressId, }) {
@@ -566,28 +319,33 @@ async function deleteCustomerAccountAddress({ addressId, }) {
566
319
  });
567
320
  }
568
321
  /**
569
- * ## Update an address for a customer account
570
- * ### APICODE(ADDRESS-200)
571
- * @param {UpdateCustomerAccountAddressParameters} params - The parameters for the function
572
- * #### addressId - `string` | <strong style={{ color: 'red' }}>required</strong>
573
- * #### additionalAddress - `string`
574
- * #### address - `string`
575
- * #### billing - `boolean`
576
- * #### city - `string`
577
- * #### company - `string`
578
- * #### country - `string`
579
- * #### fullName - `string`
580
- * #### label - `string`
581
- * #### phone - `string`
582
- * #### shipping - `boolean`
583
- * #### state - `string`
584
- * #### zipcode - `string`
585
- *
586
- * @returns {Promise<UpdateCustomerAccountAddressResponse>} - The response with the customer account address
587
- *
588
- * @example
589
- * ### input
590
- * ```typescript
322
+ * ✏️ Update an address for a customer account.
323
+ *
324
+ * This function allows you to update an existing address for a customer account. You must provide the address ID and at least one of the optional parameters for updating the address.
325
+ *
326
+ * 🛠 **Endpoint**: `PUT /v1/shop/customer-accounts/addresses/{addressId}`
327
+ *
328
+ * | Parameter | Type | Required | Description |
329
+ * |----------------------|-----------|----------|-------------------------------------------------------|
330
+ * | `addressId` | `string` | ✅ | The ID of the address to update. |
331
+ * | `additionalAddress` | `string` | ❌ | Additional address line. |
332
+ * | `address` | `string` | ✅ | The main address of the customer. |
333
+ * | `billing` | `boolean` | ❌ | Flag indicating if it's a billing address. |
334
+ * | `city` | `string` | ✅ | The city of the customer address. |
335
+ * | `company` | `string` | ❌ | The company name associated with the address. |
336
+ * | `country` | `string` | ✅ | The country of the customer address. |
337
+ * | `fullName` | `string` | ✅ | The full name of the person associated with the address. |
338
+ * | `label` | `string` | ❌ | Label for the address. |
339
+ * | `phone` | `string` | ❌ | Phone number associated with the address. |
340
+ * | `shipping` | `boolean` | ❌ | Flag indicating if it's a shipping address. |
341
+ * | `state` | `string` | ❌ | The state/province of the customer address. |
342
+ * | `zipcode` | `string` | ✅ | The postal code for the customer address. |
343
+ *
344
+ * 📤 **Returns**:
345
+ * A `Promise<UpdateCustomerAccountAddressResponse>` containing the updated customer account address.
346
+ *
347
+ * 🛠 **Example usage**:
348
+ * ```ts
591
349
  * const response = await updateCustomerAccountAddress({
592
350
  * addressId: "string",
593
351
  * additionalAddress: "string",
@@ -603,26 +361,7 @@ async function deleteCustomerAccountAddress({ addressId, }) {
603
361
  * state: "string",
604
362
  * zipcode: "string"
605
363
  * });
606
- * ```
607
- * ### output
608
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
609
- * ```json
610
- * {
611
- * "additionalAddress": "string",
612
- * "address": "string",
613
- * "billing": true,
614
- * "city": "string",
615
- * "company": "string",
616
- * "country": "string",
617
- * "externalId": "string",
618
- * "fullName": "string",
619
- * "id": "string",
620
- * "label": "string",
621
- * "phone": "string",
622
- * "shipping": true,
623
- * "state": "string",
624
- * "zipcode": "string"
625
- * }
364
+ * console.log(response); // Updated address details
626
365
  * ```
627
366
  */
628
367
  async function updateCustomerAccountAddress({ addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }) {
@@ -648,483 +387,71 @@ async function updateCustomerAccountAddress({ addressId, additionalAddress, addr
648
387
  return data;
649
388
  }
650
389
  /**
651
- * ## Get a customer account's orders
652
- * APICODE(ORDER-550)
653
- * @param {GetCustomerAccountOrdersParameters} params - The parameters for the function
654
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
655
- * #### locale - `string` | <strong style={{ color: 'red' }}>required</strong>
390
+ * 📋 Retrieves orders for a customer account.
391
+ *
392
+ * This function fetches the orders for a customer account based on the provided parameters.
656
393
  *
657
- * @returns {Promise<GetCustomerAccountOrdersResponse>} - The response with the customer account orders
394
+ * 🛠 **Endpoint**: `GET /v1/shop/customer-accounts/orders`
658
395
  *
659
- * @example
660
- * ### input
396
+ * | **Parameter** | **Type** | **Required** | **Description** |
397
+ * |----------------------|------------|--------------|---------------------------------------------------------------------------|
398
+ * | `pageable` | `object` | ✅ | The pagination parameters to retrieve paginated results. |
399
+ * | `locale` | `string` | ✅ | The locale to be used for the response. |
400
+ * | `includeInactive` | `boolean` | ❌ | Whether to include inactive orders in the response. |
401
+ * | `limit` | `number` | ❌ | The maximum number of orders to return. |
402
+ * | `offset` | `number` | ❌ | The number of orders to skip before starting to collect results. |
403
+ *
404
+ * 📤 **Returns**:
405
+ * A `Promise<GetCustomerAccountOrdersResponse>` containing the retrieved customer account orders.
406
+ *
407
+ * 🛠 **Example Usage**:
661
408
  * ```typescript
662
- * const response = await getCustomerAccountOrders({ pageable: { page: 1, size: 10 }, locale: "string" });
663
- * ```
664
- * ### output
665
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
666
- * ```json
667
- * {
668
- * "content": [
669
- * {
670
- * "billingAddressSnapshot": {
671
- * "additionalAddress": "string",
672
- * "address": "string",
673
- * "city": "string",
674
- * "company": "string",
675
- * "country": "string",
676
- * "externalId": "string",
677
- * "fullName": "string",
678
- * "id": "string",
679
- * "label": "string",
680
- * "phone": "string",
681
- * "state": "string",
682
- * "zipcode": "string"
683
- * },
684
- * "channel": "DESKTOP",
685
- * "createdAt": "2024-12-11T10:28:21.123Z",
686
- * "customFieldValues": [
687
- * {
688
- * "customField": {
689
- * "externalId": "string",
690
- * "externalSource": "MIRAKL",
691
- * "faceted": true,
692
- * "id": "string",
693
- * "indexable": true,
694
- * "mandatory": true,
695
- * "name": {
696
- * "additionalProp1": "string",
697
- * "additionalProp2": "string",
698
- * "additionalProp3": "string"
699
- * },
700
- * "role": "PRODUCT_TAX_RATE",
701
- * "sealedTarget": "string",
702
- * "searchable": true,
703
- * "sortable": true,
704
- * "status": "ACTIVE"
705
- * },
706
- * "value": {}
707
- * }
708
- * ],
709
- * "customerUserSnapshot": {
710
- * "accountExternalId": "string",
711
- * "accountId": "string",
712
- * "accountName": "string",
713
- * "accountTvaNumber": "string",
714
- * "civility": "MR",
715
- * "email": "string",
716
- * "externalId": "string",
717
- * "firstName": "string",
718
- * "id": "string",
719
- * "lastName": "string",
720
- * "phone": "string"
721
- * },
722
- * "exportStatus": "EXPORTED",
723
- * "externalId": "string",
724
- * "externalSource": "MIRAKL",
725
- * "fulfillmentMessage": "string",
726
- * "id": "string",
727
- * "incidentDeclared": true,
728
- * "initialPrice": {
729
- * "priceWithTax": 0,
730
- * "priceWithoutTax": 0,
731
- * "shippingPriceWithTax": 0,
732
- * "shippingPriceWithoutTax": 0,
733
- * "totalPriceWithTax": 0,
734
- * "totalPriceWithoutTax": 0
735
- * },
736
- * "leadTimeToShip": 0,
737
- * "lines": [
738
- * {
739
- * "confirmedQuantity": 0,
740
- * "customFieldValues": [
741
- * {
742
- * "customField": {
743
- * "externalId": "string",
744
- * "externalSource": "MIRAKL",
745
- * "faceted": true,
746
- * "id": "string",
747
- * "indexable": true,
748
- * "mandatory": true,
749
- * "name": {
750
- * "additionalProp1": "string",
751
- * "additionalProp2": "string",
752
- * "additionalProp3": "string"
753
- * },
754
- * "role": "PRODUCT_TAX_RATE",
755
- * "sealedTarget": "string",
756
- * "searchable": true,
757
- * "sortable": true,
758
- * "status": "ACTIVE"
759
- * },
760
- * "value": {}
761
- * }
762
- * ],
763
- * "externalId": "string",
764
- * "externalSource": "MIRAKL",
765
- * "id": "string",
766
- * "incidentDeclared": true,
767
- * "offerInventorySnapshotDto": {
768
- * "currency": "USD",
769
- * "customFieldValueSnapshots": [
770
- * {
771
- * "customFieldSnapshotDto": {
772
- * "externalId": "string",
773
- * "externalSource": "string",
774
- * "mandatory": true,
775
- * "names": {
776
- * "additionalProp1": "string",
777
- * "additionalProp2": "string",
778
- * "additionalProp3": "string"
779
- * },
780
- * "role": "string",
781
- * "sealedTarget": "string",
782
- * "status": "string",
783
- * "type": "string"
784
- * },
785
- * "value": "string"
786
- * }
787
- * ],
788
- * "externalSource": "MIRAKL",
789
- * "offerInventoryExternalId": "string",
790
- * "packingType": "BOX",
791
- * "productTaxCode": "string",
792
- * "productTaxRate": 0,
793
- * "quantityPerItem": 0,
794
- * "shippingTaxCode": "string",
795
- * "shippingTaxRate": 0
796
- * },
797
- * "offerPriceSnapshotDto": {
798
- * "confirmedProductPriceWithoutTaxes": 0,
799
- * "itemPerPack": 0,
800
- * "offerPriceExternalId": "string",
801
- * "offerPriceType": "PUBLIC",
802
- * "offerPriceTypeValue": "string",
803
- * "productPriceWithTaxes": 0,
804
- * "productPriceWithoutTaxes": 0,
805
- * "productTaxAmount": 0,
806
- * "shippingPriceWithTaxes": 0,
807
- * "shippingPriceWithoutTaxes": 0,
808
- * "shippingTaxAmount": 0,
809
- * "totalPriceWithTaxes": 0,
810
- * "totalPriceWithoutTaxes": 0,
811
- * "totalProductPriceWithTaxes": 0,
812
- * "totalProductPriceWithoutTaxes": 0,
813
- * "totalProductTaxAmount": 0,
814
- * "totalTaxAmount": 0
815
- * },
816
- * "orderLogisticLinePriceDto": {
817
- * "confirmedPrice": 0,
818
- * "currency": "USD",
819
- * "externalOfferId": "string",
820
- * "externalSource": "MIRAKL",
821
- * "itemPerPack": 0,
822
- * "itemPriceWithoutTaxes": 0,
823
- * "packingType": "BOX",
824
- * "priceWithTaxes": 0,
825
- * "quantityPerItem": 0,
826
- * "shippingPriceWithTaxes": 0,
827
- * "shippingPriceWithoutTaxes": 0,
828
- * "shippingTaxAmount": 0,
829
- * "taxAmount": 0,
830
- * "taxInformation": {
831
- * "productTaxAmount": 0,
832
- * "productTaxCode": "string",
833
- * "productTaxRate": 0,
834
- * "shippingTaxAmount": 0,
835
- * "shippingTaxCode": "string",
836
- * "shippingTaxRate": 0
837
- * },
838
- * "taxRate": 0,
839
- * "totalItemPrice": 0,
840
- * "totalItemPriceWithTaxes": 0,
841
- * "totalItemTaxAmount": 0,
842
- * "totalPriceWithTaxes": 0,
843
- * "totalPriceWithoutTaxes": 0,
844
- * "totalTaxes": 0,
845
- * "type": "PUBLIC",
846
- * "typeValue": "string"
847
- * },
848
- * "orderLogisticLineProductDto": {
849
- * "brand": "string",
850
- * "classificationCategory": "string",
851
- * "defaultLanguage": "EN",
852
- * "description": "string",
853
- * "externalId": "string",
854
- * "externalSource": "MIRAKL",
855
- * "name": "string",
856
- * "productAttributeValues": [
857
- * {
858
- * "attributeExternalId": "string",
859
- * "attributeExternalSource": "string",
860
- * "attributeId": "string",
861
- * "attributeName": {
862
- * "additionalProp1": "string",
863
- * "additionalProp2": "string",
864
- * "additionalProp3": "string"
865
- * },
866
- * "attributeType": "string",
867
- * "attributeValue": "string",
868
- * "id": "string"
869
- * }
870
- * ],
871
- * "productUnit": "string",
872
- * "sku": "string",
873
- * "tags": [
874
- * "string"
875
- * ]
876
- * },
877
- * "orderLogisticLineProductVariantDto": {
878
- * "attributeValues": [
879
- * {
880
- * "attributeExternalId": "string",
881
- * "attributeExternalSource": "string",
882
- * "attributeId": "string",
883
- * "attributeName": {
884
- * "additionalProp1": "string",
885
- * "additionalProp2": "string",
886
- * "additionalProp3": "string"
887
- * },
888
- * "attributeType": "string",
889
- * "attributeValue": "string",
890
- * "id": "string"
891
- * }
892
- * ],
893
- * "description": "string",
894
- * "ean": "string",
895
- * "externalId": "string",
896
- * "externalSource": "MIRAKL",
897
- * "mainImageUrl": "string",
898
- * "mpn": "string",
899
- * "name": "string",
900
- * "productMediaInfoDTOS": [
901
- * {
902
- * "isMain": true,
903
- * "urls": [
904
- * {
905
- * "formatType": "string",
906
- * "heightInPx": 0,
907
- * "sizeType": "string",
908
- * "url": "string",
909
- * "widthInPx": 0
910
- * }
911
- * ]
912
- * }
913
- * ],
914
- * "sku": "string"
915
- * },
916
- * "paymentStatus": "WAITING_REFUND",
917
- * "quantity": 0,
918
- * "quoteLineExternalId": "string",
919
- * "status": "CANCELED"
920
- * }
921
- * ],
922
- * "orderCommercialId": "string",
923
- * "orderCommercialReference": "string",
924
- * "orderLogisticPrices": {
925
- * "currency": "USD",
926
- * "totalPriceWithTax": 0,
927
- * "totalPriceWithoutTax": 0,
928
- * "totalProductTaxAmount": 0,
929
- * "totalProductWithTax": 0,
930
- * "totalProductWithoutTax": 0,
931
- * "totalShippingFeesWithTax": 0,
932
- * "totalShippingFeesWithoutTax": 0,
933
- * "totalShippingTaxAmount": 0,
934
- * "totalTaxAmount": 0
935
- * },
936
- * "orderOrigin": "CART",
937
- * "partiallyDeclinedBySupplier": true,
938
- * "paymentOption": "BANK_WIRE",
939
- * "paymentStatus": "AUTHORIZED",
940
- * "reference": "string",
941
- * "shippingAddressSnapshot": {
942
- * "additionalAddress": "string",
943
- * "address": "string",
944
- * "city": "string",
945
- * "company": "string",
946
- * "country": "string",
947
- * "externalId": "string",
948
- * "fullName": "string",
949
- * "id": "string",
950
- * "label": "string",
951
- * "phone": "string",
952
- * "state": "string",
953
- * "zipcode": "string"
954
- * },
955
- * "shippingTrackingUrl": "string",
956
- * "shippingType": "string",
957
- * "status": "CREATING",
958
- * "supplierSnapshot": {
959
- * "description": "string",
960
- * "externalId": "string",
961
- * "id": "string",
962
- * "name": "string",
963
- * "paymentDueDate": {
964
- * "paymentDueDateDelay": 0,
965
- * "paymentDueDateMode": "SIMPLE"
966
- * },
967
- * "returnPolicy": "string",
968
- * "totalOffers": 0,
969
- * "totalOrders": 0
970
- * },
971
- * "updatedAt": "2024-12-11T10:28:21.124Z",
972
- * "validatedAt": "2024-12-11T10:28:21.124Z"
973
- * }
974
- * ],
975
- * "empty": true,
976
- * "first": true,
977
- * "last": true,
978
- * "number": 0,
979
- * "numberOfElements": 0,
980
- * "pageable": {
981
- * "offset": 0,
982
- * "pageNumber": 0,
983
- * "pageSize": 0,
984
- * "paged": true,
985
- * "sort": [
986
- * {
987
- * "ascending": true,
988
- * "descending": true,
989
- * "direction": "ASC",
990
- * "ignoreCase": true,
991
- * "nullHandling": "NATIVE",
992
- * "property": "string"
993
- * }
994
- * ],
995
- * "unpaged": true
996
- * },
997
- * "size": 0,
998
- * "sort": [
999
- * {
1000
- * "ascending": true,
1001
- * "descending": true,
1002
- * "direction": "ASC",
1003
- * "ignoreCase": true,
1004
- * "nullHandling": "NATIVE",
1005
- * "property": "string"
1006
- * }
1007
- * ],
1008
- * "totalElements": 0,
1009
- * "totalPages": 0
1010
- * }
409
+ * const orders = await getCustomerAccountOrders({
410
+ * pageable: { page: 1, size: 10 },
411
+ * locale: 'en',
412
+ * });
1011
413
  * ```
414
+ *
415
+ * @param {GetCustomerAccountOrdersParameters} params - The parameters for fetching customer account orders:
416
+ * - `pageable` - Pagination parameters.
417
+ * - `locale` - The locale for the response.
418
+ * - `includeInactive` (optional) - Whether to include inactive orders.
419
+ * - `limit` (optional) - The maximum number of orders to return.
420
+ * - `offset` (optional) - The number of orders to skip before collecting results.
421
+ *
422
+ * @returns {Promise<GetCustomerAccountOrdersResponse>} - The response containing the customer account orders.
1012
423
  */
1013
- async function getCustomerAccountOrders({ pageable, locale, }) {
1014
- (0, parameters_validation_1.required)({ pageable, locale });
424
+ async function getCustomerAccountOrders(params) {
1015
425
  const { data } = await (0, fetch_instance_1.enhancedFetch)({
1016
426
  method: "GET",
1017
427
  path: `/v1/shop/customer-accounts/orders`,
1018
- params: {
1019
- pageable,
1020
- locale,
1021
- page: pageable.page,
1022
- size: pageable.size,
1023
- sort: pageable.sort,
1024
- },
428
+ params,
1025
429
  });
1026
430
  return data;
1027
431
  }
1028
432
  /**
1029
- * ## Get a customer account's users
1030
- * ### APICODE(ACCOUNT-502)
1031
- * @param {GetCustomerAccountUsersParameters} params - The parameters for the function
1032
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
433
+ * ## Retrieve Customer Account Users
434
+ *
435
+ * This function retrieves the list of users associated with a specific customer account.
436
+ *
437
+ * ### API Code: ACCOUNT-502
1033
438
  *
1034
- * @returns {Promise<GetCustomerAccountUsersResponse>} - The response with the customer account users
439
+ * ### **Endpoint**: `GET /v1/shop/customer-accounts/users`
1035
440
  *
1036
- * @example
1037
- * ### input
441
+ * | **Parameter** | **Type** | **Required** | **Description** |
442
+ * |-------------------|------------|--------------|-------------------------------------------------------------|
443
+ * | `pageable` | `object` | ✅ | Object containing pagination details: `page`, `size`, etc. |
444
+ * | `locale` | `string` | ❌ | The locale in which data should be retrieved. |
445
+ *
446
+ * ### **Returns**:
447
+ * A `Promise<GetCustomerAccountUsersResponse>` containing the list of users and pagination metadata.
448
+ *
449
+ * ### **Example Usage**:
1038
450
  * ```typescript
1039
- * const response = await getCustomerAccountUsers({ pageable: { page: 1, size: 10 }, locale: "string" });
1040
- * ```
1041
- * ### output
1042
- * Response - <strong style={{ color: 'green' }}>200</strong>
1043
- * ```json
1044
- * {
1045
- * "content": [
1046
- * {
1047
- * "civility": "MR",
1048
- * "createdAt": "2024-12-11T10:28:21.123Z",
1049
- * "customFieldValues": [
1050
- * {
1051
- * "customField": {
1052
- * "externalId": "string",
1053
- * "externalSource": "MIRAKL",
1054
- * "faceted": true,
1055
- * "id": "string",
1056
- * "indexable": true,
1057
- * "mandatory": true,
1058
- * "name": {
1059
- * "additionalProp1": "string",
1060
- * "additionalProp2": "string",
1061
- * "additionalProp3": "string"
1062
- * },
1063
- * "role": "PRODUCT_TAX_RATE",
1064
- * "sealedTarget": "string",
1065
- * "searchable": true,
1066
- * "sortable": true,
1067
- * "status": "ACTIVE"
1068
- * },
1069
- * "value": {}
1070
- * }
1071
- * ],
1072
- * "email": "string",
1073
- * "externalId": "string",
1074
- * "firstName": "string",
1075
- * "groups": [
1076
- * "string"
1077
- * ],
1078
- * "id": "string",
1079
- * "lastName": "string",
1080
- * "mainOrganisationsId": "string",
1081
- * "organisations": [
1082
- * {
1083
- * "id": "string",
1084
- * "name": "string"
1085
- * }
1086
- * ],
1087
- * "phone": "string",
1088
- * "status": "ACTIVE",
1089
- * "updatedAt": "2024-12-11T10:28:21.124Z"
1090
- * }
1091
- * ],
1092
- * "empty": true,
1093
- * "first": true,
1094
- * "last": true,
1095
- * "number": 0,
1096
- * "numberOfElements": 0,
1097
- * "pageable": {
1098
- * "offset": 0,
1099
- * "pageNumber": 0,
1100
- * "pageSize": 0,
1101
- * "paged": true,
1102
- * "sort": [
1103
- * {
1104
- * "ascending": true,
1105
- * "descending": true,
1106
- * "direction": "ASC",
1107
- * "ignoreCase": true,
1108
- * "nullHandling": "NATIVE",
1109
- * "property": "string"
1110
- * }
1111
- * ],
1112
- * "unpaged": true
1113
- * },
1114
- * "size": 0,
1115
- * "sort": [
1116
- * {
1117
- * "ascending": true,
1118
- * "descending": true,
1119
- * "direction": "ASC",
1120
- * "ignoreCase": true,
1121
- * "nullHandling": "NATIVE",
1122
- * "property": "string"
1123
- * }
1124
- * ],
1125
- * "totalElements": 0,
1126
- * "totalPages": 0
1127
- * }
451
+ * const response = await getCustomerAccountUsers({
452
+ * pageable: { page: 1, size: 10 },
453
+ * locale: "en-US",
454
+ * });
1128
455
  * ```
1129
456
  */
1130
457
  async function getCustomerAccountUsers({ pageable, }) {
@@ -1142,74 +469,31 @@ async function getCustomerAccountUsers({ pageable, }) {
1142
469
  return data;
1143
470
  }
1144
471
  /**
1145
- * ## Create a customer account's organisation
1146
- * ### APICODE(ACCOUNT-101)
1147
- * @param {CreateCustomerAccountOrganisationParameters} params - The parameters for the function
1148
- * #### externalId - `string` | <strong style={{ color: 'red' }}>required</strong>
1149
- * #### name - `string` | <strong style={{ color: 'red' }}>required</strong>
1150
- * #### parentId - `string`
472
+ * ## Create a Customer Account's Organisation
473
+ *
474
+ * This function allows the creation of a new organisation within a customer account.
475
+ *
476
+ * ### API Code: ACCOUNT-101
477
+ *
478
+ * ### **Endpoint**: `POST /v1/shop/customer-accounts/organisations`
1151
479
  *
1152
- * @returns {Promise<CreateCustomerAccountOrganisationResponse>} - The response with the customer account organisation
480
+ * | **Parameter** | **Type** | **Required** | **Description** |
481
+ * |-------------------|------------|--------------|---------------------------------------------------------------|
482
+ * | `externalId` | `string` | ✅ | A unique identifier for the organisation. |
483
+ * | `name` | `string` | ✅ | The name of the organisation. |
484
+ * | `parentId` | `string` | ❌ | The ID of the parent organisation, if applicable. |
1153
485
  *
1154
- * @example
1155
- * ### input
486
+ * ### **Returns**:
487
+ * A `Promise<CreateCustomerAccountOrganisationResponse>` containing the newly created organisation data.
488
+ *
489
+ * ### **Example Usage**:
1156
490
  * ```typescript
1157
491
  * const response = await createCustomerAccountOrganisation({
1158
- * externalId: "string",
1159
- * name: "string",
1160
- * parentId: "string"
492
+ * externalId: "org123",
493
+ * name: "My Organisation",
494
+ * parentId: "parentOrgId"
1161
495
  * });
1162
496
  * ```
1163
- * ### output
1164
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1165
- * ```json
1166
- * {
1167
- * "accountId": "string",
1168
- * "addresses": [
1169
- * {
1170
- * "additionalAddress": "string",
1171
- * "address": "string",
1172
- * "billing": true,
1173
- * "city": "string",
1174
- * "company": "string",
1175
- * "country": "string",
1176
- * "externalId": "string",
1177
- * "fullName": "string",
1178
- * "id": "string",
1179
- * "label": "string",
1180
- * "phone": "string",
1181
- * "shipping": true,
1182
- * "state": "string",
1183
- * "zipcode": "string"
1184
- * }
1185
- * ],
1186
- * children: ["string"],
1187
- * customFieldValues: [
1188
- * {
1189
- * customField: {
1190
- * externalId: "string",
1191
- * externalSource: "string",
1192
- * id: "string",
1193
- * mandatory: true,
1194
- * name: {
1195
- * additionalProp1: "string",
1196
- * additionalProp2: "string",
1197
- * additionalProp3: "string"
1198
- * },
1199
- * role: "string",
1200
- * sealedTarget: "string",
1201
- * status: "string",
1202
- * type: "string"
1203
- * },
1204
- * value: {}
1205
- * }
1206
- * ],
1207
- * id: "string",
1208
- * mainOrganisation: true
1209
- * name: "string",
1210
- * status: "ACTIVE",
1211
- * }
1212
- * ```
1213
497
  */
1214
498
  async function createCustomerAccountOrganisation({ externalId, name, parentId, }) {
1215
499
  (0, parameters_validation_1.required)({ externalId, name });
@@ -1226,74 +510,33 @@ async function createCustomerAccountOrganisation({ externalId, name, parentId, }
1226
510
  }
1227
511
  /**
1228
512
  * ## Update a customer account's organisation
1229
- * ### APICODE(ACCOUNT-202)
1230
- * @param {UpdateCustomerAccountOrganisationParameters} params - The parameters for the function
1231
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1232
- * #### name - `string`
1233
- * #### parentId - `string`
1234
- * #### status - `string`
1235
513
  *
1236
- * @returns {Promise<UpdateCustomerAccountOrganisationResponse>} - The response with the updated customer account organisation
514
+ * This function allows updating an existing organisation within a customer account.
515
+ *
516
+ * ### API Code: ACCOUNT-202
517
+ *
518
+ * ### **Endpoint**: `PUT /v1/shop/customer-accounts/organisations/{organisationId}`
519
+ *
520
+ * | **Parameter** | **Type** | **Required** | **Description** |
521
+ * |--------------------|------------|--------------|---------------------------------------------------------------|
522
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation to be updated. |
523
+ * | `name` | `string` | ❌ | The new name of the organisation. |
524
+ * | `parentId` | `string` | ❌ | The new parent ID for the organisation, if applicable. |
525
+ * | `status` | `string` | ❌ | The new status of the organisation (e.g., ACTIVE, INACTIVE). |
526
+ *
527
+ * ### **Returns**:
528
+ * A `Promise<UpdateCustomerAccountOrganisationResponse>` containing the updated organisation data.
1237
529
  *
1238
- * @example
1239
- * ### input
530
+ * ### **Example Usage**:
1240
531
  * ```typescript
1241
532
  * const response = await updateCustomerAccountOrganisation({
1242
- * organisationId: "string",
1243
- * name: "string",
1244
- * parentId: "string",
1245
- * status: "ACTIVE"
533
+ * organisationId: "org12345",
534
+ * name: "Updated Organisation Name",
535
+ * parentId: "parentOrg123",
536
+ * status: "ACTIVE",
1246
537
  * });
1247
- * ```
1248
- * ### output
1249
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1250
- * ```json
1251
- * {
1252
- * "accountId": "string",
1253
- * "addresses": [
1254
- * {
1255
- * "additionalAddress": "string",
1256
- * "address": "string",
1257
- * "billing": true,
1258
- * "city": "string",
1259
- * "company": "string",
1260
- * "country": "string",
1261
- * "externalId": "string",
1262
- * "fullName": "string",
1263
- * "id": "string",
1264
- * "label": "string",
1265
- * "phone": "string",
1266
- * "shipping": true,
1267
- * "state": "string",
1268
- * "zipcode": "string"
1269
- * }
1270
- * ],
1271
- * "children": ["string"],
1272
- * "customFieldValues": [
1273
- * {
1274
- * "customField": {
1275
- * "externalId": "string",
1276
- * "externalSource": "string",
1277
- * "id": "string",
1278
- * "mandatory": true,
1279
- * "name": {
1280
- * "additionalProp1": "string",
1281
- * "additionalProp2": "string",
1282
- * "additionalProp3": "string"
1283
- * },
1284
- * "role": "string",
1285
- * "sealedTarget": "string",
1286
- * "status": "string",
1287
- * "type": "string"
1288
- * },
1289
- * "value": {}
1290
- * }
1291
- * ],
1292
- * "id": "string",
1293
- * "mainOrganisation": true,
1294
- * "name": "string",
1295
- * "status": "ACTIVE"
1296
- * }
538
+ *
539
+ * console.log(response);
1297
540
  * ```
1298
541
  */
1299
542
  async function updateCustomerAccountOrganisation({ organisationId, name, parentId, status, }) {
@@ -1312,102 +555,20 @@ async function updateCustomerAccountOrganisation({ organisationId, name, parentI
1312
555
  /**
1313
556
  * @deprecated
1314
557
  * ## Get organisations from customer account
1315
- * ### APICODE(ACCOUNT-503)
1316
- * @returns {Promise<GetCustomerAccountOrganisationResponse>} - The response with the customer account organisations
1317
558
  *
1318
- * @example
1319
- * ### input
559
+ * This function retrieves all organisations associated with a customer account.
560
+ *
561
+ * ### API Code: ACCOUNT-503
562
+ *
563
+ * ### **Endpoint**: `GET /v1/shop/customer-accounts/organisations`
564
+ *
565
+ * ### **Returns**:
566
+ * A `Promise<GetCustomerAccountOrganisationResponse>` containing the list of customer account organisations.
567
+ *
568
+ * ### **Example Usage**:
1320
569
  * ```typescript
1321
570
  * const response = await getCustomerAccountOrganisations();
1322
- * ```
1323
- * ### output
1324
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1325
- * ```json
1326
- * {
1327
- * "content": [
1328
- * {
1329
- * "accountId": "string",
1330
- * "addresses": [
1331
- * {
1332
- * "additionalAddress": "string",
1333
- * "address": "string",
1334
- * "billing": true,
1335
- * "city": "string",
1336
- * "company": "string",
1337
- * "country": "string",
1338
- * "externalId": "string",
1339
- * "fullName": "string",
1340
- * "id": "string",
1341
- * "label": "string",
1342
- * "phone": "string",
1343
- * "shipping": true,
1344
- * "state": "string",
1345
- * "zipcode": "string"
1346
- * }
1347
- * ],
1348
- * "children": ["string"],
1349
- * "customFieldValues": [
1350
- * {
1351
- * "customField": {
1352
- * "externalId": "string",
1353
- * "externalSource": "string",
1354
- * "id": "string",
1355
- * "mandatory": true,
1356
- * "name": {
1357
- * "additionalProp1": "string",
1358
- * "additionalProp2": "string",
1359
- * "additionalProp3": "string"
1360
- * },
1361
- * "role": "string",
1362
- * "sealedTarget": "string",
1363
- * "status": "string",
1364
- * "type": "string"
1365
- * },
1366
- * "value": {}
1367
- * }
1368
- * ],
1369
- * "id": "string",
1370
- * "mainOrganisation": true,
1371
- * "name": "string",
1372
- * "status": "ACTIVE"
1373
- * }
1374
- * ],
1375
- * "empty": true,
1376
- * "first": true,
1377
- * "last": true,
1378
- * "number": 0,
1379
- * "numberOfElements": 0,
1380
- * "pageable": {
1381
- * "offset": 0,
1382
- * "pageNumber": 0,
1383
- * "pageSize": 0,
1384
- * "paged": true,
1385
- * "sort": [
1386
- * {
1387
- * "ascending": true,
1388
- * "descending": true,
1389
- * "direction": "ASC",
1390
- * "ignoreCase": true,
1391
- * "nullHandling": "NATIVE",
1392
- * "property": "string"
1393
- * }
1394
- * ],
1395
- * "unpaged": true
1396
- * },
1397
- * "size": 0,
1398
- * "sort": [
1399
- * {
1400
- * "ascending": true,
1401
- * "descending": true,
1402
- * "direction": "ASC",
1403
- * "ignoreCase": true,
1404
- * "nullHandling": "NATIVE",
1405
- * "property": "string"
1406
- * }
1407
- * ],
1408
- * "totalElements": 0,
1409
- * "totalPages": 0
1410
- * }
571
+ * console.log(response);
1411
572
  * ```
1412
573
  */
1413
574
  async function getCustomerAccountOrganisations() {
@@ -1419,38 +580,24 @@ async function getCustomerAccountOrganisations() {
1419
580
  }
1420
581
  /**
1421
582
  * ## Get addresses from a customer account organisation
1422
- * ### APICODE(ACCOUNT-505)
1423
- * @param {GetCustomerAccountOrganisationAddressesParameters} params - The parameters for the function
1424
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1425
583
  *
1426
- * @returns {Promise<GetCustomerAccountOrganisationAddressesResponse>} - The response with the customer account organisation addresses
584
+ * This function retrieves all the addresses associated with a given customer account organisation.
1427
585
  *
1428
- * @example
1429
- * ### input
586
+ * ### API Code: ACCOUNT-505
587
+ *
588
+ * ### **Endpoint**: `GET /v1/shop/customer-accounts/organisations/{organisationId}/addresses`
589
+ *
590
+ * | **Parameter** | **Type** | **Required** | **Description** |
591
+ * |---------------------|------------|--------------|--------------------------------------------------------------------|
592
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation whose addresses are being retrieved. |
593
+ *
594
+ * ### **Returns**:
595
+ * A `Promise<GetCustomerAccountOrganisationAddressesResponse>` containing the list of addresses for the specified customer account organisation.
596
+ *
597
+ * ### **Example Usage**:
1430
598
  * ```typescript
1431
- * const response = await getCustomerAccountOrganisationAddresses({ organisationId: "string" });
1432
- * ```
1433
- * ### output
1434
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1435
- * ```json
1436
- * [
1437
- * {
1438
- * "additionalAddress": "string",
1439
- * "address": "string",
1440
- * "billing": true,
1441
- * "city": "string",
1442
- * "company": "string",
1443
- * "country": "string",
1444
- * "externalId": "string",
1445
- * "fullName": "string",
1446
- * "id": "string",
1447
- * "label": "string",
1448
- * "phone": "string",
1449
- * "shipping": true,
1450
- * "state": "string",
1451
- * "zipcode": "string"
1452
- * }
1453
- * ]
599
+ * const addresses = await getCustomerAccountOrganisationAddresses({ organisationId: "org12345" });
600
+ * console.log(addresses);
1454
601
  * ```
1455
602
  */
1456
603
  async function getCustomerAccountOrganisationAddresses({ organisationId, }) {
@@ -1463,91 +610,86 @@ async function getCustomerAccountOrganisationAddresses({ organisationId, }) {
1463
610
  }
1464
611
  /**
1465
612
  * ## Delete an address from a customer account organisation
1466
- * ### APICODE(ADDRESS-301)
1467
- * @param {DeleteCustomerAccountOrganisationAddressParameters} params - The parameters for the function
1468
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1469
- * #### addressId - `string` | <strong style={{ color: 'red' }}>required</strong>
1470
613
  *
1471
- * @returns {Promise<void>} - The response with the customer account organisation address
614
+ * This function deletes a specific address from a given customer account organisation.
1472
615
  *
1473
- * @example
1474
- * ### input
1475
- * ```typescript
1476
- * const response = await deleteCustomerAccountOrganisationAddress({ organisationId: "string", addressId: "string" });
1477
- * ```
1478
- * ### output
1479
- * Response - <strong style={{ color: 'green' }}>204</strong> - No Content
1480
- * ```json
616
+ * ### API Code: ADDRESS-301
617
+ *
618
+ * ### **Endpoint**: `DELETE /v1/shop/customer-accounts/organisations/{organisationId}/addresses/{addressId}`
619
+ *
620
+ * | **Parameter** | **Type** | **Required** | **Description** |
621
+ * |---------------------|------------|--------------|---------------------------------------------------------------------|
622
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation from which the address will be deleted. |
623
+ * | `addressId` | `string` | ✅ | The unique identifier of the address to delete. |
624
+ *
625
+ * ### **Returns**:
626
+ * A `Promise<void>` that resolves when the address is successfully deleted.
1481
627
  *
628
+ * ### **Example Usage**:
629
+ * ```typescript
630
+ * await deleteCustomerAccountOrganisationAddress({
631
+ * organisationId: "org12345",
632
+ * addressId: "addr67890",
633
+ * });
634
+ * console.log('Address deleted successfully.');
1482
635
  * ```
1483
636
  */
1484
637
  async function deleteCustomerAccountOrganisationAddress({ organisationId, addressId, }) {
1485
638
  (0, parameters_validation_1.required)({ organisationId, addressId });
1486
- (0, fetch_instance_1.enhancedFetch)({
639
+ await (0, fetch_instance_1.enhancedFetch)({
1487
640
  method: "DELETE",
1488
641
  path: `/v1/shop/customer-accounts/organisations/${organisationId}/addresses/${addressId}`,
1489
642
  });
1490
643
  }
1491
644
  /**
1492
645
  * ## Update an address from a customer account organisation
1493
- * ### APICODE(ADDRESS-201)
1494
- * @param {UpdateCustomerAccountOrganisationAddressParameters} params - The parameters for the function
1495
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1496
- * #### addressId - `string` | <strong style={{ color: 'red' }}>required</strong>
1497
- * #### additionalAddress - `string`
1498
- * #### address - `string`
1499
- * #### billing - `boolean`
1500
- * #### city - `string`
1501
- * #### company - `string`
1502
- * #### country - `string`
1503
- * #### fullName - `string`
1504
- * #### label - `string`
1505
- * #### phone - `string`
1506
- * #### shipping - `boolean`
1507
- * #### state - `string`
1508
- * #### zipcode - `string`
1509
- *
1510
- * @returns {Promise<UpdateCustomerAccountOrganisationAddressResponse>} - The response with the customer account organisation address
1511
- *
1512
- * @example
1513
- * ### input
646
+ *
647
+ * This function allows updating an existing address within a customer account organisation.
648
+ *
649
+ * ### API Code: ADDRESS-201
650
+ *
651
+ * ### **Endpoint**: `PUT /v1/shop/customer-accounts/organisations/{organisationId}/addresses/{addressId}`
652
+ *
653
+ * | **Parameter** | **Type** | **Required** | **Description** |
654
+ * |----------------------|------------|--------------|-------------------------------------------------------------------|
655
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation containing the address. |
656
+ * | `addressId` | `string` | ✅ | The unique identifier of the address to be updated. |
657
+ * | `additionalAddress` | `string` | ❌ | Additional address information (optional). |
658
+ * | `address` | `string` | ❌ | The street address (optional). |
659
+ * | `billing` | `boolean` | ❌ | Whether the address is for billing purposes (optional). |
660
+ * | `city` | `string` | ❌ | The city of the address (optional). |
661
+ * | `company` | `string` | ❌ | The company associated with the address (optional). |
662
+ * | `country` | `string` | ❌ | The country of the address (optional). |
663
+ * | `fullName` | `string` | ❌ | The full name of the person associated with the address (optional).|
664
+ * | `label` | `string` | ❌ | A label for the address (optional). |
665
+ * | `phone` | `string` | ❌ | The phone number associated with the address (optional). |
666
+ * | `shipping` | `boolean` | ❌ | Whether the address is for shipping purposes (optional). |
667
+ * | `state` | `string` | ❌ | The state or region of the address (optional). |
668
+ * | `zipcode` | `string` | ❌ | The postal code for the address (optional). |
669
+ *
670
+ * ### **Returns**:
671
+ * A `Promise<UpdateCustomerAccountOrganisationAddressResponse>` containing the updated address data.
672
+ *
673
+ * ### **Example Usage**:
1514
674
  * ```typescript
1515
675
  * const response = await updateCustomerAccountOrganisationAddress({
1516
- * organisationId: "string",
1517
- * addressId: "string",
1518
- * additionalAddress: "string",
1519
- * address: "string",
676
+ * organisationId: "org12345",
677
+ * addressId: "address12345",
678
+ * additionalAddress: "Suite 5",
679
+ * address: "123 Main St",
1520
680
  * billing: true,
1521
- * city: "string",
1522
- * company: "string",
1523
- * country: "string",
1524
- * fullName: "string",
1525
- * label: "string",
1526
- * phone: "string",
681
+ * city: "New York",
682
+ * company: "Company Name",
683
+ * country: "USA",
684
+ * fullName: "John Doe",
685
+ * label: "Primary Address",
686
+ * phone: "+123456789",
1527
687
  * shipping: true,
1528
- * state: "string",
1529
- * zipcode: "string"
688
+ * state: "NY",
689
+ * zipcode: "10001"
1530
690
  * });
1531
- * ```
1532
- * ### output
1533
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1534
- * ```json
1535
- * {
1536
- * "additionalAddress": "string",
1537
- * "address": "string",
1538
- * "billing": true,
1539
- * "city": "string",
1540
- * "company": "string",
1541
- * "country": "string",
1542
- * "externalId": "string",
1543
- * "fullName": "string",
1544
- * "id": "string",
1545
- * "label": "string",
1546
- * "phone": "string",
1547
- * "shipping": true,
1548
- * "state": "string",
1549
- * "zipcode": "string"
1550
- * }
691
+ *
692
+ * console.log(response);
1551
693
  * ```
1552
694
  */
1553
695
  async function updateCustomerAccountOrganisationAddress({ organisationId, addressId, additionalAddress, address, billing, city, company, country, fullName, label, phone, shipping, state, zipcode, }) {
@@ -1573,367 +715,32 @@ async function updateCustomerAccountOrganisationAddress({ organisationId, addres
1573
715
  return data;
1574
716
  }
1575
717
  /**
1576
- * ##Get orders from a customer account organisation
1577
- * ### APICODE(ORDER-555)
1578
- * @param {GetCustomerAccountOrganisationOrdersParameters} params - The parameters for the function
1579
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1580
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
1581
- * #### locale - `string` | <strong style={{ color: 'red' }}>required</strong>
718
+ * ## Get orders from a customer account organisation
719
+ *
720
+ * This function retrieves the orders associated with a specific customer account organisation.
721
+ *
722
+ * ### API Code: ORDER-555
723
+ *
724
+ * ### **Endpoint**: `GET /v1/shop/customer-accounts/organisations/{organisationId}/orders`
1582
725
  *
1583
- * @returns {Promise<GetCustomerAccountOrganisationOrdersResponse>} - The response with the customer account organisation orders
726
+ * | **Parameter** | **Type** | **Required** | **Description** |
727
+ * |----------------------|------------|--------------|---------------------------------------------------------------------------|
728
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation whose orders need to be fetched. |
729
+ * | `pageable` | `object` | ✅ | The pagination parameters for the orders (e.g., page, size, sort). |
730
+ * | `locale` | `string` | ✅ | The locale for the response (e.g., "en_US"). |
1584
731
  *
1585
- * @example
1586
- * ### input
732
+ * ### **Returns**:
733
+ * A `Promise<GetCustomerAccountOrganisationOrdersResponse>` containing the list of orders for the organisation.
734
+ *
735
+ * ### **Example Usage**:
1587
736
  * ```typescript
1588
- * const response = await getCustomerAccountOrganisationOrders({ organisationId: "string", pageable: { page: 1, size: 10 }, locale: "string" });
1589
- * ```
1590
- * ### output
1591
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1592
- * ```json
1593
- * {
1594
- * "content": [
1595
- * {
1596
- * "billingAddressSnapshot": {
1597
- * "additionalAddress": "string",
1598
- * "address": "string",
1599
- * "city": "string",
1600
- * "company": "string",
1601
- * "country": "string",
1602
- * "externalId": "string",
1603
- * "fullName": "string",
1604
- * "id": "string",
1605
- * "label": "string",
1606
- * "phone": "string",
1607
- * "state": "string",
1608
- * "zipcode": "string"
1609
- * },
1610
- * "channel": "DESKTOP",
1611
- * "createdAt": "2024-12-11T10:28:21.123Z",
1612
- * "customFieldValues": [
1613
- * {
1614
- * "customField": {
1615
- * "externalId": "string",
1616
- * "externalSource": "MIRAKL",
1617
- * "faceted": true,
1618
- * "id": "string",
1619
- * "indexable": true,
1620
- * "mandatory": true,
1621
- * "name": {
1622
- * "additionalProp1": "string",
1623
- * "additionalProp2": "string",
1624
- * "additionalProp3": "string"
1625
- * },
1626
- * "role": "PRODUCT_TAX_RATE",
1627
- * "sealedTarget": "string",
1628
- * "searchable": true,
1629
- * "sortable": true,
1630
- * "status": "ACTIVE"
1631
- * },
1632
- * "value": {}
1633
- * }
1634
- * ],
1635
- * "customerUserSnapshot": {
1636
- * "accountExternalId": "string",
1637
- * "accountId": "string",
1638
- * "accountName": "string",
1639
- * "accountTvaNumber": "string",
1640
- * "civility": "MR",
1641
- * "email": "string",
1642
- * "externalId": "string",
1643
- * "firstName": "string",
1644
- * "id": "string",
1645
- * "lastName": "string",
1646
- * "phone": "string"
1647
- * },
1648
- * "exportStatus": "EXPORTED",
1649
- * "externalId": "string",
1650
- * "externalSource": "MIRAKL",
1651
- * "fulfillmentMessage": "string",
1652
- * "id": "string",
1653
- * "incidentDeclared": true,
1654
- * "initialPrice": {
1655
- * "priceWithTax": 0,
1656
- * "priceWithoutTax": 0,
1657
- * "shippingPriceWithTax": 0,
1658
- * "shippingPriceWithoutTax": 0,
1659
- * "totalPriceWithTax": 0,
1660
- * "totalPriceWithoutTax": 0
1661
- * },
1662
- * "leadTimeToShip": 0,
1663
- * "lines": [
1664
- * {
1665
- * "confirmedQuantity": 0,
1666
- * "customFieldValues": [
1667
- * {
1668
- * "customField": {
1669
- * "externalId": "string",
1670
- * "externalSource": "MIRAKL",
1671
- * "faceted": true,
1672
- * "id": "string",
1673
- * "indexable": true,
1674
- * "mandatory": true,
1675
- * "name": {
1676
- * "additionalProp1": "string",
1677
- * "additionalProp2": "string",
1678
- * "additionalProp3": "string"
1679
- * },
1680
- * "role": "PRODUCT_TAX_RATE",
1681
- * "sealedTarget": "string",
1682
- * "searchable": true,
1683
- * "sortable": true,
1684
- * "status": "ACTIVE"
1685
- * },
1686
- * "value": {}
1687
- * }
1688
- * ],
1689
- * "externalId": "string",
1690
- * "externalSource": "MIRAKL",
1691
- * "id": "string",
1692
- * "incidentDeclared": true,
1693
- * "offerInventorySnapshotDto": {
1694
- * "currency": "USD",
1695
- * "customFieldValueSnapshots": [
1696
- * {
1697
- * "customFieldSnapshotDto": {
1698
- * "externalId": "string",
1699
- * "externalSource": "string",
1700
- * "mandatory": true,
1701
- * "names": {
1702
- * "additionalProp1": "string",
1703
- * "additionalProp2": "string",
1704
- * "additionalProp3": "string"
1705
- * },
1706
- * "role": "string",
1707
- * "sealedTarget": "string",
1708
- * "status": "string",
1709
- * "type": "string"
1710
- * },
1711
- * "value": "string"
1712
- * }
1713
- * ],
1714
- * "externalSource": "MIRAKL",
1715
- * "offerInventoryExternalId": "string",
1716
- * "packingType": "BOX",
1717
- * "productTaxCode": "string",
1718
- * "productTaxRate": 0,
1719
- * "quantityPerItem": 0,
1720
- * "shippingTaxCode": "string",
1721
- * "shippingTaxRate": 0
1722
- * },
1723
- * "offerPriceSnapshotDto": {
1724
- * "confirmedProductPriceWithoutTaxes": 0,
1725
- * "itemPerPack": 0,
1726
- * "offerPriceExternalId": "string",
1727
- * "offerPriceType": "PUBLIC",
1728
- * "offerPriceTypeValue": "string",
1729
- * "productPriceWithTaxes": 0,
1730
- * "productPriceWithoutTaxes": 0,
1731
- * "productTaxAmount": 0,
1732
- * "shippingPriceWithTaxes": 0,
1733
- * "shippingPriceWithoutTaxes": 0,
1734
- * "shippingTaxAmount": 0,
1735
- * "totalPriceWithTaxes": 0,
1736
- * "totalPriceWithoutTaxes": 0,
1737
- * "totalProductPriceWithTaxes": 0,
1738
- * "totalProductPriceWithoutTaxes": 0,
1739
- * "totalProductTaxAmount": 0,
1740
- * "totalTaxAmount": 0
1741
- * },
1742
- * "orderLogisticLinePriceDto": {
1743
- * "confirmedPrice": 0,
1744
- * "currency": "USD",
1745
- * "externalOfferId": "string",
1746
- * "externalSource": "MIRAKL",
1747
- * "itemPerPack": 0,
1748
- * "itemPriceWithoutTaxes": 0,
1749
- * "packingType": "BOX",
1750
- * "priceWithTaxes": 0,
1751
- * "quantityPerItem": 0,
1752
- * "shippingPriceWithTaxes": 0,
1753
- * "shippingPriceWithoutTaxes": 0,
1754
- * "shippingTaxAmount": 0,
1755
- * "taxAmount": 0,
1756
- * "taxInformation": {
1757
- * "productTaxAmount": 0,
1758
- * "productTaxCode": "string",
1759
- * "productTaxRate": 0,
1760
- * "shippingTaxAmount": 0,
1761
- * "shippingTaxCode": "string",
1762
- * "shippingTaxRate": 0
1763
- * },
1764
- * "taxRate": 0,
1765
- * "totalItemPrice": 0,
1766
- * "totalItemPriceWithTaxes": 0,
1767
- * "totalItemTaxAmount": 0,
1768
- * "totalPriceWithTaxes": 0,
1769
- * "totalPriceWithoutTaxes": 0,
1770
- * "totalTaxes": 0,
1771
- * "type": "PUBLIC",
1772
- * "typeValue": "string"
1773
- * },
1774
- * "orderLogisticLineProductDto": {
1775
- * "brand": "string",
1776
- * "classificationCategory": "string",
1777
- * "defaultLanguage": "EN",
1778
- * "description": "string",
1779
- * "externalId": "string",
1780
- * "externalSource": "MIRAKL",
1781
- * "name": "string",
1782
- * "productAttributeValues": [
1783
- * {
1784
- * "attributeExternalId": "string",
1785
- * "attributeExternalSource": "string",
1786
- * "attributeId": "string",
1787
- * "attributeName": {
1788
- * "additionalProp1": "string",
1789
- * "additionalProp2": "string",
1790
- * "additionalProp3": "string"
1791
- * },
1792
- * "attributeType": "string",
1793
- * "attributeValue": "string",
1794
- * "id": "string"
1795
- * }
1796
- * ],
1797
- * "productUnit": "string",
1798
- * "sku": "string",
1799
- * "tags": [
1800
- * "string"
1801
- * ]
1802
- * },
1803
- * "orderLogisticLineProductVariantDto": {
1804
- * "attributeValues": [
1805
- * {
1806
- * "attributeExternalId": "string",
1807
- * "attributeExternalSource": "string",
1808
- * "attributeId": "string",
1809
- * "attributeName": {
1810
- * "additionalProp1": "string",
1811
- * "additionalProp2": "string",
1812
- * "additionalProp3": "string"
1813
- * },
1814
- * "attributeType": "string",
1815
- * "attributeValue": "string",
1816
- * "id": "string"
1817
- * }
1818
- * ],
1819
- * "description": "string",
1820
- * "ean": "string",
1821
- * "externalId": "string",
1822
- * "externalSource": "MIRAKL",
1823
- * "mainImageUrl": "string",
1824
- * "mpn": "string",
1825
- * "name": "string",
1826
- * "productMediaInfoDTOS": [
1827
- * {
1828
- * "isMain": true,
1829
- * "urls": [
1830
- * {
1831
- * "formatType": "string",
1832
- * "heightInPx": 0,
1833
- * "sizeType": "string",
1834
- * "url": "string",
1835
- * "widthInPx": 0
1836
- * }
1837
- * ]
1838
- * }
1839
- * ],
1840
- * "sku": "string"
1841
- * },
1842
- * "paymentStatus": "WAITING_REFUND",
1843
- * "quantity": 0,
1844
- * "quoteLineExternalId": "string",
1845
- * "status": "CANCELED"
1846
- * }
1847
- * ],
1848
- * "orderCommercialId": "string",
1849
- * "orderCommercialReference": "string",
1850
- * "orderLogisticPrices": {
1851
- * "currency": "USD",
1852
- * "totalPriceWithTax": 0,
1853
- * "totalPriceWithoutTax": 0,
1854
- * "totalProductTaxAmount": 0,
1855
- * "totalProductWithTax": 0,
1856
- * "totalProductWithoutTax": 0,
1857
- * "totalShippingFeesWithTax": 0,
1858
- * "totalShippingFeesWithoutTax": 0,
1859
- * "totalShippingTaxAmount": 0,
1860
- * "totalTaxAmount": 0
1861
- * },
1862
- * "orderOrigin": "CART",
1863
- * "partiallyDeclinedBySupplier": true,
1864
- * "paymentOption": "BANK_WIRE",
1865
- * "paymentStatus": "AUTHORIZED",
1866
- * "reference": "string",
1867
- * "shippingAddressSnapshot": {
1868
- * "additionalAddress": "string",
1869
- * "address": "string",
1870
- * "city": "string",
1871
- * "company": "string",
1872
- * "country": "string",
1873
- * "externalId": "string",
1874
- * "fullName": "string",
1875
- * "id": "string",
1876
- * "label": "string",
1877
- * "phone": "string",
1878
- * "state": "string",
1879
- * "zipcode": "string"
1880
- * },
1881
- * "shippingTrackingUrl": "string",
1882
- * "shippingType": "string",
1883
- * "status": "CREATING",
1884
- * "supplierSnapshot": {
1885
- * "description": "string",
1886
- * "externalId": "string",
1887
- * "id": "string",
1888
- * "name": "string",
1889
- * "paymentDueDate": {
1890
- * "paymentDueDateDelay": 0,
1891
- * "paymentDueDateMode": "SIMPLE"
1892
- * },
1893
- * "returnPolicy": "string",
1894
- * "totalOffers": 0,
1895
- * "totalOrders": 0
1896
- * },
1897
- * "updatedAt": "2024-12-11T10:28:21.124Z",
1898
- * "validatedAt": "2024-12-11T10:28:21.124Z"
1899
- * }
1900
- * ],
1901
- * "empty": true,
1902
- * "first": true,
1903
- * "last": true,
1904
- * "number": 0,
1905
- * "numberOfElements": 0,
1906
- * "pageable": {
1907
- * "offset": 0,
1908
- * "pageNumber": 0,
1909
- * "pageSize": 0,
1910
- * "paged": true,
1911
- * "sort": [
1912
- * {
1913
- * "ascending": true,
1914
- * "descending": true,
1915
- * "direction": "ASC",
1916
- * "ignoreCase": true,
1917
- * "nullHandling": "NATIVE",
1918
- * "property": "string"
1919
- * }
1920
- * ],
1921
- * "unpaged": true
1922
- * },
1923
- * "size": 0,
1924
- * "sort": [
1925
- * {
1926
- * "ascending": true,
1927
- * "descending": true,
1928
- * "direction": "ASC",
1929
- * "ignoreCase": true,
1930
- * "nullHandling": "NATIVE",
1931
- * "property": "string"
1932
- * }
1933
- * ],
1934
- * "totalElements": 0,
1935
- * "totalPages": 0
1936
- * }
737
+ * const response = await getCustomerAccountOrganisationOrders({
738
+ * organisationId: "org12345",
739
+ * pageable: { page: 1, size: 10, sort: [{ property: "createdAt", direction: "DESC" }] },
740
+ * locale: "en_US"
741
+ * });
742
+ *
743
+ * console.log(response);
1937
744
  * ```
1938
745
  */
1939
746
  async function getCustomerAccountOrganisationOrders({ organisationId, pageable, locale, }) {
@@ -1953,72 +760,29 @@ async function getCustomerAccountOrganisationOrders({ organisationId, pageable,
1953
760
  }
1954
761
  /**
1955
762
  * ## Get users from a customer account organisation
1956
- * ### APICODE(ACCOUNT-504)
1957
- * @param {GetCustomerAccountOrganisationUsersParameters} params - The parameters for the function
1958
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
1959
- * #### pageable - `object` | <strong style={{ color: 'red' }}>required</strong>
1960
763
  *
1961
- * @returns {Promise<GetCustomerAccountOrganisationUsersResponse>} - The response with the customer account organisation users
764
+ * This function retrieves the list of users associated with a specific customer account organisation.
765
+ *
766
+ * ### API Code: ACCOUNT-504
767
+ *
768
+ * ### **Endpoint**: `GET /v1/shop/customer-accounts/organisations/{organisationId}/users`
769
+ *
770
+ * | **Parameter** | **Type** | **Required** | **Description** |
771
+ * |----------------------|------------|--------------|---------------------------------------------------------------------------|
772
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation whose users need to be fetched. |
773
+ * | `pageable` | `object` | ✅ | The pagination parameters for the users (e.g., page, size, sort). |
1962
774
  *
1963
- * @example
1964
- * ### input
775
+ * ### **Returns**:
776
+ * A `Promise<GetCustomerAccountOrganisationUsersResponse>` containing the list of users for the organisation.
777
+ *
778
+ * ### **Example Usage**:
1965
779
  * ```typescript
1966
- * const response = await getCustomerAccountOrganisationUsers({ organisationId: "string", pageable: { page: 1, size: 10 }, locale: "string" });
1967
- * ```
1968
- * ### output
1969
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
1970
- * ```json
1971
- * {
1972
- * "content": [
1973
- * {
1974
- * "civility": "MR",
1975
- * "createdAt": "2024-12-11T10:28:21.123Z",
1976
- * "firstName": "string",
1977
- * "groups": [
1978
- * "string"
1979
- * ],
1980
- * "id": "string",
1981
- * "lastName": "string",
1982
- * "phone": "string",
1983
- * "status": "ACTIVE",
1984
- * }
1985
- * ],
1986
- * "empty": true,
1987
- * "first": true,
1988
- * "last": true,
1989
- * "number": 0,
1990
- * "numberOfElements": 0,
1991
- * "pageable": {
1992
- * "offset": 0,
1993
- * "pageNumber": 0,
1994
- * "pageSize": 0,
1995
- * "paged": true,
1996
- * "sort": [
1997
- * {
1998
- * "ascending": true,
1999
- * "descending": true,
2000
- * "direction": "ASC",
2001
- * "ignoreCase": true,
2002
- * "nullHandling": "NATIVE",
2003
- * "property": "string"
2004
- * }
2005
- * ],
2006
- * "unpaged": true
2007
- * },
2008
- * "size": 0,
2009
- * "sort": [
2010
- * {
2011
- * "ascending": true,
2012
- * "descending": true,
2013
- * "direction": "ASC",
2014
- * "ignoreCase": true,
2015
- * "nullHandling": "NATIVE",
2016
- * "property": "string"
2017
- * }
2018
- * ],
2019
- * "totalElements": 0,
2020
- * "totalPages": 0
2021
- * }
780
+ * const response = await getCustomerAccountOrganisationUsers({
781
+ * organisationId: "org12345",
782
+ * pageable: { page: 1, size: 10, sort: [{ property: "createdAt", direction: "DESC" }] },
783
+ * });
784
+ *
785
+ * console.log(response);
2022
786
  * ```
2023
787
  */
2024
788
  async function getCustomerAccountOrganisationUsers({ organisationId, pageable, }) {
@@ -2037,44 +801,44 @@ async function getCustomerAccountOrganisationUsers({ organisationId, pageable, }
2037
801
  }
2038
802
  /**
2039
803
  * ## Update a customer account organisation user
2040
- * ### APICODE(ACCOUNT-202)
2041
- * @param {UpdateCustomerAccountOrganisationUserParameters} params - The parameters for the function
2042
- * #### organisationId - `string` | <strong style={{ color: 'red' }}>required</strong>
2043
- * #### customerUserId - `string` | <strong style={{ color: 'red' }}>required</strong>
2044
- * #### civility - `string`
2045
- * #### customFieldValues - `object[]`
2046
- * #### firstName - `string`
2047
- * #### lastName - `string`
2048
- * #### phone - `string`
2049
- *
2050
- * @returns {Promise<UpdateCustomerAccountOrganisationUserResponse>} - The response with the updated customer account organisation user
2051
- *
2052
- * @example
2053
- * ### input
804
+ *
805
+ * This function updates the details of a specific user within a customer account organisation.
806
+ *
807
+ * ### API Code: ACCOUNT-202
808
+ *
809
+ * ### **Endpoint**: `PUT /v1/shop/customer-accounts/organisations/{organisationId}/users/{customerUserId}`
810
+ *
811
+ * | **Parameter** | **Type** | **Required** | **Description** |
812
+ * |-------------------------|-------------|--------------|---------------------------------------------------------------------------------|
813
+ * | `organisationId` | `string` | ✅ | The unique identifier of the organisation. |
814
+ * | `customerUserId` | `string` | ✅ | The unique identifier of the user to update. |
815
+ * | `civility` | `string` | ❌ | Civility of the user (e.g., "MR", "MRS"). |
816
+ * | `customFieldValues` | `object[]` | ❌ | Array of custom field values for the user. |
817
+ * | `firstName` | `string` | ❌ | First name of the user. |
818
+ * | `lastName` | `string` | ❌ | Last name of the user. |
819
+ * | `phone` | `string` | ❌ | Phone number of the user. |
820
+ *
821
+ * ### **Returns**:
822
+ * A `Promise<UpdateCustomerAccountOrganisationUserResponse>` containing the details of the updated user.
823
+ *
824
+ * ### **Example Usage**:
2054
825
  * ```typescript
2055
826
  * const response = await updateCustomerAccountOrganisationUser({
2056
- * organisationId: "string",
2057
- * customerUserId: "string",
827
+ * organisationId: "org12345",
828
+ * customerUserId: "user67890",
2058
829
  * civility: "MR",
2059
830
  * customFieldValues: [
2060
831
  * {
2061
- * customFieldId: "string",
2062
- * customFieldValue: "string"
832
+ * customFieldId: "custom123",
833
+ * customFieldValue: "value123"
2063
834
  * }
2064
835
  * ],
2065
- * firstName: "string",
2066
- * lastName: "string",
2067
- * phone: "string"
836
+ * firstName: "John",
837
+ * lastName: "Doe",
838
+ * phone: "+1234567890"
2068
839
  * });
2069
- * ```
2070
- * ### output
2071
- * Response - <strong style={{ color: 'green' }}>200</strong> - OK
2072
- * ```json
2073
- * {
2074
- * createdAt: "2024-12-11T10:28:21.123Z",
2075
- * id: "string",
2076
- * updatedAt: "2024-12-11T10:28:21.123Z"
2077
- * }
840
+ *
841
+ * console.log(response);
2078
842
  * ```
2079
843
  */
2080
844
  async function updateCustomerAccountOrganisationUser({ organisationId, customerUserId, civility, customFieldValues, firstName, lastName, phone, }) {