---
schema_version: "1"
id: 0ce9734fdfa2509ca7512b4403fb7dbe5340375345902c1026cf9af27d607951
title: Data OCAPI Configs (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-ocapi-configs.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-ocapi-configs
source_site: developer.salesforce.com
content_type: documentation
content_hash: f7b1d3b8374195e7ce6a001d4eed2b1ed62d41f9e07c2b6b4ede50e560eac6c1
products:
  - B2C Commerce
  - Salesforce APIs
---
Data OCAPI Configs (deprecated)

# Data OCAPI Configs (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 all allowed resources for the client.

`GET /ocapi_configs/{clientId}`

Operation ID: `Get all allowed resources for the client.`. Tags: ocapi\_configs. Security: oauth2\_application.

Get all allowed resources for the client.

This endpoint may return the following faults:

*   400 - InvalidOCAPIConfigException - Indicates that at least one of the existing configs can not be parsed

#### Parameters

*   `clientId` (path, string, required) client ID  
    Minimum length: 1.

#### Responses

*   **400** `InvalidOCAPIConfigException` - Indicates that at least one of the existing configs can not be parsed
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `ocapi_configs_api_response`.
    

### PUT Add a client to existing OCAPI configurations. Overwrite config if the client already exists.

`PUT /ocapi_configs/{clientId}`

Operation ID: `Add a client to existing OCAPI configurations. Overwrite config if the client already exists.`. Tags: ocapi\_configs. Security: oauth2\_application.

Add a client to existing OCAPI configurations. Overwrite config if the client already exists.

This endpoint may return the following faults:

*   400 - InvalidOCAPIConfigException - Indicates that the resulting config is not valid
*   400 - SelfUpdateException - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)
*   404 - SiteNotFoundException - Indicates that at least one of the target sites is unknown

#### Parameters

*   `clientId` (path, string, required) client ID  
    Minimum length: 1.

#### Request body (required)

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

#### Responses

*   **400** `InvalidOCAPIConfigException` - Indicates that the resulting config is not valid or `SelfUpdateException` - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `SiteNotFoundException` - Indicates that at least one of the target sites is unknown
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `ocapi_configs_api_response`.
    

### POST Add a client to existing OCAPI configurations. Return errors when client already exists.

`POST /ocapi_configs/{clientId}`

Operation ID: `Add a client to existing OCAPI configurations. Return errors when client already exists.`. Tags: ocapi\_configs. Security: oauth2\_application.

Add a client to existing OCAPI configurations. Return errors when client already exists.

This endpoint may return the following faults:

*   400 - InvalidOCAPIConfigException - Indicates that the resulting config is not valid
*   400 - SelfUpdateException - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)
*   404 - SiteNotFoundException - Indicates that at least one of the target sites is unknown
*   409 - DuplicateClientIdException - Indicates that the client id already exists in original OCAPI configuration

#### Parameters

*   `clientId` (path, string, required) client ID  
    Minimum length: 1.

#### Request body (required)

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

#### Responses

*   **400** `InvalidOCAPIConfigException` - Indicates that the resulting config is not valid or `SelfUpdateException` - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `SiteNotFoundException` - Indicates that at least one of the target sites is unknown
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **409** `DuplicateClientIdException` - Indicates that the client id already exists in original OCAPI configuration
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `ocapi_configs_api_response`.
    

### DELETE Delete a client.

`DELETE /ocapi_configs/{clientId}`

Operation ID: `Delete a client.`. Tags: ocapi\_configs. Security: oauth2\_application.

Delete a client.

This endpoint may return the following faults:

*   400 - InvalidOCAPIConfigException - Indicates that the resulting config is not valid
*   400 - SelfUpdateException - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)

#### Parameters

*   `clientId` (path, string, required) Id of the client to be deleted.  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `InvalidOCAPIConfigException` - Indicates that the resulting config is not valid or `SelfUpdateException` - Write operation on self is not allowed. (The clientId being used for calling this API should be different from target clientId)
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

## Schemas

### 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.

### ocapi\_configs\_api\_response

OCAPI configuration APIs response. It contains all available resources for a client

*   `global` (_array of site\_resource\_info_) Global configuration
*   `sites` (_array of site\_resource\_info_) Site configurations

_Example_

```
{
  "resource_info": {
    "resource_type": "data",
    "resources": [
      {
        "methods": [
          "get"
        ],
        "read_attributes": "(**)",
        "resource_id": "/sites",
        "write_attributes": "(**)"
      },
      {
        "methods": [
          "post"
        ],
        "read_attributes": "(**)",
        "resource_id": "/customers",
        "write_attributes": "(**)"
      }
    ]
  }
}
```

### ocapi\_configs\_api\_request

OCAPI configuration APIs request

*   `resource_info` (_resource\_info_, required) Information of resources to be added
*   `sites` (_array of string_, required) Sites to be updated

_Example_

```
{
  "resource_info": {
    "allowed_origins": [
      "http://foo.example.org"
    ],
    "resource_type": "shop",
    "resources": [
      {
        "methods": [
          "post"
        ],
        "read_attributes": "(**)",
        "resource_id": "/baskets",
        "write_attributes": "(**)"
      },
      {
        "methods": [
          "put"
        ],
        "read_attributes": "(**)",
        "resource_id": "/baskets/*/billing_address",
        "write_attributes": "(**)"
      }
    ]
  }
}
```

### cause

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

### site\_resource\_info

Object to represent a site configuration and available resources in the site configuration.

*   `site_configs` (_array of resource\_info_, required) Site configuration
*   `site_id` (_string_) Site ID

_Example_

```
{
  "site_configs": [
    {
      "resource_type": "data",
      "resources": [
        {
          "methods": [
            "get"
          ],
          "read_attributes": "(**)",
          "resource_id": "/sites",
          "write_attributes": "(**)"
        },
        {
          "methods": [
            "post"
          ],
          "read_attributes": "(**)",
          "resource_id": "/customers",
          "write_attributes": "(**)"
        }
      ]
    },
    {
      "allowed_origins": [
        "http://foo.example.org"
      ],
      "resource_type": "shop",
      "resources": [
        {
          "methods": [
            "post"
          ],
          "read_attributes": "(**)",
          "resource_id": "/baskets",
          "write_attributes": "(**)"
        },
        {
          "methods": [
            "put"
          ],
          "read_attributes": "(**)",
          "resource_id": "/baskets/*/billing_address",
          "write_attributes": "(**)"
        }
      ]
    }
  ]
}
```

### resource\_info

*   `allowed_origins` (_array of string_) Allowed Origins
*   `api_type` (_string_, required) API Type  
    Allowed values: `data`, `shop`.
*   `resources` (_array of resource\_object_, required) An array of resources  
    Minimum items: 1.
*   `response_headers` (_object_) Response Header
    
    Additional properties: `string`.
    

_Example_

```
{
  "allowed_origins": [
    "http://foo.example.org"
  ],
  "resource_type": "shop",
  "resources": [
    {
      "methods": [
        "post"
      ],
      "read_attributes": "(**)",
      "resource_id": "/baskets",
      "write_attributes": "(**)"
    },
    {
      "methods": [
        "put"
      ],
      "read_attributes": "(**)",
      "resource_id": "/baskets/*/billing_address",
      "write_attributes": "(**)"
    }
  ]
}
```

### resource\_object

Object to represent a resource in ocapi\_config\_api\_request

*   `cache_time` (_integer (int32)_) Resource Cache time
*   `config` (_object_) Configuration of the resource
    
    Additional properties: `string`.
    
*   `methods` (_array of string_, required) Allowed methods of the resource  
    Minimum items: 1.
*   `personalized_caching_enabled` (_boolean_) Indicate if the personalized caching is enabled for the resource
*   `read_attributes` (_string_) Read attributes of the resource
*   `resource_id` (_string_, required) Resource ID  
    Minimum length: 1.
*   `version_range` (_version\_range\_object_) Version range
*   `write_attributes` (_string_) Write attributes of the resource

_Example_

```
{
  "methods": [
    "post"
  ],
  "read_attributes": "(**)",
  "resource_id": "/baskets",
  "write_attributes": "(**)"
}
```

### version\_range\_object

Object to represent the Version Range. Used in resources\_object.

*   `from` (_string_) Starting version
*   `until` (_string_) Ending version