Update product type

Update the details of a specific product type referring to its ID. If you need to update existing product attributes, refer to their IDs in your request.

If you want to add new product attributes to existing product type, send your new attributes AND all existing attributes for that product type. Otherwise you will reset the existing attributes in that product type.

Headers

NameTypeDescription
AuthorizationstringoAuth token with mandatory Bearer before it. Example: Bearer e***s0, where e***s0 should be replaced with your oAuth token.

Request

A JSON object of type 'ProductClass' with the following fields:

ProductClass

FieldTypeDescription
namestringProduct type name. Isn't available to change for 'General' product type
attributesArray<Attribute>Product type attributes

Attribute

FieldTypeDescription
idnumberAttribute internal unique ID (leave empty when adding a new attribute)
namestringAttribute title
nameTranslated<Translations>Available translations for product attribute name
typestringAttribute 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
showstringDefines if an attribute is visible on a product page. Supported values: NOTSHOW, DESCR, PRICE. The value PRICE = DESCR.

Translations

FieldTypeDescription
<ISO_LANG_CODE>stringTranslations for each available language. If no other translations are provided, the default language translations is returned. See available languages in store language settings

Response

A JSON object of type 'UpdateStatus' with the following fields:

UpdateStatus

FieldTypeDescription
updateCountnumberThe number of updated types (1 or 0 depending on whether the update was successful)

Errors

In case of error, Ecwid responds with an error HTTP status code and, optionally, a JSON-formatted body containing error description.

HTTP codes

HTTP StatusResponse JSONDescription
400Request parameters are malformed
409The type/class with the given name already exists
415Unsupported content-type: expected application/json or text/json
500The request failed because of an error on the server

Error response body (optional)

FieldTypeDescription
errorMessagestringError message
Language