commerce-sdk-isomorphic 3.4.0 → 4.0.1-preview-shopper-test.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.
Files changed (86) hide show
  1. package/README.md +88 -10
  2. package/lib/clientConfig.cjs.d.ts +52 -0
  3. package/lib/clientConfig.cjs.js +1 -0
  4. package/lib/clientConfig.d.ts +52 -0
  5. package/lib/clientConfig.js +1 -0
  6. package/lib/config.cjs.d.ts +2 -0
  7. package/lib/config.cjs.js +1 -0
  8. package/lib/config.d.ts +2 -0
  9. package/lib/config.js +1 -0
  10. package/lib/helpers.cjs.d.ts +2225 -0
  11. package/lib/helpers.cjs.js +1 -0
  12. package/lib/helpers.d.ts +2225 -0
  13. package/lib/helpers.js +1 -0
  14. package/lib/index.cjs.d.ts +51500 -28554
  15. package/lib/index.cjs.js +1 -1
  16. package/lib/index.esm.d.ts +51500 -28554
  17. package/lib/index.esm.js +1 -1
  18. package/lib/responseError.cjs.d.ts +12 -0
  19. package/lib/responseError.cjs.js +1 -0
  20. package/lib/responseError.d.ts +12 -0
  21. package/lib/responseError.js +1 -0
  22. package/lib/shopperBaskets.cjs.d.ts +10259 -0
  23. package/lib/shopperBaskets.cjs.js +1 -0
  24. package/lib/shopperBaskets.d.ts +10259 -0
  25. package/lib/shopperBaskets.js +1 -0
  26. package/lib/shopperBasketsv2.cjs.d.ts +10453 -0
  27. package/lib/shopperBasketsv2.cjs.js +1 -0
  28. package/lib/shopperBasketsv2.d.ts +10453 -0
  29. package/lib/shopperBasketsv2.js +1 -0
  30. package/lib/shopperConsents.cjs.d.ts +1142 -0
  31. package/lib/shopperConsents.cjs.js +1 -0
  32. package/lib/shopperConsents.d.ts +1142 -0
  33. package/lib/shopperConsents.js +1 -0
  34. package/lib/shopperContext.cjs.d.ts +1401 -0
  35. package/lib/shopperContext.cjs.js +1 -0
  36. package/lib/shopperContext.d.ts +1401 -0
  37. package/lib/shopperContext.js +1 -0
  38. package/lib/shopperCustomers.cjs.d.ts +12185 -0
  39. package/lib/shopperCustomers.cjs.js +1 -0
  40. package/lib/shopperCustomers.d.ts +12185 -0
  41. package/lib/shopperCustomers.js +1 -0
  42. package/lib/shopperExperience.cjs.d.ts +1169 -0
  43. package/lib/shopperExperience.cjs.js +1 -0
  44. package/lib/shopperExperience.d.ts +1169 -0
  45. package/lib/shopperExperience.js +1 -0
  46. package/lib/shopperGiftCertificates.cjs.d.ts +729 -0
  47. package/lib/shopperGiftCertificates.cjs.js +1 -0
  48. package/lib/shopperGiftCertificates.d.ts +729 -0
  49. package/lib/shopperGiftCertificates.js +1 -0
  50. package/lib/shopperLogin.cjs.d.ts +3842 -0
  51. package/lib/shopperLogin.cjs.js +1 -0
  52. package/lib/shopperLogin.d.ts +3842 -0
  53. package/lib/shopperLogin.js +1 -0
  54. package/lib/shopperOrders.cjs.d.ts +5393 -0
  55. package/lib/shopperOrders.cjs.js +1 -0
  56. package/lib/shopperOrders.d.ts +5393 -0
  57. package/lib/shopperOrders.js +1 -0
  58. package/lib/shopperProducts.cjs.d.ts +3479 -0
  59. package/lib/shopperProducts.cjs.js +1 -0
  60. package/lib/shopperProducts.d.ts +3479 -0
  61. package/lib/shopperProducts.js +1 -0
  62. package/lib/shopperPromotions.cjs.d.ts +1001 -0
  63. package/lib/shopperPromotions.cjs.js +1 -0
  64. package/lib/shopperPromotions.d.ts +1001 -0
  65. package/lib/shopperPromotions.js +1 -0
  66. package/lib/shopperSearch.cjs.d.ts +3352 -0
  67. package/lib/shopperSearch.cjs.js +1 -0
  68. package/lib/shopperSearch.d.ts +3352 -0
  69. package/lib/shopperSearch.js +1 -0
  70. package/lib/shopperSeo.cjs.d.ts +769 -0
  71. package/lib/shopperSeo.cjs.js +1 -0
  72. package/lib/shopperSeo.d.ts +769 -0
  73. package/lib/shopperSeo.js +1 -0
  74. package/lib/shopperStores.cjs.d.ts +1289 -0
  75. package/lib/shopperStores.cjs.js +1 -0
  76. package/lib/shopperStores.d.ts +1289 -0
  77. package/lib/shopperStores.js +1 -0
  78. package/lib/templateUrl.cjs.d.ts +76 -0
  79. package/lib/templateUrl.cjs.js +1 -0
  80. package/lib/templateUrl.d.ts +76 -0
  81. package/lib/templateUrl.js +1 -0
  82. package/lib/version.cjs.d.ts +3 -0
  83. package/lib/version.cjs.js +1 -0
  84. package/lib/version.d.ts +3 -0
  85. package/lib/version.js +1 -0
  86. package/package.json +101 -32
@@ -0,0 +1,3842 @@
1
+ /*
2
+ * Copyright (c) 2021, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { RequestInit as NodeRequestInit } from "node-fetch";
8
+ /*
9
+ * Copyright (c) 2025, Salesforce, Inc.
10
+ * All rights reserved.
11
+ * SPDX-License-Identifier: BSD-3-Clause
12
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
13
+ */
14
+ declare const defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1";
15
+ /**
16
+ * Makes a type easier to read.
17
+ */
18
+ type Prettify<T> = NonNullable<{
19
+ [K in keyof T]: T[K];
20
+ }>;
21
+ /**
22
+ * Generates the types required on a method, based on those provided in the config.
23
+ */
24
+ type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
25
+ /**
26
+ * If an object has a `parameters` property, and the `parameters` object has required properties,
27
+ * then the `parameters` property on the root object is marked as required.
28
+ */
29
+ type RequireParametersUnlessAllAreOptional<T extends {
30
+ parameters?: Record<string, unknown>;
31
+ }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
32
+ /**
33
+ * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
34
+ * if not specified.
35
+ */
36
+ interface BaseUriParameters {
37
+ shortCode: string;
38
+ }
39
+ type LocaleCode = {
40
+ [key: string]: any;
41
+ };
42
+ /**
43
+ * Generic interface for path parameters.
44
+ */
45
+ interface PathParameters {
46
+ [key: string]: string | number | boolean;
47
+ }
48
+ /**
49
+ * Generic interface for query parameters.
50
+ */
51
+ interface QueryParameters {
52
+ [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
53
+ }
54
+ /**
55
+ * Custom body request type with any string prefixed with `c_` as the key and the allowed
56
+ * types for the value.
57
+ */
58
+ type CustomRequestBody = {
59
+ [key in `c_${string}`]: string | number | boolean | string[] | number[] | {
60
+ [key: string]: unknown;
61
+ };
62
+ };
63
+ /**
64
+ * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
65
+ * it from the `RequestInit` provided by node-fetch.
66
+ */
67
+ type BrowserRequestInit = RequestInit;
68
+ /**
69
+ * Any properties supported in either the browser or node are accepted.
70
+ * Using the right properties in the right context is left to the user.
71
+ */
72
+ type FetchOptions = NodeRequestInit & BrowserRequestInit;
73
+ /**
74
+ * Base options that can be passed to the `ClientConfig` class.
75
+ */
76
+ interface ClientConfigInit<Params extends BaseUriParameters> {
77
+ baseUri?: string;
78
+ proxy?: string;
79
+ headers?: {
80
+ [key: string]: string;
81
+ };
82
+ parameters: Params;
83
+ fetchOptions?: FetchOptions;
84
+ transformRequest?: (data: unknown, headers: {
85
+ [key: string]: string;
86
+ }) => Required<FetchOptions>["body"];
87
+ throwOnBadResponse?: boolean;
88
+ }
89
+ /**
90
+ * Configuration parameters common to Commerce SDK clients
91
+ */
92
+ declare class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
93
+ baseUri?: string;
94
+ proxy?: string;
95
+ headers: {
96
+ [key: string]: string;
97
+ };
98
+ parameters: Params;
99
+ fetchOptions: FetchOptions;
100
+ transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
101
+ throwOnBadResponse: boolean;
102
+ constructor(config: ClientConfigInit<Params>);
103
+ static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
104
+ }
105
+ /**
106
+ * Grant Type
107
+ */
108
+ type GrantType = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
109
+ /**
110
+ * @type Oauth2ErrorResponse:
111
+ *
112
+ * @property error:
113
+ *
114
+ * @property error_uri:
115
+ *
116
+ * @property error_description:
117
+ *
118
+ */
119
+ type Oauth2ErrorResponse = {
120
+ error: string;
121
+ error_uri?: string;
122
+ error_description?: string;
123
+ } & {
124
+ [key: string]: any;
125
+ };
126
+ /**
127
+ * Response Type
128
+ */
129
+ type ResponseType = "code";
130
+ /**
131
+ * @type TokenActionRequest:
132
+ *
133
+ * @property token: Token to inspect or revoke.
134
+ *
135
+ * @property token_type_hint: Token Type Hint
136
+ *
137
+ */
138
+ type TokenActionRequest = {
139
+ token: string;
140
+ token_type_hint?: TokenActionRequestTokenTypeHintEnum;
141
+ } & {
142
+ [key: string]: any;
143
+ };
144
+ type TokenActionRequestTokenTypeHintEnum = "access_token" | "refresh_token";
145
+ /**
146
+ * Token Type
147
+ */
148
+ type TokenType = "Bearer";
149
+ /**
150
+ * @type TokenResponse:
151
+ *
152
+ * @property access_token: Short term shopper JWT that can be used to access Shopper APIs. Valid for 30 minutes. A trusted agent shopper JWT is valid for 15 min.
153
+ *
154
+ * @property id_token: User ID token. Valid for 30 minutes.
155
+ *
156
+ * @property refresh_token: Long term refresh token that can be used to refresh an access token. Valid for 30 days. The refresh_token will not be returned for trusted agents JWTs. A JWT for trusted agents expires after 15 minutes and is not refreshable. When expired, then app must restart the authorization flow and make another request to the /trusted-agent/authorize endpoint.
157
+ *
158
+ * @property expires_in: Remaining access token expiry time, in seconds.
159
+ *
160
+ * @property refresh_token_expires_in: Remaining refresh token expiry time, in seconds.
161
+ *
162
+ * @property token_type:
163
+ *
164
+ * @property usid: The unique shopper ID. Returned when using the `client_credentials` grant type.
165
+ *
166
+ * @property customer_id: Customer\'s ID
167
+ *
168
+ * @property enc_user_id: MD5 Hashed B2C Commerce user ID in uppercase.
169
+ *
170
+ * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
171
+ * - **Max Length:** 8192
172
+ *
173
+ */
174
+ type TokenResponse = {
175
+ access_token: string;
176
+ id_token: string;
177
+ refresh_token: string;
178
+ expires_in: number;
179
+ refresh_token_expires_in: number;
180
+ token_type: TokenType;
181
+ usid: string;
182
+ customer_id: string;
183
+ enc_user_id: string;
184
+ idp_access_token: string;
185
+ } & {
186
+ [key: string]: any;
187
+ };
188
+ type AuthorizeCustomerResponseTypeEnum = "code";
189
+ type AuthorizeCustomerScopeEnum = "openid" | "offline_access" | "email";
190
+ type AuthorizePasswordlessCustomerModeEnum = "callback" | "sms";
191
+ type GetPasswordLessAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
192
+ type GetPasswordResetTokenModeEnum = "callback" | "sms";
193
+ type GetSessionBridgeAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
194
+ type GetTrustedAgentAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
195
+ type GetTrustedAgentAuthorizationTokenResponseTypeEnum = "code";
196
+ type GetTrustedSystemAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
197
+ type GetTrustedSystemAccessTokenHintEnum = "ts_ext_on_behalf_of";
198
+ type GetTrustedSystemAccessTokenIdpOriginEnum = "apple" | "auth0" | "azure" | "azure_adb2c" | "cognito" | "default" | "ecom" | "facebook" | "forgerock" | "gigya" | "gigya_socialize" | "google" | "okta" | "ping" | "salesforce";
199
+ type IntrospectTokenTokenTypeHintEnum = "access_token" | "refresh_token";
200
+ type LogoutCustomerHintEnum = "all-sessions";
201
+ type RevokeTokenTokenTypeHintEnum = "access_token" | "refresh_token";
202
+ type authenticateCustomerQueryParameters = {};
203
+ type authenticateCustomerPathParameters = {
204
+ organizationId: string;
205
+ };
206
+ type authenticateCustomerBodyType = {
207
+ client_id?: string;
208
+ response_type?: ResponseType;
209
+ redirect_uri: string;
210
+ state?: string;
211
+ scope?: string;
212
+ usid?: string;
213
+ channel_id: string;
214
+ code_challenge?: string;
215
+ };
216
+ type authorizeCustomerQueryParameters = {
217
+ redirect_uri: string;
218
+ response_type: "code";
219
+ client_id: string;
220
+ scope?: "openid" | "offline_access" | "email";
221
+ state?: string;
222
+ usid?: string;
223
+ hint?: string;
224
+ channel_id?: string;
225
+ code_challenge?: string;
226
+ ui_locales?: string;
227
+ };
228
+ type authorizeCustomerPathParameters = {
229
+ organizationId: string;
230
+ };
231
+ type authorizePasswordlessCustomerQueryParameters = {};
232
+ type authorizePasswordlessCustomerPathParameters = {
233
+ organizationId: string;
234
+ };
235
+ type authorizePasswordlessCustomerBodyType = {
236
+ user_id: string;
237
+ mode: string;
238
+ locale?: string;
239
+ usid?: string;
240
+ channel_id: string;
241
+ callback_uri?: string;
242
+ };
243
+ type getAccessTokenQueryParameters = {};
244
+ type getAccessTokenPathParameters = {
245
+ organizationId: string;
246
+ };
247
+ type getAccessTokenBodyType = {
248
+ refresh_token?: string;
249
+ code?: string;
250
+ usid?: string;
251
+ grant_type: GrantType;
252
+ redirect_uri?: string;
253
+ code_verifier?: string;
254
+ client_id?: string;
255
+ channel_id?: string;
256
+ dnt?: string;
257
+ };
258
+ type getJwksUriQueryParameters = {};
259
+ type getJwksUriPathParameters = {
260
+ organizationId: string;
261
+ };
262
+ type getPasswordLessAccessTokenQueryParameters = {};
263
+ type getPasswordLessAccessTokenPathParameters = {
264
+ organizationId: string;
265
+ };
266
+ type getPasswordLessAccessTokenBodyType = {
267
+ grant_type: string;
268
+ hint: string;
269
+ pwdless_login_token: string;
270
+ client_id?: string;
271
+ code_verifier?: string;
272
+ };
273
+ type getPasswordResetTokenQueryParameters = {};
274
+ type getPasswordResetTokenPathParameters = {
275
+ organizationId: string;
276
+ };
277
+ type getPasswordResetTokenBodyType = {
278
+ user_id: string;
279
+ mode: string;
280
+ channel_id: string;
281
+ locale?: string;
282
+ client_id?: string;
283
+ code_challenge?: string;
284
+ callback_uri?: string;
285
+ idp_name?: string;
286
+ hint?: string;
287
+ };
288
+ type getSessionBridgeAccessTokenQueryParameters = {};
289
+ type getSessionBridgeAccessTokenPathParameters = {
290
+ organizationId: string;
291
+ };
292
+ type getSessionBridgeAccessTokenBodyType = {
293
+ code: string;
294
+ client_id: string;
295
+ channel_id: string;
296
+ code_verifier: string;
297
+ dwsid: string;
298
+ grant_type: string;
299
+ login_id: string;
300
+ dwsgst?: string;
301
+ dwsrst?: string;
302
+ usid?: string;
303
+ dnt?: string;
304
+ };
305
+ type getTrustedAgentAccessTokenQueryParameters = {};
306
+ type getTrustedAgentAccessTokenPathParameters = {
307
+ organizationId: string;
308
+ };
309
+ type getTrustedAgentAccessTokenBodyType = {
310
+ agent_id?: string;
311
+ client_id: string;
312
+ channel_id: string;
313
+ code_verifier: string;
314
+ grant_type: string;
315
+ login_id: string;
316
+ idp_origin: string;
317
+ usid?: string;
318
+ dnt?: string;
319
+ state?: string;
320
+ };
321
+ type getTrustedAgentAuthorizationTokenQueryParameters = {
322
+ client_id: string;
323
+ channel_id: string;
324
+ code_challenge?: string;
325
+ login_id: string;
326
+ idp_origin: string;
327
+ redirect_uri: string;
328
+ response_type: "code";
329
+ };
330
+ type getTrustedAgentAuthorizationTokenPathParameters = {
331
+ organizationId: string;
332
+ };
333
+ type getTrustedSystemAccessTokenQueryParameters = {};
334
+ type getTrustedSystemAccessTokenPathParameters = {
335
+ organizationId: string;
336
+ };
337
+ type getTrustedSystemAccessTokenBodyType = {
338
+ usid?: string;
339
+ grant_type: string;
340
+ hint: string;
341
+ login_id: string;
342
+ idp_origin: string;
343
+ client_id: string;
344
+ channel_id: string;
345
+ email_id?: string;
346
+ dnt?: string;
347
+ };
348
+ type getUserInfoQueryParameters = {
349
+ channel_id?: string;
350
+ };
351
+ type getUserInfoPathParameters = {
352
+ organizationId: string;
353
+ };
354
+ type getWellknownOpenidConfigurationQueryParameters = {};
355
+ type getWellknownOpenidConfigurationPathParameters = {
356
+ organizationId: string;
357
+ };
358
+ type introspectTokenQueryParameters = {};
359
+ type introspectTokenPathParameters = {
360
+ organizationId: string;
361
+ };
362
+ type introspectTokenBodyType = {
363
+ token: string;
364
+ token_type_hint?: string;
365
+ };
366
+ type logoutCustomerQueryParameters = {
367
+ client_id: string;
368
+ refresh_token: string;
369
+ channel_id?: string;
370
+ hint?: "all-sessions";
371
+ };
372
+ type logoutCustomerPathParameters = {
373
+ organizationId: string;
374
+ };
375
+ type resetPasswordQueryParameters = {};
376
+ type resetPasswordPathParameters = {
377
+ organizationId: string;
378
+ };
379
+ type resetPasswordBodyType = {
380
+ client_id: string;
381
+ pwd_action_token: string;
382
+ code_verifier: string;
383
+ new_password?: string;
384
+ channel_id: string;
385
+ hint?: string;
386
+ };
387
+ type revokeTokenQueryParameters = {};
388
+ type revokeTokenPathParameters = {
389
+ organizationId: string;
390
+ };
391
+ type revokeTokenBodyType = {
392
+ token: string;
393
+ token_type_hint?: string;
394
+ };
395
+ /**
396
+ * All path parameters that are used by at least one ShopperLogin method.
397
+ */
398
+ type ShopperLoginPathParameters = Partial<authenticateCustomerPathParameters & authorizeCustomerPathParameters & authorizePasswordlessCustomerPathParameters & getAccessTokenPathParameters & getJwksUriPathParameters & getPasswordLessAccessTokenPathParameters & getPasswordResetTokenPathParameters & getSessionBridgeAccessTokenPathParameters & getTrustedAgentAccessTokenPathParameters & getTrustedAgentAuthorizationTokenPathParameters & getTrustedSystemAccessTokenPathParameters & getUserInfoPathParameters & getWellknownOpenidConfigurationPathParameters & introspectTokenPathParameters & logoutCustomerPathParameters & resetPasswordPathParameters & revokeTokenPathParameters & {}>;
399
+ /**
400
+ * All query parameters that are used by at least one ShopperLogin method.
401
+ */
402
+ type ShopperLoginQueryParameters = Partial<authenticateCustomerQueryParameters & authorizeCustomerQueryParameters & authorizePasswordlessCustomerQueryParameters & getAccessTokenQueryParameters & getJwksUriQueryParameters & getPasswordLessAccessTokenQueryParameters & getPasswordResetTokenQueryParameters & getSessionBridgeAccessTokenQueryParameters & getTrustedAgentAccessTokenQueryParameters & getTrustedAgentAuthorizationTokenQueryParameters & getTrustedSystemAccessTokenQueryParameters & getUserInfoQueryParameters & getWellknownOpenidConfigurationQueryParameters & introspectTokenQueryParameters & logoutCustomerQueryParameters & resetPasswordQueryParameters & revokeTokenQueryParameters & {}>;
403
+ /**
404
+ * All parameters that are used by ShopperLogin.
405
+ */
406
+ type ShopperLoginParameters = ShopperLoginPathParameters & BaseUriParameters & ShopperLoginQueryParameters;
407
+ /**
408
+ * [Shopper Login](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary)
409
+ * ==================================
410
+ *
411
+ * *# API Overview
412
+
413
+ The Shopper Login and API Access Service (SLAS) enables secure access to Commerce Cloud’s Shopper APIs for a wide range of headless commerce applications.
414
+
415
+ **Important:** Before using this API, see [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html) in the Get Started guides and the more detailed [SLAS guides](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html) for instructions on setting up a SLAS client, obtaining credentials, as well as flow and use case information.
416
+
417
+ For load shedding and rate limiting information, see [Load Shedding and Rate Limiting.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/throttle-rates.html)*<br />
418
+ *
419
+ * Simple example:
420
+ *
421
+ * ```typescript
422
+ * import { ShopperLogin } from "commerce-sdk-isomorphic";
423
+ *
424
+ * const clientConfig = {
425
+ * parameters: {
426
+ * clientId: "XXXXXX",
427
+ * organizationId: "XXXX",
428
+ * shortCode: "XXX",
429
+ * siteId: "XX"
430
+ * }
431
+ * };
432
+ * const shopperLoginClient = new ShopperLogin(clientConfig);
433
+ * ```
434
+ *
435
+ * <span style="font-size:.7em; display:block; text-align: right">
436
+ * API Version: 0.0.33<br />
437
+ * Last Updated: <br />
438
+ * </span>
439
+ *
440
+ *
441
+ */
442
+ declare class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Record<string, unknown>> {
443
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
444
+ clientConfig: ClientConfig<ConfigParameters> & {
445
+ baseUri: string;
446
+ };
447
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1";
448
+ static readonly apiPaths: {
449
+ authenticateCustomer: string;
450
+ authorizeCustomer: string;
451
+ authorizePasswordlessCustomer: string;
452
+ getAccessToken: string;
453
+ getJwksUri: string;
454
+ getPasswordLessAccessToken: string;
455
+ getPasswordResetToken: string;
456
+ getSessionBridgeAccessToken: string;
457
+ getTrustedAgentAccessToken: string;
458
+ getTrustedAgentAuthorizationToken: string;
459
+ getTrustedSystemAccessToken: string;
460
+ getUserInfo: string;
461
+ getWellknownOpenidConfiguration: string;
462
+ introspectToken: string;
463
+ logoutCustomer: string;
464
+ resetPassword: string;
465
+ revokeToken: string;
466
+ };
467
+ constructor(config: ClientConfigInit<ConfigParameters>);
468
+ static readonly paramKeys: {
469
+ readonly authenticateCustomer: readonly [
470
+ "organizationId",
471
+ "redirect_uri",
472
+ "channel_id",
473
+ "client_id",
474
+ "response_type",
475
+ "state",
476
+ "scope",
477
+ "usid",
478
+ "code_challenge"
479
+ ];
480
+ readonly authenticateCustomerRequired: readonly [
481
+ "organizationId",
482
+ "redirect_uri",
483
+ "channel_id"
484
+ ];
485
+ readonly authorizeCustomer: readonly [
486
+ "organizationId",
487
+ "redirect_uri",
488
+ "response_type",
489
+ "client_id",
490
+ "scope",
491
+ "state",
492
+ "usid",
493
+ "hint",
494
+ "channel_id",
495
+ "code_challenge",
496
+ "ui_locales"
497
+ ];
498
+ readonly authorizeCustomerRequired: readonly [
499
+ "organizationId",
500
+ "redirect_uri",
501
+ "response_type",
502
+ "client_id"
503
+ ];
504
+ readonly authorizePasswordlessCustomer: readonly [
505
+ "organizationId",
506
+ "user_id",
507
+ "mode",
508
+ "channel_id",
509
+ "locale",
510
+ "usid",
511
+ "callback_uri"
512
+ ];
513
+ readonly authorizePasswordlessCustomerRequired: readonly [
514
+ "organizationId",
515
+ "user_id",
516
+ "mode",
517
+ "channel_id"
518
+ ];
519
+ readonly getAccessToken: readonly [
520
+ "organizationId",
521
+ "grant_type",
522
+ "refresh_token",
523
+ "code",
524
+ "usid",
525
+ "redirect_uri",
526
+ "code_verifier",
527
+ "client_id",
528
+ "channel_id",
529
+ "dnt"
530
+ ];
531
+ readonly getAccessTokenRequired: readonly [
532
+ "organizationId",
533
+ "grant_type"
534
+ ];
535
+ readonly getJwksUri: readonly [
536
+ "organizationId"
537
+ ];
538
+ readonly getJwksUriRequired: readonly [
539
+ "organizationId"
540
+ ];
541
+ readonly getPasswordLessAccessToken: readonly [
542
+ "organizationId",
543
+ "grant_type",
544
+ "hint",
545
+ "pwdless_login_token",
546
+ "client_id",
547
+ "code_verifier"
548
+ ];
549
+ readonly getPasswordLessAccessTokenRequired: readonly [
550
+ "organizationId",
551
+ "grant_type",
552
+ "hint",
553
+ "pwdless_login_token"
554
+ ];
555
+ readonly getPasswordResetToken: readonly [
556
+ "organizationId",
557
+ "user_id",
558
+ "mode",
559
+ "channel_id",
560
+ "locale",
561
+ "client_id",
562
+ "code_challenge",
563
+ "callback_uri",
564
+ "idp_name",
565
+ "hint"
566
+ ];
567
+ readonly getPasswordResetTokenRequired: readonly [
568
+ "organizationId",
569
+ "user_id",
570
+ "mode",
571
+ "channel_id"
572
+ ];
573
+ readonly getSessionBridgeAccessToken: readonly [
574
+ "organizationId",
575
+ "code",
576
+ "client_id",
577
+ "channel_id",
578
+ "code_verifier",
579
+ "dwsid",
580
+ "grant_type",
581
+ "login_id",
582
+ "dwsgst",
583
+ "dwsrst",
584
+ "usid",
585
+ "dnt"
586
+ ];
587
+ readonly getSessionBridgeAccessTokenRequired: readonly [
588
+ "organizationId",
589
+ "code",
590
+ "client_id",
591
+ "channel_id",
592
+ "code_verifier",
593
+ "dwsid",
594
+ "grant_type",
595
+ "login_id"
596
+ ];
597
+ readonly getTrustedAgentAccessToken: readonly [
598
+ "organizationId",
599
+ "client_id",
600
+ "channel_id",
601
+ "code_verifier",
602
+ "grant_type",
603
+ "login_id",
604
+ "idp_origin",
605
+ "agent_id",
606
+ "usid",
607
+ "dnt",
608
+ "state"
609
+ ];
610
+ readonly getTrustedAgentAccessTokenRequired: readonly [
611
+ "organizationId",
612
+ "client_id",
613
+ "channel_id",
614
+ "code_verifier",
615
+ "grant_type",
616
+ "login_id",
617
+ "idp_origin"
618
+ ];
619
+ readonly getTrustedAgentAuthorizationToken: readonly [
620
+ "organizationId",
621
+ "client_id",
622
+ "channel_id",
623
+ "login_id",
624
+ "idp_origin",
625
+ "redirect_uri",
626
+ "response_type",
627
+ "code_challenge"
628
+ ];
629
+ readonly getTrustedAgentAuthorizationTokenRequired: readonly [
630
+ "organizationId",
631
+ "client_id",
632
+ "channel_id",
633
+ "login_id",
634
+ "idp_origin",
635
+ "redirect_uri",
636
+ "response_type"
637
+ ];
638
+ readonly getTrustedSystemAccessToken: readonly [
639
+ "organizationId",
640
+ "grant_type",
641
+ "hint",
642
+ "login_id",
643
+ "idp_origin",
644
+ "client_id",
645
+ "channel_id",
646
+ "usid",
647
+ "email_id",
648
+ "dnt"
649
+ ];
650
+ readonly getTrustedSystemAccessTokenRequired: readonly [
651
+ "organizationId",
652
+ "grant_type",
653
+ "hint",
654
+ "login_id",
655
+ "idp_origin",
656
+ "client_id",
657
+ "channel_id"
658
+ ];
659
+ readonly getUserInfo: readonly [
660
+ "organizationId",
661
+ "channel_id"
662
+ ];
663
+ readonly getUserInfoRequired: readonly [
664
+ "organizationId"
665
+ ];
666
+ readonly getWellknownOpenidConfiguration: readonly [
667
+ "organizationId"
668
+ ];
669
+ readonly getWellknownOpenidConfigurationRequired: readonly [
670
+ "organizationId"
671
+ ];
672
+ readonly introspectToken: readonly [
673
+ "organizationId",
674
+ "token",
675
+ "token_type_hint"
676
+ ];
677
+ readonly introspectTokenRequired: readonly [
678
+ "organizationId",
679
+ "token"
680
+ ];
681
+ readonly logoutCustomer: readonly [
682
+ "organizationId",
683
+ "client_id",
684
+ "refresh_token",
685
+ "channel_id",
686
+ "hint"
687
+ ];
688
+ readonly logoutCustomerRequired: readonly [
689
+ "organizationId",
690
+ "client_id",
691
+ "refresh_token"
692
+ ];
693
+ readonly resetPassword: readonly [
694
+ "organizationId",
695
+ "client_id",
696
+ "pwd_action_token",
697
+ "code_verifier",
698
+ "channel_id",
699
+ "new_password",
700
+ "hint"
701
+ ];
702
+ readonly resetPasswordRequired: readonly [
703
+ "organizationId",
704
+ "client_id",
705
+ "pwd_action_token",
706
+ "code_verifier",
707
+ "channel_id"
708
+ ];
709
+ readonly revokeToken: readonly [
710
+ "organizationId",
711
+ "token",
712
+ "token_type_hint"
713
+ ];
714
+ readonly revokeTokenRequired: readonly [
715
+ "organizationId",
716
+ "token"
717
+ ];
718
+ };
719
+ /**
720
+ * This follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).
721
+
722
+ For PKCE values:
723
+ - The `code_verifier` string is a random string used for the `/token` endpoint request.
724
+ - The `code_challenge` is an encoded version of the `code_verifier` string using an SHA-256 hash.
725
+
726
+ The request must include a basic authorization header that contains a Base64 encoded version of the following string: `<shopperUserID>:<shopperPassword>`.
727
+ Required parameters: `code_challenge`, `channel_id`, `client_id`, and `redirect_uri`.
728
+
729
+ Optional parameters: `usid`.
730
+ The SLAS `/login` endpoint redirects back to the redirect URI and returns an authorization code.
731
+ Calls to `/login` made with the same loginId and tenantId within 1 second result in a conflict.
732
+ *
733
+ * If you would like to get a raw Response object use the other authenticateCustomer function.
734
+ *
735
+ * @param options - An object containing the options for this method.
736
+ * @param options.parameters - An object containing the parameters for this method.
737
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
738
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
739
+ * @param options.body - The data to send as the request body.
740
+ * @param options.body.client_id - SLAS client ID. Required when the grant type is `authorization_code_pkce`.
741
+ * @param options.body.response_type - Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).
742
+ * @param options.body.redirect_uri - The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
743
+ * @param options.body.state - Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
744
+ * @param options.body.scope - Scopes to limit an application\'s access to a user\'s account.
745
+ * @param options.body.usid - The unique shopper ID.
746
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
747
+ * @param options.body.code_challenge - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_challenge` is optional when using a private client id for the token request.
748
+ *
749
+ * @returns A promise of type void.
750
+ */
751
+ authenticateCustomer(options?: RequireParametersUnlessAllAreOptional<{
752
+ parameters?: CompositeParameters<{
753
+ organizationId: string;
754
+ } & QueryParameters, ConfigParameters>;
755
+ headers?: {
756
+ [key: string]: string;
757
+ };
758
+ body: authenticateCustomerBodyType & CustomRequestBody;
759
+ }>): Promise<void>;
760
+ /**
761
+ * This follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).
762
+
763
+ For PKCE values:
764
+ - The `code_verifier` string is a random string used for the `/token` endpoint request.
765
+ - The `code_challenge` is an encoded version of the `code_verifier` string using an SHA-256 hash.
766
+
767
+ The request must include a basic authorization header that contains a Base64 encoded version of the following string: `<shopperUserID>:<shopperPassword>`.
768
+ Required parameters: `code_challenge`, `channel_id`, `client_id`, and `redirect_uri`.
769
+
770
+ Optional parameters: `usid`.
771
+ The SLAS `/login` endpoint redirects back to the redirect URI and returns an authorization code.
772
+ Calls to `/login` made with the same loginId and tenantId within 1 second result in a conflict.
773
+ *
774
+ * @param options - An object containing the options for this method.
775
+ * @param options.parameters - An object containing the parameters for this method.
776
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
777
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
778
+ * @param options.body - The data to send as the request body.
779
+ * @param options.body.client_id - SLAS client ID. Required when the grant type is `authorization_code_pkce`.
780
+ * @param options.body.response_type - Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).
781
+ * @param options.body.redirect_uri - The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
782
+ * @param options.body.state - Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
783
+ * @param options.body.scope - Scopes to limit an application\'s access to a user\'s account.
784
+ * @param options.body.usid - The unique shopper ID.
785
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
786
+ * @param options.body.code_challenge - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_challenge` is optional when using a private client id for the token request.
787
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
788
+ *
789
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
790
+ */
791
+ authenticateCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
792
+ parameters?: CompositeParameters<{
793
+ organizationId: string;
794
+ } & QueryParameters, ConfigParameters>;
795
+ headers?: {
796
+ [key: string]: string;
797
+ };
798
+ body: authenticateCustomerBodyType & CustomRequestBody;
799
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
800
+ /**
801
+ * This is the first step of the OAuth 2.1 authorization code flow, in which a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.
802
+
803
+ You can call this endpoint from the front channel (the browser).
804
+ *
805
+ * If you would like to get a raw Response object use the other authorizeCustomer function.
806
+ *
807
+ * @param options - An object containing the options for this method.
808
+ * @param options.parameters - An object containing the parameters for this method.
809
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
810
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
811
+ - `http://localhost:3000/callback`
812
+ - `https://example.com/callback`
813
+ - `com.example.app:redirect_uri_path`
814
+ - ` *.subdomain.topleveldomain.com`
815
+
816
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
817
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
818
+ * @param options.parameters.scope -
819
+ * @param options.parameters.state - Value to send the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
820
+ * @param options.parameters.usid - A unique shopper identifier (USID). If not provided, a new USID is generated.
821
+ * @param options.parameters.hint - Name of an identity provider (IDP) to optionally redirect to, thereby skipping the IDP selection step.
822
+
823
+ To use a public client, set `hint` to `guest` and use a public client ID to get an authorization code. If no `hint` is provided, the preferred IDP of the tenant is used by default.
824
+
825
+ For session bridge authorization the `hint` should be set to `sb-user` for a registered customer and to `sb-guest` for a guest. For session bridge authorization the SLAS Client `sfcc.session_bridge` scope.
826
+ * @param options.parameters.channel_id - The channel that this request is for. For a B2C Commerce request, this is angalous to the site ID.
827
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
828
+
829
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
830
+
831
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
832
+
833
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
834
+ * @param options.parameters.ui_locales - End-User's preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For example, the value `fr-CA fr en` represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation).
835
+
836
+ In most cases the IDP supports one language tag and has a default language set on the server. SLAS will support the space-separated list and pass them to the IDP.
837
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
838
+ *
839
+ * @returns A promise of type void.
840
+ */
841
+ authorizeCustomer(options?: RequireParametersUnlessAllAreOptional<{
842
+ parameters?: CompositeParameters<{
843
+ organizationId: string;
844
+ redirect_uri: string;
845
+ response_type: AuthorizeCustomerResponseTypeEnum;
846
+ client_id: string;
847
+ scope?: AuthorizeCustomerScopeEnum;
848
+ state?: string;
849
+ usid?: string;
850
+ hint?: string;
851
+ channel_id?: string;
852
+ code_challenge?: string;
853
+ ui_locales?: string;
854
+ } & QueryParameters, ConfigParameters>;
855
+ headers?: {
856
+ [key: string]: string;
857
+ };
858
+ }>): Promise<void>;
859
+ /**
860
+ * This is the first step of the OAuth 2.1 authorization code flow, in which a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.
861
+
862
+ You can call this endpoint from the front channel (the browser).
863
+ *
864
+ * @param options - An object containing the options for this method.
865
+ * @param options.parameters - An object containing the parameters for this method.
866
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
867
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
868
+ - `http://localhost:3000/callback`
869
+ - `https://example.com/callback`
870
+ - `com.example.app:redirect_uri_path`
871
+ - ` *.subdomain.topleveldomain.com`
872
+
873
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
874
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
875
+ * @param options.parameters.scope -
876
+ * @param options.parameters.state - Value to send the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
877
+ * @param options.parameters.usid - A unique shopper identifier (USID). If not provided, a new USID is generated.
878
+ * @param options.parameters.hint - Name of an identity provider (IDP) to optionally redirect to, thereby skipping the IDP selection step.
879
+
880
+ To use a public client, set `hint` to `guest` and use a public client ID to get an authorization code. If no `hint` is provided, the preferred IDP of the tenant is used by default.
881
+
882
+ For session bridge authorization the `hint` should be set to `sb-user` for a registered customer and to `sb-guest` for a guest. For session bridge authorization the SLAS Client `sfcc.session_bridge` scope.
883
+ * @param options.parameters.channel_id - The channel that this request is for. For a B2C Commerce request, this is angalous to the site ID.
884
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
885
+
886
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
887
+
888
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
889
+
890
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
891
+ * @param options.parameters.ui_locales - End-User's preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For example, the value `fr-CA fr en` represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation).
892
+
893
+ In most cases the IDP supports one language tag and has a default language set on the server. SLAS will support the space-separated list and pass them to the IDP.
894
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
895
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
896
+ *
897
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
898
+ */
899
+ authorizeCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
900
+ parameters?: CompositeParameters<{
901
+ organizationId: string;
902
+ redirect_uri: string;
903
+ response_type: AuthorizeCustomerResponseTypeEnum;
904
+ client_id: string;
905
+ scope?: AuthorizeCustomerScopeEnum;
906
+ state?: string;
907
+ usid?: string;
908
+ hint?: string;
909
+ channel_id?: string;
910
+ code_challenge?: string;
911
+ ui_locales?: string;
912
+ } & QueryParameters, ConfigParameters>;
913
+ headers?: {
914
+ [key: string]: string;
915
+ };
916
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
917
+ /**
918
+ * This endpoint allows customers to authenticate when their configured identity provider is inaccessible. It provides an alternative authentication path through passwordless login methods like email or SMS verification.
919
+ *
920
+ * If you would like to get a raw Response object use the other authorizePasswordlessCustomer function.
921
+ *
922
+ * @param options - An object containing the options for this method.
923
+ * @param options.parameters - An object containing the parameters for this method.
924
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
925
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
926
+ * @param options.body - The data to send as the request body.
927
+ * @param options.body.user_id - User ID for logging in.
928
+ * @param options.body.mode - Password Action delivery modes
929
+ * @param options.body.locale - The locale of the template. Not needed for the `callback` mode
930
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
931
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
932
+ * @param options.body.callback_uri - The callback URI. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
933
+ *
934
+ * @returns A promise of type string.
935
+ */
936
+ authorizePasswordlessCustomer(options?: RequireParametersUnlessAllAreOptional<{
937
+ parameters?: CompositeParameters<{
938
+ organizationId: string;
939
+ } & QueryParameters, ConfigParameters>;
940
+ headers?: {
941
+ [key: string]: string;
942
+ };
943
+ body: authorizePasswordlessCustomerBodyType & CustomRequestBody;
944
+ }>): Promise<string>;
945
+ /**
946
+ * This endpoint allows customers to authenticate when their configured identity provider is inaccessible. It provides an alternative authentication path through passwordless login methods like email or SMS verification.
947
+ *
948
+ * @param options - An object containing the options for this method.
949
+ * @param options.parameters - An object containing the parameters for this method.
950
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
951
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
952
+ * @param options.body - The data to send as the request body.
953
+ * @param options.body.user_id - User ID for logging in.
954
+ * @param options.body.mode - Password Action delivery modes
955
+ * @param options.body.locale - The locale of the template. Not needed for the `callback` mode
956
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
957
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
958
+ * @param options.body.callback_uri - The callback URI. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
959
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
960
+ *
961
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
962
+ */
963
+ authorizePasswordlessCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
964
+ parameters?: CompositeParameters<{
965
+ organizationId: string;
966
+ } & QueryParameters, ConfigParameters>;
967
+ headers?: {
968
+ [key: string]: string;
969
+ };
970
+ body: authorizePasswordlessCustomerBodyType & CustomRequestBody;
971
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
972
+ /**
973
+ * This is the second step of the OAuth 2.1 authorization code flow.
974
+
975
+ For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the `authorize` endpoint.
976
+
977
+ For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.
978
+
979
+ For a public client using PKCE, an application passes a PKCE `code_verifier` that matches the `code_challenge` that was used to `authorize` the customer along with the authorization code.
980
+
981
+ When refreshing the access token with a private client ID and client secret, the refresh token is _not_ regenerated. However, when refreshing the access token with a public client ID, the refresh token is _always_ regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client must be replaced to always store the new refresh token.
982
+
983
+ See the Body section for required parameters, including `grant_type` and others that depend on the value of `grant_type`.
984
+
985
+ **Important**: As of July 31, 2024**, SLAS requires the `channel_id` query parameter in token requests.
986
+ *
987
+ * If you would like to get a raw Response object use the other getAccessToken function.
988
+ *
989
+ * @param options - An object containing the options for this method.
990
+ * @param options.parameters - An object containing the parameters for this method.
991
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
992
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
993
+ * @param options.body - The data to send as the request body.
994
+ * @param options.body.refresh_token - The long-term token used to refresh the short term access token. Required only with a grant type of `refresh_token`.
995
+ * @param options.body.code - Authorization code from the OAuth 2.1 service received in the front channel that is used to get access tokens and refresh tokens. Required with a grant type of `authorization_code` and `session_bridge`.
996
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
997
+ * @param options.body.grant_type -
998
+ * @param options.body.redirect_uri - The redirect URI that was used when getting the authorization code. A variety of URI formats and wildcards for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
999
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is optional when using a private client id for the token request.
1000
+ * @param options.body.client_id - The SLAS client ID. Required when the grant type is `authorization_code_pkce`.
1001
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with. **Important: We strongly recommended using the channel_id query parameter because it will be required in the future. **NOTE - As of July 31, 2024**, SLAS will be requiring the `channel_id` query parameter in token requests.
1002
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
1003
+ *
1004
+ * @returns A promise of type TokenResponse.
1005
+ */
1006
+ getAccessToken(options?: RequireParametersUnlessAllAreOptional<{
1007
+ parameters?: CompositeParameters<{
1008
+ organizationId: string;
1009
+ } & QueryParameters, ConfigParameters>;
1010
+ headers?: {
1011
+ [key: string]: string;
1012
+ };
1013
+ body: getAccessTokenBodyType & CustomRequestBody;
1014
+ }>): Promise<TokenResponse>;
1015
+ /**
1016
+ * This is the second step of the OAuth 2.1 authorization code flow.
1017
+
1018
+ For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the `authorize` endpoint.
1019
+
1020
+ For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.
1021
+
1022
+ For a public client using PKCE, an application passes a PKCE `code_verifier` that matches the `code_challenge` that was used to `authorize` the customer along with the authorization code.
1023
+
1024
+ When refreshing the access token with a private client ID and client secret, the refresh token is _not_ regenerated. However, when refreshing the access token with a public client ID, the refresh token is _always_ regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client must be replaced to always store the new refresh token.
1025
+
1026
+ See the Body section for required parameters, including `grant_type` and others that depend on the value of `grant_type`.
1027
+
1028
+ **Important**: As of July 31, 2024**, SLAS requires the `channel_id` query parameter in token requests.
1029
+ *
1030
+ * @param options - An object containing the options for this method.
1031
+ * @param options.parameters - An object containing the parameters for this method.
1032
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1033
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1034
+ * @param options.body - The data to send as the request body.
1035
+ * @param options.body.refresh_token - The long-term token used to refresh the short term access token. Required only with a grant type of `refresh_token`.
1036
+ * @param options.body.code - Authorization code from the OAuth 2.1 service received in the front channel that is used to get access tokens and refresh tokens. Required with a grant type of `authorization_code` and `session_bridge`.
1037
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
1038
+ * @param options.body.grant_type -
1039
+ * @param options.body.redirect_uri - The redirect URI that was used when getting the authorization code. A variety of URI formats and wildcards for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
1040
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is optional when using a private client id for the token request.
1041
+ * @param options.body.client_id - The SLAS client ID. Required when the grant type is `authorization_code_pkce`.
1042
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with. **Important: We strongly recommended using the channel_id query parameter because it will be required in the future. **NOTE - As of July 31, 2024**, SLAS will be requiring the `channel_id` query parameter in token requests.
1043
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
1044
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1045
+ *
1046
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1047
+ */
1048
+ getAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1049
+ parameters?: CompositeParameters<{
1050
+ organizationId: string;
1051
+ } & QueryParameters, ConfigParameters>;
1052
+ headers?: {
1053
+ [key: string]: string;
1054
+ };
1055
+ body: getAccessTokenBodyType & CustomRequestBody;
1056
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1057
+ /**
1058
+ * The `/jwks` endpoint provides a JSON Web Key Set (JWKS) that includes current, past, and future public keys. These keys allow clients to validate the Shopper JSON Web Token (JWT) issued by SLAS, ensuring that no tampering with the token has occurred. Every SLAS JWT that is passed into SLAS, SCAPI, or OCAPI is always validated and is rejected if the signature validation does not match.
1059
+
1060
+ To optimize performance, the `/jwks` endpoint is limited to 25 calls per minute, so we recommended caching the JWKS keys and refresh them only when necessary, instead of making frequent requests. Typically, the JWKs endpoint can be used once per DAY.
1061
+
1062
+ For additional information on using JWKS, see https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-validate-jwt-with-jwks.html.
1063
+
1064
+ *
1065
+ * If you would like to get a raw Response object use the other getJwksUri function.
1066
+ *
1067
+ * @param options - An object containing the options for this method.
1068
+ * @param options.parameters - An object containing the parameters for this method.
1069
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1070
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1071
+ *
1072
+ * @returns A promise of type object.
1073
+ */
1074
+ getJwksUri(options?: RequireParametersUnlessAllAreOptional<{
1075
+ parameters?: CompositeParameters<{
1076
+ organizationId: string;
1077
+ } & QueryParameters, ConfigParameters>;
1078
+ headers?: {
1079
+ [key: string]: string;
1080
+ };
1081
+ }>): Promise<object>;
1082
+ /**
1083
+ * The `/jwks` endpoint provides a JSON Web Key Set (JWKS) that includes current, past, and future public keys. These keys allow clients to validate the Shopper JSON Web Token (JWT) issued by SLAS, ensuring that no tampering with the token has occurred. Every SLAS JWT that is passed into SLAS, SCAPI, or OCAPI is always validated and is rejected if the signature validation does not match.
1084
+
1085
+ To optimize performance, the `/jwks` endpoint is limited to 25 calls per minute, so we recommended caching the JWKS keys and refresh them only when necessary, instead of making frequent requests. Typically, the JWKs endpoint can be used once per DAY.
1086
+
1087
+ For additional information on using JWKS, see https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-validate-jwt-with-jwks.html.
1088
+
1089
+ *
1090
+ * @param options - An object containing the options for this method.
1091
+ * @param options.parameters - An object containing the parameters for this method.
1092
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1093
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1094
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1095
+ *
1096
+ * @returns A promise of type Response if rawResponse is true, a promise of type object otherwise.
1097
+ */
1098
+ getJwksUri<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1099
+ parameters?: CompositeParameters<{
1100
+ organizationId: string;
1101
+ } & QueryParameters, ConfigParameters>;
1102
+ headers?: {
1103
+ [key: string]: string;
1104
+ };
1105
+ }>, rawResponse?: T): Promise<T extends true ? Response : object>;
1106
+ /**
1107
+ * This endpoint issues a shopper JWT access token using a passwordless login token. It enables authentication flows where traditional username/password combinations are not required, supporting alternative authentication methods.
1108
+ *
1109
+ * If you would like to get a raw Response object use the other getPasswordLessAccessToken function.
1110
+ *
1111
+ * @param options - An object containing the options for this method.
1112
+ * @param options.parameters - An object containing the parameters for this method.
1113
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1114
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1115
+ * @param options.body - The data to send as the request body.
1116
+ * @param options.body.grant_type - Grant Type
1117
+ * @param options.body.hint - Passwordless hint. Use `pwdless_login`.
1118
+ * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
1119
+ * @param options.body.client_id - The public client ID.
1120
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1121
+ *
1122
+ * @returns A promise of type TokenResponse.
1123
+ */
1124
+ getPasswordLessAccessToken(options?: RequireParametersUnlessAllAreOptional<{
1125
+ parameters?: CompositeParameters<{
1126
+ organizationId: string;
1127
+ } & QueryParameters, ConfigParameters>;
1128
+ headers?: {
1129
+ [key: string]: string;
1130
+ };
1131
+ body: getPasswordLessAccessTokenBodyType & CustomRequestBody;
1132
+ }>): Promise<TokenResponse>;
1133
+ /**
1134
+ * This endpoint issues a shopper JWT access token using a passwordless login token. It enables authentication flows where traditional username/password combinations are not required, supporting alternative authentication methods.
1135
+ *
1136
+ * @param options - An object containing the options for this method.
1137
+ * @param options.parameters - An object containing the parameters for this method.
1138
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1139
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1140
+ * @param options.body - The data to send as the request body.
1141
+ * @param options.body.grant_type - Grant Type
1142
+ * @param options.body.hint - Passwordless hint. Use `pwdless_login`.
1143
+ * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
1144
+ * @param options.body.client_id - The public client ID.
1145
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1146
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1147
+ *
1148
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1149
+ */
1150
+ getPasswordLessAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1151
+ parameters?: CompositeParameters<{
1152
+ organizationId: string;
1153
+ } & QueryParameters, ConfigParameters>;
1154
+ headers?: {
1155
+ [key: string]: string;
1156
+ };
1157
+ body: getPasswordLessAccessTokenBodyType & CustomRequestBody;
1158
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1159
+ /**
1160
+ * This endpoint initiates the password reset process for a customer by requesting a password reset token. The token is delivered through the configured delivery mode (email, SMS, etc.) and can be used with the password/action endpoint to set a new password.
1161
+ *
1162
+ * If you would like to get a raw Response object use the other getPasswordResetToken function.
1163
+ *
1164
+ * @param options - An object containing the options for this method.
1165
+ * @param options.parameters - An object containing the parameters for this method.
1166
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1167
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1168
+ * @param options.body - The data to send as the request body.
1169
+ * @param options.body.user_id - User ID for logging in. This is the id that is used to log into SFCC.
1170
+ * @param options.body.mode - Password Action delivery modes
1171
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1172
+ * @param options.body.locale - The locale of the template.
1173
+ * @param options.body.client_id - -| The public client ID. Requires setting `grant_type` to `passwordless_login_pkce`. When using the `hint` query parameter either a public or private client ID can be used.
1174
+ * @param options.body.code_challenge - PKCE code challenge. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. Requires setting `grant_type` to `passwordless_login_pkce`
1175
+ * @param options.body.callback_uri - The callback uri. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
1176
+ * @param options.body.idp_name - The name of the 3rd party identity provider for the user ID
1177
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_challenge for password reset request. If the `hint` query parameter is used it must also be used in the password reset request.
1178
+ *
1179
+ * @returns A promise of type void.
1180
+ */
1181
+ getPasswordResetToken(options?: RequireParametersUnlessAllAreOptional<{
1182
+ parameters?: CompositeParameters<{
1183
+ organizationId: string;
1184
+ } & QueryParameters, ConfigParameters>;
1185
+ headers?: {
1186
+ [key: string]: string;
1187
+ };
1188
+ body: getPasswordResetTokenBodyType & CustomRequestBody;
1189
+ }>): Promise<void>;
1190
+ /**
1191
+ * This endpoint initiates the password reset process for a customer by requesting a password reset token. The token is delivered through the configured delivery mode (email, SMS, etc.) and can be used with the password/action endpoint to set a new password.
1192
+ *
1193
+ * @param options - An object containing the options for this method.
1194
+ * @param options.parameters - An object containing the parameters for this method.
1195
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1196
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1197
+ * @param options.body - The data to send as the request body.
1198
+ * @param options.body.user_id - User ID for logging in. This is the id that is used to log into SFCC.
1199
+ * @param options.body.mode - Password Action delivery modes
1200
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1201
+ * @param options.body.locale - The locale of the template.
1202
+ * @param options.body.client_id - -| The public client ID. Requires setting `grant_type` to `passwordless_login_pkce`. When using the `hint` query parameter either a public or private client ID can be used.
1203
+ * @param options.body.code_challenge - PKCE code challenge. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. Requires setting `grant_type` to `passwordless_login_pkce`
1204
+ * @param options.body.callback_uri - The callback uri. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
1205
+ * @param options.body.idp_name - The name of the 3rd party identity provider for the user ID
1206
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_challenge for password reset request. If the `hint` query parameter is used it must also be used in the password reset request.
1207
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1208
+ *
1209
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
1210
+ */
1211
+ getPasswordResetToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1212
+ parameters?: CompositeParameters<{
1213
+ organizationId: string;
1214
+ } & QueryParameters, ConfigParameters>;
1215
+ headers?: {
1216
+ [key: string]: string;
1217
+ };
1218
+ body: getPasswordResetTokenBodyType & CustomRequestBody;
1219
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
1220
+ /**
1221
+ * For public client ID requests, you must set the grant_type to `session_bridge`.
1222
+
1223
+ For private client_id and secret, you must set the grant_type to `client_credentials` along with a basic authorization header.
1224
+
1225
+ **DEPRECATED** - As of January 31, 2024, SLAS no longer supports the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. We recommended you transition to using a SESB `dwsgst` token.
1226
+
1227
+ The `dwsid` is still needed for `registered` user `session-bridge/token` calls.
1228
+
1229
+ **NOTE:** The registered customer Json Web Token (JWT) is available in B2C Commerce versions 25.4 and later.
1230
+ *
1231
+ * If you would like to get a raw Response object use the other getSessionBridgeAccessToken function.
1232
+ *
1233
+ * @param options - An object containing the options for this method.
1234
+ * @param options.parameters - An object containing the parameters for this method.
1235
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1236
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1237
+ * @param options.body - The data to send as the request body.
1238
+ * @param options.body.code - Authorization code returned from session bridge authorization received in the front channel that is used to get session bridge access tokens and refresh tokens. Required with a grant type of `session_bridge`. The SLAS client must have the `sfcc.session_bridge` scope to request a session bridge token.
1239
+ * @param options.body.client_id - The SLAS public client ID for use with PKCE requests. This is a required parameter when using a public client.
1240
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1241
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. This is a required parameter when using a public client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1242
+ * @param options.body.dwsid - Cookie passed back from the \'/authorize\' endpoint call for session bridge. This parameter is optional and not needed if using the `dwsgst` parameter. **DEPRECATED** - As of January 31, 2024, SLAS will no longer support the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. It is recommended to transition over to using a SESB `dwsgst` token. The `dwsid` will still be needed for `registered` user session-bridge/token calls.
1243
+ * @param options.body.grant_type - Grant Type
1244
+ * @param options.body.login_id - The ID of the shopper for session bridge access. If requesting a token for a guest user set login_id to `guest`.
1245
+ * @param options.body.dwsgst - Signed guest Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the guest `dwsid` parameter.
1246
+ * @param options.body.dwsrst - Signed registered customer Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the registered user `dwsid` parameter. **NOTE:** The registered customer Json Web Token (JWT) will be available in ECOM versions 25.4 and higher.
1247
+ * @param options.body.usid - The unique shopper ID. Returned when from session bridge authorization.
1248
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
1249
+ *
1250
+ * @returns A promise of type TokenResponse.
1251
+ */
1252
+ getSessionBridgeAccessToken(options?: RequireParametersUnlessAllAreOptional<{
1253
+ parameters?: CompositeParameters<{
1254
+ organizationId: string;
1255
+ } & QueryParameters, ConfigParameters>;
1256
+ headers?: {
1257
+ [key: string]: string;
1258
+ };
1259
+ body: getSessionBridgeAccessTokenBodyType & CustomRequestBody;
1260
+ }>): Promise<TokenResponse>;
1261
+ /**
1262
+ * For public client ID requests, you must set the grant_type to `session_bridge`.
1263
+
1264
+ For private client_id and secret, you must set the grant_type to `client_credentials` along with a basic authorization header.
1265
+
1266
+ **DEPRECATED** - As of January 31, 2024, SLAS no longer supports the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. We recommended you transition to using a SESB `dwsgst` token.
1267
+
1268
+ The `dwsid` is still needed for `registered` user `session-bridge/token` calls.
1269
+
1270
+ **NOTE:** The registered customer Json Web Token (JWT) is available in B2C Commerce versions 25.4 and later.
1271
+ *
1272
+ * @param options - An object containing the options for this method.
1273
+ * @param options.parameters - An object containing the parameters for this method.
1274
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1275
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1276
+ * @param options.body - The data to send as the request body.
1277
+ * @param options.body.code - Authorization code returned from session bridge authorization received in the front channel that is used to get session bridge access tokens and refresh tokens. Required with a grant type of `session_bridge`. The SLAS client must have the `sfcc.session_bridge` scope to request a session bridge token.
1278
+ * @param options.body.client_id - The SLAS public client ID for use with PKCE requests. This is a required parameter when using a public client.
1279
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1280
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. This is a required parameter when using a public client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1281
+ * @param options.body.dwsid - Cookie passed back from the \'/authorize\' endpoint call for session bridge. This parameter is optional and not needed if using the `dwsgst` parameter. **DEPRECATED** - As of January 31, 2024, SLAS will no longer support the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. It is recommended to transition over to using a SESB `dwsgst` token. The `dwsid` will still be needed for `registered` user session-bridge/token calls.
1282
+ * @param options.body.grant_type - Grant Type
1283
+ * @param options.body.login_id - The ID of the shopper for session bridge access. If requesting a token for a guest user set login_id to `guest`.
1284
+ * @param options.body.dwsgst - Signed guest Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the guest `dwsid` parameter.
1285
+ * @param options.body.dwsrst - Signed registered customer Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the registered user `dwsid` parameter. **NOTE:** The registered customer Json Web Token (JWT) will be available in ECOM versions 25.4 and higher.
1286
+ * @param options.body.usid - The unique shopper ID. Returned when from session bridge authorization.
1287
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
1288
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1289
+ *
1290
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1291
+ */
1292
+ getSessionBridgeAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1293
+ parameters?: CompositeParameters<{
1294
+ organizationId: string;
1295
+ } & QueryParameters, ConfigParameters>;
1296
+ headers?: {
1297
+ [key: string]: string;
1298
+ };
1299
+ body: getSessionBridgeAccessTokenBodyType & CustomRequestBody;
1300
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1301
+ /**
1302
+ * If using a SLAS private client ID, you must also use an `_sfdc_client_auth` header.
1303
+
1304
+ The value of the `_sfdc_client_auth` header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (`:`). For example, `privateClientId:privateClientsecret` becomes `cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ=` after Base64 encoding.
1305
+ *
1306
+ * If you would like to get a raw Response object use the other getTrustedAgentAccessToken function.
1307
+ *
1308
+ * @param options - An object containing the options for this method.
1309
+ * @param options.parameters - An object containing the parameters for this method.
1310
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1311
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1312
+ * @param options.body - The data to send as the request body.
1313
+ * @param options.body.agent_id - The ID of the merchant. If passed in, the `agent_id` will be validated using the SUB claim in the response from Account Manager. This is an optional parameter unless the request is for a Trusted Agent on Behalf then `agent_id` is required.
1314
+ * @param options.body.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-system requests. The `client_id` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
1315
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1316
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
1317
+ * @param options.body.grant_type - Grant Type
1318
+ * @param options.body.login_id - The ID is the shopper for trusted agent access. For TAOB Guest the `login_id` must be set to `Guest`.
1319
+ * @param options.body.idp_origin - The IDP that the user is associated with. For TAOB Guest the `idp_origin` parameter should be `slas`. If set to any other IDP origin a 400 Bad Request will be returned.
1320
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
1321
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `true` Note: The default value for `dnt` is set to `true` for all TAOB flows. This is opposite from other SLAS token requests.
1322
+ * @param options.body.state - This is an optional parameter to set state for the trusted agent session. If the `state` parameter is used it will be validated and a 400 Bad Request will be returned if missing or invalid. For TAOB Guest you must pass the `state` parameter to transfer the state from the TAOB Guest authorization call to the token call. The `state` parameter value is returned with the authorization code in the response url from the TAOB guest authorization call, for example: `.../taob/callback?code=HETXpvg5LKBNIHjDTWkRrf2MLVU&state=taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b`. You would use `taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b` for the `state` value in the TAOB request.
1323
+ *
1324
+ * @returns A promise of type TokenResponse.
1325
+ */
1326
+ getTrustedAgentAccessToken(options?: RequireParametersUnlessAllAreOptional<{
1327
+ parameters?: CompositeParameters<{
1328
+ organizationId: string;
1329
+ } & QueryParameters, ConfigParameters>;
1330
+ headers?: {
1331
+ [key: string]: string;
1332
+ };
1333
+ body: getTrustedAgentAccessTokenBodyType & CustomRequestBody;
1334
+ }>): Promise<TokenResponse>;
1335
+ /**
1336
+ * If using a SLAS private client ID, you must also use an `_sfdc_client_auth` header.
1337
+
1338
+ The value of the `_sfdc_client_auth` header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (`:`). For example, `privateClientId:privateClientsecret` becomes `cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ=` after Base64 encoding.
1339
+ *
1340
+ * @param options - An object containing the options for this method.
1341
+ * @param options.parameters - An object containing the parameters for this method.
1342
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1343
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1344
+ * @param options.body - The data to send as the request body.
1345
+ * @param options.body.agent_id - The ID of the merchant. If passed in, the `agent_id` will be validated using the SUB claim in the response from Account Manager. This is an optional parameter unless the request is for a Trusted Agent on Behalf then `agent_id` is required.
1346
+ * @param options.body.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-system requests. The `client_id` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
1347
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
1348
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
1349
+ * @param options.body.grant_type - Grant Type
1350
+ * @param options.body.login_id - The ID is the shopper for trusted agent access. For TAOB Guest the `login_id` must be set to `Guest`.
1351
+ * @param options.body.idp_origin - The IDP that the user is associated with. For TAOB Guest the `idp_origin` parameter should be `slas`. If set to any other IDP origin a 400 Bad Request will be returned.
1352
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
1353
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `true` Note: The default value for `dnt` is set to `true` for all TAOB flows. This is opposite from other SLAS token requests.
1354
+ * @param options.body.state - This is an optional parameter to set state for the trusted agent session. If the `state` parameter is used it will be validated and a 400 Bad Request will be returned if missing or invalid. For TAOB Guest you must pass the `state` parameter to transfer the state from the TAOB Guest authorization call to the token call. The `state` parameter value is returned with the authorization code in the response url from the TAOB guest authorization call, for example: `.../taob/callback?code=HETXpvg5LKBNIHjDTWkRrf2MLVU&state=taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b`. You would use `taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b` for the `state` value in the TAOB request.
1355
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1356
+ *
1357
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1358
+ */
1359
+ getTrustedAgentAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1360
+ parameters?: CompositeParameters<{
1361
+ organizationId: string;
1362
+ } & QueryParameters, ConfigParameters>;
1363
+ headers?: {
1364
+ [key: string]: string;
1365
+ };
1366
+ body: getTrustedAgentAccessTokenBodyType & CustomRequestBody;
1367
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1368
+ /**
1369
+ * This endpoint enables trusted agents (such as customer service representatives or merchants) to obtain authorization tokens that allow them to act on behalf of registered customers. This facilitates customer support scenarios where agents need secure access to customer accounts.
1370
+ *
1371
+ * If you would like to get a raw Response object use the other getTrustedAgentAuthorizationToken function.
1372
+ *
1373
+ * @param options - An object containing the options for this method.
1374
+ * @param options.parameters - An object containing the parameters for this method.
1375
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1376
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
1377
+ * @param options.parameters.channel_id - The channel (B2C Commerce site) that the user is associated with.
1378
+ * @param options.parameters.login_id - The ID of the shopper for trusted agent access.
1379
+
1380
+ For TAOB Guest the `login_id` must be set to `Guest`.
1381
+ * @param options.parameters.idp_origin - The IDP that the shopper is associated with.
1382
+
1383
+ For TAOB Guest the `idp_origin` must be set to `slas`. This is standard for SLAS Guest requests. If any other `idp_origin` value is used, SLAS returns a bad request.
1384
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
1385
+ - `http://localhost:3000/callback`
1386
+ - `https://example.com/callback`
1387
+ - `com.example.app:redirect_uri_path`
1388
+ - ` *.subdomain.topleveldomain.com`
1389
+
1390
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
1391
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
1392
+
1393
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
1394
+
1395
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1396
+
1397
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
1398
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1399
+ *
1400
+ * @returns A promise of type void.
1401
+ */
1402
+ getTrustedAgentAuthorizationToken(options?: RequireParametersUnlessAllAreOptional<{
1403
+ parameters?: CompositeParameters<{
1404
+ organizationId: string;
1405
+ client_id: string;
1406
+ channel_id: string;
1407
+ login_id: string;
1408
+ idp_origin: string;
1409
+ redirect_uri: string;
1410
+ response_type: GetTrustedAgentAuthorizationTokenResponseTypeEnum;
1411
+ code_challenge?: string;
1412
+ } & QueryParameters, ConfigParameters>;
1413
+ headers?: {
1414
+ [key: string]: string;
1415
+ };
1416
+ }>): Promise<void>;
1417
+ /**
1418
+ * This endpoint enables trusted agents (such as customer service representatives or merchants) to obtain authorization tokens that allow them to act on behalf of registered customers. This facilitates customer support scenarios where agents need secure access to customer accounts.
1419
+ *
1420
+ * @param options - An object containing the options for this method.
1421
+ * @param options.parameters - An object containing the parameters for this method.
1422
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1423
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
1424
+ * @param options.parameters.channel_id - The channel (B2C Commerce site) that the user is associated with.
1425
+ * @param options.parameters.login_id - The ID of the shopper for trusted agent access.
1426
+
1427
+ For TAOB Guest the `login_id` must be set to `Guest`.
1428
+ * @param options.parameters.idp_origin - The IDP that the shopper is associated with.
1429
+
1430
+ For TAOB Guest the `idp_origin` must be set to `slas`. This is standard for SLAS Guest requests. If any other `idp_origin` value is used, SLAS returns a bad request.
1431
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
1432
+ - `http://localhost:3000/callback`
1433
+ - `https://example.com/callback`
1434
+ - `com.example.app:redirect_uri_path`
1435
+ - ` *.subdomain.topleveldomain.com`
1436
+
1437
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
1438
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
1439
+
1440
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
1441
+
1442
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1443
+
1444
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
1445
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1446
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1447
+ *
1448
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
1449
+ */
1450
+ getTrustedAgentAuthorizationToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1451
+ parameters?: CompositeParameters<{
1452
+ organizationId: string;
1453
+ client_id: string;
1454
+ channel_id: string;
1455
+ login_id: string;
1456
+ idp_origin: string;
1457
+ redirect_uri: string;
1458
+ response_type: GetTrustedAgentAuthorizationTokenResponseTypeEnum;
1459
+ code_challenge?: string;
1460
+ } & QueryParameters, ConfigParameters>;
1461
+ headers?: {
1462
+ [key: string]: string;
1463
+ };
1464
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
1465
+ /**
1466
+ * The SLAS client must have the `sfcc.ts_ext_on_behalf_of` scope to access this endpoint.
1467
+
1468
+
1469
+ For trusted-system requests, you can use a basic authorization header that includes a SLAS private client ID and SLAS private client secret instead of the bearer token.
1470
+
1471
+
1472
+ For trusted-system requests, you cannot use SLAS public client_ids.
1473
+ *
1474
+ * If you would like to get a raw Response object use the other getTrustedSystemAccessToken function.
1475
+ *
1476
+ * @param options - An object containing the options for this method.
1477
+ * @param options.parameters - An object containing the parameters for this method.
1478
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1479
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1480
+ * @param options.body - The data to send as the request body.
1481
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
1482
+ * @param options.body.grant_type - Grant Type
1483
+ * @param options.body.hint - Type of system used for Trusted System On Behalf of requests.
1484
+ * @param options.body.login_id - The ID used by the shopper for trusted system access. If set to `guest`, a token is returned for a guest user.
1485
+ * @param options.body.idp_origin - IDPs that work with SLAS. Use `ecom` when using B2C Commerce is the identity provider.
1486
+ * @param options.body.client_id - The SLAS public client ID for use with trusted-system requests.
1487
+ * @param options.body.channel_id - The channel (ECOM site) that the user is associated with.
1488
+ * @param options.body.email_id - The email address for the shopper that is used for trusted-system requests. If not provided, `login_id` is used instead.
1489
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`. Note: The default value for `dnt` is set to `false` for SLAS token requests except for Trusted Agent token request. For Trusted Agent token requests the default value for `dnt` is `true`.
1490
+ *
1491
+ * @returns A promise of type TokenResponse.
1492
+ */
1493
+ getTrustedSystemAccessToken(options?: RequireParametersUnlessAllAreOptional<{
1494
+ parameters?: CompositeParameters<{
1495
+ organizationId: string;
1496
+ } & QueryParameters, ConfigParameters>;
1497
+ headers?: {
1498
+ [key: string]: string;
1499
+ };
1500
+ body: getTrustedSystemAccessTokenBodyType & CustomRequestBody;
1501
+ }>): Promise<TokenResponse>;
1502
+ /**
1503
+ * The SLAS client must have the `sfcc.ts_ext_on_behalf_of` scope to access this endpoint.
1504
+
1505
+
1506
+ For trusted-system requests, you can use a basic authorization header that includes a SLAS private client ID and SLAS private client secret instead of the bearer token.
1507
+
1508
+
1509
+ For trusted-system requests, you cannot use SLAS public client_ids.
1510
+ *
1511
+ * @param options - An object containing the options for this method.
1512
+ * @param options.parameters - An object containing the parameters for this method.
1513
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1514
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1515
+ * @param options.body - The data to send as the request body.
1516
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
1517
+ * @param options.body.grant_type - Grant Type
1518
+ * @param options.body.hint - Type of system used for Trusted System On Behalf of requests.
1519
+ * @param options.body.login_id - The ID used by the shopper for trusted system access. If set to `guest`, a token is returned for a guest user.
1520
+ * @param options.body.idp_origin - IDPs that work with SLAS. Use `ecom` when using B2C Commerce is the identity provider.
1521
+ * @param options.body.client_id - The SLAS public client ID for use with trusted-system requests.
1522
+ * @param options.body.channel_id - The channel (ECOM site) that the user is associated with.
1523
+ * @param options.body.email_id - The email address for the shopper that is used for trusted-system requests. If not provided, `login_id` is used instead.
1524
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`. Note: The default value for `dnt` is set to `false` for SLAS token requests except for Trusted Agent token request. For Trusted Agent token requests the default value for `dnt` is `true`.
1525
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1526
+ *
1527
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1528
+ */
1529
+ getTrustedSystemAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1530
+ parameters?: CompositeParameters<{
1531
+ organizationId: string;
1532
+ } & QueryParameters, ConfigParameters>;
1533
+ headers?: {
1534
+ [key: string]: string;
1535
+ };
1536
+ body: getTrustedSystemAccessTokenBodyType & CustomRequestBody;
1537
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1538
+ /**
1539
+ * This endpoint returns identity information about the authenticated user in the form of OpenID Connect claims. It requires a valid access token and returns information such as user ID, name, email, and other identity attributes based on the scopes granted during authentication.
1540
+ *
1541
+ * If you would like to get a raw Response object use the other getUserInfo function.
1542
+ *
1543
+ * @param options - An object containing the options for this method.
1544
+ * @param options.parameters - An object containing the parameters for this method.
1545
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1546
+ * @param options.parameters.channel_id - Used when getting user information for a SFCC login. For an B2C Commerce customer, this is angalous to the site ID. Required when getting user information for an B2C Commerce customer.
1547
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1548
+ *
1549
+ * @returns A promise of type string.
1550
+ */
1551
+ getUserInfo(options?: RequireParametersUnlessAllAreOptional<{
1552
+ parameters?: CompositeParameters<{
1553
+ organizationId: string;
1554
+ channel_id?: string;
1555
+ } & QueryParameters, ConfigParameters>;
1556
+ headers?: {
1557
+ [key: string]: string;
1558
+ };
1559
+ }>): Promise<string>;
1560
+ /**
1561
+ * This endpoint returns identity information about the authenticated user in the form of OpenID Connect claims. It requires a valid access token and returns information such as user ID, name, email, and other identity attributes based on the scopes granted during authentication.
1562
+ *
1563
+ * @param options - An object containing the options for this method.
1564
+ * @param options.parameters - An object containing the parameters for this method.
1565
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1566
+ * @param options.parameters.channel_id - Used when getting user information for a SFCC login. For an B2C Commerce customer, this is angalous to the site ID. Required when getting user information for an B2C Commerce customer.
1567
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1568
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1569
+ *
1570
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
1571
+ */
1572
+ getUserInfo<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1573
+ parameters?: CompositeParameters<{
1574
+ organizationId: string;
1575
+ channel_id?: string;
1576
+ } & QueryParameters, ConfigParameters>;
1577
+ headers?: {
1578
+ [key: string]: string;
1579
+ };
1580
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
1581
+ /**
1582
+ * This endpoint provides OpenID Connect discovery information in a standardized format. It allows clients to programmatically discover SLAS capabilities, including available endpoints, supported authentication flows, token signing algorithms, and other configuration details. This information helps clients integrate with the authentication service with minimal manual configuration.
1583
+ *
1584
+ * If you would like to get a raw Response object use the other getWellknownOpenidConfiguration function.
1585
+ *
1586
+ * @param options - An object containing the options for this method.
1587
+ * @param options.parameters - An object containing the parameters for this method.
1588
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1589
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1590
+ *
1591
+ * @returns A promise of type string.
1592
+ */
1593
+ getWellknownOpenidConfiguration(options?: RequireParametersUnlessAllAreOptional<{
1594
+ parameters?: CompositeParameters<{
1595
+ organizationId: string;
1596
+ } & QueryParameters, ConfigParameters>;
1597
+ headers?: {
1598
+ [key: string]: string;
1599
+ };
1600
+ }>): Promise<string>;
1601
+ /**
1602
+ * This endpoint provides OpenID Connect discovery information in a standardized format. It allows clients to programmatically discover SLAS capabilities, including available endpoints, supported authentication flows, token signing algorithms, and other configuration details. This information helps clients integrate with the authentication service with minimal manual configuration.
1603
+ *
1604
+ * @param options - An object containing the options for this method.
1605
+ * @param options.parameters - An object containing the parameters for this method.
1606
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1607
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1608
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1609
+ *
1610
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
1611
+ */
1612
+ getWellknownOpenidConfiguration<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1613
+ parameters?: CompositeParameters<{
1614
+ organizationId: string;
1615
+ } & QueryParameters, ConfigParameters>;
1616
+ headers?: {
1617
+ [key: string]: string;
1618
+ };
1619
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
1620
+ /**
1621
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, as well as an access token or refresh token. Use `token_type_hint` to help identify the token.
1622
+ *
1623
+ * If you would like to get a raw Response object use the other introspectToken function.
1624
+ *
1625
+ * @param options - An object containing the options for this method.
1626
+ * @param options.parameters - An object containing the parameters for this method.
1627
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1628
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1629
+ * @param options.body - The data to send as the request body.
1630
+ * @param options.body.token - Token to inspect or revoke.
1631
+ * @param options.body.token_type_hint - Token Type Hint
1632
+ *
1633
+ * @returns A promise of type TokenActionRequest.
1634
+ */
1635
+ introspectToken(options?: RequireParametersUnlessAllAreOptional<{
1636
+ parameters?: CompositeParameters<{
1637
+ organizationId: string;
1638
+ } & QueryParameters, ConfigParameters>;
1639
+ headers?: {
1640
+ [key: string]: string;
1641
+ };
1642
+ body: introspectTokenBodyType & CustomRequestBody;
1643
+ }>): Promise<TokenActionRequest>;
1644
+ /**
1645
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, as well as an access token or refresh token. Use `token_type_hint` to help identify the token.
1646
+ *
1647
+ * @param options - An object containing the options for this method.
1648
+ * @param options.parameters - An object containing the parameters for this method.
1649
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1650
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1651
+ * @param options.body - The data to send as the request body.
1652
+ * @param options.body.token - Token to inspect or revoke.
1653
+ * @param options.body.token_type_hint - Token Type Hint
1654
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1655
+ *
1656
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenActionRequest otherwise.
1657
+ */
1658
+ introspectToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1659
+ parameters?: CompositeParameters<{
1660
+ organizationId: string;
1661
+ } & QueryParameters, ConfigParameters>;
1662
+ headers?: {
1663
+ [key: string]: string;
1664
+ };
1665
+ body: introspectTokenBodyType & CustomRequestBody;
1666
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenActionRequest>;
1667
+ /**
1668
+ * The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (B2C Commerce) instance, the OCAPI JWT is also revoked. Call this endpoint for registered users that have logged in using SLAS. Do not use this endpoint for guest users.
1669
+
1670
+ Required header: Authorization header bearer token of the Shopper access token to log out.
1671
+
1672
+ Required parameters: `refresh token`, `channel_id`, and `client`.
1673
+ *
1674
+ * If you would like to get a raw Response object use the other logoutCustomer function.
1675
+ *
1676
+ * @param options - An object containing the options for this method.
1677
+ * @param options.parameters - An object containing the parameters for this method.
1678
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1679
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
1680
+ * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
1681
+ * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
1682
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
1683
+
1684
+ If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
1685
+
1686
+ If an incorrect value is provided for the hint other than `all-sessions`, the request fails.
1687
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1688
+ *
1689
+ * @returns A promise of type TokenResponse.
1690
+ */
1691
+ logoutCustomer(options?: RequireParametersUnlessAllAreOptional<{
1692
+ parameters?: CompositeParameters<{
1693
+ organizationId: string;
1694
+ client_id: string;
1695
+ refresh_token: string;
1696
+ channel_id?: string;
1697
+ hint?: LogoutCustomerHintEnum;
1698
+ } & QueryParameters, ConfigParameters>;
1699
+ headers?: {
1700
+ [key: string]: string;
1701
+ };
1702
+ }>): Promise<TokenResponse>;
1703
+ /**
1704
+ * The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (B2C Commerce) instance, the OCAPI JWT is also revoked. Call this endpoint for registered users that have logged in using SLAS. Do not use this endpoint for guest users.
1705
+
1706
+ Required header: Authorization header bearer token of the Shopper access token to log out.
1707
+
1708
+ Required parameters: `refresh token`, `channel_id`, and `client`.
1709
+ *
1710
+ * @param options - An object containing the options for this method.
1711
+ * @param options.parameters - An object containing the parameters for this method.
1712
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1713
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
1714
+ * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
1715
+ * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
1716
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
1717
+
1718
+ If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
1719
+
1720
+ If an incorrect value is provided for the hint other than `all-sessions`, the request fails.
1721
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1722
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1723
+ *
1724
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
1725
+ */
1726
+ logoutCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1727
+ parameters?: CompositeParameters<{
1728
+ organizationId: string;
1729
+ client_id: string;
1730
+ refresh_token: string;
1731
+ channel_id?: string;
1732
+ hint?: LogoutCustomerHintEnum;
1733
+ } & QueryParameters, ConfigParameters>;
1734
+ headers?: {
1735
+ [key: string]: string;
1736
+ };
1737
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
1738
+ /**
1739
+ * This endpoint allows a customer to set a new password using a valid password reset token. The customer must provide the token received from the password/reset endpoint along with the desired new password.
1740
+ *
1741
+ * If you would like to get a raw Response object use the other resetPassword function.
1742
+ *
1743
+ * @param options - An object containing the options for this method.
1744
+ * @param options.parameters - An object containing the parameters for this method.
1745
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1746
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1747
+ * @param options.body - The data to send as the request body.
1748
+ * @param options.body.client_id - -| The public client ID. When using the `hint` query parameter either a public or private client ID can be used.
1749
+ * @param options.body.pwd_action_token - Password action token that was returned from the `/password/reset` endpoint.
1750
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1751
+ * @param options.body.new_password - The new password to set for the shopper associated with the password action token.
1752
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
1753
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_verifier for password reset request. If the `hint` query parameter is used it must also have been used in the password action request.
1754
+ *
1755
+ * @returns A promise of type void.
1756
+ */
1757
+ resetPassword(options?: RequireParametersUnlessAllAreOptional<{
1758
+ parameters?: CompositeParameters<{
1759
+ organizationId: string;
1760
+ } & QueryParameters, ConfigParameters>;
1761
+ headers?: {
1762
+ [key: string]: string;
1763
+ };
1764
+ body: resetPasswordBodyType & CustomRequestBody;
1765
+ }>): Promise<void>;
1766
+ /**
1767
+ * This endpoint allows a customer to set a new password using a valid password reset token. The customer must provide the token received from the password/reset endpoint along with the desired new password.
1768
+ *
1769
+ * @param options - An object containing the options for this method.
1770
+ * @param options.parameters - An object containing the parameters for this method.
1771
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1772
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1773
+ * @param options.body - The data to send as the request body.
1774
+ * @param options.body.client_id - -| The public client ID. When using the `hint` query parameter either a public or private client ID can be used.
1775
+ * @param options.body.pwd_action_token - Password action token that was returned from the `/password/reset` endpoint.
1776
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
1777
+ * @param options.body.new_password - The new password to set for the shopper associated with the password action token.
1778
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
1779
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_verifier for password reset request. If the `hint` query parameter is used it must also have been used in the password action request.
1780
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1781
+ *
1782
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
1783
+ */
1784
+ resetPassword<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1785
+ parameters?: CompositeParameters<{
1786
+ organizationId: string;
1787
+ } & QueryParameters, ConfigParameters>;
1788
+ headers?: {
1789
+ [key: string]: string;
1790
+ };
1791
+ body: resetPasswordBodyType & CustomRequestBody;
1792
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
1793
+ /**
1794
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, and the refresh token to be revoked is required in the body.
1795
+ *
1796
+ * If you would like to get a raw Response object use the other revokeToken function.
1797
+ *
1798
+ * @param options - An object containing the options for this method.
1799
+ * @param options.parameters - An object containing the parameters for this method.
1800
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1801
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1802
+ * @param options.body - The data to send as the request body.
1803
+ * @param options.body.token - Token to inspect or revoke.
1804
+ * @param options.body.token_type_hint - Token Type Hint
1805
+ *
1806
+ * @returns A promise of type TokenActionRequest.
1807
+ */
1808
+ revokeToken(options?: RequireParametersUnlessAllAreOptional<{
1809
+ parameters?: CompositeParameters<{
1810
+ organizationId: string;
1811
+ } & QueryParameters, ConfigParameters>;
1812
+ headers?: {
1813
+ [key: string]: string;
1814
+ };
1815
+ body: revokeTokenBodyType & CustomRequestBody;
1816
+ }>): Promise<TokenActionRequest>;
1817
+ /**
1818
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, and the refresh token to be revoked is required in the body.
1819
+ *
1820
+ * @param options - An object containing the options for this method.
1821
+ * @param options.parameters - An object containing the parameters for this method.
1822
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
1823
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
1824
+ * @param options.body - The data to send as the request body.
1825
+ * @param options.body.token - Token to inspect or revoke.
1826
+ * @param options.body.token_type_hint - Token Type Hint
1827
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
1828
+ *
1829
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenActionRequest otherwise.
1830
+ */
1831
+ revokeToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
1832
+ parameters?: CompositeParameters<{
1833
+ organizationId: string;
1834
+ } & QueryParameters, ConfigParameters>;
1835
+ headers?: {
1836
+ [key: string]: string;
1837
+ };
1838
+ body: revokeTokenBodyType & CustomRequestBody;
1839
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenActionRequest>;
1840
+ }
1841
+ declare namespace ShopperLoginApiTypes {
1842
+ /*
1843
+ * Copyright (c) 2023, Salesforce, Inc.
1844
+ * All rights reserved.
1845
+ * SPDX-License-Identifier: BSD-3-Clause
1846
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
1847
+ */
1848
+ /**
1849
+ * Makes a type easier to read.
1850
+ */
1851
+ type Prettify<T> = NonNullable<{
1852
+ [K in keyof T]: T[K];
1853
+ }>;
1854
+ /**
1855
+ * Generates the types required on a method, based on those provided in the config.
1856
+ */
1857
+ type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
1858
+ /**
1859
+ * If an object has a `parameters` property, and the `parameters` object has required properties,
1860
+ * then the `parameters` property on the root object is marked as required.
1861
+ */
1862
+ type RequireParametersUnlessAllAreOptional<T extends {
1863
+ parameters?: Record<string, unknown>;
1864
+ }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
1865
+ /**
1866
+ * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
1867
+ * if not specified.
1868
+ */
1869
+ interface BaseUriParameters {
1870
+ shortCode: string;
1871
+ }
1872
+ type LocaleCode = {
1873
+ [key: string]: any;
1874
+ };
1875
+ /**
1876
+ * Generic interface for path parameters.
1877
+ */
1878
+ interface PathParameters {
1879
+ [key: string]: string | number | boolean;
1880
+ }
1881
+ /**
1882
+ * Generic interface for query parameters.
1883
+ */
1884
+ interface QueryParameters {
1885
+ [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
1886
+ }
1887
+ /**
1888
+ * Generic interface for all parameter types.
1889
+ */
1890
+ type UrlParameters = PathParameters | QueryParameters;
1891
+ /**
1892
+ * Custom query parameter type with any string prefixed with `c_` as the key and the allowed
1893
+ * types for query parameters for the value.
1894
+ */
1895
+ type CustomQueryParameters = {
1896
+ [key in `c_${string}`]: string | number | boolean | string[] | number[];
1897
+ };
1898
+ /**
1899
+ * Custom body request type with any string prefixed with `c_` as the key and the allowed
1900
+ * types for the value.
1901
+ */
1902
+ type CustomRequestBody = {
1903
+ [key in `c_${string}`]: string | number | boolean | string[] | number[] | {
1904
+ [key: string]: unknown;
1905
+ };
1906
+ };
1907
+ /**
1908
+ * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
1909
+ * it from the `RequestInit` provided by node-fetch.
1910
+ */
1911
+ type BrowserRequestInit = RequestInit;
1912
+ /**
1913
+ * Any properties supported in either the browser or node are accepted.
1914
+ * Using the right properties in the right context is left to the user.
1915
+ */
1916
+ type FetchOptions = NodeRequestInit & BrowserRequestInit;
1917
+ /**
1918
+ * Base options that can be passed to the `ClientConfig` class.
1919
+ */
1920
+ interface ClientConfigInit<Params extends BaseUriParameters> {
1921
+ baseUri?: string;
1922
+ proxy?: string;
1923
+ headers?: {
1924
+ [key: string]: string;
1925
+ };
1926
+ parameters: Params;
1927
+ fetchOptions?: FetchOptions;
1928
+ transformRequest?: (data: unknown, headers: {
1929
+ [key: string]: string;
1930
+ }) => Required<FetchOptions>["body"];
1931
+ throwOnBadResponse?: boolean;
1932
+ }
1933
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
1934
+ /**
1935
+ * Configuration parameters common to Commerce SDK clients
1936
+ */
1937
+ class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
1938
+ baseUri?: string;
1939
+ proxy?: string;
1940
+ headers: {
1941
+ [key: string]: string;
1942
+ };
1943
+ parameters: Params;
1944
+ fetchOptions: FetchOptions;
1945
+ transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
1946
+ throwOnBadResponse: boolean;
1947
+ constructor(config: ClientConfigInit<Params>);
1948
+ static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
1949
+ }
1950
+ /**
1951
+ * Grant Type
1952
+ */
1953
+ type GrantType = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
1954
+ /**
1955
+ * @type Oauth2ErrorResponse:
1956
+ *
1957
+ * @property error:
1958
+ *
1959
+ * @property error_uri:
1960
+ *
1961
+ * @property error_description:
1962
+ *
1963
+ */
1964
+ type Oauth2ErrorResponse = {
1965
+ error: string;
1966
+ error_uri?: string;
1967
+ error_description?: string;
1968
+ } & {
1969
+ [key: string]: any;
1970
+ };
1971
+ /**
1972
+ * Response Type
1973
+ */
1974
+ type ResponseType = "code";
1975
+ /**
1976
+ * @type TokenActionRequest:
1977
+ *
1978
+ * @property token: Token to inspect or revoke.
1979
+ *
1980
+ * @property token_type_hint: Token Type Hint
1981
+ *
1982
+ */
1983
+ type TokenActionRequest = {
1984
+ token: string;
1985
+ token_type_hint?: TokenActionRequestTokenTypeHintEnum;
1986
+ } & {
1987
+ [key: string]: any;
1988
+ };
1989
+ type TokenActionRequestTokenTypeHintEnum = "access_token" | "refresh_token";
1990
+ /**
1991
+ * Token Type
1992
+ */
1993
+ type TokenType = "Bearer";
1994
+ /**
1995
+ * @type TokenResponse:
1996
+ *
1997
+ * @property access_token: Short term shopper JWT that can be used to access Shopper APIs. Valid for 30 minutes. A trusted agent shopper JWT is valid for 15 min.
1998
+ *
1999
+ * @property id_token: User ID token. Valid for 30 minutes.
2000
+ *
2001
+ * @property refresh_token: Long term refresh token that can be used to refresh an access token. Valid for 30 days. The refresh_token will not be returned for trusted agents JWTs. A JWT for trusted agents expires after 15 minutes and is not refreshable. When expired, then app must restart the authorization flow and make another request to the /trusted-agent/authorize endpoint.
2002
+ *
2003
+ * @property expires_in: Remaining access token expiry time, in seconds.
2004
+ *
2005
+ * @property refresh_token_expires_in: Remaining refresh token expiry time, in seconds.
2006
+ *
2007
+ * @property token_type:
2008
+ *
2009
+ * @property usid: The unique shopper ID. Returned when using the `client_credentials` grant type.
2010
+ *
2011
+ * @property customer_id: Customer\'s ID
2012
+ *
2013
+ * @property enc_user_id: MD5 Hashed B2C Commerce user ID in uppercase.
2014
+ *
2015
+ * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
2016
+ * - **Max Length:** 8192
2017
+ *
2018
+ */
2019
+ type TokenResponse = {
2020
+ access_token: string;
2021
+ id_token: string;
2022
+ refresh_token: string;
2023
+ expires_in: number;
2024
+ refresh_token_expires_in: number;
2025
+ token_type: TokenType;
2026
+ usid: string;
2027
+ customer_id: string;
2028
+ enc_user_id: string;
2029
+ idp_access_token: string;
2030
+ } & {
2031
+ [key: string]: any;
2032
+ };
2033
+ type AuthorizeCustomerResponseTypeEnum = "code";
2034
+ type AuthorizeCustomerScopeEnum = "openid" | "offline_access" | "email";
2035
+ type AuthorizePasswordlessCustomerModeEnum = "callback" | "sms";
2036
+ type GetPasswordLessAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
2037
+ type GetPasswordResetTokenModeEnum = "callback" | "sms";
2038
+ type GetSessionBridgeAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
2039
+ type GetTrustedAgentAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
2040
+ type GetTrustedAgentAuthorizationTokenResponseTypeEnum = "code";
2041
+ type GetTrustedSystemAccessTokenGrantTypeEnum = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
2042
+ type GetTrustedSystemAccessTokenHintEnum = "ts_ext_on_behalf_of";
2043
+ type GetTrustedSystemAccessTokenIdpOriginEnum = "apple" | "auth0" | "azure" | "azure_adb2c" | "cognito" | "default" | "ecom" | "facebook" | "forgerock" | "gigya" | "gigya_socialize" | "google" | "okta" | "ping" | "salesforce";
2044
+ type IntrospectTokenTokenTypeHintEnum = "access_token" | "refresh_token";
2045
+ type LogoutCustomerHintEnum = "all-sessions";
2046
+ type RevokeTokenTokenTypeHintEnum = "access_token" | "refresh_token";
2047
+ type authenticateCustomerQueryParameters = {};
2048
+ type authenticateCustomerPathParameters = {
2049
+ organizationId: string;
2050
+ };
2051
+ type authenticateCustomerBodyType = {
2052
+ client_id?: string;
2053
+ response_type?: ResponseType;
2054
+ redirect_uri: string;
2055
+ state?: string;
2056
+ scope?: string;
2057
+ usid?: string;
2058
+ channel_id: string;
2059
+ code_challenge?: string;
2060
+ };
2061
+ type authorizeCustomerQueryParameters = {
2062
+ redirect_uri: string;
2063
+ response_type: "code";
2064
+ client_id: string;
2065
+ scope?: "openid" | "offline_access" | "email";
2066
+ state?: string;
2067
+ usid?: string;
2068
+ hint?: string;
2069
+ channel_id?: string;
2070
+ code_challenge?: string;
2071
+ ui_locales?: string;
2072
+ };
2073
+ type authorizeCustomerPathParameters = {
2074
+ organizationId: string;
2075
+ };
2076
+ type authorizePasswordlessCustomerQueryParameters = {};
2077
+ type authorizePasswordlessCustomerPathParameters = {
2078
+ organizationId: string;
2079
+ };
2080
+ type authorizePasswordlessCustomerBodyType = {
2081
+ user_id: string;
2082
+ mode: string;
2083
+ locale?: string;
2084
+ usid?: string;
2085
+ channel_id: string;
2086
+ callback_uri?: string;
2087
+ };
2088
+ type getAccessTokenQueryParameters = {};
2089
+ type getAccessTokenPathParameters = {
2090
+ organizationId: string;
2091
+ };
2092
+ type getAccessTokenBodyType = {
2093
+ refresh_token?: string;
2094
+ code?: string;
2095
+ usid?: string;
2096
+ grant_type: GrantType;
2097
+ redirect_uri?: string;
2098
+ code_verifier?: string;
2099
+ client_id?: string;
2100
+ channel_id?: string;
2101
+ dnt?: string;
2102
+ };
2103
+ type getJwksUriQueryParameters = {};
2104
+ type getJwksUriPathParameters = {
2105
+ organizationId: string;
2106
+ };
2107
+ type getPasswordLessAccessTokenQueryParameters = {};
2108
+ type getPasswordLessAccessTokenPathParameters = {
2109
+ organizationId: string;
2110
+ };
2111
+ type getPasswordLessAccessTokenBodyType = {
2112
+ grant_type: string;
2113
+ hint: string;
2114
+ pwdless_login_token: string;
2115
+ client_id?: string;
2116
+ code_verifier?: string;
2117
+ };
2118
+ type getPasswordResetTokenQueryParameters = {};
2119
+ type getPasswordResetTokenPathParameters = {
2120
+ organizationId: string;
2121
+ };
2122
+ type getPasswordResetTokenBodyType = {
2123
+ user_id: string;
2124
+ mode: string;
2125
+ channel_id: string;
2126
+ locale?: string;
2127
+ client_id?: string;
2128
+ code_challenge?: string;
2129
+ callback_uri?: string;
2130
+ idp_name?: string;
2131
+ hint?: string;
2132
+ };
2133
+ type getSessionBridgeAccessTokenQueryParameters = {};
2134
+ type getSessionBridgeAccessTokenPathParameters = {
2135
+ organizationId: string;
2136
+ };
2137
+ type getSessionBridgeAccessTokenBodyType = {
2138
+ code: string;
2139
+ client_id: string;
2140
+ channel_id: string;
2141
+ code_verifier: string;
2142
+ dwsid: string;
2143
+ grant_type: string;
2144
+ login_id: string;
2145
+ dwsgst?: string;
2146
+ dwsrst?: string;
2147
+ usid?: string;
2148
+ dnt?: string;
2149
+ };
2150
+ type getTrustedAgentAccessTokenQueryParameters = {};
2151
+ type getTrustedAgentAccessTokenPathParameters = {
2152
+ organizationId: string;
2153
+ };
2154
+ type getTrustedAgentAccessTokenBodyType = {
2155
+ agent_id?: string;
2156
+ client_id: string;
2157
+ channel_id: string;
2158
+ code_verifier: string;
2159
+ grant_type: string;
2160
+ login_id: string;
2161
+ idp_origin: string;
2162
+ usid?: string;
2163
+ dnt?: string;
2164
+ state?: string;
2165
+ };
2166
+ type getTrustedAgentAuthorizationTokenQueryParameters = {
2167
+ client_id: string;
2168
+ channel_id: string;
2169
+ code_challenge?: string;
2170
+ login_id: string;
2171
+ idp_origin: string;
2172
+ redirect_uri: string;
2173
+ response_type: "code";
2174
+ };
2175
+ type getTrustedAgentAuthorizationTokenPathParameters = {
2176
+ organizationId: string;
2177
+ };
2178
+ type getTrustedSystemAccessTokenQueryParameters = {};
2179
+ type getTrustedSystemAccessTokenPathParameters = {
2180
+ organizationId: string;
2181
+ };
2182
+ type getTrustedSystemAccessTokenBodyType = {
2183
+ usid?: string;
2184
+ grant_type: string;
2185
+ hint: string;
2186
+ login_id: string;
2187
+ idp_origin: string;
2188
+ client_id: string;
2189
+ channel_id: string;
2190
+ email_id?: string;
2191
+ dnt?: string;
2192
+ };
2193
+ type getUserInfoQueryParameters = {
2194
+ channel_id?: string;
2195
+ };
2196
+ type getUserInfoPathParameters = {
2197
+ organizationId: string;
2198
+ };
2199
+ type getWellknownOpenidConfigurationQueryParameters = {};
2200
+ type getWellknownOpenidConfigurationPathParameters = {
2201
+ organizationId: string;
2202
+ };
2203
+ type introspectTokenQueryParameters = {};
2204
+ type introspectTokenPathParameters = {
2205
+ organizationId: string;
2206
+ };
2207
+ type introspectTokenBodyType = {
2208
+ token: string;
2209
+ token_type_hint?: string;
2210
+ };
2211
+ type logoutCustomerQueryParameters = {
2212
+ client_id: string;
2213
+ refresh_token: string;
2214
+ channel_id?: string;
2215
+ hint?: "all-sessions";
2216
+ };
2217
+ type logoutCustomerPathParameters = {
2218
+ organizationId: string;
2219
+ };
2220
+ type resetPasswordQueryParameters = {};
2221
+ type resetPasswordPathParameters = {
2222
+ organizationId: string;
2223
+ };
2224
+ type resetPasswordBodyType = {
2225
+ client_id: string;
2226
+ pwd_action_token: string;
2227
+ code_verifier: string;
2228
+ new_password?: string;
2229
+ channel_id: string;
2230
+ hint?: string;
2231
+ };
2232
+ type revokeTokenQueryParameters = {};
2233
+ type revokeTokenPathParameters = {
2234
+ organizationId: string;
2235
+ };
2236
+ type revokeTokenBodyType = {
2237
+ token: string;
2238
+ token_type_hint?: string;
2239
+ };
2240
+ /**
2241
+ * All path parameters that are used by at least one ShopperLogin method.
2242
+ */
2243
+ type ShopperLoginPathParameters = Partial<authenticateCustomerPathParameters & authorizeCustomerPathParameters & authorizePasswordlessCustomerPathParameters & getAccessTokenPathParameters & getJwksUriPathParameters & getPasswordLessAccessTokenPathParameters & getPasswordResetTokenPathParameters & getSessionBridgeAccessTokenPathParameters & getTrustedAgentAccessTokenPathParameters & getTrustedAgentAuthorizationTokenPathParameters & getTrustedSystemAccessTokenPathParameters & getUserInfoPathParameters & getWellknownOpenidConfigurationPathParameters & introspectTokenPathParameters & logoutCustomerPathParameters & resetPasswordPathParameters & revokeTokenPathParameters & {}>;
2244
+ /**
2245
+ * All query parameters that are used by at least one ShopperLogin method.
2246
+ */
2247
+ type ShopperLoginQueryParameters = Partial<authenticateCustomerQueryParameters & authorizeCustomerQueryParameters & authorizePasswordlessCustomerQueryParameters & getAccessTokenQueryParameters & getJwksUriQueryParameters & getPasswordLessAccessTokenQueryParameters & getPasswordResetTokenQueryParameters & getSessionBridgeAccessTokenQueryParameters & getTrustedAgentAccessTokenQueryParameters & getTrustedAgentAuthorizationTokenQueryParameters & getTrustedSystemAccessTokenQueryParameters & getUserInfoQueryParameters & getWellknownOpenidConfigurationQueryParameters & introspectTokenQueryParameters & logoutCustomerQueryParameters & resetPasswordQueryParameters & revokeTokenQueryParameters & {}>;
2248
+ /**
2249
+ * All parameters that are used by ShopperLogin.
2250
+ */
2251
+ type ShopperLoginParameters = ShopperLoginPathParameters & BaseUriParameters & ShopperLoginQueryParameters;
2252
+ /**
2253
+ * [Shopper Login](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-login:Summary)
2254
+ * ==================================
2255
+ *
2256
+ * *# API Overview
2257
+
2258
+ The Shopper Login and API Access Service (SLAS) enables secure access to Commerce Cloud’s Shopper APIs for a wide range of headless commerce applications.
2259
+
2260
+ **Important:** Before using this API, see [Authorization for Shopper APIs](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html) in the Get Started guides and the more detailed [SLAS guides](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html) for instructions on setting up a SLAS client, obtaining credentials, as well as flow and use case information.
2261
+
2262
+ For load shedding and rate limiting information, see [Load Shedding and Rate Limiting.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/throttle-rates.html)*<br />
2263
+ *
2264
+ * Simple example:
2265
+ *
2266
+ * ```typescript
2267
+ * import { ShopperLogin } from "commerce-sdk-isomorphic";
2268
+ *
2269
+ * const clientConfig = {
2270
+ * parameters: {
2271
+ * clientId: "XXXXXX",
2272
+ * organizationId: "XXXX",
2273
+ * shortCode: "XXX",
2274
+ * siteId: "XX"
2275
+ * }
2276
+ * };
2277
+ * const shopperLoginClient = new ShopperLogin(clientConfig);
2278
+ * ```
2279
+ *
2280
+ * <span style="font-size:.7em; display:block; text-align: right">
2281
+ * API Version: 0.0.33<br />
2282
+ * Last Updated: <br />
2283
+ * </span>
2284
+ *
2285
+ *
2286
+ */
2287
+ class ShopperLogin<ConfigParameters extends ShopperLoginParameters & Record<string, unknown>> {
2288
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
2289
+ clientConfig: ClientConfig<ConfigParameters> & {
2290
+ baseUri: string;
2291
+ };
2292
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/v1";
2293
+ static readonly apiPaths: {
2294
+ authenticateCustomer: string;
2295
+ authorizeCustomer: string;
2296
+ authorizePasswordlessCustomer: string;
2297
+ getAccessToken: string;
2298
+ getJwksUri: string;
2299
+ getPasswordLessAccessToken: string;
2300
+ getPasswordResetToken: string;
2301
+ getSessionBridgeAccessToken: string;
2302
+ getTrustedAgentAccessToken: string;
2303
+ getTrustedAgentAuthorizationToken: string;
2304
+ getTrustedSystemAccessToken: string;
2305
+ getUserInfo: string;
2306
+ getWellknownOpenidConfiguration: string;
2307
+ introspectToken: string;
2308
+ logoutCustomer: string;
2309
+ resetPassword: string;
2310
+ revokeToken: string;
2311
+ };
2312
+ constructor(config: ClientConfigInit<ConfigParameters>);
2313
+ static readonly paramKeys: {
2314
+ readonly authenticateCustomer: readonly [
2315
+ "organizationId",
2316
+ "redirect_uri",
2317
+ "channel_id",
2318
+ "client_id",
2319
+ "response_type",
2320
+ "state",
2321
+ "scope",
2322
+ "usid",
2323
+ "code_challenge"
2324
+ ];
2325
+ readonly authenticateCustomerRequired: readonly [
2326
+ "organizationId",
2327
+ "redirect_uri",
2328
+ "channel_id"
2329
+ ];
2330
+ readonly authorizeCustomer: readonly [
2331
+ "organizationId",
2332
+ "redirect_uri",
2333
+ "response_type",
2334
+ "client_id",
2335
+ "scope",
2336
+ "state",
2337
+ "usid",
2338
+ "hint",
2339
+ "channel_id",
2340
+ "code_challenge",
2341
+ "ui_locales"
2342
+ ];
2343
+ readonly authorizeCustomerRequired: readonly [
2344
+ "organizationId",
2345
+ "redirect_uri",
2346
+ "response_type",
2347
+ "client_id"
2348
+ ];
2349
+ readonly authorizePasswordlessCustomer: readonly [
2350
+ "organizationId",
2351
+ "user_id",
2352
+ "mode",
2353
+ "channel_id",
2354
+ "locale",
2355
+ "usid",
2356
+ "callback_uri"
2357
+ ];
2358
+ readonly authorizePasswordlessCustomerRequired: readonly [
2359
+ "organizationId",
2360
+ "user_id",
2361
+ "mode",
2362
+ "channel_id"
2363
+ ];
2364
+ readonly getAccessToken: readonly [
2365
+ "organizationId",
2366
+ "grant_type",
2367
+ "refresh_token",
2368
+ "code",
2369
+ "usid",
2370
+ "redirect_uri",
2371
+ "code_verifier",
2372
+ "client_id",
2373
+ "channel_id",
2374
+ "dnt"
2375
+ ];
2376
+ readonly getAccessTokenRequired: readonly [
2377
+ "organizationId",
2378
+ "grant_type"
2379
+ ];
2380
+ readonly getJwksUri: readonly [
2381
+ "organizationId"
2382
+ ];
2383
+ readonly getJwksUriRequired: readonly [
2384
+ "organizationId"
2385
+ ];
2386
+ readonly getPasswordLessAccessToken: readonly [
2387
+ "organizationId",
2388
+ "grant_type",
2389
+ "hint",
2390
+ "pwdless_login_token",
2391
+ "client_id",
2392
+ "code_verifier"
2393
+ ];
2394
+ readonly getPasswordLessAccessTokenRequired: readonly [
2395
+ "organizationId",
2396
+ "grant_type",
2397
+ "hint",
2398
+ "pwdless_login_token"
2399
+ ];
2400
+ readonly getPasswordResetToken: readonly [
2401
+ "organizationId",
2402
+ "user_id",
2403
+ "mode",
2404
+ "channel_id",
2405
+ "locale",
2406
+ "client_id",
2407
+ "code_challenge",
2408
+ "callback_uri",
2409
+ "idp_name",
2410
+ "hint"
2411
+ ];
2412
+ readonly getPasswordResetTokenRequired: readonly [
2413
+ "organizationId",
2414
+ "user_id",
2415
+ "mode",
2416
+ "channel_id"
2417
+ ];
2418
+ readonly getSessionBridgeAccessToken: readonly [
2419
+ "organizationId",
2420
+ "code",
2421
+ "client_id",
2422
+ "channel_id",
2423
+ "code_verifier",
2424
+ "dwsid",
2425
+ "grant_type",
2426
+ "login_id",
2427
+ "dwsgst",
2428
+ "dwsrst",
2429
+ "usid",
2430
+ "dnt"
2431
+ ];
2432
+ readonly getSessionBridgeAccessTokenRequired: readonly [
2433
+ "organizationId",
2434
+ "code",
2435
+ "client_id",
2436
+ "channel_id",
2437
+ "code_verifier",
2438
+ "dwsid",
2439
+ "grant_type",
2440
+ "login_id"
2441
+ ];
2442
+ readonly getTrustedAgentAccessToken: readonly [
2443
+ "organizationId",
2444
+ "client_id",
2445
+ "channel_id",
2446
+ "code_verifier",
2447
+ "grant_type",
2448
+ "login_id",
2449
+ "idp_origin",
2450
+ "agent_id",
2451
+ "usid",
2452
+ "dnt",
2453
+ "state"
2454
+ ];
2455
+ readonly getTrustedAgentAccessTokenRequired: readonly [
2456
+ "organizationId",
2457
+ "client_id",
2458
+ "channel_id",
2459
+ "code_verifier",
2460
+ "grant_type",
2461
+ "login_id",
2462
+ "idp_origin"
2463
+ ];
2464
+ readonly getTrustedAgentAuthorizationToken: readonly [
2465
+ "organizationId",
2466
+ "client_id",
2467
+ "channel_id",
2468
+ "login_id",
2469
+ "idp_origin",
2470
+ "redirect_uri",
2471
+ "response_type",
2472
+ "code_challenge"
2473
+ ];
2474
+ readonly getTrustedAgentAuthorizationTokenRequired: readonly [
2475
+ "organizationId",
2476
+ "client_id",
2477
+ "channel_id",
2478
+ "login_id",
2479
+ "idp_origin",
2480
+ "redirect_uri",
2481
+ "response_type"
2482
+ ];
2483
+ readonly getTrustedSystemAccessToken: readonly [
2484
+ "organizationId",
2485
+ "grant_type",
2486
+ "hint",
2487
+ "login_id",
2488
+ "idp_origin",
2489
+ "client_id",
2490
+ "channel_id",
2491
+ "usid",
2492
+ "email_id",
2493
+ "dnt"
2494
+ ];
2495
+ readonly getTrustedSystemAccessTokenRequired: readonly [
2496
+ "organizationId",
2497
+ "grant_type",
2498
+ "hint",
2499
+ "login_id",
2500
+ "idp_origin",
2501
+ "client_id",
2502
+ "channel_id"
2503
+ ];
2504
+ readonly getUserInfo: readonly [
2505
+ "organizationId",
2506
+ "channel_id"
2507
+ ];
2508
+ readonly getUserInfoRequired: readonly [
2509
+ "organizationId"
2510
+ ];
2511
+ readonly getWellknownOpenidConfiguration: readonly [
2512
+ "organizationId"
2513
+ ];
2514
+ readonly getWellknownOpenidConfigurationRequired: readonly [
2515
+ "organizationId"
2516
+ ];
2517
+ readonly introspectToken: readonly [
2518
+ "organizationId",
2519
+ "token",
2520
+ "token_type_hint"
2521
+ ];
2522
+ readonly introspectTokenRequired: readonly [
2523
+ "organizationId",
2524
+ "token"
2525
+ ];
2526
+ readonly logoutCustomer: readonly [
2527
+ "organizationId",
2528
+ "client_id",
2529
+ "refresh_token",
2530
+ "channel_id",
2531
+ "hint"
2532
+ ];
2533
+ readonly logoutCustomerRequired: readonly [
2534
+ "organizationId",
2535
+ "client_id",
2536
+ "refresh_token"
2537
+ ];
2538
+ readonly resetPassword: readonly [
2539
+ "organizationId",
2540
+ "client_id",
2541
+ "pwd_action_token",
2542
+ "code_verifier",
2543
+ "channel_id",
2544
+ "new_password",
2545
+ "hint"
2546
+ ];
2547
+ readonly resetPasswordRequired: readonly [
2548
+ "organizationId",
2549
+ "client_id",
2550
+ "pwd_action_token",
2551
+ "code_verifier",
2552
+ "channel_id"
2553
+ ];
2554
+ readonly revokeToken: readonly [
2555
+ "organizationId",
2556
+ "token",
2557
+ "token_type_hint"
2558
+ ];
2559
+ readonly revokeTokenRequired: readonly [
2560
+ "organizationId",
2561
+ "token"
2562
+ ];
2563
+ };
2564
+ /**
2565
+ * This follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).
2566
+
2567
+ For PKCE values:
2568
+ - The `code_verifier` string is a random string used for the `/token` endpoint request.
2569
+ - The `code_challenge` is an encoded version of the `code_verifier` string using an SHA-256 hash.
2570
+
2571
+ The request must include a basic authorization header that contains a Base64 encoded version of the following string: `<shopperUserID>:<shopperPassword>`.
2572
+ Required parameters: `code_challenge`, `channel_id`, `client_id`, and `redirect_uri`.
2573
+
2574
+ Optional parameters: `usid`.
2575
+ The SLAS `/login` endpoint redirects back to the redirect URI and returns an authorization code.
2576
+ Calls to `/login` made with the same loginId and tenantId within 1 second result in a conflict.
2577
+ *
2578
+ * If you would like to get a raw Response object use the other authenticateCustomer function.
2579
+ *
2580
+ * @param options - An object containing the options for this method.
2581
+ * @param options.parameters - An object containing the parameters for this method.
2582
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2583
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2584
+ * @param options.body - The data to send as the request body.
2585
+ * @param options.body.client_id - SLAS client ID. Required when the grant type is `authorization_code_pkce`.
2586
+ * @param options.body.response_type - Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).
2587
+ * @param options.body.redirect_uri - The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
2588
+ * @param options.body.state - Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
2589
+ * @param options.body.scope - Scopes to limit an application\'s access to a user\'s account.
2590
+ * @param options.body.usid - The unique shopper ID.
2591
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
2592
+ * @param options.body.code_challenge - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_challenge` is optional when using a private client id for the token request.
2593
+ *
2594
+ * @returns A promise of type void.
2595
+ */
2596
+ authenticateCustomer(options?: RequireParametersUnlessAllAreOptional<{
2597
+ parameters?: CompositeParameters<{
2598
+ organizationId: string;
2599
+ } & QueryParameters, ConfigParameters>;
2600
+ headers?: {
2601
+ [key: string]: string;
2602
+ };
2603
+ body: authenticateCustomerBodyType & CustomRequestBody;
2604
+ }>): Promise<void>;
2605
+ /**
2606
+ * This follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).
2607
+
2608
+ For PKCE values:
2609
+ - The `code_verifier` string is a random string used for the `/token` endpoint request.
2610
+ - The `code_challenge` is an encoded version of the `code_verifier` string using an SHA-256 hash.
2611
+
2612
+ The request must include a basic authorization header that contains a Base64 encoded version of the following string: `<shopperUserID>:<shopperPassword>`.
2613
+ Required parameters: `code_challenge`, `channel_id`, `client_id`, and `redirect_uri`.
2614
+
2615
+ Optional parameters: `usid`.
2616
+ The SLAS `/login` endpoint redirects back to the redirect URI and returns an authorization code.
2617
+ Calls to `/login` made with the same loginId and tenantId within 1 second result in a conflict.
2618
+ *
2619
+ * @param options - An object containing the options for this method.
2620
+ * @param options.parameters - An object containing the parameters for this method.
2621
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2622
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2623
+ * @param options.body - The data to send as the request body.
2624
+ * @param options.body.client_id - SLAS client ID. Required when the grant type is `authorization_code_pkce`.
2625
+ * @param options.body.response_type - Must be `code`. Indicates that the client wants an authorization code (when the grant type is `authorization_code`).
2626
+ * @param options.body.redirect_uri - The URI to which the server redirects the browser after the user grants the authorization. The URI must be registered with the SLAS client. A variety of URI formats and wildcards for host are supported, but app links like airbnb:// or fb:// are not. Examples of supported URIs: Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
2627
+ * @param options.body.state - Value to be sent by the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
2628
+ * @param options.body.scope - Scopes to limit an application\'s access to a user\'s account.
2629
+ * @param options.body.usid - The unique shopper ID.
2630
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
2631
+ * @param options.body.code_challenge - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_challenge` is optional when using a private client id for the token request.
2632
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2633
+ *
2634
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
2635
+ */
2636
+ authenticateCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2637
+ parameters?: CompositeParameters<{
2638
+ organizationId: string;
2639
+ } & QueryParameters, ConfigParameters>;
2640
+ headers?: {
2641
+ [key: string]: string;
2642
+ };
2643
+ body: authenticateCustomerBodyType & CustomRequestBody;
2644
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
2645
+ /**
2646
+ * This is the first step of the OAuth 2.1 authorization code flow, in which a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.
2647
+
2648
+ You can call this endpoint from the front channel (the browser).
2649
+ *
2650
+ * If you would like to get a raw Response object use the other authorizeCustomer function.
2651
+ *
2652
+ * @param options - An object containing the options for this method.
2653
+ * @param options.parameters - An object containing the parameters for this method.
2654
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2655
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
2656
+ - `http://localhost:3000/callback`
2657
+ - `https://example.com/callback`
2658
+ - `com.example.app:redirect_uri_path`
2659
+ - ` *.subdomain.topleveldomain.com`
2660
+
2661
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
2662
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
2663
+ * @param options.parameters.scope -
2664
+ * @param options.parameters.state - Value to send the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
2665
+ * @param options.parameters.usid - A unique shopper identifier (USID). If not provided, a new USID is generated.
2666
+ * @param options.parameters.hint - Name of an identity provider (IDP) to optionally redirect to, thereby skipping the IDP selection step.
2667
+
2668
+ To use a public client, set `hint` to `guest` and use a public client ID to get an authorization code. If no `hint` is provided, the preferred IDP of the tenant is used by default.
2669
+
2670
+ For session bridge authorization the `hint` should be set to `sb-user` for a registered customer and to `sb-guest` for a guest. For session bridge authorization the SLAS Client `sfcc.session_bridge` scope.
2671
+ * @param options.parameters.channel_id - The channel that this request is for. For a B2C Commerce request, this is angalous to the site ID.
2672
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
2673
+
2674
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
2675
+
2676
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
2677
+
2678
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
2679
+ * @param options.parameters.ui_locales - End-User's preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For example, the value `fr-CA fr en` represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation).
2680
+
2681
+ In most cases the IDP supports one language tag and has a default language set on the server. SLAS will support the space-separated list and pass them to the IDP.
2682
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2683
+ *
2684
+ * @returns A promise of type void.
2685
+ */
2686
+ authorizeCustomer(options?: RequireParametersUnlessAllAreOptional<{
2687
+ parameters?: CompositeParameters<{
2688
+ organizationId: string;
2689
+ redirect_uri: string;
2690
+ response_type: AuthorizeCustomerResponseTypeEnum;
2691
+ client_id: string;
2692
+ scope?: AuthorizeCustomerScopeEnum;
2693
+ state?: string;
2694
+ usid?: string;
2695
+ hint?: string;
2696
+ channel_id?: string;
2697
+ code_challenge?: string;
2698
+ ui_locales?: string;
2699
+ } & QueryParameters, ConfigParameters>;
2700
+ headers?: {
2701
+ [key: string]: string;
2702
+ };
2703
+ }>): Promise<void>;
2704
+ /**
2705
+ * This is the first step of the OAuth 2.1 authorization code flow, in which a user can log in via federation to the IDP configured for the client. After successfully logging in, the user gets an authorization code via a redirect URI.
2706
+
2707
+ You can call this endpoint from the front channel (the browser).
2708
+ *
2709
+ * @param options - An object containing the options for this method.
2710
+ * @param options.parameters - An object containing the parameters for this method.
2711
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2712
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
2713
+ - `http://localhost:3000/callback`
2714
+ - `https://example.com/callback`
2715
+ - `com.example.app:redirect_uri_path`
2716
+ - ` *.subdomain.topleveldomain.com`
2717
+
2718
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
2719
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
2720
+ * @param options.parameters.scope -
2721
+ * @param options.parameters.state - Value to send the client to determine the state between the authorization request and the server response. Optional, but strongly recommended.
2722
+ * @param options.parameters.usid - A unique shopper identifier (USID). If not provided, a new USID is generated.
2723
+ * @param options.parameters.hint - Name of an identity provider (IDP) to optionally redirect to, thereby skipping the IDP selection step.
2724
+
2725
+ To use a public client, set `hint` to `guest` and use a public client ID to get an authorization code. If no `hint` is provided, the preferred IDP of the tenant is used by default.
2726
+
2727
+ For session bridge authorization the `hint` should be set to `sb-user` for a registered customer and to `sb-guest` for a guest. For session bridge authorization the SLAS Client `sfcc.session_bridge` scope.
2728
+ * @param options.parameters.channel_id - The channel that this request is for. For a B2C Commerce request, this is angalous to the site ID.
2729
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
2730
+
2731
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
2732
+
2733
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
2734
+
2735
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
2736
+ * @param options.parameters.ui_locales - End-User's preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For example, the value `fr-CA fr en` represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation).
2737
+
2738
+ In most cases the IDP supports one language tag and has a default language set on the server. SLAS will support the space-separated list and pass them to the IDP.
2739
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2740
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2741
+ *
2742
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
2743
+ */
2744
+ authorizeCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2745
+ parameters?: CompositeParameters<{
2746
+ organizationId: string;
2747
+ redirect_uri: string;
2748
+ response_type: AuthorizeCustomerResponseTypeEnum;
2749
+ client_id: string;
2750
+ scope?: AuthorizeCustomerScopeEnum;
2751
+ state?: string;
2752
+ usid?: string;
2753
+ hint?: string;
2754
+ channel_id?: string;
2755
+ code_challenge?: string;
2756
+ ui_locales?: string;
2757
+ } & QueryParameters, ConfigParameters>;
2758
+ headers?: {
2759
+ [key: string]: string;
2760
+ };
2761
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
2762
+ /**
2763
+ * This endpoint allows customers to authenticate when their configured identity provider is inaccessible. It provides an alternative authentication path through passwordless login methods like email or SMS verification.
2764
+ *
2765
+ * If you would like to get a raw Response object use the other authorizePasswordlessCustomer function.
2766
+ *
2767
+ * @param options - An object containing the options for this method.
2768
+ * @param options.parameters - An object containing the parameters for this method.
2769
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2770
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2771
+ * @param options.body - The data to send as the request body.
2772
+ * @param options.body.user_id - User ID for logging in.
2773
+ * @param options.body.mode - Password Action delivery modes
2774
+ * @param options.body.locale - The locale of the template. Not needed for the `callback` mode
2775
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
2776
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
2777
+ * @param options.body.callback_uri - The callback URI. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
2778
+ *
2779
+ * @returns A promise of type string.
2780
+ */
2781
+ authorizePasswordlessCustomer(options?: RequireParametersUnlessAllAreOptional<{
2782
+ parameters?: CompositeParameters<{
2783
+ organizationId: string;
2784
+ } & QueryParameters, ConfigParameters>;
2785
+ headers?: {
2786
+ [key: string]: string;
2787
+ };
2788
+ body: authorizePasswordlessCustomerBodyType & CustomRequestBody;
2789
+ }>): Promise<string>;
2790
+ /**
2791
+ * This endpoint allows customers to authenticate when their configured identity provider is inaccessible. It provides an alternative authentication path through passwordless login methods like email or SMS verification.
2792
+ *
2793
+ * @param options - An object containing the options for this method.
2794
+ * @param options.parameters - An object containing the parameters for this method.
2795
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2796
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2797
+ * @param options.body - The data to send as the request body.
2798
+ * @param options.body.user_id - User ID for logging in.
2799
+ * @param options.body.mode - Password Action delivery modes
2800
+ * @param options.body.locale - The locale of the template. Not needed for the `callback` mode
2801
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
2802
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
2803
+ * @param options.body.callback_uri - The callback URI. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
2804
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2805
+ *
2806
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
2807
+ */
2808
+ authorizePasswordlessCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2809
+ parameters?: CompositeParameters<{
2810
+ organizationId: string;
2811
+ } & QueryParameters, ConfigParameters>;
2812
+ headers?: {
2813
+ [key: string]: string;
2814
+ };
2815
+ body: authorizePasswordlessCustomerBodyType & CustomRequestBody;
2816
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
2817
+ /**
2818
+ * This is the second step of the OAuth 2.1 authorization code flow.
2819
+
2820
+ For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the `authorize` endpoint.
2821
+
2822
+ For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.
2823
+
2824
+ For a public client using PKCE, an application passes a PKCE `code_verifier` that matches the `code_challenge` that was used to `authorize` the customer along with the authorization code.
2825
+
2826
+ When refreshing the access token with a private client ID and client secret, the refresh token is _not_ regenerated. However, when refreshing the access token with a public client ID, the refresh token is _always_ regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client must be replaced to always store the new refresh token.
2827
+
2828
+ See the Body section for required parameters, including `grant_type` and others that depend on the value of `grant_type`.
2829
+
2830
+ **Important**: As of July 31, 2024**, SLAS requires the `channel_id` query parameter in token requests.
2831
+ *
2832
+ * If you would like to get a raw Response object use the other getAccessToken function.
2833
+ *
2834
+ * @param options - An object containing the options for this method.
2835
+ * @param options.parameters - An object containing the parameters for this method.
2836
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2837
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2838
+ * @param options.body - The data to send as the request body.
2839
+ * @param options.body.refresh_token - The long-term token used to refresh the short term access token. Required only with a grant type of `refresh_token`.
2840
+ * @param options.body.code - Authorization code from the OAuth 2.1 service received in the front channel that is used to get access tokens and refresh tokens. Required with a grant type of `authorization_code` and `session_bridge`.
2841
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
2842
+ * @param options.body.grant_type -
2843
+ * @param options.body.redirect_uri - The redirect URI that was used when getting the authorization code. A variety of URI formats and wildcards for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
2844
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is optional when using a private client id for the token request.
2845
+ * @param options.body.client_id - The SLAS client ID. Required when the grant type is `authorization_code_pkce`.
2846
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with. **Important: We strongly recommended using the channel_id query parameter because it will be required in the future. **NOTE - As of July 31, 2024**, SLAS will be requiring the `channel_id` query parameter in token requests.
2847
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
2848
+ *
2849
+ * @returns A promise of type TokenResponse.
2850
+ */
2851
+ getAccessToken(options?: RequireParametersUnlessAllAreOptional<{
2852
+ parameters?: CompositeParameters<{
2853
+ organizationId: string;
2854
+ } & QueryParameters, ConfigParameters>;
2855
+ headers?: {
2856
+ [key: string]: string;
2857
+ };
2858
+ body: getAccessTokenBodyType & CustomRequestBody;
2859
+ }>): Promise<TokenResponse>;
2860
+ /**
2861
+ * This is the second step of the OAuth 2.1 authorization code flow.
2862
+
2863
+ For a private client, an application is able to get an access token for the shopper through the back channel (a trusted server) by passing in the client credentials and the authorization code retrieved from the `authorize` endpoint.
2864
+
2865
+ For a guest user, get the shopper JWT access token and a refresh token. This is where a client appplication is able to get an access token for the guest user through the back channel (a trusted server) by passing in the client credentials.
2866
+
2867
+ For a public client using PKCE, an application passes a PKCE `code_verifier` that matches the `code_challenge` that was used to `authorize` the customer along with the authorization code.
2868
+
2869
+ When refreshing the access token with a private client ID and client secret, the refresh token is _not_ regenerated. However, when refreshing the access token with a public client ID, the refresh token is _always_ regenerated. The old refresh token is voided with every refresh call, so the refresh token on the client must be replaced to always store the new refresh token.
2870
+
2871
+ See the Body section for required parameters, including `grant_type` and others that depend on the value of `grant_type`.
2872
+
2873
+ **Important**: As of July 31, 2024**, SLAS requires the `channel_id` query parameter in token requests.
2874
+ *
2875
+ * @param options - An object containing the options for this method.
2876
+ * @param options.parameters - An object containing the parameters for this method.
2877
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2878
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2879
+ * @param options.body - The data to send as the request body.
2880
+ * @param options.body.refresh_token - The long-term token used to refresh the short term access token. Required only with a grant type of `refresh_token`.
2881
+ * @param options.body.code - Authorization code from the OAuth 2.1 service received in the front channel that is used to get access tokens and refresh tokens. Required with a grant type of `authorization_code` and `session_bridge`.
2882
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
2883
+ * @param options.body.grant_type -
2884
+ * @param options.body.redirect_uri - The redirect URI that was used when getting the authorization code. A variety of URI formats and wildcards for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs: - `http://localhost:3000/callback` - `https://example.com/callback` - `com.example.app:redirect_uri_path` - ` *.subdomain.topleveldomain.com`
2885
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client calling the `login` endpoint. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is optional when using a private client id for the token request.
2886
+ * @param options.body.client_id - The SLAS client ID. Required when the grant type is `authorization_code_pkce`.
2887
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with. **Important: We strongly recommended using the channel_id query parameter because it will be required in the future. **NOTE - As of July 31, 2024**, SLAS will be requiring the `channel_id` query parameter in token requests.
2888
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
2889
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2890
+ *
2891
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
2892
+ */
2893
+ getAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2894
+ parameters?: CompositeParameters<{
2895
+ organizationId: string;
2896
+ } & QueryParameters, ConfigParameters>;
2897
+ headers?: {
2898
+ [key: string]: string;
2899
+ };
2900
+ body: getAccessTokenBodyType & CustomRequestBody;
2901
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
2902
+ /**
2903
+ * The `/jwks` endpoint provides a JSON Web Key Set (JWKS) that includes current, past, and future public keys. These keys allow clients to validate the Shopper JSON Web Token (JWT) issued by SLAS, ensuring that no tampering with the token has occurred. Every SLAS JWT that is passed into SLAS, SCAPI, or OCAPI is always validated and is rejected if the signature validation does not match.
2904
+
2905
+ To optimize performance, the `/jwks` endpoint is limited to 25 calls per minute, so we recommended caching the JWKS keys and refresh them only when necessary, instead of making frequent requests. Typically, the JWKs endpoint can be used once per DAY.
2906
+
2907
+ For additional information on using JWKS, see https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-validate-jwt-with-jwks.html.
2908
+
2909
+ *
2910
+ * If you would like to get a raw Response object use the other getJwksUri function.
2911
+ *
2912
+ * @param options - An object containing the options for this method.
2913
+ * @param options.parameters - An object containing the parameters for this method.
2914
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2915
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2916
+ *
2917
+ * @returns A promise of type object.
2918
+ */
2919
+ getJwksUri(options?: RequireParametersUnlessAllAreOptional<{
2920
+ parameters?: CompositeParameters<{
2921
+ organizationId: string;
2922
+ } & QueryParameters, ConfigParameters>;
2923
+ headers?: {
2924
+ [key: string]: string;
2925
+ };
2926
+ }>): Promise<object>;
2927
+ /**
2928
+ * The `/jwks` endpoint provides a JSON Web Key Set (JWKS) that includes current, past, and future public keys. These keys allow clients to validate the Shopper JSON Web Token (JWT) issued by SLAS, ensuring that no tampering with the token has occurred. Every SLAS JWT that is passed into SLAS, SCAPI, or OCAPI is always validated and is rejected if the signature validation does not match.
2929
+
2930
+ To optimize performance, the `/jwks` endpoint is limited to 25 calls per minute, so we recommended caching the JWKS keys and refresh them only when necessary, instead of making frequent requests. Typically, the JWKs endpoint can be used once per DAY.
2931
+
2932
+ For additional information on using JWKS, see https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-validate-jwt-with-jwks.html.
2933
+
2934
+ *
2935
+ * @param options - An object containing the options for this method.
2936
+ * @param options.parameters - An object containing the parameters for this method.
2937
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2938
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2939
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2940
+ *
2941
+ * @returns A promise of type Response if rawResponse is true, a promise of type object otherwise.
2942
+ */
2943
+ getJwksUri<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2944
+ parameters?: CompositeParameters<{
2945
+ organizationId: string;
2946
+ } & QueryParameters, ConfigParameters>;
2947
+ headers?: {
2948
+ [key: string]: string;
2949
+ };
2950
+ }>, rawResponse?: T): Promise<T extends true ? Response : object>;
2951
+ /**
2952
+ * This endpoint issues a shopper JWT access token using a passwordless login token. It enables authentication flows where traditional username/password combinations are not required, supporting alternative authentication methods.
2953
+ *
2954
+ * If you would like to get a raw Response object use the other getPasswordLessAccessToken function.
2955
+ *
2956
+ * @param options - An object containing the options for this method.
2957
+ * @param options.parameters - An object containing the parameters for this method.
2958
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2959
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2960
+ * @param options.body - The data to send as the request body.
2961
+ * @param options.body.grant_type - Grant Type
2962
+ * @param options.body.hint - Passwordless hint. Use `pwdless_login`.
2963
+ * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
2964
+ * @param options.body.client_id - The public client ID.
2965
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
2966
+ *
2967
+ * @returns A promise of type TokenResponse.
2968
+ */
2969
+ getPasswordLessAccessToken(options?: RequireParametersUnlessAllAreOptional<{
2970
+ parameters?: CompositeParameters<{
2971
+ organizationId: string;
2972
+ } & QueryParameters, ConfigParameters>;
2973
+ headers?: {
2974
+ [key: string]: string;
2975
+ };
2976
+ body: getPasswordLessAccessTokenBodyType & CustomRequestBody;
2977
+ }>): Promise<TokenResponse>;
2978
+ /**
2979
+ * This endpoint issues a shopper JWT access token using a passwordless login token. It enables authentication flows where traditional username/password combinations are not required, supporting alternative authentication methods.
2980
+ *
2981
+ * @param options - An object containing the options for this method.
2982
+ * @param options.parameters - An object containing the parameters for this method.
2983
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
2984
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
2985
+ * @param options.body - The data to send as the request body.
2986
+ * @param options.body.grant_type - Grant Type
2987
+ * @param options.body.hint - Passwordless hint. Use `pwdless_login`.
2988
+ * @param options.body.pwdless_login_token - Passwordless login token that was created from the user ID.
2989
+ * @param options.body.client_id - The public client ID.
2990
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
2991
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
2992
+ *
2993
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
2994
+ */
2995
+ getPasswordLessAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
2996
+ parameters?: CompositeParameters<{
2997
+ organizationId: string;
2998
+ } & QueryParameters, ConfigParameters>;
2999
+ headers?: {
3000
+ [key: string]: string;
3001
+ };
3002
+ body: getPasswordLessAccessTokenBodyType & CustomRequestBody;
3003
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
3004
+ /**
3005
+ * This endpoint initiates the password reset process for a customer by requesting a password reset token. The token is delivered through the configured delivery mode (email, SMS, etc.) and can be used with the password/action endpoint to set a new password.
3006
+ *
3007
+ * If you would like to get a raw Response object use the other getPasswordResetToken function.
3008
+ *
3009
+ * @param options - An object containing the options for this method.
3010
+ * @param options.parameters - An object containing the parameters for this method.
3011
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3012
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3013
+ * @param options.body - The data to send as the request body.
3014
+ * @param options.body.user_id - User ID for logging in. This is the id that is used to log into SFCC.
3015
+ * @param options.body.mode - Password Action delivery modes
3016
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3017
+ * @param options.body.locale - The locale of the template.
3018
+ * @param options.body.client_id - -| The public client ID. Requires setting `grant_type` to `passwordless_login_pkce`. When using the `hint` query parameter either a public or private client ID can be used.
3019
+ * @param options.body.code_challenge - PKCE code challenge. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. Requires setting `grant_type` to `passwordless_login_pkce`
3020
+ * @param options.body.callback_uri - The callback uri. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
3021
+ * @param options.body.idp_name - The name of the 3rd party identity provider for the user ID
3022
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_challenge for password reset request. If the `hint` query parameter is used it must also be used in the password reset request.
3023
+ *
3024
+ * @returns A promise of type void.
3025
+ */
3026
+ getPasswordResetToken(options?: RequireParametersUnlessAllAreOptional<{
3027
+ parameters?: CompositeParameters<{
3028
+ organizationId: string;
3029
+ } & QueryParameters, ConfigParameters>;
3030
+ headers?: {
3031
+ [key: string]: string;
3032
+ };
3033
+ body: getPasswordResetTokenBodyType & CustomRequestBody;
3034
+ }>): Promise<void>;
3035
+ /**
3036
+ * This endpoint initiates the password reset process for a customer by requesting a password reset token. The token is delivered through the configured delivery mode (email, SMS, etc.) and can be used with the password/action endpoint to set a new password.
3037
+ *
3038
+ * @param options - An object containing the options for this method.
3039
+ * @param options.parameters - An object containing the parameters for this method.
3040
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3041
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3042
+ * @param options.body - The data to send as the request body.
3043
+ * @param options.body.user_id - User ID for logging in. This is the id that is used to log into SFCC.
3044
+ * @param options.body.mode - Password Action delivery modes
3045
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3046
+ * @param options.body.locale - The locale of the template.
3047
+ * @param options.body.client_id - -| The public client ID. Requires setting `grant_type` to `passwordless_login_pkce`. When using the `hint` query parameter either a public or private client ID can be used.
3048
+ * @param options.body.code_challenge - PKCE code challenge. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. Requires setting `grant_type` to `passwordless_login_pkce`
3049
+ * @param options.body.callback_uri - The callback uri. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.
3050
+ * @param options.body.idp_name - The name of the 3rd party identity provider for the user ID
3051
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_challenge for password reset request. If the `hint` query parameter is used it must also be used in the password reset request.
3052
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3053
+ *
3054
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
3055
+ */
3056
+ getPasswordResetToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3057
+ parameters?: CompositeParameters<{
3058
+ organizationId: string;
3059
+ } & QueryParameters, ConfigParameters>;
3060
+ headers?: {
3061
+ [key: string]: string;
3062
+ };
3063
+ body: getPasswordResetTokenBodyType & CustomRequestBody;
3064
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
3065
+ /**
3066
+ * For public client ID requests, you must set the grant_type to `session_bridge`.
3067
+
3068
+ For private client_id and secret, you must set the grant_type to `client_credentials` along with a basic authorization header.
3069
+
3070
+ **DEPRECATED** - As of January 31, 2024, SLAS no longer supports the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. We recommended you transition to using a SESB `dwsgst` token.
3071
+
3072
+ The `dwsid` is still needed for `registered` user `session-bridge/token` calls.
3073
+
3074
+ **NOTE:** The registered customer Json Web Token (JWT) is available in B2C Commerce versions 25.4 and later.
3075
+ *
3076
+ * If you would like to get a raw Response object use the other getSessionBridgeAccessToken function.
3077
+ *
3078
+ * @param options - An object containing the options for this method.
3079
+ * @param options.parameters - An object containing the parameters for this method.
3080
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3081
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3082
+ * @param options.body - The data to send as the request body.
3083
+ * @param options.body.code - Authorization code returned from session bridge authorization received in the front channel that is used to get session bridge access tokens and refresh tokens. Required with a grant type of `session_bridge`. The SLAS client must have the `sfcc.session_bridge` scope to request a session bridge token.
3084
+ * @param options.body.client_id - The SLAS public client ID for use with PKCE requests. This is a required parameter when using a public client.
3085
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3086
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. This is a required parameter when using a public client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3087
+ * @param options.body.dwsid - Cookie passed back from the \'/authorize\' endpoint call for session bridge. This parameter is optional and not needed if using the `dwsgst` parameter. **DEPRECATED** - As of January 31, 2024, SLAS will no longer support the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. It is recommended to transition over to using a SESB `dwsgst` token. The `dwsid` will still be needed for `registered` user session-bridge/token calls.
3088
+ * @param options.body.grant_type - Grant Type
3089
+ * @param options.body.login_id - The ID of the shopper for session bridge access. If requesting a token for a guest user set login_id to `guest`.
3090
+ * @param options.body.dwsgst - Signed guest Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the guest `dwsid` parameter.
3091
+ * @param options.body.dwsrst - Signed registered customer Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the registered user `dwsid` parameter. **NOTE:** The registered customer Json Web Token (JWT) will be available in ECOM versions 25.4 and higher.
3092
+ * @param options.body.usid - The unique shopper ID. Returned when from session bridge authorization.
3093
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
3094
+ *
3095
+ * @returns A promise of type TokenResponse.
3096
+ */
3097
+ getSessionBridgeAccessToken(options?: RequireParametersUnlessAllAreOptional<{
3098
+ parameters?: CompositeParameters<{
3099
+ organizationId: string;
3100
+ } & QueryParameters, ConfigParameters>;
3101
+ headers?: {
3102
+ [key: string]: string;
3103
+ };
3104
+ body: getSessionBridgeAccessTokenBodyType & CustomRequestBody;
3105
+ }>): Promise<TokenResponse>;
3106
+ /**
3107
+ * For public client ID requests, you must set the grant_type to `session_bridge`.
3108
+
3109
+ For private client_id and secret, you must set the grant_type to `client_credentials` along with a basic authorization header.
3110
+
3111
+ **DEPRECATED** - As of January 31, 2024, SLAS no longer supports the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. We recommended you transition to using a SESB `dwsgst` token.
3112
+
3113
+ The `dwsid` is still needed for `registered` user `session-bridge/token` calls.
3114
+
3115
+ **NOTE:** The registered customer Json Web Token (JWT) is available in B2C Commerce versions 25.4 and later.
3116
+ *
3117
+ * @param options - An object containing the options for this method.
3118
+ * @param options.parameters - An object containing the parameters for this method.
3119
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3120
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3121
+ * @param options.body - The data to send as the request body.
3122
+ * @param options.body.code - Authorization code returned from session bridge authorization received in the front channel that is used to get session bridge access tokens and refresh tokens. Required with a grant type of `session_bridge`. The SLAS client must have the `sfcc.session_bridge` scope to request a session bridge token.
3123
+ * @param options.body.client_id - The SLAS public client ID for use with PKCE requests. This is a required parameter when using a public client.
3124
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3125
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. This is a required parameter when using a public client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3126
+ * @param options.body.dwsid - Cookie passed back from the \'/authorize\' endpoint call for session bridge. This parameter is optional and not needed if using the `dwsgst` parameter. **DEPRECATED** - As of January 31, 2024, SLAS will no longer support the SESB `dwsid` parameter for `guest` users for `session-bridge/token` calls. It is recommended to transition over to using a SESB `dwsgst` token. The `dwsid` will still be needed for `registered` user session-bridge/token calls.
3127
+ * @param options.body.grant_type - Grant Type
3128
+ * @param options.body.login_id - The ID of the shopper for session bridge access. If requesting a token for a guest user set login_id to `guest`.
3129
+ * @param options.body.dwsgst - Signed guest Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the guest `dwsid` parameter.
3130
+ * @param options.body.dwsrst - Signed registered customer Json Web Token (JWT) that was obtained from B2C Commerce. This parameter is optional and not needed if using the registered user `dwsid` parameter. **NOTE:** The registered customer Json Web Token (JWT) will be available in ECOM versions 25.4 and higher.
3131
+ * @param options.body.usid - The unique shopper ID. Returned when from session bridge authorization.
3132
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`.
3133
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3134
+ *
3135
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
3136
+ */
3137
+ getSessionBridgeAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3138
+ parameters?: CompositeParameters<{
3139
+ organizationId: string;
3140
+ } & QueryParameters, ConfigParameters>;
3141
+ headers?: {
3142
+ [key: string]: string;
3143
+ };
3144
+ body: getSessionBridgeAccessTokenBodyType & CustomRequestBody;
3145
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
3146
+ /**
3147
+ * If using a SLAS private client ID, you must also use an `_sfdc_client_auth` header.
3148
+
3149
+ The value of the `_sfdc_client_auth` header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (`:`). For example, `privateClientId:privateClientsecret` becomes `cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ=` after Base64 encoding.
3150
+ *
3151
+ * If you would like to get a raw Response object use the other getTrustedAgentAccessToken function.
3152
+ *
3153
+ * @param options - An object containing the options for this method.
3154
+ * @param options.parameters - An object containing the parameters for this method.
3155
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3156
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3157
+ * @param options.body - The data to send as the request body.
3158
+ * @param options.body.agent_id - The ID of the merchant. If passed in, the `agent_id` will be validated using the SUB claim in the response from Account Manager. This is an optional parameter unless the request is for a Trusted Agent on Behalf then `agent_id` is required.
3159
+ * @param options.body.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-system requests. The `client_id` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
3160
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3161
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
3162
+ * @param options.body.grant_type - Grant Type
3163
+ * @param options.body.login_id - The ID is the shopper for trusted agent access. For TAOB Guest the `login_id` must be set to `Guest`.
3164
+ * @param options.body.idp_origin - The IDP that the user is associated with. For TAOB Guest the `idp_origin` parameter should be `slas`. If set to any other IDP origin a 400 Bad Request will be returned.
3165
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
3166
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `true` Note: The default value for `dnt` is set to `true` for all TAOB flows. This is opposite from other SLAS token requests.
3167
+ * @param options.body.state - This is an optional parameter to set state for the trusted agent session. If the `state` parameter is used it will be validated and a 400 Bad Request will be returned if missing or invalid. For TAOB Guest you must pass the `state` parameter to transfer the state from the TAOB Guest authorization call to the token call. The `state` parameter value is returned with the authorization code in the response url from the TAOB guest authorization call, for example: `.../taob/callback?code=HETXpvg5LKBNIHjDTWkRrf2MLVU&state=taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b`. You would use `taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b` for the `state` value in the TAOB request.
3168
+ *
3169
+ * @returns A promise of type TokenResponse.
3170
+ */
3171
+ getTrustedAgentAccessToken(options?: RequireParametersUnlessAllAreOptional<{
3172
+ parameters?: CompositeParameters<{
3173
+ organizationId: string;
3174
+ } & QueryParameters, ConfigParameters>;
3175
+ headers?: {
3176
+ [key: string]: string;
3177
+ };
3178
+ body: getTrustedAgentAccessTokenBodyType & CustomRequestBody;
3179
+ }>): Promise<TokenResponse>;
3180
+ /**
3181
+ * If using a SLAS private client ID, you must also use an `_sfdc_client_auth` header.
3182
+
3183
+ The value of the `_sfdc_client_auth` header must be a Base64-encoded string. The string is composed of a SLAS private client ID and client secret, separated by a colon (`:`). For example, `privateClientId:privateClientsecret` becomes `cHJpdmF0ZUNsaWVudElkOnByaXZhdGVDbGllbnRzZWNyZXQ=` after Base64 encoding.
3184
+ *
3185
+ * @param options - An object containing the options for this method.
3186
+ * @param options.parameters - An object containing the parameters for this method.
3187
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3188
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3189
+ * @param options.body - The data to send as the request body.
3190
+ * @param options.body.agent_id - The ID of the merchant. If passed in, the `agent_id` will be validated using the SUB claim in the response from Account Manager. This is an optional parameter unless the request is for a Trusted Agent on Behalf then `agent_id` is required.
3191
+ * @param options.body.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-system requests. The `client_id` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
3192
+ * @param options.body.channel_id - The channel (B2C Commerce site) that the user is associated with.
3193
+ * @param options.body.code_verifier - PKCE code verifier. Created by the caller. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters. The `code_verifier` is not needed if a using a SLAS private `client_id` and the `_sfdc_client_auth` header.
3194
+ * @param options.body.grant_type - Grant Type
3195
+ * @param options.body.login_id - The ID is the shopper for trusted agent access. For TAOB Guest the `login_id` must be set to `Guest`.
3196
+ * @param options.body.idp_origin - The IDP that the user is associated with. For TAOB Guest the `idp_origin` parameter should be `slas`. If set to any other IDP origin a 400 Bad Request will be returned.
3197
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
3198
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `true` Note: The default value for `dnt` is set to `true` for all TAOB flows. This is opposite from other SLAS token requests.
3199
+ * @param options.body.state - This is an optional parameter to set state for the trusted agent session. If the `state` parameter is used it will be validated and a 400 Bad Request will be returned if missing or invalid. For TAOB Guest you must pass the `state` parameter to transfer the state from the TAOB Guest authorization call to the token call. The `state` parameter value is returned with the authorization code in the response url from the TAOB guest authorization call, for example: `.../taob/callback?code=HETXpvg5LKBNIHjDTWkRrf2MLVU&state=taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b`. You would use `taob.gst.7bc7fb7f-e646-44fd-bc73-dfd5c3c9019b` for the `state` value in the TAOB request.
3200
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3201
+ *
3202
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
3203
+ */
3204
+ getTrustedAgentAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3205
+ parameters?: CompositeParameters<{
3206
+ organizationId: string;
3207
+ } & QueryParameters, ConfigParameters>;
3208
+ headers?: {
3209
+ [key: string]: string;
3210
+ };
3211
+ body: getTrustedAgentAccessTokenBodyType & CustomRequestBody;
3212
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
3213
+ /**
3214
+ * This endpoint enables trusted agents (such as customer service representatives or merchants) to obtain authorization tokens that allow them to act on behalf of registered customers. This facilitates customer support scenarios where agents need secure access to customer accounts.
3215
+ *
3216
+ * If you would like to get a raw Response object use the other getTrustedAgentAuthorizationToken function.
3217
+ *
3218
+ * @param options - An object containing the options for this method.
3219
+ * @param options.parameters - An object containing the parameters for this method.
3220
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3221
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
3222
+ * @param options.parameters.channel_id - The channel (B2C Commerce site) that the user is associated with.
3223
+ * @param options.parameters.login_id - The ID of the shopper for trusted agent access.
3224
+
3225
+ For TAOB Guest the `login_id` must be set to `Guest`.
3226
+ * @param options.parameters.idp_origin - The IDP that the shopper is associated with.
3227
+
3228
+ For TAOB Guest the `idp_origin` must be set to `slas`. This is standard for SLAS Guest requests. If any other `idp_origin` value is used, SLAS returns a bad request.
3229
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
3230
+ - `http://localhost:3000/callback`
3231
+ - `https://example.com/callback`
3232
+ - `com.example.app:redirect_uri_path`
3233
+ - ` *.subdomain.topleveldomain.com`
3234
+
3235
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
3236
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
3237
+
3238
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
3239
+
3240
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3241
+
3242
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
3243
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3244
+ *
3245
+ * @returns A promise of type void.
3246
+ */
3247
+ getTrustedAgentAuthorizationToken(options?: RequireParametersUnlessAllAreOptional<{
3248
+ parameters?: CompositeParameters<{
3249
+ organizationId: string;
3250
+ client_id: string;
3251
+ channel_id: string;
3252
+ login_id: string;
3253
+ idp_origin: string;
3254
+ redirect_uri: string;
3255
+ response_type: GetTrustedAgentAuthorizationTokenResponseTypeEnum;
3256
+ code_challenge?: string;
3257
+ } & QueryParameters, ConfigParameters>;
3258
+ headers?: {
3259
+ [key: string]: string;
3260
+ };
3261
+ }>): Promise<void>;
3262
+ /**
3263
+ * This endpoint enables trusted agents (such as customer service representatives or merchants) to obtain authorization tokens that allow them to act on behalf of registered customers. This facilitates customer support scenarios where agents need secure access to customer accounts.
3264
+ *
3265
+ * @param options - An object containing the options for this method.
3266
+ * @param options.parameters - An object containing the parameters for this method.
3267
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3268
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
3269
+ * @param options.parameters.channel_id - The channel (B2C Commerce site) that the user is associated with.
3270
+ * @param options.parameters.login_id - The ID of the shopper for trusted agent access.
3271
+
3272
+ For TAOB Guest the `login_id` must be set to `Guest`.
3273
+ * @param options.parameters.idp_origin - The IDP that the shopper is associated with.
3274
+
3275
+ For TAOB Guest the `idp_origin` must be set to `slas`. This is standard for SLAS Guest requests. If any other `idp_origin` value is used, SLAS returns a bad request.
3276
+ * @param options.parameters.redirect_uri - The redirect for Account Manager to redirect to. A variety of URI formats and wildcard for host are supported, but app links like `airbnb://` or `fb://` are not. Examples of supported URIs:
3277
+ - `http://localhost:3000/callback`
3278
+ - `https://example.com/callback`
3279
+ - `com.example.app:redirect_uri_path`
3280
+ - ` *.subdomain.topleveldomain.com`
3281
+
3282
+ * @param options.parameters.response_type - Must be `code`. Indicates that the caller wants an authorization code.
3283
+ * @param options.parameters.code_challenge - PKCE code challenge. Created by the caller.
3284
+
3285
+ The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash.
3286
+
3287
+ The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3288
+
3289
+ The *`code_challenge` and 'code_verifier'* are required if a using SLAS public `client_id`.
3290
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3291
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3292
+ *
3293
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
3294
+ */
3295
+ getTrustedAgentAuthorizationToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3296
+ parameters?: CompositeParameters<{
3297
+ organizationId: string;
3298
+ client_id: string;
3299
+ channel_id: string;
3300
+ login_id: string;
3301
+ idp_origin: string;
3302
+ redirect_uri: string;
3303
+ response_type: GetTrustedAgentAuthorizationTokenResponseTypeEnum;
3304
+ code_challenge?: string;
3305
+ } & QueryParameters, ConfigParameters>;
3306
+ headers?: {
3307
+ [key: string]: string;
3308
+ };
3309
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
3310
+ /**
3311
+ * The SLAS client must have the `sfcc.ts_ext_on_behalf_of` scope to access this endpoint.
3312
+
3313
+
3314
+ For trusted-system requests, you can use a basic authorization header that includes a SLAS private client ID and SLAS private client secret instead of the bearer token.
3315
+
3316
+
3317
+ For trusted-system requests, you cannot use SLAS public client_ids.
3318
+ *
3319
+ * If you would like to get a raw Response object use the other getTrustedSystemAccessToken function.
3320
+ *
3321
+ * @param options - An object containing the options for this method.
3322
+ * @param options.parameters - An object containing the parameters for this method.
3323
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3324
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3325
+ * @param options.body - The data to send as the request body.
3326
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
3327
+ * @param options.body.grant_type - Grant Type
3328
+ * @param options.body.hint - Type of system used for Trusted System On Behalf of requests.
3329
+ * @param options.body.login_id - The ID used by the shopper for trusted system access. If set to `guest`, a token is returned for a guest user.
3330
+ * @param options.body.idp_origin - IDPs that work with SLAS. Use `ecom` when using B2C Commerce is the identity provider.
3331
+ * @param options.body.client_id - The SLAS public client ID for use with trusted-system requests.
3332
+ * @param options.body.channel_id - The channel (ECOM site) that the user is associated with.
3333
+ * @param options.body.email_id - The email address for the shopper that is used for trusted-system requests. If not provided, `login_id` is used instead.
3334
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`. Note: The default value for `dnt` is set to `false` for SLAS token requests except for Trusted Agent token request. For Trusted Agent token requests the default value for `dnt` is `true`.
3335
+ *
3336
+ * @returns A promise of type TokenResponse.
3337
+ */
3338
+ getTrustedSystemAccessToken(options?: RequireParametersUnlessAllAreOptional<{
3339
+ parameters?: CompositeParameters<{
3340
+ organizationId: string;
3341
+ } & QueryParameters, ConfigParameters>;
3342
+ headers?: {
3343
+ [key: string]: string;
3344
+ };
3345
+ body: getTrustedSystemAccessTokenBodyType & CustomRequestBody;
3346
+ }>): Promise<TokenResponse>;
3347
+ /**
3348
+ * The SLAS client must have the `sfcc.ts_ext_on_behalf_of` scope to access this endpoint.
3349
+
3350
+
3351
+ For trusted-system requests, you can use a basic authorization header that includes a SLAS private client ID and SLAS private client secret instead of the bearer token.
3352
+
3353
+
3354
+ For trusted-system requests, you cannot use SLAS public client_ids.
3355
+ *
3356
+ * @param options - An object containing the options for this method.
3357
+ * @param options.parameters - An object containing the parameters for this method.
3358
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3359
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3360
+ * @param options.body - The data to send as the request body.
3361
+ * @param options.body.usid - The shopper\'s unique identifier, if known. If not provided, a new USID is generated.
3362
+ * @param options.body.grant_type - Grant Type
3363
+ * @param options.body.hint - Type of system used for Trusted System On Behalf of requests.
3364
+ * @param options.body.login_id - The ID used by the shopper for trusted system access. If set to `guest`, a token is returned for a guest user.
3365
+ * @param options.body.idp_origin - IDPs that work with SLAS. Use `ecom` when using B2C Commerce is the identity provider.
3366
+ * @param options.body.client_id - The SLAS public client ID for use with trusted-system requests.
3367
+ * @param options.body.channel_id - The channel (ECOM site) that the user is associated with.
3368
+ * @param options.body.email_id - The email address for the shopper that is used for trusted-system requests. If not provided, `login_id` is used instead.
3369
+ * @param options.body.dnt - This is an optional parameter to set `Do Not Track` for the session. SLAS is making this available, but will not be used by B2C Commerce until after the 24.4 release. Values are: * `false` * `true` If not added the `dnt` value will default to `false`. Note: The default value for `dnt` is set to `false` for SLAS token requests except for Trusted Agent token request. For Trusted Agent token requests the default value for `dnt` is `true`.
3370
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3371
+ *
3372
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
3373
+ */
3374
+ getTrustedSystemAccessToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3375
+ parameters?: CompositeParameters<{
3376
+ organizationId: string;
3377
+ } & QueryParameters, ConfigParameters>;
3378
+ headers?: {
3379
+ [key: string]: string;
3380
+ };
3381
+ body: getTrustedSystemAccessTokenBodyType & CustomRequestBody;
3382
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
3383
+ /**
3384
+ * This endpoint returns identity information about the authenticated user in the form of OpenID Connect claims. It requires a valid access token and returns information such as user ID, name, email, and other identity attributes based on the scopes granted during authentication.
3385
+ *
3386
+ * If you would like to get a raw Response object use the other getUserInfo function.
3387
+ *
3388
+ * @param options - An object containing the options for this method.
3389
+ * @param options.parameters - An object containing the parameters for this method.
3390
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3391
+ * @param options.parameters.channel_id - Used when getting user information for a SFCC login. For an B2C Commerce customer, this is angalous to the site ID. Required when getting user information for an B2C Commerce customer.
3392
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3393
+ *
3394
+ * @returns A promise of type string.
3395
+ */
3396
+ getUserInfo(options?: RequireParametersUnlessAllAreOptional<{
3397
+ parameters?: CompositeParameters<{
3398
+ organizationId: string;
3399
+ channel_id?: string;
3400
+ } & QueryParameters, ConfigParameters>;
3401
+ headers?: {
3402
+ [key: string]: string;
3403
+ };
3404
+ }>): Promise<string>;
3405
+ /**
3406
+ * This endpoint returns identity information about the authenticated user in the form of OpenID Connect claims. It requires a valid access token and returns information such as user ID, name, email, and other identity attributes based on the scopes granted during authentication.
3407
+ *
3408
+ * @param options - An object containing the options for this method.
3409
+ * @param options.parameters - An object containing the parameters for this method.
3410
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3411
+ * @param options.parameters.channel_id - Used when getting user information for a SFCC login. For an B2C Commerce customer, this is angalous to the site ID. Required when getting user information for an B2C Commerce customer.
3412
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3413
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3414
+ *
3415
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
3416
+ */
3417
+ getUserInfo<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3418
+ parameters?: CompositeParameters<{
3419
+ organizationId: string;
3420
+ channel_id?: string;
3421
+ } & QueryParameters, ConfigParameters>;
3422
+ headers?: {
3423
+ [key: string]: string;
3424
+ };
3425
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
3426
+ /**
3427
+ * This endpoint provides OpenID Connect discovery information in a standardized format. It allows clients to programmatically discover SLAS capabilities, including available endpoints, supported authentication flows, token signing algorithms, and other configuration details. This information helps clients integrate with the authentication service with minimal manual configuration.
3428
+ *
3429
+ * If you would like to get a raw Response object use the other getWellknownOpenidConfiguration function.
3430
+ *
3431
+ * @param options - An object containing the options for this method.
3432
+ * @param options.parameters - An object containing the parameters for this method.
3433
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3434
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3435
+ *
3436
+ * @returns A promise of type string.
3437
+ */
3438
+ getWellknownOpenidConfiguration(options?: RequireParametersUnlessAllAreOptional<{
3439
+ parameters?: CompositeParameters<{
3440
+ organizationId: string;
3441
+ } & QueryParameters, ConfigParameters>;
3442
+ headers?: {
3443
+ [key: string]: string;
3444
+ };
3445
+ }>): Promise<string>;
3446
+ /**
3447
+ * This endpoint provides OpenID Connect discovery information in a standardized format. It allows clients to programmatically discover SLAS capabilities, including available endpoints, supported authentication flows, token signing algorithms, and other configuration details. This information helps clients integrate with the authentication service with minimal manual configuration.
3448
+ *
3449
+ * @param options - An object containing the options for this method.
3450
+ * @param options.parameters - An object containing the parameters for this method.
3451
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3452
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3453
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3454
+ *
3455
+ * @returns A promise of type Response if rawResponse is true, a promise of type string otherwise.
3456
+ */
3457
+ getWellknownOpenidConfiguration<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3458
+ parameters?: CompositeParameters<{
3459
+ organizationId: string;
3460
+ } & QueryParameters, ConfigParameters>;
3461
+ headers?: {
3462
+ [key: string]: string;
3463
+ };
3464
+ }>, rawResponse?: T): Promise<T extends true ? Response : string>;
3465
+ /**
3466
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, as well as an access token or refresh token. Use `token_type_hint` to help identify the token.
3467
+ *
3468
+ * If you would like to get a raw Response object use the other introspectToken function.
3469
+ *
3470
+ * @param options - An object containing the options for this method.
3471
+ * @param options.parameters - An object containing the parameters for this method.
3472
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3473
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3474
+ * @param options.body - The data to send as the request body.
3475
+ * @param options.body.token - Token to inspect or revoke.
3476
+ * @param options.body.token_type_hint - Token Type Hint
3477
+ *
3478
+ * @returns A promise of type TokenActionRequest.
3479
+ */
3480
+ introspectToken(options?: RequireParametersUnlessAllAreOptional<{
3481
+ parameters?: CompositeParameters<{
3482
+ organizationId: string;
3483
+ } & QueryParameters, ConfigParameters>;
3484
+ headers?: {
3485
+ [key: string]: string;
3486
+ };
3487
+ body: introspectTokenBodyType & CustomRequestBody;
3488
+ }>): Promise<TokenActionRequest>;
3489
+ /**
3490
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, as well as an access token or refresh token. Use `token_type_hint` to help identify the token.
3491
+ *
3492
+ * @param options - An object containing the options for this method.
3493
+ * @param options.parameters - An object containing the parameters for this method.
3494
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3495
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3496
+ * @param options.body - The data to send as the request body.
3497
+ * @param options.body.token - Token to inspect or revoke.
3498
+ * @param options.body.token_type_hint - Token Type Hint
3499
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3500
+ *
3501
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenActionRequest otherwise.
3502
+ */
3503
+ introspectToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3504
+ parameters?: CompositeParameters<{
3505
+ organizationId: string;
3506
+ } & QueryParameters, ConfigParameters>;
3507
+ headers?: {
3508
+ [key: string]: string;
3509
+ };
3510
+ body: introspectTokenBodyType & CustomRequestBody;
3511
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenActionRequest>;
3512
+ /**
3513
+ * The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (B2C Commerce) instance, the OCAPI JWT is also revoked. Call this endpoint for registered users that have logged in using SLAS. Do not use this endpoint for guest users.
3514
+
3515
+ Required header: Authorization header bearer token of the Shopper access token to log out.
3516
+
3517
+ Required parameters: `refresh token`, `channel_id`, and `client`.
3518
+ *
3519
+ * If you would like to get a raw Response object use the other logoutCustomer function.
3520
+ *
3521
+ * @param options - An object containing the options for this method.
3522
+ * @param options.parameters - An object containing the parameters for this method.
3523
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3524
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
3525
+ * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
3526
+ * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
3527
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
3528
+
3529
+ If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
3530
+
3531
+ If an incorrect value is provided for the hint other than `all-sessions`, the request fails.
3532
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3533
+ *
3534
+ * @returns A promise of type TokenResponse.
3535
+ */
3536
+ logoutCustomer(options?: RequireParametersUnlessAllAreOptional<{
3537
+ parameters?: CompositeParameters<{
3538
+ organizationId: string;
3539
+ client_id: string;
3540
+ refresh_token: string;
3541
+ channel_id?: string;
3542
+ hint?: LogoutCustomerHintEnum;
3543
+ } & QueryParameters, ConfigParameters>;
3544
+ headers?: {
3545
+ [key: string]: string;
3546
+ };
3547
+ }>): Promise<TokenResponse>;
3548
+ /**
3549
+ * The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (B2C Commerce) instance, the OCAPI JWT is also revoked. Call this endpoint for registered users that have logged in using SLAS. Do not use this endpoint for guest users.
3550
+
3551
+ Required header: Authorization header bearer token of the Shopper access token to log out.
3552
+
3553
+ Required parameters: `refresh token`, `channel_id`, and `client`.
3554
+ *
3555
+ * @param options - An object containing the options for this method.
3556
+ * @param options.parameters - An object containing the parameters for this method.
3557
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3558
+ * @param options.parameters.client_id - The SLAS public client ID or SLAS private client ID for use with trusted-agent requests. When using a private client ID a PKCE code challenge is not required.
3559
+ * @param options.parameters.refresh_token - Refresh token that was given during the access token request.
3560
+ * @param options.parameters.channel_id - The `channel_id` parameter must be provided if the shopper authenticated using the `login` endpoint with B2C Commerce.
3561
+ * @param options.parameters.hint - `hint=all-sessions` logs out all sessions of the shopper and invalidates all active refresh tokens for the shopper.
3562
+
3563
+ If this query parameter is not provided, the default behavior is to log out only the current session that matches the refresh token in the request.
3564
+
3565
+ If an incorrect value is provided for the hint other than `all-sessions`, the request fails.
3566
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3567
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3568
+ *
3569
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenResponse otherwise.
3570
+ */
3571
+ logoutCustomer<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3572
+ parameters?: CompositeParameters<{
3573
+ organizationId: string;
3574
+ client_id: string;
3575
+ refresh_token: string;
3576
+ channel_id?: string;
3577
+ hint?: LogoutCustomerHintEnum;
3578
+ } & QueryParameters, ConfigParameters>;
3579
+ headers?: {
3580
+ [key: string]: string;
3581
+ };
3582
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenResponse>;
3583
+ /**
3584
+ * This endpoint allows a customer to set a new password using a valid password reset token. The customer must provide the token received from the password/reset endpoint along with the desired new password.
3585
+ *
3586
+ * If you would like to get a raw Response object use the other resetPassword function.
3587
+ *
3588
+ * @param options - An object containing the options for this method.
3589
+ * @param options.parameters - An object containing the parameters for this method.
3590
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3591
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3592
+ * @param options.body - The data to send as the request body.
3593
+ * @param options.body.client_id - -| The public client ID. When using the `hint` query parameter either a public or private client ID can be used.
3594
+ * @param options.body.pwd_action_token - Password action token that was returned from the `/password/reset` endpoint.
3595
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3596
+ * @param options.body.new_password - The new password to set for the shopper associated with the password action token.
3597
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
3598
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_verifier for password reset request. If the `hint` query parameter is used it must also have been used in the password action request.
3599
+ *
3600
+ * @returns A promise of type void.
3601
+ */
3602
+ resetPassword(options?: RequireParametersUnlessAllAreOptional<{
3603
+ parameters?: CompositeParameters<{
3604
+ organizationId: string;
3605
+ } & QueryParameters, ConfigParameters>;
3606
+ headers?: {
3607
+ [key: string]: string;
3608
+ };
3609
+ body: resetPasswordBodyType & CustomRequestBody;
3610
+ }>): Promise<void>;
3611
+ /**
3612
+ * This endpoint allows a customer to set a new password using a valid password reset token. The customer must provide the token received from the password/reset endpoint along with the desired new password.
3613
+ *
3614
+ * @param options - An object containing the options for this method.
3615
+ * @param options.parameters - An object containing the parameters for this method.
3616
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3617
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3618
+ * @param options.body - The data to send as the request body.
3619
+ * @param options.body.client_id - -| The public client ID. When using the `hint` query parameter either a public or private client ID can be used.
3620
+ * @param options.body.pwd_action_token - Password action token that was returned from the `/password/reset` endpoint.
3621
+ * @param options.body.code_verifier - PKCE code verifier. Created by the client. The `code_challenge` is created by SHA256 hashing the `code_verifier` and Base64 encoding the resulting hash. The `code_verifier` should be a high entropy cryptographically random string with a minimum of 43 characters and a maximum of 128 characters.
3622
+ * @param options.body.new_password - The new password to set for the shopper associated with the password action token.
3623
+ * @param options.body.channel_id - The channel that the request is for. For a B2C Commerce request, this is angalous to the site ID.
3624
+ * @param options.body.hint - Adding a `hint` query parameter with a value of `cross_device` will remove the need to have the code_verifier for password reset request. If the `hint` query parameter is used it must also have been used in the password action request.
3625
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3626
+ *
3627
+ * @returns A promise of type Response if rawResponse is true, a promise of type void otherwise.
3628
+ */
3629
+ resetPassword<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3630
+ parameters?: CompositeParameters<{
3631
+ organizationId: string;
3632
+ } & QueryParameters, ConfigParameters>;
3633
+ headers?: {
3634
+ [key: string]: string;
3635
+ };
3636
+ body: resetPasswordBodyType & CustomRequestBody;
3637
+ }>, rawResponse?: T): Promise<T extends true ? Response : void>;
3638
+ /**
3639
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, and the refresh token to be revoked is required in the body.
3640
+ *
3641
+ * If you would like to get a raw Response object use the other revokeToken function.
3642
+ *
3643
+ * @param options - An object containing the options for this method.
3644
+ * @param options.parameters - An object containing the parameters for this method.
3645
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3646
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3647
+ * @param options.body - The data to send as the request body.
3648
+ * @param options.body.token - Token to inspect or revoke.
3649
+ * @param options.body.token_type_hint - Token Type Hint
3650
+ *
3651
+ * @returns A promise of type TokenActionRequest.
3652
+ */
3653
+ revokeToken(options?: RequireParametersUnlessAllAreOptional<{
3654
+ parameters?: CompositeParameters<{
3655
+ organizationId: string;
3656
+ } & QueryParameters, ConfigParameters>;
3657
+ headers?: {
3658
+ [key: string]: string;
3659
+ };
3660
+ body: revokeTokenBodyType & CustomRequestBody;
3661
+ }>): Promise<TokenActionRequest>;
3662
+ /**
3663
+ * A basic auth header with Base64-encoded `clientId:secret` is required in the Authorization header, and the refresh token to be revoked is required in the body.
3664
+ *
3665
+ * @param options - An object containing the options for this method.
3666
+ * @param options.parameters - An object containing the parameters for this method.
3667
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
3668
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
3669
+ * @param options.body - The data to send as the request body.
3670
+ * @param options.body.token - Token to inspect or revoke.
3671
+ * @param options.body.token_type_hint - Token Type Hint
3672
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
3673
+ *
3674
+ * @returns A promise of type Response if rawResponse is true, a promise of type TokenActionRequest otherwise.
3675
+ */
3676
+ revokeToken<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
3677
+ parameters?: CompositeParameters<{
3678
+ organizationId: string;
3679
+ } & QueryParameters, ConfigParameters>;
3680
+ headers?: {
3681
+ [key: string]: string;
3682
+ };
3683
+ body: revokeTokenBodyType & CustomRequestBody;
3684
+ }>, rawResponse?: T): Promise<T extends true ? Response : TokenActionRequest>;
3685
+ }
3686
+ }
3687
+ declare namespace ShopperLoginModelTypes {
3688
+ /**
3689
+ * Grant Type
3690
+ */
3691
+ type GrantType = "authorization_code" | "refresh_token" | "client_credentials" | "authorization_code_pkce" | "session_bridge";
3692
+ /**
3693
+ * @type Oauth2ErrorResponse:
3694
+ *
3695
+ * @property error:
3696
+ *
3697
+ * @property error_uri:
3698
+ *
3699
+ * @property error_description:
3700
+ *
3701
+ */
3702
+ type Oauth2ErrorResponse = {
3703
+ error: string;
3704
+ error_uri?: string;
3705
+ error_description?: string;
3706
+ } & {
3707
+ [key: string]: any;
3708
+ };
3709
+ /**
3710
+ * Response Type
3711
+ */
3712
+ type ResponseType = "code";
3713
+ /**
3714
+ * @type TokenActionRequest:
3715
+ *
3716
+ * @property token: Token to inspect or revoke.
3717
+ *
3718
+ * @property token_type_hint: Token Type Hint
3719
+ *
3720
+ */
3721
+ type TokenActionRequest = {
3722
+ token: string;
3723
+ token_type_hint?: TokenActionRequestTokenTypeHintEnum;
3724
+ } & {
3725
+ [key: string]: any;
3726
+ };
3727
+ type TokenActionRequestTokenTypeHintEnum = "access_token" | "refresh_token";
3728
+ /**
3729
+ * Token Type
3730
+ */
3731
+ type TokenType = "Bearer";
3732
+ /**
3733
+ * @type TokenResponse:
3734
+ *
3735
+ * @property access_token: Short term shopper JWT that can be used to access Shopper APIs. Valid for 30 minutes. A trusted agent shopper JWT is valid for 15 min.
3736
+ *
3737
+ * @property id_token: User ID token. Valid for 30 minutes.
3738
+ *
3739
+ * @property refresh_token: Long term refresh token that can be used to refresh an access token. Valid for 30 days. The refresh_token will not be returned for trusted agents JWTs. A JWT for trusted agents expires after 15 minutes and is not refreshable. When expired, then app must restart the authorization flow and make another request to the /trusted-agent/authorize endpoint.
3740
+ *
3741
+ * @property expires_in: Remaining access token expiry time, in seconds.
3742
+ *
3743
+ * @property refresh_token_expires_in: Remaining refresh token expiry time, in seconds.
3744
+ *
3745
+ * @property token_type:
3746
+ *
3747
+ * @property usid: The unique shopper ID. Returned when using the `client_credentials` grant type.
3748
+ *
3749
+ * @property customer_id: Customer\'s ID
3750
+ *
3751
+ * @property enc_user_id: MD5 Hashed B2C Commerce user ID in uppercase.
3752
+ *
3753
+ * @property idp_access_token: This is the access token that is returned from the IDP. The IDP access token is returned to be able to make calls into the IDP outside of SLAS.
3754
+ * - **Max Length:** 8192
3755
+ *
3756
+ */
3757
+ type TokenResponse = {
3758
+ access_token: string;
3759
+ id_token: string;
3760
+ refresh_token: string;
3761
+ expires_in: number;
3762
+ refresh_token_expires_in: number;
3763
+ token_type: TokenType;
3764
+ usid: string;
3765
+ customer_id: string;
3766
+ enc_user_id: string;
3767
+ idp_access_token: string;
3768
+ } & {
3769
+ [key: string]: any;
3770
+ };
3771
+ }
3772
+ declare namespace ShopperLoginTypes {
3773
+ type ShopperLoginPathParameters = ShopperLoginApiTypes.ShopperLoginPathParameters;
3774
+ type ShopperLoginQueryParameters = ShopperLoginApiTypes.ShopperLoginQueryParameters;
3775
+ type authenticateCustomerBodyType = ShopperLoginApiTypes.authenticateCustomerBodyType;
3776
+ type authenticateCustomerQueryParameters = ShopperLoginApiTypes.authenticateCustomerQueryParameters;
3777
+ type authenticateCustomerPathParameters = ShopperLoginApiTypes.authenticateCustomerPathParameters;
3778
+ type AuthorizeCustomerResponseTypeEnum = ShopperLoginApiTypes.AuthorizeCustomerResponseTypeEnum;
3779
+ type AuthorizeCustomerScopeEnum = ShopperLoginApiTypes.AuthorizeCustomerScopeEnum;
3780
+ type authorizeCustomerQueryParameters = ShopperLoginApiTypes.authorizeCustomerQueryParameters;
3781
+ type authorizeCustomerPathParameters = ShopperLoginApiTypes.authorizeCustomerPathParameters;
3782
+ type AuthorizePasswordlessCustomerModeEnum = ShopperLoginApiTypes.AuthorizePasswordlessCustomerModeEnum;
3783
+ type authorizePasswordlessCustomerBodyType = ShopperLoginApiTypes.authorizePasswordlessCustomerBodyType;
3784
+ type authorizePasswordlessCustomerQueryParameters = ShopperLoginApiTypes.authorizePasswordlessCustomerQueryParameters;
3785
+ type authorizePasswordlessCustomerPathParameters = ShopperLoginApiTypes.authorizePasswordlessCustomerPathParameters;
3786
+ type getAccessTokenBodyType = ShopperLoginApiTypes.getAccessTokenBodyType;
3787
+ type getAccessTokenQueryParameters = ShopperLoginApiTypes.getAccessTokenQueryParameters;
3788
+ type getAccessTokenPathParameters = ShopperLoginApiTypes.getAccessTokenPathParameters;
3789
+ type getJwksUriQueryParameters = ShopperLoginApiTypes.getJwksUriQueryParameters;
3790
+ type getJwksUriPathParameters = ShopperLoginApiTypes.getJwksUriPathParameters;
3791
+ type GetPasswordLessAccessTokenGrantTypeEnum = ShopperLoginApiTypes.GetPasswordLessAccessTokenGrantTypeEnum;
3792
+ type getPasswordLessAccessTokenBodyType = ShopperLoginApiTypes.getPasswordLessAccessTokenBodyType;
3793
+ type getPasswordLessAccessTokenQueryParameters = ShopperLoginApiTypes.getPasswordLessAccessTokenQueryParameters;
3794
+ type getPasswordLessAccessTokenPathParameters = ShopperLoginApiTypes.getPasswordLessAccessTokenPathParameters;
3795
+ type GetPasswordResetTokenModeEnum = ShopperLoginApiTypes.GetPasswordResetTokenModeEnum;
3796
+ type getPasswordResetTokenBodyType = ShopperLoginApiTypes.getPasswordResetTokenBodyType;
3797
+ type getPasswordResetTokenQueryParameters = ShopperLoginApiTypes.getPasswordResetTokenQueryParameters;
3798
+ type getPasswordResetTokenPathParameters = ShopperLoginApiTypes.getPasswordResetTokenPathParameters;
3799
+ type GetSessionBridgeAccessTokenGrantTypeEnum = ShopperLoginApiTypes.GetSessionBridgeAccessTokenGrantTypeEnum;
3800
+ type getSessionBridgeAccessTokenBodyType = ShopperLoginApiTypes.getSessionBridgeAccessTokenBodyType;
3801
+ type getSessionBridgeAccessTokenQueryParameters = ShopperLoginApiTypes.getSessionBridgeAccessTokenQueryParameters;
3802
+ type getSessionBridgeAccessTokenPathParameters = ShopperLoginApiTypes.getSessionBridgeAccessTokenPathParameters;
3803
+ type GetTrustedAgentAccessTokenGrantTypeEnum = ShopperLoginApiTypes.GetTrustedAgentAccessTokenGrantTypeEnum;
3804
+ type getTrustedAgentAccessTokenBodyType = ShopperLoginApiTypes.getTrustedAgentAccessTokenBodyType;
3805
+ type getTrustedAgentAccessTokenQueryParameters = ShopperLoginApiTypes.getTrustedAgentAccessTokenQueryParameters;
3806
+ type getTrustedAgentAccessTokenPathParameters = ShopperLoginApiTypes.getTrustedAgentAccessTokenPathParameters;
3807
+ type GetTrustedAgentAuthorizationTokenResponseTypeEnum = ShopperLoginApiTypes.GetTrustedAgentAuthorizationTokenResponseTypeEnum;
3808
+ type getTrustedAgentAuthorizationTokenQueryParameters = ShopperLoginApiTypes.getTrustedAgentAuthorizationTokenQueryParameters;
3809
+ type getTrustedAgentAuthorizationTokenPathParameters = ShopperLoginApiTypes.getTrustedAgentAuthorizationTokenPathParameters;
3810
+ type GetTrustedSystemAccessTokenGrantTypeEnum = ShopperLoginApiTypes.GetTrustedSystemAccessTokenGrantTypeEnum;
3811
+ type GetTrustedSystemAccessTokenHintEnum = ShopperLoginApiTypes.GetTrustedSystemAccessTokenHintEnum;
3812
+ type GetTrustedSystemAccessTokenIdpOriginEnum = ShopperLoginApiTypes.GetTrustedSystemAccessTokenIdpOriginEnum;
3813
+ type getTrustedSystemAccessTokenBodyType = ShopperLoginApiTypes.getTrustedSystemAccessTokenBodyType;
3814
+ type getTrustedSystemAccessTokenQueryParameters = ShopperLoginApiTypes.getTrustedSystemAccessTokenQueryParameters;
3815
+ type getTrustedSystemAccessTokenPathParameters = ShopperLoginApiTypes.getTrustedSystemAccessTokenPathParameters;
3816
+ type getUserInfoQueryParameters = ShopperLoginApiTypes.getUserInfoQueryParameters;
3817
+ type getUserInfoPathParameters = ShopperLoginApiTypes.getUserInfoPathParameters;
3818
+ type getWellknownOpenidConfigurationQueryParameters = ShopperLoginApiTypes.getWellknownOpenidConfigurationQueryParameters;
3819
+ type getWellknownOpenidConfigurationPathParameters = ShopperLoginApiTypes.getWellknownOpenidConfigurationPathParameters;
3820
+ type IntrospectTokenTokenTypeHintEnum = ShopperLoginApiTypes.IntrospectTokenTokenTypeHintEnum;
3821
+ type introspectTokenBodyType = ShopperLoginApiTypes.introspectTokenBodyType;
3822
+ type introspectTokenQueryParameters = ShopperLoginApiTypes.introspectTokenQueryParameters;
3823
+ type introspectTokenPathParameters = ShopperLoginApiTypes.introspectTokenPathParameters;
3824
+ type LogoutCustomerHintEnum = ShopperLoginApiTypes.LogoutCustomerHintEnum;
3825
+ type logoutCustomerQueryParameters = ShopperLoginApiTypes.logoutCustomerQueryParameters;
3826
+ type logoutCustomerPathParameters = ShopperLoginApiTypes.logoutCustomerPathParameters;
3827
+ type resetPasswordBodyType = ShopperLoginApiTypes.resetPasswordBodyType;
3828
+ type resetPasswordQueryParameters = ShopperLoginApiTypes.resetPasswordQueryParameters;
3829
+ type resetPasswordPathParameters = ShopperLoginApiTypes.resetPasswordPathParameters;
3830
+ type RevokeTokenTokenTypeHintEnum = ShopperLoginApiTypes.RevokeTokenTokenTypeHintEnum;
3831
+ type revokeTokenBodyType = ShopperLoginApiTypes.revokeTokenBodyType;
3832
+ type revokeTokenQueryParameters = ShopperLoginApiTypes.revokeTokenQueryParameters;
3833
+ type revokeTokenPathParameters = ShopperLoginApiTypes.revokeTokenPathParameters;
3834
+ type GrantType = ShopperLoginModelTypes.GrantType;
3835
+ type Oauth2ErrorResponse = ShopperLoginModelTypes.Oauth2ErrorResponse;
3836
+ type ResponseType = ShopperLoginModelTypes.ResponseType;
3837
+ type TokenActionRequest = ShopperLoginModelTypes.TokenActionRequest;
3838
+ type TokenActionRequestTokenTypeHintEnum = ShopperLoginModelTypes.TokenActionRequestTokenTypeHintEnum;
3839
+ type TokenResponse = ShopperLoginModelTypes.TokenResponse;
3840
+ type TokenType = ShopperLoginModelTypes.TokenType;
3841
+ }
3842
+ export { defaultBaseUri, AuthorizeCustomerResponseTypeEnum, AuthorizeCustomerScopeEnum, AuthorizePasswordlessCustomerModeEnum, GetPasswordLessAccessTokenGrantTypeEnum, GetPasswordResetTokenModeEnum, GetSessionBridgeAccessTokenGrantTypeEnum, GetTrustedAgentAccessTokenGrantTypeEnum, GetTrustedAgentAuthorizationTokenResponseTypeEnum, GetTrustedSystemAccessTokenGrantTypeEnum, GetTrustedSystemAccessTokenHintEnum, GetTrustedSystemAccessTokenIdpOriginEnum, IntrospectTokenTokenTypeHintEnum, LogoutCustomerHintEnum, RevokeTokenTokenTypeHintEnum, authenticateCustomerQueryParameters, authenticateCustomerPathParameters, authenticateCustomerBodyType, authorizeCustomerQueryParameters, authorizeCustomerPathParameters, authorizePasswordlessCustomerQueryParameters, authorizePasswordlessCustomerPathParameters, authorizePasswordlessCustomerBodyType, getAccessTokenQueryParameters, getAccessTokenPathParameters, getAccessTokenBodyType, getJwksUriQueryParameters, getJwksUriPathParameters, getPasswordLessAccessTokenQueryParameters, getPasswordLessAccessTokenPathParameters, getPasswordLessAccessTokenBodyType, getPasswordResetTokenQueryParameters, getPasswordResetTokenPathParameters, getPasswordResetTokenBodyType, getSessionBridgeAccessTokenQueryParameters, getSessionBridgeAccessTokenPathParameters, getSessionBridgeAccessTokenBodyType, getTrustedAgentAccessTokenQueryParameters, getTrustedAgentAccessTokenPathParameters, getTrustedAgentAccessTokenBodyType, getTrustedAgentAuthorizationTokenQueryParameters, getTrustedAgentAuthorizationTokenPathParameters, getTrustedSystemAccessTokenQueryParameters, getTrustedSystemAccessTokenPathParameters, getTrustedSystemAccessTokenBodyType, getUserInfoQueryParameters, getUserInfoPathParameters, getWellknownOpenidConfigurationQueryParameters, getWellknownOpenidConfigurationPathParameters, introspectTokenQueryParameters, introspectTokenPathParameters, introspectTokenBodyType, logoutCustomerQueryParameters, logoutCustomerPathParameters, resetPasswordQueryParameters, resetPasswordPathParameters, resetPasswordBodyType, revokeTokenQueryParameters, revokeTokenPathParameters, revokeTokenBodyType, ShopperLoginPathParameters, ShopperLoginQueryParameters, ShopperLoginParameters, ShopperLogin, GrantType, Oauth2ErrorResponse, ResponseType, TokenActionRequest, TokenActionRequestTokenTypeHintEnum, TokenResponse, TokenType, ShopperLoginTypes };