Skip to main content

Get Variant Attributes

Retrieve a list of all available variant attributes and their possible values within the Presto system.

Overview

This endpoint allows you to fetch the attributes (such as size, color, etc.) that can be used for item variants, along with their possible values.

Endpoint Details

Method: GET
URL: /api/developer/v1/variant-attributes
Authentication: Bearer Token Required

Request Specification

No query parameters are required for this endpoint.

Example Request

GET /api/developer/v1/variant-attributes
Authorization: Bearer <your-token>
Accept: application/json

Response Specification

Success Response 200 OK

{
"data": [
{
"id": 1,
"localized_name": "size",
"name": {
"en": "Size",
"ar": "الحجم",
"fr": "Taille"
},
"key": "size",
"values_count": 3,
"values": [
{
"id": 101,
"localized_name": "Small",
"name": {
"en": "Small",
"ar": "صغير",
"fr": "Petit"
},
"key": "small"
},
{
"id": 102,
"localized_name": "Medium",
"name": {
"en": "Medium",
"ar": "متوسط",
"fr": "Moyen"
},
"key": "medium"
},
{
"id": 103,
"localized_name": "Large",
"name": {
"en": "Large",
"ar": "كبير",
"fr": "Grand"
},
"key": "large"
}
]
},
{
"id": 2,
"localized_name": "Color",
"name": {
"en": "Color",
"ar": "اللون",
"fr": "Couleur"
},
"key": "color",
"values_count": 2,
"values": [
{
"id": 201,
"localized_name": "Red",
"name": {
"en": "Red",
"ar": "أحمر",
"fr": "Rouge"
},
"key": "red"
},
{
"id": 202,
"localized_name": "Blue",
"name": {
"en": "Blue",
"ar": "أزرق",
"fr": "Bleu"
},
"key": "blue"
}
]
}
]
}

Response Fields (data array objects)

FieldTypeDescription
idintegerUnique identifier for the attribute.
localized_namestringAttribute name in the default language.
nameobjectContains the attribute name in different languages.
name.enstringAttribute name in English.
name.arstringAttribute name in Arabic.
name.frstringAttribute name in French.
keystringAttribute key (used for referencing in APIs).
values_countintegerNumber of possible values for this attribute.
valuesarray[object]List of possible values for this attribute.

Response Fields (values array objects)

FieldTypeDescription
idintegerUnique identifier for the value.
localized_namestringValue name in the default language.
nameobjectContains the value name in different languages.
name.enstringValue name in English.
name.arstringValue name in Arabic.
name.frstringValue name in French.
keystringValue key (used for referencing in APIs).

Error Responses

401 Unauthorized
{
"status": "error",
"message": "Unauthenticated."
}
500 Internal Server Error
{
"status":"error",
"message": "An unexpected error occurred on the server"

}

Implementation Tips

  • Use these attributes and values to build variant selection UIs for your products.
  • If values_count is zero, the attribute currently has no selectable values.
  • Always support multiple languages for attribute and value names if your UI is multilingual.
  • Cache the attribute list if your catalog rarely changes.