@djust-b2b/djust-front-sdk 2.2.0 → 2.3.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.
|
@@ -48,7 +48,7 @@ export declare function getCustomerAccountV2(pageable: PageableParameters): Prom
|
|
|
48
48
|
*
|
|
49
49
|
* This function allows the creation of a new customer account with relevant details including addresses, user information, and custom fields.
|
|
50
50
|
*
|
|
51
|
-
* 🛠 **Endpoint**: `POST /v1/shop/customer-accounts`
|
|
51
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-accounts` [ACCOUNT-100]
|
|
52
52
|
*
|
|
53
53
|
* | Parameter | Type | Required | Description |
|
|
54
54
|
* |-----------------------------------|--------------------------------|----------|-------------|
|
|
@@ -58,82 +58,59 @@ export declare function getCustomerAccountV2(pageable: PageableParameters): Prom
|
|
|
58
58
|
* | `customFieldValues` | `object[]` | ✅ | List of custom fields with their `customFieldId` and `customFieldValue`. |
|
|
59
59
|
* | `customerTagList` | `string[]` | ✅ | List of customer tags. |
|
|
60
60
|
* | `fromFO` | `boolean` | ✅ | Flag indicating if the account is created from the front-office (FO). |
|
|
61
|
-
* | `legalUser` | `object
|
|
62
|
-
|
|
61
|
+
* | `legalUser` | `object` | ✅ | Information about the legal user including `birthday`, `countryOfResidence`, `email`, `firstName`, `lastName`, and `nationality`. |
|
|
62
|
+
*
|
|
63
63
|
* 📤 **Returns**:
|
|
64
64
|
* A `Promise<CreateCustomerAccountResponse>` containing the details of the created customer account.
|
|
65
65
|
*
|
|
66
66
|
* 🛠 **Example usage**:
|
|
67
67
|
* ```ts
|
|
68
68
|
* const response = await createCustomerAccount({
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* accountManager: "string",
|
|
109
|
-
* businessRegistrationNumber: "string",
|
|
110
|
-
* companyRegistrationName: "string",
|
|
111
|
-
* externalId: "string",
|
|
112
|
-
* name: "string",
|
|
113
|
-
* vatNumber: "string",
|
|
114
|
-
* website: "string"
|
|
115
|
-
* },
|
|
116
|
-
* customFieldValues: [
|
|
117
|
-
* {
|
|
118
|
-
* customFieldId: "string",
|
|
119
|
-
* customFieldValue: "value"
|
|
120
|
-
* }
|
|
121
|
-
* ],
|
|
122
|
-
* customerTagList: ["tag1", "tag2"],
|
|
123
|
-
* fromFO: true,
|
|
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
|
-
* ],
|
|
69
|
+
* createAddressRequests: [
|
|
70
|
+
* {
|
|
71
|
+
* address: "123 Main Street",
|
|
72
|
+
* city: "Paris",
|
|
73
|
+
* country: "FR",
|
|
74
|
+
* billing: true,
|
|
75
|
+
* shipping: true,
|
|
76
|
+
* fullName: "John Doe",
|
|
77
|
+
* zipcode: "75001"
|
|
78
|
+
* }
|
|
79
|
+
* ],
|
|
80
|
+
* createCustomerUserRequest: {
|
|
81
|
+
* email: "john.doe@example.com",
|
|
82
|
+
* firstName: "John",
|
|
83
|
+
* lastName: "Doe",
|
|
84
|
+
* password: "securePassword123",
|
|
85
|
+
* phone: "+33123456789"
|
|
86
|
+
* },
|
|
87
|
+
* createObjectCustomerAccountRequest: {
|
|
88
|
+
* name: "Acme Corporation",
|
|
89
|
+
* externalId: "acme-corp-001",
|
|
90
|
+
* vatNumber: "FR12345678901"
|
|
91
|
+
* },
|
|
92
|
+
* customFieldValues: [
|
|
93
|
+
* {
|
|
94
|
+
* customFieldId: "industry",
|
|
95
|
+
* customFieldValue: "technology"
|
|
96
|
+
* }
|
|
97
|
+
* ],
|
|
98
|
+
* customerTagList: ["premium", "enterprise"],
|
|
99
|
+
* fromFO: true,
|
|
100
|
+
* legalUser: {
|
|
101
|
+
* birthday: "1990-01-01T00:00:00.000Z",
|
|
102
|
+
* countryOfResidence: "FR",
|
|
103
|
+
* email: "john.doe@example.com",
|
|
104
|
+
* firstName: "John",
|
|
105
|
+
* lastName: "Doe",
|
|
106
|
+
* nationality: "FR"
|
|
107
|
+
* }
|
|
135
108
|
* });
|
|
136
109
|
* ```
|
|
110
|
+
*
|
|
111
|
+
* @param {CreateCustomerAccountParameters} params - The parameters for creating a customer account
|
|
112
|
+
* @throws {Error} If required parameters are missing
|
|
113
|
+
* @returns {Promise<CreateCustomerAccountResponse>} A promise resolving to the response containing the created customer account
|
|
137
114
|
*/
|
|
138
115
|
export declare function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, ...config }: CreateCustomerAccountParameters & DjustConfig): Promise<CreateCustomerAccountResponse>;
|
|
139
116
|
/**
|
|
@@ -88,7 +88,7 @@ async function getCustomerAccountV2(pageable) {
|
|
|
88
88
|
*
|
|
89
89
|
* This function allows the creation of a new customer account with relevant details including addresses, user information, and custom fields.
|
|
90
90
|
*
|
|
91
|
-
* 🛠 **Endpoint**: `POST /v1/shop/customer-accounts`
|
|
91
|
+
* 🛠 **Endpoint**: `POST /v1/shop/customer-accounts` [ACCOUNT-100]
|
|
92
92
|
*
|
|
93
93
|
* | Parameter | Type | Required | Description |
|
|
94
94
|
* |-----------------------------------|--------------------------------|----------|-------------|
|
|
@@ -98,82 +98,59 @@ async function getCustomerAccountV2(pageable) {
|
|
|
98
98
|
* | `customFieldValues` | `object[]` | ✅ | List of custom fields with their `customFieldId` and `customFieldValue`. |
|
|
99
99
|
* | `customerTagList` | `string[]` | ✅ | List of customer tags. |
|
|
100
100
|
* | `fromFO` | `boolean` | ✅ | Flag indicating if the account is created from the front-office (FO). |
|
|
101
|
-
* | `legalUser` | `object
|
|
102
|
-
|
|
101
|
+
* | `legalUser` | `object` | ✅ | Information about the legal user including `birthday`, `countryOfResidence`, `email`, `firstName`, `lastName`, and `nationality`. |
|
|
102
|
+
*
|
|
103
103
|
* 📤 **Returns**:
|
|
104
104
|
* A `Promise<CreateCustomerAccountResponse>` containing the details of the created customer account.
|
|
105
105
|
*
|
|
106
106
|
* 🛠 **Example usage**:
|
|
107
107
|
* ```ts
|
|
108
108
|
* const response = await createCustomerAccount({
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* accountManager: "string",
|
|
149
|
-
* businessRegistrationNumber: "string",
|
|
150
|
-
* companyRegistrationName: "string",
|
|
151
|
-
* externalId: "string",
|
|
152
|
-
* name: "string",
|
|
153
|
-
* vatNumber: "string",
|
|
154
|
-
* website: "string"
|
|
155
|
-
* },
|
|
156
|
-
* customFieldValues: [
|
|
157
|
-
* {
|
|
158
|
-
* customFieldId: "string",
|
|
159
|
-
* customFieldValue: "value"
|
|
160
|
-
* }
|
|
161
|
-
* ],
|
|
162
|
-
* customerTagList: ["tag1", "tag2"],
|
|
163
|
-
* fromFO: true,
|
|
164
|
-
* legalUser: [
|
|
165
|
-
* {
|
|
166
|
-
* birthday: "2024-12-11T09:46:27.656Z",
|
|
167
|
-
* countryOfResidence: "FR",
|
|
168
|
-
* email: "user@example.com",
|
|
169
|
-
* firstName: "John",
|
|
170
|
-
* id: "userId",
|
|
171
|
-
* lastName: "Doe",
|
|
172
|
-
* nationality: "FR"
|
|
173
|
-
* }
|
|
174
|
-
* ],
|
|
109
|
+
* createAddressRequests: [
|
|
110
|
+
* {
|
|
111
|
+
* address: "123 Main Street",
|
|
112
|
+
* city: "Paris",
|
|
113
|
+
* country: "FR",
|
|
114
|
+
* billing: true,
|
|
115
|
+
* shipping: true,
|
|
116
|
+
* fullName: "John Doe",
|
|
117
|
+
* zipcode: "75001"
|
|
118
|
+
* }
|
|
119
|
+
* ],
|
|
120
|
+
* createCustomerUserRequest: {
|
|
121
|
+
* email: "john.doe@example.com",
|
|
122
|
+
* firstName: "John",
|
|
123
|
+
* lastName: "Doe",
|
|
124
|
+
* password: "securePassword123",
|
|
125
|
+
* phone: "+33123456789"
|
|
126
|
+
* },
|
|
127
|
+
* createObjectCustomerAccountRequest: {
|
|
128
|
+
* name: "Acme Corporation",
|
|
129
|
+
* externalId: "acme-corp-001",
|
|
130
|
+
* vatNumber: "FR12345678901"
|
|
131
|
+
* },
|
|
132
|
+
* customFieldValues: [
|
|
133
|
+
* {
|
|
134
|
+
* customFieldId: "industry",
|
|
135
|
+
* customFieldValue: "technology"
|
|
136
|
+
* }
|
|
137
|
+
* ],
|
|
138
|
+
* customerTagList: ["premium", "enterprise"],
|
|
139
|
+
* fromFO: true,
|
|
140
|
+
* legalUser: {
|
|
141
|
+
* birthday: "1990-01-01T00:00:00.000Z",
|
|
142
|
+
* countryOfResidence: "FR",
|
|
143
|
+
* email: "john.doe@example.com",
|
|
144
|
+
* firstName: "John",
|
|
145
|
+
* lastName: "Doe",
|
|
146
|
+
* nationality: "FR"
|
|
147
|
+
* }
|
|
175
148
|
* });
|
|
176
149
|
* ```
|
|
150
|
+
*
|
|
151
|
+
* @param {CreateCustomerAccountParameters} params - The parameters for creating a customer account
|
|
152
|
+
* @throws {Error} If required parameters are missing
|
|
153
|
+
* @returns {Promise<CreateCustomerAccountResponse>} A promise resolving to the response containing the created customer account
|
|
177
154
|
*/
|
|
178
155
|
async function createCustomerAccount({ createAddressRequests, createCustomerUserRequest, createObjectCustomerAccountRequest, customFieldValues, customerTagList, fromFO, legalUser, ...config }) {
|
|
179
156
|
(0, parameters_validation_1.required)({
|