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)
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier for the attribute. |
localized_name | string | Attribute name in the default language. |
name | object | Contains the attribute name in different languages. |
name.en | string | Attribute name in English. |
name.ar | string | Attribute name in Arabic. |
name.fr | string | Attribute name in French. |
key | string | Attribute key (used for referencing in APIs). |
values_count | integer | Number of possible values for this attribute. |
values | array[object] | List of possible values for this attribute. |
Response Fields (values array objects)
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier for the value. |
localized_name | string | Value name in the default language. |
name | object | Contains the value name in different languages. |
name.en | string | Value name in English. |
name.ar | string | Value name in Arabic. |
name.fr | string | Value name in French. |
key | string | Value key (used for referencing in APIs). |
Error Responses
401 Unauthorized{
"status": "error",
"message": "Unauthenticated."
}
{
"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_countis 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.