Skip to content

Update attribute

POST
/merchants/{merchantCode}/attributes/{attributeCode}
curl --request POST \
--url https://customer.shopgate.io/v1/merchants/example/attributes/example \
--header 'Content-Type: application/json' \
--data '{ "isRequired": true, "name": "Favorite Pet", "visibility": "internal", "values": [ { "name": "Dog", "code": "dog", "sequenceId": 0 }, { "name": "Fish", "code": "fish", "sequenceId": 1 }, { "name": "Cat", "code": "cat", "sequenceId": 2 }, { "name": "Rabbit", "code": "rabbit", "sequenceId": 3 } ] }'

Update attribute

Preserving attribute values

To preserve an existing attribute value pass its “code” property only.

Example to remove all values except “green” from an attribute:

{
  "values": [
    { "code": "green" }
  ]
}
merchantCode
required
string
attributeCode
required
string
localeCode
string

Locale code to change the language of the attributes

Media typeapplication/json
object
name

Name of the attribute which will be shown to the customer. It’s saved in the language of the passed locale.

string
Example
Color
isRequired
boolean
values
Array<object>
object
code
required

Unique identifier for the attribute value

string
Example
black
sequenceId

Sequence id of the order of the values. The lowest number is at the top and the highest number is at the bottom.

number
Example
0
name

Name of the attribute value which will be shown to the customer. It’s saved in the language of the passed locale.

string
Example
Black
Example
{
"name": "Rabbit",
"sequenceId": 3
}
visibility

Controls the visibility of attributes on a customer

string
Allowed values: internal public
displayGroup

Controls display grouping of attributes

string | null
Example
{
"isRequired": true,
"name": "Favorite Pet",
"visibility": "internal",
"values": [
{
"name": "Dog",
"code": "dog",
"sequenceId": 0
},
{
"name": "Fish",
"code": "fish",
"sequenceId": 1
},
{
"name": "Cat",
"code": "cat",
"sequenceId": 2
},
{
"name": "Rabbit",
"code": "rabbit",
"sequenceId": 3
}
]
}

Successfully updated

Media typeapplication/json

Validation error

Media typeapplication/json
object
errors
Array<object>
object
field
required

The parameter-field, that failed to validate, like “shopNumber”

string
value

The value, that was sent, like “xxx”

string
code
required

Machine readable error code

string
Allowed values: ENUM_MISMATCH MAXIMUM MAXIMUM_EXCLUSIVE MINIMUM MINIMUM_EXCLUSIVE MULTIPLE_OF ARRAY_LENGTH_LONG ARRAY_LENGTH_SHORT ARRAY_ADDITIONAL_ITEMS ARRAY_UNIQUE MAX_LENGTH MIN_LENGTH MAX_PROPERTIES MIN_PROPERTIES OBJECT_MISSING_REQUIRED_PROPERTY OBJECT_PROPERTIES_MAXIMUM OBJECT_PROPERTIES_MINIMUM OBJECT_ADDITIONAL_PROPERTIES OBJECT_DEPENDENCY_KEY ONE_OF_MISSING ONE_OF_MULTIPLE NOT_PASSED INVALID_FORMAT UNKNOWN_FORMAT PATTERN
message
required

Human readable error code

string
Example
{
"errors": [
{
"code": "ENUM_MISMATCH"
}
]
}

Attribute not found

Media typeapplication/json
object
code
required
string
message
required
string
Example
{
"code": "NotFound",
"message": "Merchant not found"
}

One or more attribute values are used for products and cannot be replaced

Media typeapplication/json