Update attribute
const url = 'https://customer.shopgate.io/v1/merchants/example/attributes/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"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}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }
]
}
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Locale code to change the language of the attributes
Request Body
Section titled “Request Body”object
Name of the attribute which will be shown to the customer. It’s saved in the language of the passed locale.
Example
Colorobject
Unique identifier for the attribute value
Example
blackSequence id of the order of the values. The lowest number is at the top and the highest number is at the bottom.
Example
0Name of the attribute value which will be shown to the customer. It’s saved in the language of the passed locale.
Example
BlackExample
{ "name": "Rabbit", "sequenceId": 3}Controls the visibility of attributes on a customer
Controls display grouping of attributes
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 } ]}Responses
Section titled “Responses”Successfully updated
Validation error
object
object
The parameter-field, that failed to validate, like “shopNumber”
The value, that was sent, like “xxx”
Machine readable error code
Human readable error code
Example
{ "errors": [ { "code": "ENUM_MISMATCH" } ]}Attribute not found
object
Example
{ "code": "NotFound", "message": "Merchant not found"}One or more attribute values are used for products and cannot be replaced

