---
schema_version: "1"
id: 1b539f44e6912686fcac4b127aa20849cfd097cef1e88d30f76d6b70928b814d
title: Data Custom Objects (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-custom-objects.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-custom-objects
source_site: developer.salesforce.com
content_type: documentation
content_hash: 050aef35ce07781b049ad309ca1f6881307b21f383f6f9571a0c557819eb8dfb
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Custom Objects (deprecated)

# Data Custom Objects (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 Read site specific Custom Object

`GET /sites/{site_id}/custom_objects/{object_type}/{key}`

Operation ID: `Read site specific Custom Object`. Tags: sites. Security: oauth2\_application.

Reads a site specific Custom Object with a given object type ID and a value for the key attribute of the object which represents its unique identifier.

This endpoint may return the following faults:

*   400 - MalformedKeyParameterException - If the object key must be an integer, but the path parameter has an invalid format
*   404 - ObjectTypeNotFoundException - For an unknown object type ID
*   404 - CustomObjectNotFoundException - For an unknown object key

#### Parameters

*   `site_id` (path, string, required) the ID of the site  
    Minimum length: 1.
*   `object_type` (path, string, required) the ID of the object type  
    Minimum length: 1.
*   `key` (path, string, required) the key attribute value of the Custom Object  
    Minimum length: 1.

#### Responses

*   **400** `MalformedKeyParameterException` - If the object key must be an integer, but the path parameter has an invalid format
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `ObjectTypeNotFoundException` - For an unknown object type ID or `CustomObjectNotFoundException` - For an unknown object key
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `custom_object`.
    

### PUT Create site specific Custom Object

`PUT /sites/{site_id}/custom_objects/{object_type}/{key}`

Operation ID: `Create site specific Custom Object`. Tags: sites. Security: oauth2\_application.

Creates a site specific Custom Object from the request body. Note that an existing site specific Custom Object with the same key is overwritten by this action.

Use Custom Properties prefixed with `c_` to define the Custom Object fields.  
For localizable strings, structure the field to support multiple language values by using a map where each locale, for example: en\_US, fr\_FR, has its corresponding string value.

This endpoint may return the following faults:

*   400 - MalformedKeyParameterException - If the object key must be an integer, but the path parameter has an invalid format
*   404 - ObjectTypeNotFoundException - For an unknown object type ID
*   404 - CustomObjectNotFoundException - For an unknown object key

#### Parameters

*   `site_id` (path, string, required) the ID of the site  
    Minimum length: 1.
*   `object_type` (path, string, required) the ID of the object type  
    Minimum length: 1.
*   `key` (path, string, required) the key attribute value of the Custom Object  
    Minimum length: 1.

#### Request body

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

#### Responses

*   **400** `MalformedKeyParameterException` - If the object key must be an integer, but the path parameter has an invalid format
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `ObjectTypeNotFoundException` - For an unknown object type ID or `CustomObjectNotFoundException` - For an unknown object key
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `custom_object`.
    

### DELETE Delete site specific Custom Object

`DELETE /sites/{site_id}/custom_objects/{object_type}/{key}`

Operation ID: `Delete site specific Custom Object`. Tags: sites. Security: oauth2\_application.

Deletes a site specific Custom Object. If the Custom Object does not exist, this will do nothing. Note that the customization scripts are only called, if the Custom Object does exist.

This endpoint may return the following faults:

*   400 - MalformedKeyParameterException - If the object key must be an integer, but the path parameter has an invalid format
*   404 - ObjectTypeNotFoundException - For an unknown object type ID

#### Parameters

*   `site_id` (path, string, required) the ID of the site  
    Minimum length: 1.
*   `object_type` (path, string, required) the ID of the object type  
    Minimum length: 1.
*   `key` (path, string, required) the key attribute value of the Custom Object  
    Minimum length: 1.

#### Responses

*   **204**
*   **400** `MalformedKeyParameterException` - If the object key must be an integer, but the path parameter has an invalid format
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `ObjectTypeNotFoundException` - For an unknown object type ID
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    

### PATCH Update site specific Custom Object

`PATCH /sites/{site_id}/custom_objects/{object_type}/{key}`

Operation ID: `Update site specific Custom Object`. Tags: sites. Security: oauth2\_application.

Updates a site specific Custom Object with information from the request body. Note that only provided attributes are updated and that the key attribute is ignored. All other attributes are unchanged.

Use Custom Properties prefixed with `c_` to define the Custom Object fields.  
For localizable strings, structure the field to support multiple language values by using a map where each locale, for example: en\_US, fr\_FR, has its corresponding string value.

This endpoint may return the following faults:

*   400 - MalformedKeyParameterException - If the object key must be an integer, but the path parameter has an invalid format
*   404 - ObjectTypeNotFoundException - For an unknown object type ID
*   404 - CustomObjectNotFoundException - For an unknown object key

#### Parameters

*   `site_id` (path, string, required) the ID of the site  
    Minimum length: 1.
*   `object_type` (path, string, required) the ID of the object type  
    Minimum length: 1.
*   `key` (path, string, required) the key attribute value of the Custom Object  
    Minimum length: 1.

#### Request body (required)

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

#### Responses

*   **400** `MalformedKeyParameterException` - If the object key must be an integer, but the path parameter has an invalid format
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **404** `ObjectTypeNotFoundException` - For an unknown object type ID or `CustomObjectNotFoundException` - For an unknown object key
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `custom_object`.
    

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

### custom\_object

Document representing a custom object that contains all defined custom attributes for its object type.

*   `key_property` (_string_) The name of the key property for the custom object. This is ignored in input documents.
*   `key_value_integer` (_integer (int32)_) The id of the custom object when the type of the key is Integer. This is ignored in input documents.
*   `key_value_string` (_string_) The id of the custom object when the type of the key is String. This is ignored in input documents.
*   `object_type` (_string_) The id of the object type. This is ignored in input documents.

_Example_

```
{
  "key_property": "key_attribute",
  "object_type": "my_object_type",
  "c_boolean": true,
  "c_date": "2015-02-03T00:00:00.000Z",
  "c_email": "jdoe@salesforce.com",
  "c_integer": 42,
  "c_number": 42,
  "c_string": "some text"
}
```

### cause

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