---
schema_version: "1"
id: d21bc0636a42794869cc2c501b12ffdd1e06d98334f6b39ac0ebe38fa35fa26b
title: Store Redirect Mappings
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/commerce-api/references/generated-api-specs/store-redirect-mappings.md
canonical_url: https://developer.salesforce.com/docs/commerce/commerce-api/references/store-redirect-mappings
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1d17061f51bc0e61b0269126c7000e215337488e5702d5be4a6366499c9d1107
products:
  - B2C Commerce API
  - Salesforce APIs
---
Store Redirect Mappings

# Store Redirect Mappings

[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/store-redirect-mappings/store-redirect-mappings-oas-v1-public.yaml)

## API Overview

The Store Redirect Mappings API provides access to store redirect mapping data within the Store API family. Use this API to manage redirect mappings that configure redirects from one store ID to another. This is typically used for SEO purposes when URL patterns require traffic to be redirected to different stores.

### Features

*   Get Store Redirect Mappings: Retrieve a paginated list of all store redirect mappings in an organization.
*   Get Specific Mapping: Retrieve a specific store redirect mapping by source store ID.
*   Bulk Operations: Create or update multiple store redirect mappings in a single request (only returns counts for performance).
*   Batch Deletion: Delete multiple store redirect mappings in a single request (only returns counts for performance).
*   Pagination: Built-in pagination support with configurable limits and offsets
*   Sorting: Sort results by `sourceStoreId` or `targetStoreId` in ascending or descending order

### Authentication & Authorization

For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request.

The API client must also have the following OAuth scopes:

*   `sfcc.store-redirect-mappings` - Read access to store redirect mapping resources
*   `sfcc.store-redirect-mappings.rw` - Read and write access to store redirect mapping resources

You must include the relevant scope(s) in the client ID used to generate the token. For details, see the \[Authorization Scopes Catalog\[(https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html).

For detailed setup instructions, see the \[Authorization for Admin APIs guide\[(https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html).

### Mapping Fields

Each store redirect mapping contains the following fields:

*   `sourceStoreId` - The source store ID that should redirect (String, 1-256 characters)
*   `targetStoreId` - The target store ID to redirect to (String, 1-256 characters)

### Use Cases

*   Store Consolidation: When merging stores, redirect old store IDs to new store IDs.
*   SEO Management: Maintain search engine rankings when store IDs change.
*   URL Migration: Handle redirects during store reorganization or rebranding.

**Version:** 1.2.0

## Servers

*   `https://{shortCode}.api.commercecloud.salesforce.com/store/store-redirect-mappings/v1`
    *   `shortCode (default shortCode)`

## Security

*   `AmOAuth2` (oauth2) OAuth 2.0 Authorization via Account Manager
    *   OAuth flow clientCredentials (tokenUrl: https://account.demandware.com/dw/oauth2/access\_token)
    *   Scope sfcc.store-redirect-mappings: Read access to store redirect mapping resources
    *   Scope sfcc.store-redirect-mappings.rw: Read and write access to store redirect mapping resources

## Operations

### GET Get all store redirect mappings.

`GET /organizations/{organizationId}/store-redirect-mappings`

Operation ID: `getAllStoreRedirectMappings`. Tags: Store Redirect Mappings. Security: AmOAuth2 (sfcc.store-redirect-mappings, sfcc.store-redirect-mappings.rw).

Retrieve all store redirect mappings for the specified organization and site. Use the offset and limit parameters for pagination, or omit them to return all mappings. You can also sort results using the sortBy and sortOrder parameters.

#### Parameters

*   `organizationId` (path, OrganizationId, required) An identifier for the organization the request is being made by
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `siteId` (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    
*   `sortBy` (query, string) Field for sorting  
    Allowed values: `sourceStoreId`, `targetStoreId`. Default: `sourceStoreId`. Example: `sourceStoreId`.
*   `sortOrder` (query, string) Sort direction  
    Allowed values: `asc`, `desc`. Default: `asc`. Example: `asc`.
*   `limit` (query, integer (int32)) Maximum records to retrieve per request, not to exceed 200. Defaults to 25.  
    Default: `25`. Maximum: 200.
*   `offset` (query, integer (int32)) Used to retrieve the results based on a particular resource offset.  
    Default: `0`. Minimum: 0.

#### Responses

*   **200** Store redirect mappings returned successfully.
    
    Media type: `application/json`. Schema: `StoreRedirectMappingsResult`.
    
    _Example: StoreRedirectMappingsResultGetResponse_ Successfully retrieved store redirect mappings
    
    Example response for GET all store redirect mappings
    
    ```
    {
      "data": [
        {
          "sourceStoreId": "store1",
          "targetStoreId": "store2"
        },
        {
          "sourceStoreId": "store3",
          "targetStoreId": "store4"
        }
      ],
      "offset": 0,
      "limit": 25,
      "total": 2
    }
    ```
    
*   **401** Your access token is invalid or expired and can’t be used to identify a user.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: UnauthorizedExample_
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
      "title": "Unauthorized",
      "detail": "Your access token is invalid or expired and can’t be used to identify a user."
    }
    ```
    
*   **403** Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: ForbiddenExample_
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden",
      "title": "Forbidden",
      "detail": "Your access token is valid, but you don’t have the required permissions to access the resource."
    }
    ```
    

### POST Create or update store redirect mappings.

`POST /organizations/{organizationId}/store-redirect-mappings/actions/bulk`

Operation ID: `upsertStoreRedirectMappings`. Tags: Store Redirect Mappings. Security: AmOAuth2 (sfcc.store-redirect-mappings.rw).

Performs a batch creation or update of store redirect mappings.

*   If a mapping for a `sourceStoreId` already exists, the system updates it; otherwise, it creates a new mapping.
*   If the request contains duplicate keys in the `storeRedirectMappings` object, the system processes only the last value provided for each key.
*   Entries with a blank `sourceStoreId` or `targetStoreId` are ignored.
*   To maintain efficiency with large datasets, the response returns execution counts rather than the full objects.

To verify the current state of mappings after a batch update, use the `GET` endpoint.

#### Parameters

*   `organizationId` (path, OrganizationId, required) An identifier for the organization the request is being made by
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `siteId` (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `StoreRedirectMappingsRequest`.

_Example: UpsertSingle_ Upsert single store redirect mapping

Example request body for creating or updating a single store redirect mapping

```
{
  "storeRedirectMappings": {
    "store1": "target1"
  }
}
```

_Example: UpsertMultiple_ Upsert multiple store redirect mappings

Example request body for creating or updating multiple store redirect mappings

```
{
  "storeRedirectMappings": {
    "store1": "target1",
    "store2": "target2",
    "store3": "target3"
  }
}
```

#### Responses

*   **207** Multi-status response for non-atomic bulk operation. The response contains operation counts (total, success, failures). All items might succeed (failures = 0) or some might fail (failures > 0).
    
    Media type: `application/json`. Schema: `StoreRedirectMappingsBulkResponse`.
    
    _Example: StoreRedirectMappingsBulkUpsertResponse_ Bulk upsert operation response
    
    Example response for POST bulk upsert operation (HTTP 207 Multi-Status). The response contains operation counts (total, success, failures). This example shows a case where some items succeeded while others failed.
    
    ```
    {
      "total": 100,
      "success": 95,
      "failures": 5
    }
    ```
    
*   **400** Bad request
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: EmptyUpsertRequest_ Empty Upsert Request Body
    
    Example error response when upsert request body is missing or empty
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
      "title": "Bad Request",
      "detail": "The request body must contain at least one store redirect mapping in the storeRedirectMappings object."
    }
    ```
    
*   **401** Your access token is invalid or expired and can’t be used to identify a user.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example UnauthorizedExample: same as GET /organizations/{organizationId}/store-redirect-mappings 401 response._
    
*   **403** Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example ForbiddenExample: same as GET /organizations/{organizationId}/store-redirect-mappings 403 response._
    

### POST Delete store redirect mappings (batch).

`POST /organizations/{organizationId}/store-redirect-mappings/actions/bulk-delete`

Operation ID: `deleteStoreRedirectMappings`. Tags: Store Redirect Mappings. Security: AmOAuth2 (sfcc.store-redirect-mappings.rw).

Deletes multiple store redirect mappings in a single request.

*   Accepts an array of source store IDs.
*   Blank IDs are skipped, and non-existent mappings are silently ignored.
*   The response returns summary counts instead of deleted items to optimize for large datasets.

Use the `GET` endpoint to retrieve remaining mappings if needed.

#### Parameters

*   `organizationId` (path, OrganizationId, required) An identifier for the organization the request is being made by
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `siteId` (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    

#### Request body (required)

Media type: `application/json`. Schema: `StoreRedirectMappingsDeleteRequest`.

_Example: DeleteSingle_ Delete single store redirect mapping

Example request body for deleting a single store redirect mapping

```
{
  "sourceStoreIds": [
    "store1"
  ]
}
```

_Example: DeleteMultiple_ Delete multiple store redirect mappings

Example request body for deleting multiple store redirect mappings

```
{
  "sourceStoreIds": [
    "store1",
    "store2",
    "store3"
  ]
}
```

#### Responses

*   **207** Multi-status response for non-atomic bulk operation. The response contains operation counts (total, success, failures). All items might succeed (failures = 0) or some might fail (failures > 0).
    
    Media type: `application/json`. Schema: `StoreRedirectMappingsBulkResponse`.
    
    _Example: StoreRedirectMappingsBulkDeleteResponse_ Bulk delete operation response
    
    Example response for POST bulk delete operation (HTTP 207 Multi-Status). The response contains operation counts (total, success, failures). This example shows a case where some items succeeded while others failed.
    
    ```
    {
      "total": 50,
      "success": 48,
      "failures": 2
    }
    ```
    
*   **400** Bad request
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: EmptyDeleteRequest_ Empty Delete Request Body
    
    Example error response when delete request body is missing or contains no valid source store IDs
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
      "title": "Bad Request",
      "detail": "The request body must contain at least one valid source store ID in the sourceStoreIds array."
    }
    ```
    
*   **401** Your access token is invalid or expired and can’t be used to identify a user.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example UnauthorizedExample: same as GET /organizations/{organizationId}/store-redirect-mappings 401 response._
    
*   **403** Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example ForbiddenExample: same as GET /organizations/{organizationId}/store-redirect-mappings 403 response._
    

### GET Get a specific store redirect mapping.

`GET /organizations/{organizationId}/store-redirect-mappings/{sourceStoreId}`

Operation ID: `getStoreRedirectMapping`. Tags: Store Redirect Mappings. Security: AmOAuth2 (sfcc.store-redirect-mappings, sfcc.store-redirect-mappings.rw).

Retrieve a specific store redirect mapping by source store ID.

#### Parameters

*   `organizationId` (path, OrganizationId, required) An identifier for the organization the request is being made by
    
    _Example_
    
    ```
    f_ecom_zzxy_prd
    ```
    
*   `sourceStoreId` (path, SourceStoreId, required) The source store ID to use for retrieval.
*   `siteId` (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
    
    _Example: SiteId_
    
    ```
    RefArch
    ```
    

#### Responses

*   **200** Specified store redirect mapping successfully retrieved.
    
    Media type: `application/json`. Schema: `StoreRedirectMapping`.
    
    _Example: StoreRedirectMappingGetResponse_ Successfully retrieved a store redirect mapping
    
    Example response for GET a specific store redirect mapping
    
    ```
    {
      "sourceStoreId": "store1",
      "targetStoreId": "store2"
    }
    ```
    
*   **400** Bad request
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: BlankSourceStoreId_ Blank Source Store ID
    
    Example error response when sourceStoreId parameter is blank
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
      "title": "Bad Request",
      "detail": "The sourceStoreId parameter is required and cannot be blank."
    }
    ```
    
*   **401** Your access token is invalid or expired and can’t be used to identify a user.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example UnauthorizedExample: same as GET /organizations/{organizationId}/store-redirect-mappings 401 response._
    
*   **403** Forbidden. Your access token is valid, but you don’t have the required permissions to access the resource.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example ForbiddenExample: same as GET /organizations/{organizationId}/store-redirect-mappings 403 response._
    
*   **404** Store redirect mapping not found.
    
    Media type: `application/problem+json`. Schema: `ErrorResponse`.
    
    _Example: StoreRedirectMappingNotFound_ Store Redirect Mapping Not Found
    
    Example error response when the requested store redirect mapping was not found
    
    ```
    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/not-found",
      "title": "Store Redirect Mapping Not Found",
      "detail": "Store redirect mapping with source store ID 'nonexistent-store' was not found."
    }
    ```
    

## Schemas

### OrganizationId

An identifier for the organization the request is being made by

Type: `string`.

Minimum length: 1. Maximum length: 32. Example: `f_ecom_zzxy_prd`.

### SiteId

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites

Type: `string`.

Minimum length: 1. Maximum length: 32. Example: `RefArch`.

### StoreRedirectMappingsResult

Document representing a paginated list of store redirect mappings.

Includes all fields of `PaginatedResultBase`.

*   `data` (_array of StoreRedirectMapping_, required) Array of store redirect mappings

### ErrorResponse

*   `title` (_string_, required) A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization  
    Maximum length: 256. Example: `You do not have enough credit`.
*   `type` (_string_, required) A URI reference \[RFC3986\] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML \[W3C.REC-html5-20141028\]). When this member is not present, its value is assumed to be "about:blank". It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per \[RFC3986\], Section 5.  
    Maximum length: 2048. Example: `NotEnoughMoney`.
*   `detail` (_string_, required) A human-readable explanation specific to this occurrence of the problem.  
    Example: `Your current balance is 30, but that costs 50`.
*   `instance` (_string_) A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per \[RFC3986\], Section 5.  
    Maximum length: 2048. Example: `/account/12345/msgs/abc`.

### StoreRedirectMappingsRequest

*   `storeRedirectMappings` (_object_, required) Map of source store IDs to target store IDs. Keys are source store IDs, values are target store IDs. Note: If duplicate keys are present in the JSON, only the last value for each key will be used.  
    Minimum properties: 1.
    
    Minimum properties: 1.
    
    Additional properties: `string`.
    
    Minimum length: 1. Maximum length: 256. Example: `target1`.
    

### StoreRedirectMappingsBulkResponse

Response for bulk operations (create/update/delete) containing operation counts

*   `total` (_integer (int32)_, required) Total number of items in the request  
    Example: `60000`.
*   `success` (_integer (int32)_, required) Number of items successfully processed  
    Example: `50000`.
*   `failures` (_integer (int32)_, required) Number of items that failed or were skipped (invalid or not found)  
    Example: `10000`.

### StoreRedirectMappingsDeleteRequest

*   `sourceStoreIds` (_array of SourceStoreId_, required) Array of source store IDs to delete  
    Minimum items: 1.

### SourceStoreId

The source store ID that should redirect

Type: `string`.

Minimum length: 1. Maximum length: 256. Example: `store1`.

### StoreRedirectMapping

*   `sourceStoreId` (_SourceStoreId_, required)
*   `targetStoreId` (_TargetStoreId_, required)

### PaginatedResultBase

Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. If you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.

Includes all fields of `ResultBase`.

*   `offset` (_Offset_, required)

### TargetStoreId

The target store ID to redirect to

Type: `string`.

Minimum length: 1. Maximum length: 256. Example: `store2`.

### ResultBase

Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.

*   `limit` (_object_, required)  
    Maximum: 200.
    
    Includes all fields of `Limit`.
    
    Maximum: 200.
    
*   `total` (_Total_, required)

### Offset

The zero-based index of the first hit/data to include in the result.

Type: `integer (int32)`.

Default: `0`. Minimum: 0. Example: `0`.

### Limit

Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).

Type: `integer (int32)`.

Default: `10`. Minimum: 1. Example: `10`.

### Total

The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.

Type: `integer (int32)`.

Default: `0`. Minimum: 0. Example: `10`.