View a shopper type

To view a shopper type, issue a GET request to the /ccadmin/v1/shopperTypes/{id} endpoint on the administration server.

The following example illustrates calling this endpoint with user (the only type currently available) specified as the value for id:

GET /ccadmin/v1/shopperTypes/user HTTP/1.1
Authorization: Bearer <access_token>

The following example shows a portion of the response returned:

{
    "id": "user",
    "links": [
        {
           "rel": "self",
           "href": "http://myserver.example.com:7002/ccadmin/v1/shopperTypes/user"
        }
    ],
    "properties": {
         ...
        "lastName": {
            "writable": true,
            "localizable": false,
            "label": "Last name",
            "type": "shortText",
            "uiEditorType": "shortText",
            "textSearchable": false,
            "multiSelect": null,
            "dimension": false,
            "internalOnly": null,
            "default": null,
            "audienceVisibility": null,
            "editableAttributes": [
                "textSearchable",
                "multiSelect",
                "dimension",
                "internalOnly",
                "default",
                "label",
                "required",
                "audienceVisibility",
                "searchable"
            ],
            "length": 254,
            "required": false,
            "searchable": false
        },
     },
     ...
}

This example shows a portion of the response corresponding to one of the predefined profile properties appearing in the previous example. The property has a group of attributes that control the behavior associated with the property. To modify the user shopper type, you can create custom properties or modify existing properties by setting the values of these attributes.

Settable attributes of shopper type properties

The following table describes all of the attributes of shopper type properties that you can set through the Shopper Types endpoints of the Admin API:

Attribute Description
label String containing the display name of the property on the storefront. This attribute is localizable. If a value is not supplied, the attribute value is set to the name of the property.
type Data type of the property. Valid values are shortText, richText, number, date, and checkbox. This attribute must be set explicitly, and it cannot be modified after it is set.
uiEditorType Data type for determining the type of user interface control for editing the value of the property. This attribute must be set to the same value as the type attribute for the property, and cannot be modified after it is set.
internalOnly Boolean that specifies whether the property can be displayed on the storefront. If true, the property cannot be displayed. Defaults to false if not specified explicitly.
default Value to use for the property if a value is not specified. Defaults to null if not set explicitly. Must be set explicitly if the required attribute is true.
required Boolean that specifies whether the property value must be set. If this attribute is true, the property must have a default value set through the default attribute. Defaults to false if not set explicitly.
audienceVisibility String that determines whether the property appears as a choice in the Attributes field of the audience interface. For shopper profile properties, this value should be set to all. See Define Audiences.

Note that in addition to the attributes listed in the table above, there are several more attributes whose values are returned when you issue a GET request to the /ccadmin/v1/shopperTypes/{id} endpoint. These attributes either cannot be set through the API, or if they are set, have no effect.