Add attribute values
POST
/merchants/{merchantCode}/attributes/{attributeCode}/values
const url = 'https://customer.shopgate.io/v1/merchants/example/attributes/example/values';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"values":[{"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/values \ --header 'Content-Type: application/json' \ --data '{ "values": [ { "name": "Rabbit", "code": "rabbit", "sequenceId": 3 } ] }'Add attribute values
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
attributeCode
required
string
Query Parameters
Section titled “Query Parameters”localeCode
string
Locale code to change the language of the attributes
Request Body
Section titled “Request Body”Media typeapplication/json
object
values
Array
object
code
required
Unique identifier for the attribute value
string
Example
blacksequenceId
required
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
0name
required
Name of the attribute value which will be shown to the customer. It’s saved in the language of the passed locale.
string
Example
BlackExample
{ "name": "Rabbit", "code": "rabbit", "sequenceId": 3}Responses
Section titled “Responses”Successfully created
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
message
required
Human readable error code
string
Example
{ "errors": [ { "code": "ENUM_MISMATCH" } ]}Merchant or attribute not found
Media typeapplication/json
default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
Machine readable error code
string
message
required
Human readable error code
string
Examplegenerated
{ "code": "example", "message": "example"}
