Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperSEO<ConfigParameters>

*Download API specification

API Overview

The Shopper SEO API Provides access to SEO-related information, such as URL mapping information.

Authentication & Authorization

The Shopper SEO API requires a shopper access token from the Shopper Login and API Access Service (SLAS).

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For a full list of required permissions, see the Authorization Scopes Catalog.

For details on how to request a shopper access token from SLAS, see the guest user flows for public clients and private clients in the SLAS guides.

Customization

Hooks

For details on working with hooks, see Extensibility with Hooks.

Response Details

Personalization

Responses from this API are not personalized via the Shopper Context API.

Caching

Caching is provided for this API. For details, see Server-Side Web-Tier Caching.

Timeouts

Shopper API requests must respond within 10 seconds, including any hook execution. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see Timeouts and Limits.

Error Handling

Error responses follow the RFC 7807 problem detail format. To trace errors, include a correlation-id header in your request — the response returns it as x-correlation-id. For details, see HTTP Status Codes and Errors.

Use Cases

Resolve a URL

Resolve a URL path to its resource type (product, category, or content page).

curl "https://{shortCode}.api.commercecloud.salesforce.com/site/shopper-seo/v1/organizations/{organizationId}/url-mapping?urlSegment=new-arrivals-tops&siteId=RefArch" \
-H "Authorization: Bearer {access_token}"

URL Resolution

For information on setting up URL rules and URL redirects in Business Manager, see URL Resolution.

Related APIs

Simple example:

  import { ShopperSEO } from "commerce-sdk-isomorphic";

  const clientConfig = {
    parameters: {
      clientId: "XXXXXX",
      organizationId: "XXXX",
      shortCode: "XXX",
      siteId: "XX"
    }
  };
  const shopperSEOClient = new ShopperSEO(clientConfig);
API Version: 0.0.33
Last Updated:

Type parameters

Hierarchy

  • ShopperSEO

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/site/shopper-seo/v1" = currentBaseUri

Static Readonly paramKeys

paramKeys: { getUrlMapping: ["organizationId", "urlSegment", "siteId", "locale", "personalized"]; getUrlMappingRequired: ["organizationId", "urlSegment", "siteId"] } = {getUrlMapping: ['organizationId','urlSegment','siteId','locale','personalized',],getUrlMappingRequired: ['organizationId','urlSegment','siteId',],} as const

Type declaration

  • getUrlMapping: ["organizationId", "urlSegment", "siteId", "locale", "personalized"]
  • getUrlMappingRequired: ["organizationId", "urlSegment", "siteId"]

Methods

getUrlMapping

  • The mapping information is based on URL rules and redirects that are set up in Business Manager. For more information about prerequisites and sample usage, see URL Resolution. You can customize the behavior of this endpoint by using hooks. For details, refer to the Hook List.

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

    Parameters

    Returns Promise<UrlMapping>

    A promise of type UrlMapping.

  • The mapping information is based on URL rules and redirects that are set up in Business Manager. For more information about prerequisites and sample usage, see URL Resolution. You can customize the behavior of this endpoint by using hooks. For details, refer to the Hook List.

    Type parameters

    • T: boolean

    Parameters

    Returns Promise<T extends true ? Response : UrlMapping>

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

Object literals

Static Readonly apiPaths

apiPaths: object

getUrlMapping

getUrlMapping: string = "/organizations/{organizationId}/url-mapping"

Generated using TypeDoc