Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperLogin

Enable shoppers to log in more easily, stay logged in for longer, and get a more fluid and personalized shopping experience powered by Shopper APIs.

Example with shopper auth

import { Customer, ClientConfig, Customer, slasHelpers } from "commerce-sdk";
// or
const { Customer, ClientConfig, Customer, slasHelpers } = require("commerce-sdk");

const clientConfig: ClientConfig = {
  parameters: {
    clientId: "XXXXXX",
    organizationId: "XXXX",
    shortCode: "XXX",
    siteId: "XX"
  }
};

// must be registered in SLAS. On server, redirectURI is never called
const redirectURI = "http://localhost:3000/callback";
const slasClient = new Customer.ShopperLogin(clientConfig);
token = await slasHelpers.loginGuestUser(slasClient, { redirectURI });

clientConfig.headers['authorization'] = `Bearer ${token.access_token}`;
const shopperLoginClient = new Customer.ShopperLogin(clientConfig);
API Version: 1.39.22
Last Updated:

Hierarchy

  • BaseClient
    • ShopperLogin

Index

Type aliases

Constructors

Properties

Methods

Type aliases

Static AsyncCreated

AsyncCreated: {}

Type declaration

Static AttributeDefinition

AttributeDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean }

Type declaration

  • Optional defaultValue?: PropertyValueDefinition
  • description: L10nString
  • Optional id?: string
  • Optional key?: boolean
  • Optional localizable?: boolean
  • Optional mandatory?: boolean
  • Optional max?: number
  • Optional min?: number
  • Optional minLength?: number
  • Optional multiValueType?: boolean
  • name: L10nString
  • Optional possibleValues?: Array<PropertyValueDefinition>
  • Optional regularExpression?: string
  • Optional scale?: number
  • Optional searchable?: boolean
  • Optional siteSpecific?: boolean
  • Optional system?: boolean
  • type: string
  • Optional unit?: L10nString
  • Optional visible?: boolean

Static BoolFilter

BoolFilter: { filters?: Array<Filter>; operator: string } & {}

Static BoolQuery

BoolQuery: { must?: Array<Query>; mustNot?: Array<Query>; should?: Array<Query> } & {}

Static ChangeControlled

ChangeControlled: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ChangeControlledDataType

ChangeControlledDataType: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ClosedObject

ClosedObject: {} & {}

Static DateConditionalRequest

DateConditionalRequest: {}

Type declaration

Static DateRangeFilter

DateRangeFilter: {}

Type declaration

Static DatetimeRangeFilter

DatetimeRangeFilter: {}

Type declaration

Static Error

Error: { detail?: string; instance?: string; title?: string; type: string } & {}

Static ErrorResponse

ErrorResponse: { detail?: string; instance?: string; title?: string; type: string } & {}

Static EtagConditionalRequest

EtagConditionalRequest: {}

Type declaration

Static EtagResponse

EtagResponse: {}

Type declaration

Static Filter

Filter: { boolFilter?: BoolFilter; queryFilter?: QueryFilter; range2Filter?: Range2Filter; rangeFilter?: RangeFilter; termFilter?: TermFilter } & {}

Static FilteredQuery

FilteredQuery: { filter: Filter; query: Query } & {}

Static IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static IntrospectResponse

IntrospectResponse: { active: boolean; client_id: string; exp: number; scope: string; sub: string; token_type: string; username: string } & {}

Static L10nString

L10nString: {} & {}

Static LocalizedString

LocalizedString: {} & {}

Static LoginRequest

LoginRequest: { channel_id: string; client_id?: string; code_challenge?: string; redirect_uri: string; response_type?: string; scope?: string; state?: string; usid?: string } & {}

Static MatchAllQuery

MatchAllQuery: {} & {}

Static Money

Money: { currencyMnemonic?: string; value?: number } & {}

Static MoneyMnemonic

MoneyMnemonic: { currencyMnemonic?: string; value?: number } & {}

Static NestedQuery

NestedQuery: { path: string; query: Query; scoreMode?: string } & {}

Static NoPropertiesAllowed

NoPropertiesAllowed: {}

Type declaration

Static NumericRangeFilter

NumericRangeFilter: {}

Type declaration

Static Oauth2ErrorResponse

Oauth2ErrorResponse: { error: string; error_description?: string; error_uri?: string } & {}

Static OffsetPaginated

OffsetPaginated: {}

Type declaration

Static OpenObject

OpenObject: {} & {}

Static PaginatedSearchResult

PaginatedSearchResult: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PaginatedSearchResultBase

PaginatedSearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PasswordActionRequest

PasswordActionRequest: { callback_uri?: string; channel_id: string; client_id?: string; code_challenge?: string; idp_name?: string; locale?: string; mode: string; user_id: string } & {}

Static PasswordActionVerifyRequest

PasswordActionVerifyRequest: { channel_id: string; client_id: string; code_verifier: string; new_password: string; pwd_action_token: string } & {}

Static PasswordLessLoginTokenRequest

PasswordLessLoginTokenRequest: { client_id?: string; code_verifier?: string; grant_type: string; hint: string; pwdless_login_token: string } & {}

Static PasswordlessLoginRequest

PasswordlessLoginRequest: { callback_uri?: string; channel_id: string; locale?: string; mode: string; user_id: string; usid?: string } & {}

Static PropertyDefinition

PropertyDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean } & {}

Static PropertyValueDefinition

PropertyValueDefinition: { description: L10nString; displayValue: L10nString; id: string; position?: number; value: string }

Type declaration

  • description: L10nString
  • displayValue: L10nString
  • id: string
  • Optional position?: number
  • value: string

Static Query

Query: { boolQuery?: BoolQuery; filteredQuery?: FilteredQuery; matchAllQuery?: MatchAllQuery; nestedQuery?: NestedQuery; termQuery?: TermQuery; textQuery?: TextQuery } & {}

Static QueryFilter

QueryFilter: { query: Query } & {}

Static QueryParamsLimit

QueryParamsLimit: {}

Type declaration

Static QueryParamsOffset

QueryParamsOffset: {}

Type declaration

Static Range2Filter

Range2Filter: { filterMode?: string; fromField: string; fromInclusive?: boolean; fromValue?: any; toField: string; toInclusive?: boolean; toValue?: any } & {}

Static RangeFilter

RangeFilter: {}

Type declaration

Static RateLimited

RateLimited: {}

Type declaration

Static RateLimited2

RateLimited2: {}

Type declaration

Static RateLimited3

RateLimited3: {}

Type declaration

Static RateLimited4

RateLimited4: {}

Type declaration

Static RateLimited5

RateLimited5: {}

Type declaration

Static SearchRequest

SearchRequest: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static SearchRequestBase

SearchRequestBase: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static SessionBridgeTokenRequest

SessionBridgeTokenRequest: { channel_id: string; client_id: string; code: string; code_verifier: string; dnt?: string; dwsgst?: string; dwsid: string; grant_type: string; login_id: string; usid?: string } & {}

Static SimpleSearchResult

SimpleSearchResult: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SimpleSearchResultBase

SimpleSearchResultBase: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SiteSpecific

SiteSpecific: {}

Type declaration

Static SlasRateLimit

SlasRateLimit: {}

Type declaration

Static Sort

Sort: { field: string; sortOrder?: string } & {}

Static SpecifiedPropertiesAllowed

SpecifiedPropertiesAllowed: {} & {}

Static SyncCreated

SyncCreated: {}

Type declaration

Static TermFilter

TermFilter: { field: string; operator: string; values?: Array<any> } & {}

Static TermQuery

TermQuery: { fields: Array<string>; operator: string; values?: Array<any> } & {}

Static TextQuery

TextQuery: { fields: Array<string>; searchPhrase: string } & {}

Static TokenActionRequest

TokenActionRequest: { token: string; token_type_hint?: string } & {}

Static TokenRequest

TokenRequest: { channel_id?: string; client_id?: string; code?: string; code_verifier?: string; dnt?: string; grant_type: string; redirect_uri?: string; refresh_token?: string; usid?: string } & {}

Static TokenResponse

TokenResponse: { access_token: string; customer_id: string; enc_user_id: string; expires_in: number; id_token: string; idp_access_token: string; refresh_token: string; refresh_token_expires_in: any; token_type: string; usid: string } & {}

Static TrustedAgentTokenRequest

TrustedAgentTokenRequest: { agent_id?: string; channel_id: string; client_id: string; code_verifier: string; dnt?: string; grant_type: string; idp_origin: string; login_id: string; usid?: string } & {}

Static TrustedSystemTokenRequest

TrustedSystemTokenRequest: { channel_id: string; client_id: string; dnt?: string; email_id?: string; grant_type: string; hint: string; idp_origin: string; login_id: string; usid?: string } & {}

Constructors

constructor

  • Parameters

    • config: ClientConfig

    Returns ShopperLogin

Properties

clientConfig

clientConfig: ClientConfig

Methods

authenticateCustomer

  • authenticateCustomer(options: { body: LoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • authenticateCustomer<T>(options: { body: LoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Logs in a shopper with credentials that are managed by a B2C Commerce instance (ECOM). It follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).

    For PKCE values:

    • The code_verifier string is a random string used for the /token endpoint request.
    • The code_challenge is an encoded version of the code_verifier string using an SHA-256 hash.

    The request must include a basic authorization header that contains a Base64 encoded version of the following string: \<shopperUserID\>:\<shopperPassword\>.

    Required parameters: code_challenge, channel_id, client_id, and redirect_uri.

    Optional parameters: usid.

    The SLAS /login endpoint redirects back to the redirect URI and returns an authorization code.

    Calls to /login made with the same loginId and tenantId within 1 second will result in a conflict.

    If you would like to get a raw Response object use the other authenticateCustomer function.

    Parameters

    • options: { body: LoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: LoginRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Logs in a shopper with credentials that are managed by a B2C Commerce instance (ECOM). It follows the authorization code grant flow as defined by the OAuth 2.1 standard. It also uses a proof key for code exchange (PKCE).

    For PKCE values:

    • The code_verifier string is a random string used for the /token endpoint request.
    • The code_challenge is an encoded version of the code_verifier string using an SHA-256 hash.

    The request must include a basic authorization header that contains a Base64 encoded version of the following string: \<shopperUserID\>:\<shopperPassword\>.

    Required parameters: code_challenge, channel_id, client_id, and redirect_uri.

    Optional parameters: usid.

    The SLAS /login endpoint redirects back to the redirect URI and returns an authorization code.

    Calls to /login made with the same loginId and tenantId within 1 second will result in a conflict.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: LoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: LoginRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

authorizeCustomer

  • authorizeCustomer(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • authorizeCustomer<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Get an authorization code after authenticating a user against an identity provider (IDP). This is the first step of the OAuth 2.1 authorization code flow, where 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.

    This endpoint can be called from the front channel (the browser).

    If you would like to get a raw Response object use the other authorizeCustomer function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Get an authorization code after authenticating a user against an identity provider (IDP). This is the first step of the OAuth 2.1 authorization code flow, where 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.

    This endpoint can be called from the front channel (the browser).

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; client_id: string; code_challenge: string; hint?: string; organizationId?: string; redirect_uri: string; response_type: string; scope?: string; state?: string; ui_locales?: string; usid?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

authorizePasswordlessCustomer

  • authorizePasswordlessCustomer(options: { body: PasswordlessLoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<Object>
  • authorizePasswordlessCustomer<T>(options: { body: PasswordlessLoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Object>
  • Allows the customer to authenticate when their identity provider is down.

    If you would like to get a raw Response object use the other authorizePasswordlessCustomer function.

    Parameters

    • options: { body: PasswordlessLoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordlessLoginRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Object>

    A promise of type Object.

  • Allows the customer to authenticate when their identity provider is down.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: PasswordlessLoginRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordlessLoginRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getAccessToken

  • getAccessToken(options: { body: TokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • getAccessToken<T>(options: { body: TokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Get the shopper or guest JWT access token and a refresh token. This is the second step of the OAuth 2.1 authorization code flow.

    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.

    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.

    For a public client using PKCE, an application will pass a PKCE code_verifier that matches the code_challenge that was used to authorize the customer along with the authorization code.

    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 needs to be replaced to always store the new refresh token.

    See the Body section for required parameters, including grant_type and others, depending on the value of grant_type.

    Important: We strongly recommended using the channel_id query parameter because *it will be required in the future.

    If you would like to get a raw Response object use the other getAccessToken function.

    Parameters

    • options: { body: TokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Get the shopper or guest JWT access token and a refresh token. This is the second step of the OAuth 2.1 authorization code flow.

    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.

    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.

    For a public client using PKCE, an application will pass a PKCE code_verifier that matches the code_challenge that was used to authorize the customer along with the authorization code.

    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 needs to be replaced to always store the new refresh token.

    See the Body section for required parameters, including grant_type and others, depending on the value of grant_type.

    Important: We strongly recommended using the channel_id query parameter because *it will be required in the future.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: TokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

getJwksUri

  • getJwksUri(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<Object>
  • getJwksUri<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Object>
  • Returns a JSON Web Key Set (JWKS) containing the current, past, and future public keys. The key set enables clients to validate the Shopper JSON Web Token (JWT) issued by SLAS.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    If you would like to get a raw Response object use the other getJwksUri function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON Web Key Set (JWKS) containing the current, past, and future public keys. The key set enables clients to validate the Shopper JSON Web Token (JWT) issued by SLAS.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getPasswordLessAccessToken

  • getPasswordLessAccessToken(options: { body: PasswordLessLoginTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • getPasswordLessAccessToken<T>(options: { body: PasswordLessLoginTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Issue a shopper token (JWT).

    If you would like to get a raw Response object use the other getPasswordLessAccessToken function.

    Parameters

    • options: { body: PasswordLessLoginTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordLessLoginTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Issue a shopper token (JWT).

    Type parameters

    • T: boolean

    Parameters

    • options: { body: PasswordLessLoginTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordLessLoginTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

getPasswordResetToken

  • getPasswordResetToken(options: { body: PasswordActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • getPasswordResetToken<T>(options: { body: PasswordActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Request a reset password token

    If you would like to get a raw Response object use the other getPasswordResetToken function.

    Parameters

    • options: { body: PasswordActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Request a reset password token

    Type parameters

    • T: boolean

    Parameters

    • options: { body: PasswordActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

getSessionBridgeAccessToken

  • getSessionBridgeAccessToken(options: { body: SessionBridgeTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • getSessionBridgeAccessToken<T>(options: { body: SessionBridgeTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Get a shopper JWT access token for a registered customer using session bridge.

    For public client id requests the grant_type must be set to session_bridge.

    For private client_id and secret the grant_type must be set to client_credentials along with a basic authorization header.

    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.

    If you would like to get a raw Response object use the other getSessionBridgeAccessToken function.

    Parameters

    • options: { body: SessionBridgeTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SessionBridgeTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Get a shopper JWT access token for a registered customer using session bridge.

    For public client id requests the grant_type must be set to session_bridge.

    For private client_id and secret the grant_type must be set to client_credentials along with a basic authorization header.

    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.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: SessionBridgeTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SessionBridgeTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

getTrustedAgentAccessToken

  • getTrustedAgentAccessToken(options: { body: TrustedAgentTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • getTrustedAgentAccessToken<T>(options: { body: TrustedAgentTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Get a shopper JWT access token for a registered customer using a trusted agent (merchant).

    If using a SLAS private client ID, you must also use an _sfdc_client_auth header.

    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.

    If you would like to get a raw Response object use the other getTrustedAgentAccessToken function.

    Parameters

    • options: { body: TrustedAgentTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TrustedAgentTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Get a shopper JWT access token for a registered customer using a trusted agent (merchant).

    If using a SLAS private client ID, you must also use an _sfdc_client_auth header.

    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.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: TrustedAgentTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TrustedAgentTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

getTrustedAgentAuthorizationToken

  • getTrustedAgentAuthorizationToken(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • getTrustedAgentAuthorizationToken<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Obtains a new agent on behalf authorization token for a registered customer.

    If you would like to get a raw Response object use the other getTrustedAgentAuthorizationToken function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Obtains a new agent on behalf authorization token for a registered customer.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id: string; client_id: string; code_challenge: string; idp_origin: string; login_id: string; organizationId?: string; redirect_uri: string; response_type: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

getTrustedSystemAccessToken

  • getTrustedSystemAccessToken(options: { body: TrustedSystemTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • getTrustedSystemAccessToken<T>(options: { body: TrustedSystemTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Get a shopper JWT access token for a registered customer whose credentials are stored using a third party system.

    For trusted-system requests, a basic authorization header that includes a SLAS client ID and SLAS client secret can be used in place of the bearer token.

    If you would like to get a raw Response object use the other getTrustedSystemAccessToken function.

    Parameters

    • options: { body: TrustedSystemTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TrustedSystemTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Get a shopper JWT access token for a registered customer whose credentials are stored using a third party system.

    For trusted-system requests, a basic authorization header that includes a SLAS client ID and SLAS client secret can be used in place of the bearer token.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: TrustedSystemTokenRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TrustedSystemTokenRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

getUserInfo

  • getUserInfo(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<Object>
  • getUserInfo<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Object>
  • Returns a JSON listing of claims about the currently authenticated user.

    If you would like to get a raw Response object use the other getUserInfo function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON listing of claims about the currently authenticated user.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

getWellknownOpenidConfiguration

  • getWellknownOpenidConfiguration(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<Object>
  • getWellknownOpenidConfiguration<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Object>
  • Returns a JSON listing of the OpenID/OAuth endpoints, supported scopes and claims, public keys used to sign the tokens, and other details.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    If you would like to get a raw Response object use the other getWellknownOpenidConfiguration function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Object>

    A promise of type Object.

  • Returns a JSON listing of the OpenID/OAuth endpoints, supported scopes and claims, public keys used to sign the tokens, and other details.

    For performance purposes, the /jwks endpoint is rate limited to 25 call per minute.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

introspectToken

  • introspectToken(options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<Object>
  • introspectToken<T>(options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Object>
  • Returns the token properties. 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.

    If you would like to get a raw Response object use the other introspectToken function.

    Parameters

    • options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Object>

    A promise of type Object.

  • Returns the token properties. 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.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Object>

    A promise of type Response if rawResponse is true, a promise of type Object otherwise.

logoutCustomer

  • logoutCustomer(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • logoutCustomer<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Log out a shopper. The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (ECOM) instance, the OCAPI JWT is also revoked. This should be called for Registered users that have logged in using SLAS. his should be called for registered users that have logged in using SLAS. This endpoint is not for use with guest users.

    Required header: Authorization header bearer token of the Shopper access token to logout.

    Required parameters: refresh token, channel_id, and client.

    If you would like to get a raw Response object use the other logoutCustomer function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Log out a shopper. The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (ECOM) instance, the OCAPI JWT is also revoked. This should be called for Registered users that have logged in using SLAS. his should be called for registered users that have logged in using SLAS. This endpoint is not for use with guest users.

    Required header: Authorization header bearer token of the Shopper access token to logout.

    Required parameters: refresh token, channel_id, and client.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { channel_id?: string; client_id: string; hint?: string; organizationId?: string; refresh_token: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

resetPassword

  • resetPassword(options: { body: PasswordActionVerifyRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • resetPassword<T>(options: { body: PasswordActionVerifyRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Creates a new password

    If you would like to get a raw Response object use the other resetPassword function.

    Parameters

    • options: { body: PasswordActionVerifyRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordActionVerifyRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Creates a new password

    Type parameters

    • T: boolean

    Parameters

    • options: { body: PasswordActionVerifyRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: PasswordActionVerifyRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

revokeToken

  • revokeToken(options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }): Promise<TokenResponse>
  • revokeToken<T>(options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperLogin.TokenResponse>
  • Invalidate the refresh token. 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.

    If you would like to get a raw Response object use the other revokeToken function.

    Parameters

    • options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<TokenResponse>

    A promise of type ShopperLogin.TokenResponse.

  • Invalidate the refresh token. 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.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: TokenActionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: TokenActionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : ShopperLogin.TokenResponse>

    A promise of type Response if rawResponse is true, a promise of type ShopperLogin.TokenResponse otherwise.

Generated using TypeDoc