Update product type and attributes

PUT https://app.ecwid.com/api/v3/{storeId}/classes/{classId}

Request and response example

Request:

PUT /api/v3/1003/classes/4208002 HTTP/1.1
Authorization: Bearer secret_token
Host: app.ecwid.com
Content-Type: application/json
Cache-Control: no-cache

{
    "name": "New Class Name", 
    "attributes": [
        {
            "id": 5508062, 
            "name": "New attribute name",
            "type": "CUSTOM",
            "show": "DESCR"            
        },
        {
            "name": "Model ID",
            "type": "CUSTOM",
            "show": "DESCR"            
        }
    ]
}

Response:

{
    "updateCount": 1
}

Required access scopes

Your app must have the following access scopes to make this request: update_catalog

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

classId

number

Internal product type ID.

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Request JSON

A JSON object with the following fields:

Field
Type
Description

name

string

Product type name. Empty for the "General" type.

attributes

array of objects attributes

Product attributes assigned to this product type. Note: to add new product attributes, send both new and all existing attributes in the request. Otherwise, the request will delete all attributes currently assigned to the product type.

attributes

Field
Type
Description

id

number

Internal unique ID of the product attribute. Specify attribute ID to update the existing attribute. If ID is not specified, the attribute is considered new.

name

string

Attribute title visible. Product attribute with an empty name field will also be returned

nameTranslated

Available translations for product attribute name

type

string

Attribute type. There are user-defined attributes, general attributes and special 'price per unit' attributes. The 'type' field contains one of the following: CUSTOM, UPC, BRAND, GENDER, AGE_GROUP, COLOR, SIZE, PRICE_PER_UNIT, UNITS_IN_PRODUCT. Attributes of type PRICE_PER_UNIT and UNITS_IN_PRODUCT are only returned if price per unit feature is enabled.

show

string

Defines if an attribute is visible on a product page. Supported values: NOTSHOW, DESCR, PRICE. The value PRICE = DESCR. For public tokens, NOTSHOW attributes are not returned

translations

Object with text field translations in the "lang": "text" format, where the "lang" is an ISO 639-1 language code. For example:

{
    "en": "Sample text",
    "nl": "Voorbeeldtekst"
}

Translations are available for all active store languages. Only the default language translations are returned if no other translations are provided for the field. Find active store languages with GET /profile request > languages > enabledLanguages.

Response JSON

A JSON object with the following fields:

Field
Type
Description

updateCount

number

The number of updated items that defines if the request was successful. One of:

1 if the item was updated,

0 if the item was not updated.

Last updated

Was this helpful?