Get attribute
const url = 'https://customer.shopgate.io/v1/merchants/example/attributes/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://customer.shopgate.io/v1/merchants/example/attributes/exampleGet attribute
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
Responses
Section titled “Responses”Attribute information
object
object
Controls the visibility of attributes on a customer
Controls display grouping of attributes
Describes which type of validation to apply to an attribute’s value. “collectionOfValues” will check for an existing attribute value, the others will check for customer inputs to meet validation criteria of the suggested type (e.g. for type “boolean”, passing “123” will fail validation). The type cannot be changed once an attribute has been created.
Name of the attribute which will be shown to the customer. It’s saved in the language of the passed locale.
object
Unique identifier for the attribute value
Sequence id of the order of the values. The lowest number is at the top and the highest number is at the bottom.
Name of the attribute value which will be shown to the customer. It’s saved in the language of the passed locale.
Example
{ "attribute": { "type": "text", "isRequired": true, "name": "Favorite Pet", "code": "favoritePet", "visibility": "public", "displayGroup": "default", "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 } ] }}Merchant or attribute not found
default
Section titled “default”Unexpected error
object
Machine readable error code
Human readable error code
Examplegenerated
{ "code": "example", "message": "example"}
