Lojas
Atualizar Loja
Aprenda a atualizar uma loja existente usando o 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"
}✏️ Atualizar Loja
Este endpoint permite atualizar dados de uma loja existente da sua conta. Ele é ideal para:- Alterar nome, descrição e imagem da loja
- Trocar template e domínio
- Atualizar metadados para integrações internas
🔐 Autenticação
Esta rota exige autenticação via API Key, enviada no header da requisição:Authorization: SUA_API_KEY_AQUI
📥 Parâmetros de Rota
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
storeId | string | Sim | ID da loja que será atualizada (sem validação estrita de formato UUID; ID inexistente retorna 404 STORE_NOT_FOUND). |
📥 Body da Requisição
Pelo menos 1 campo deve ser enviado no body.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
template | string | Não | Valores aceitos: PERSONALIZADO ou N/A. |
position | number | Não | Inteiro maior ou igual a 1 para reordenar manualmente. |
name | string | Não | Nome da loja (mín. 4, máx. 32). |
description | string | Não | Descrição da loja (mín. 12, máx. 256). |
image | string | Não | URL da imagem da loja (mín. 12, máx. 512). |
metadata | object | Não | Metadados customizados da loja. |
domain | object | Condicional | Obrigatório quando template = PERSONALIZADO. |
Estrutura de domain
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
type | string | Sim | Valores aceitos: CUSTOM ou DEFAULT. |
value | string | Sim | Domínio ou subdomínio (mín. 8, máx. 75). |
📋 Exemplo de Requisição
curl --location --request PUT "https://api.cabrapi.com.br/v1/stores/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
--header "Authorization: SUA_API_KEY_AQUI" \
--header "Content-Type: application/json" \
--data '{
"name": "Minha Loja Atualizada",
"template": "PERSONALIZADO",
"domain": {
"type": "DEFAULT",
"value": "minha-loja-v2"
}
}'
📊 Exemplo de Resposta (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"
}
}
❌ Possíveis Erros
| Status | Code | Quando acontece |
|---|---|---|
400 | INVALID_DATA | Body JSON inválido ou nenhum campo enviado. |
400 | INVALID_DATA_POSITION | position menor que 1. |
400 | INVALID_DATA_NAME_MIN | name possui menos de 4 caracteres. |
400 | INVALID_DATA_NAME_MAX | name possui mais de 32 caracteres. |
400 | INVALID_DATA_DESCRIPTION_MIN | description possui menos de 12 caracteres. |
400 | INVALID_DATA_DESCRIPTION_MAX | description possui mais de 256 caracteres. |
400 | INVALID_DATA_IMAGE | image fora do intervalo permitido (12 a 512 caracteres). |
400 | INVALID_DATA_TEMPLATE | template diferente de PERSONALIZADO e N/A. |
400 | INVALID_DATA_DOMAIN | domain.type diferente de CUSTOM/DEFAULT ou domain.value inválido (8 a 75 caracteres). |
400 | DOMAIN_REQUIRED | template é PERSONALIZADO e domain não foi enviado. |
400 | DOMAIN_ALREADY_EXISTS | Domínio já está sendo usado por outra loja. |
400 | NAME_ALREADY_EXISTS | Já existe loja com esse nome para o mesmo usuário. |
401 | API_KEY_NOT_PROVIDED | Header Authorization não enviado. |
401 | INVALID_API_KEY | API Key inválida ou não encontrada. |
401 | UNAUTHENTICATED | Sessão/usuário não autenticado no contexto da requisição. |
403 | USER_DISABLED | Conta do usuário desativada ou excluída. |
403 | NO_ACTIVE_SUBSCRIPTION | Conta sem plano ativo. |
404 | STORE_NOT_FOUND | Loja não existe, foi removida ou não pertence à sua conta. |
429 | RATE_LIMIT_EXCEEDED | Limite de requisições por minuto do plano excedido. |
500 | INTERNAL_SERVER_ERROR | Falha interna ao processar a requisição. |
503 | SERVICE_UNAVAILABLE | Serviço temporariamente indisponível. |
🔗 Links Úteis
Update: 28/02/2026 as 00:00Corpo
application/json
Esta página foi útil?
⌘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"
}