Appearance
Atributos
Gerencie atributos de variação (ex: Cor, Tamanho) e seus valores. Atributos são usados para criar variantes de produtos.
Listar atributos
http
GET /api/v1/attributesQuery parameters
| Parâmetro | Tipo | Descrição |
|---|---|---|
search | string | Busca por nome |
sort | string | Campo de ordenação (padrão: order) |
direction | string | asc ou desc (padrão: asc) |
per_page | integer | Itens por página (máx: 100, padrão: 25) |
Exemplo
bash
curl -X GET "https://sualoja.com.br/api/v1/attributes" \
-H "X-API-Key: SUA_CHAVE"Resposta
json
{
"data": [
{
"id": 1,
"name": "Cor",
"display_name": null,
"slug": "cor",
"order": 0,
"values": [
{
"id": 1,
"attribute_id": 1,
"value": "Vermelho",
"slug": "vermelho",
"display_value": null,
"order": 0,
"icon": null
},
{
"id": 2,
"attribute_id": 1,
"value": "Azul",
"slug": "azul",
"display_value": "#0000FF",
"order": 1,
"icon": null
}
],
"created_at": "2026-01-10T08:00:00Z",
"updated_at": "2026-01-10T08:00:00Z"
}
]
}Buscar atributo
http
GET /api/v1/attributes/{id}Retorna o atributo com todos os seus valores.
Criar atributo
http
POST /api/v1/attributesCampos
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string | ✅ | Nome do atributo (ex: "Cor", "Tamanho") |
order | integer | Ordem de exibição |
Exemplo
bash
curl -X POST https://sualoja.com.br/api/v1/attributes \
-H "X-API-Key: SUA_CHAVE" \
-H "Content-Type: application/json" \
-d '{
"name": "Material",
"order": 2
}'Atualizar atributo
http
PUT /api/v1/attributes/{id}Excluir atributo
http
DELETE /api/v1/attributes/{id}Restrição
Não é possível excluir um atributo cujos valores estão vinculados a variantes de produtos. A API retorna 422.
Valores de Atributo
Gerencie os valores de um atributo específico.
Listar valores
http
GET /api/v1/attributes/{attribute_id}/valuesRetorna os valores ordenados pelo campo order.
json
{
"data": [
{
"id": 1,
"attribute_id": 1,
"value": "Vermelho",
"slug": "vermelho",
"display_value": null,
"order": 0,
"icon": null,
"created_at": "2026-01-10T08:00:00Z",
"updated_at": "2026-01-10T08:00:00Z"
}
]
}Criar valor
http
POST /api/v1/attributes/{attribute_id}/values| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
value | string | ✅ | Valor (ex: "Vermelho", "P", "Algodão") |
display_value | string | Valor de exibição (ex: código de cor "#FF0000") | |
order | integer | Ordem de exibição |
bash
curl -X POST https://sualoja.com.br/api/v1/attributes/1/values \
-H "X-API-Key: SUA_CHAVE" \
-H "Content-Type: application/json" \
-d '{
"value": "Verde",
"display_value": "#00FF00",
"order": 3
}'Atualizar valor
http
PUT /api/v1/attributes/{attribute_id}/values/{value_id}Excluir valor
http
DELETE /api/v1/attributes/{attribute_id}/values/{value_id}Restrição
Não é possível excluir um valor que está vinculado a variantes de produtos.