---
schema_version: "1"
id: ca0edc1b6e40212e2b6cddbc3558144d9dbdcffb279a1053a468342ce1d6b3f9
title: Data Source Code Groups (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-data-soure-code-groups.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-soure-code-groups
source_site: developer.salesforce.com
content_type: documentation
content_hash: da1b670cb4973e3f1fee3ca8560dd3469d67871be122886d8c6e0f43bdff8a39
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Source Code Groups (deprecated)

# Data Source Code Groups (deprecated)

Data API endpoints enable developers to build applications for merchants: Create, update, delete business objects, like products, customers, pricing and promotions or assignments. They typically provide read and write access and are designed for moderate usage.

**Version:** 25.6

## Servers

*   `https://{host}/s/-/dw/data/v25_6`

Protocols: https.

## Security

*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### GET Get Source Code Groups

`GET /sites/{site_id}/source_code_groups`

Operation ID: `Get Source Code Groups`. Tags: sites. Security: oauth2\_application.

Action to get all the source code groups with no filtering.

#### Parameters

*   `site_id` (path, string, required)  
    Minimum length: 1.
*   `start` (query, integer (int32)) Optional start index for retrieving the items from a given index (default 0).
*   `count` (query, integer (int32)) Optional count for retrieving only a subset of the items (default is 25).
*   `select` (query, string) The property selector.
*   `expand` (query, array of string)

#### Responses

*   **default**
    
    Media type: `application/json, text/xml`. Schema: `source_code_groups`.
    

### GET Get Source Code Group

`GET /sites/{site_id}/source_code_groups/{id}`

Operation ID: `Get Source Code Group`. Tags: sites. Security: oauth2\_application.

Action to retrieve source code group information.

This endpoint may return the following faults:

*   404 - SourceCodeGroupNotFoundException - Thrown in case the source code group does not exist matching the given id

#### Parameters

*   `site_id` (path, string, required) The id of the site.  
    Minimum length: 1.
*   `id` (path, string, required) The id of the requested source code group.  
    Minimum length: 1. Maximum length: 28.
*   `expand` (query, array of string) the query parameter takes an expansion list to include extra information, such as specifications. usage: expand=specifications.

#### Responses

*   **404** `SourceCodeGroupNotFoundException` - Thrown in case the source code group does not exist matching the given id
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `source_code_group`.
    

### PUT Create SourceCodeGroup

`PUT /sites/{site_id}/source_code_groups/{id}`

Operation ID: `Create SourceCodeGroup`. Tags: sites. Security: oauth2\_application.

Creates a source code group using the information provided.

This endpoint may return the following faults:

*   400 - IdConflictException - Thrown when the id given in request URL is different from the id provided in the source code group document
*   400 - SourceCodeGroupInvalidException - if the source code group passed in is not valid (the argument indicates the field that was invalid).

#### Parameters

*   `site_id` (path, string, required) The id of the site.  
    Minimum length: 1.
*   `id` (path, string, required) The id of the source code group to create.  
    Minimum length: 1. Maximum length: 28.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `source_code_group`.

#### Responses

*   **400** `IdConflictException` - Thrown when the id given in request URL is different from the id provided in the source code group document or `SourceCodeGroupInvalidException` - if the source code group passed in is not valid (the argument indicates the field that was invalid).
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `source_code_group`.
    

### DELETE Delete SourceCodeGroup

`DELETE /sites/{site_id}/source_code_groups/{id}`

Operation ID: `Delete SourceCodeGroup`. Tags: sites. Security: oauth2\_application.

Deletes the source code group by ID

#### Parameters

*   `site_id` (path, string, required) The id of the site.  
    Minimum length: 1.
*   `id` (path, string, required) One source code group id to remove  
    Minimum length: 1. Maximum length: 28.

#### Responses

*   **204**

### PATCH Update Source Code Group

`PATCH /sites/{site_id}/source_code_groups/{id}`

Operation ID: `Update Source Code Group`. Tags: sites. Security: oauth2\_application.

Updates the source code group with the specified information.

This endpoint may return the following faults:

*   404 - SourceCodeGroupNotFoundException - Thrown in case the source code group does not exist matching the given id

#### Parameters

*   `site_id` (path, string, required) The id of the site.  
    Minimum length: 1.
*   `id` (path, string, required) The id of the requested source code group.  
    Minimum length: 1. Maximum length: 28.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `source_code_group`.

#### Responses

*   **404** `SourceCodeGroupNotFoundException` - Thrown in case the source code group does not exist matching the given id
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `source_code_group`.
    

## Schemas

### source\_code\_groups

Document representing an unfiltered list of source code groups.

*   `count` (_integer (int32)_) The number of returned documents.
*   `data` (_array of source\_code\_group_)
*   `expand` (_array of string_) The list of expands set for the search request. Expands are optional.
*   `next` (_string_) The URL of the next result page.
*   `previous` (_string_) The URL of the previous result page.
*   `select` (_string_) The fields that you want to select.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.
*   `total` (_integer (int32)_) The total number of documents.

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### source\_code\_group

Document representing a source code group

*   `active` (_boolean_) The active flag, a computed value based on start and end time
*   `active_redirect` (_source\_code\_redirect\_info_) The active redirect information
*   `cookie_duration` (_integer (int32)_) The cookie duration in days  
    Minimum: 0. Maximum: 999.
*   `creation_date` (_string (date-time)_, read-only) Returns the value of attribute 'creationDate'.
*   `description` (_string_) The description
*   `enabled` (_boolean_) The enabled flag for storefront to consider the source code group, default to false.
*   `end_time` (_string (date-time)_) The end time
*   `id` (_string_) The id of source code group  
    Minimum length: 1. Maximum length: 28.
*   `inactive_redirect` (_source\_code\_redirect\_info_) The inactive redirect information
*   `last_modified` (_string (date-time)_, read-only) Returns the value of attribute 'lastModified'.
*   `link` (_string_) URL that is used to get this instance, read only
*   `specifications` (_array of source\_code\_specification_) Source Code specifications
*   `start_time` (_string (date-time)_) The start time

_Example_

```
{
  "description": "My source code group 1",
  "id": "my_source_code_group1",
  "link": "https://example.com/s/-/dw/data/{version}/sites/SiteGenesis/source_code_groups/my_source_code_group1",
  "specifications": [
    {
      "expression": "wsc4"
    },
    {
      "expression": "wsc4?"
    }
  ],
  "start_time": "2014-11-15T00:00:00.000Z"
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### source\_code\_redirect\_info

Document representing a source code redirect info

*   `location` (_string_) The location of redirect, based on the type, this can be a product location, category location, home page, content page, or just a URL
*   `location_type` (_string_) The type of redirect location, e.g. product (for a product page), category (a category page), home (for home page), page (for content), url (for a URL location)  
    Allowed values: `default`, `home`, `product`, `category`, `page`, `url`.

_Example_

```
{
  "location_type": "default"
}
```

### source\_code\_specification

Document representing a source code specification

*   `expression` (_string_)
    
    Expression is a value for the "Source Code Specification" may be a literal source code, or it may contain wildcards.
    
    A literal code is simply the literal code. Valid characters are letters and numbers (no spaces).
    
    A wildcard allows a single source code specification to match multiple source codes. The following wildcards are supported:
    
    *   ? - Matches any single alpha-numeric character. For example: the source code specification 'ABC?' would match 'ABCD' or 'ABC3', but not 'ABCDE'.
        
    *   *   *   Matches any sequence of alpha-numeric characters. For example: the source code specification 'ABC\*' would match 'ABCD', 'ABCDE', or 'ABC123'.
    *   \[n1..n2\] - Matches any number from n1 through and including n2. For example: the source code specification 'ABC\[3..22\]' would match 'ABC3', 'ABC4' or 'ABC22', but not 'ABC33' or 'ABCD'.
        

_Example_

```
{
  "expression": "wsc4?"
}
```