Tiendas
Actualizar Tienda
Aprenda a actualizar una tienda existente usando el endpoint PUT /stores/.
PUT
/
stores
/
{storeId}
Update store
curl --request PUT \
--url https://api.cabrapi.com.br/v1/stores/{storeId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"image": "<string>",
"metadata": {},
"name": "<string>",
"position": 2
}
'import requests
url = "https://api.cabrapi.com.br/v1/stores/{storeId}"
payload = {
"description": "<string>",
"image": "<string>",
"metadata": {},
"name": "<string>",
"position": 2
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
image: '<string>',
metadata: {},
name: '<string>',
position: 2
})
};
fetch('https://api.cabrapi.com.br/v1/stores/{storeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cabrapi.com.br/v1/stores/{storeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'image' => '<string>',
'metadata' => [
],
'name' => '<string>',
'position' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cabrapi.com.br/v1/stores/{storeId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cabrapi.com.br/v1/stores/{storeId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cabrapi.com.br/v1/stores/{storeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}"
response = http.request(request)
puts response.read_body{
"code": "STORE_UPDATED",
"store": {
"createdAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"template": "PERSONALIZADO",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"domain": "<string>",
"image": "<string>",
"metadata": {}
}
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}✏️ Actualizar Tienda
Este endpoint permite actualizar los datos de una tienda existente de su cuenta. Es ideal para:- Cambiar nombre, descripción e imagen de la tienda
- Cambiar template y dominio
- Actualizar metadatos para integraciones internas
🔐 Autenticación
Esta ruta requiere autenticación mediante API Key, enviada en el header de la solicitud:Authorization: TU_API_KEY_AQUI
📥 Parámetros de Ruta
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
storeId | string | Sí | ID de la tienda que será actualizada (sin validación estricta de formato UUID; un ID inexistente devuelve 404 STORE_NOT_FOUND). |
📥 Body de la Solicitud
Al menos 1 campo debe enviarse en el body.
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
template | string | No | Valores aceptados: PERSONALIZADO o N/A. |
position | number | No | Entero mayor o igual a 1 para reordenar manualmente. |
name | string | No | Nombre de la tienda (mín. 4, máx. 32). |
description | string | No | Descripción de la tienda (mín. 12, máx. 256). |
image | string | No | URL de la imagen de la tienda (mín. 12, máx. 512). |
metadata | object | No | Metadatos personalizados de la tienda. |
domain | object | Condicional | Obligatorio cuando template = PERSONALIZADO. |
Estructura de domain
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
type | string | Sí | Valores aceptados: CUSTOM o DEFAULT. |
value | string | Sí | Dominio o subdominio (mín. 8, máx. 75). |
📋 Ejemplo de Solicitud
curl --location --request PUT "https://api.cabrapi.com.br/v1/stores/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
--header "Authorization: TU_API_KEY_AQUI" \
--header "Content-Type: application/json" \
--data '{
"name": "Minha Loja Atualizada",
"template": "PERSONALIZADO",
"domain": {
"type": "DEFAULT",
"value": "minha-loja-v2"
}
}'
📊 Ejemplo de Respuesta (200)
{
"code": "STORE_UPDATED",
"store": {
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "Minha Loja Atualizada",
"position": 2,
"description": "Loja oficial da minha marca",
"image": "https://example.com/store.png",
"domain": "minha-loja-v2-web.cabrapi.com.br",
"template": "PERSONALIZADO",
"metadata": null,
"createdAt": "2026-02-28T12:00:00.000Z",
"updatedAt": "2026-02-28T12:10:00.000Z"
}
}
❌ Posibles Errores
| Status | Code | Cuándo ocurre |
|---|---|---|
400 | INVALID_DATA | Body JSON inválido o ningún campo enviado. |
400 | INVALID_DATA_POSITION | position es menor que 1. |
400 | INVALID_DATA_NAME_MIN | name tiene menos de 4 caracteres. |
400 | INVALID_DATA_NAME_MAX | name tiene más de 32 caracteres. |
400 | INVALID_DATA_DESCRIPTION_MIN | description tiene menos de 12 caracteres. |
400 | INVALID_DATA_DESCRIPTION_MAX | description tiene más de 256 caracteres. |
400 | INVALID_DATA_IMAGE | image fuera del rango permitido (12 a 512 caracteres). |
400 | INVALID_DATA_TEMPLATE | template distinto de PERSONALIZADO y N/A. |
400 | INVALID_DATA_DOMAIN | domain.type distinto de CUSTOM/DEFAULT o domain.value inválido (8 a 75 caracteres). |
400 | DOMAIN_REQUIRED | template es PERSONALIZADO y no se envió domain. |
400 | DOMAIN_ALREADY_EXISTS | El dominio ya está siendo usado por otra tienda. |
400 | NAME_ALREADY_EXISTS | Ya existe una tienda con ese nombre para el mismo usuario. |
401 | API_KEY_NOT_PROVIDED | Header Authorization no enviado. |
401 | INVALID_API_KEY | API Key inválida o no encontrada. |
401 | UNAUTHENTICATED | Sesión/usuario no autenticado en el contexto de la solicitud. |
403 | USER_DISABLED | Cuenta de usuario desactivada o eliminada. |
403 | NO_ACTIVE_SUBSCRIPTION | Cuenta sin plan activo. |
404 | STORE_NOT_FOUND | La tienda no existe, fue eliminada o no pertenece a su cuenta. |
429 | RATE_LIMIT_EXCEEDED | Límite de solicitudes por minuto del plan excedido. |
500 | INTERNAL_SERVER_ERROR | Fallo interno al procesar la solicitud. |
503 | SERVICE_UNAVAILABLE | Servicio temporalmente no disponible. |
🔗 Enlaces Útiles
Update: 28/02/2026 as 00:00Cuerpo
application/json
¿Esta página le ayudó?
⌘I
Update store
curl --request PUT \
--url https://api.cabrapi.com.br/v1/stores/{storeId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"image": "<string>",
"metadata": {},
"name": "<string>",
"position": 2
}
'import requests
url = "https://api.cabrapi.com.br/v1/stores/{storeId}"
payload = {
"description": "<string>",
"image": "<string>",
"metadata": {},
"name": "<string>",
"position": 2
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
image: '<string>',
metadata: {},
name: '<string>',
position: 2
})
};
fetch('https://api.cabrapi.com.br/v1/stores/{storeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cabrapi.com.br/v1/stores/{storeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'image' => '<string>',
'metadata' => [
],
'name' => '<string>',
'position' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cabrapi.com.br/v1/stores/{storeId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cabrapi.com.br/v1/stores/{storeId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cabrapi.com.br/v1/stores/{storeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"metadata\": {},\n \"name\": \"<string>\",\n \"position\": 2\n}"
response = http.request(request)
puts response.read_body{
"code": "STORE_UPDATED",
"store": {
"createdAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"template": "PERSONALIZADO",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"domain": "<string>",
"image": "<string>",
"metadata": {}
}
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}{
"code": "STORE_NOT_FOUND"
}