Lojas
Obter Loja por ID
Aprenda a consultar uma loja específica da sua conta usando o endpoint GET /stores/.
GET
/
stores
/
{storeId}
Get store by ID
curl --request GET \
--url https://api.cabrapi.com.br/v1/stores/{storeId} \
--header 'Authorization: <api-key>'import requests
url = "https://api.cabrapi.com.br/v1/stores/{storeId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cabrapi.com.br/v1/stores/{storeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cabrapi.com.br/v1/stores/{storeId}")
.header("Authorization", "<api-key>")
.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::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "SUCCESS",
"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",
"categories": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"image": "<string>",
"metadata": {}
}
],
"products": [
{
"categories": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"delivery": "DIGITAL",
"disabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"price": 123,
"sold": 123,
"stock": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"image": "<string>",
"metadata": {}
}
],
"coupons": [
{
"categories": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"code": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"discount": 123,
"expiredAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 123,
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"rules": [
{
"type": "SINGLE_USE_PER_CUSTOMER",
"value": "<unknown>"
}
],
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"useLimit": 123
}
],
"payment": [
{
"coupon": true,
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"gateway": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"description": "<string>",
"image": "<string>"
}
],
"shipment": "PENDING",
"status": "PENDING",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliateCode": "<string>",
"affiliateCommission": {
"code": "<string>",
"name": "<string>",
"value": 123,
"email": "<string>"
},
"cpf": "<string>",
"metadata": {}
}
],
"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"
}🏪 Obter Loja por ID
Este endpoint permite consultar uma loja específica da sua conta pelo ID. Ele é ideal para:- Carregar detalhes completos de uma loja
- Buscar dados relacionados (categorias, produtos, cupons e pagamentos)
- Validar se uma loja existe antes de outras operações
🔐 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 (UUID) | Sim | ID da loja que será consultada. |
📋 Exemplo de Requisição
curl --location "https://api.cabrapi.com.br/v1/stores/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
--header "Authorization: SUA_API_KEY_AQUI"
📊 Exemplo de Resposta (200)
{
"code": "SUCCESS",
"store": {
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "Minha Loja",
"position": 1,
"description": "Loja de exemplo",
"image": "https://example.com/store.png",
"template": "PERSONALIZADO",
"domain": "minhaloja-web.cabrapi.com.br",
"metadata": null,
"createdAt": "2026-02-28T12:00:00.000Z",
"updatedAt": "2026-02-28T12:00:00.000Z",
"categories": [],
"products": [],
"coupons": [],
"payment": []
}
}
❌ Possíveis Erros
| Status | Code | Quando acontece |
|---|---|---|
400 | INVALID_DATA | Quando o storeId não é um UUID válido. |
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 | Quando a 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. |
Observacoes
categories,productsecouponsretornam ordenados porposition.
🔗 Links Úteis
Update: 28/02/2026 as 00:00Esta página foi útil?
⌘I
Get store by ID
curl --request GET \
--url https://api.cabrapi.com.br/v1/stores/{storeId} \
--header 'Authorization: <api-key>'import requests
url = "https://api.cabrapi.com.br/v1/stores/{storeId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.cabrapi.com.br/v1/stores/{storeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.cabrapi.com.br/v1/stores/{storeId}")
.header("Authorization", "<api-key>")
.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::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": "SUCCESS",
"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",
"categories": [
{
"createdAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"image": "<string>",
"metadata": {}
}
],
"products": [
{
"categories": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"delivery": "DIGITAL",
"disabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"position": 123,
"price": 123,
"sold": 123,
"stock": 123,
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"image": "<string>",
"metadata": {}
}
],
"coupons": [
{
"categories": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"code": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"discount": 123,
"expiredAt": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 123,
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"rules": [
{
"type": "SINGLE_USE_PER_CUSTOMER",
"value": "<unknown>"
}
],
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"useLimit": 123
}
],
"payment": [
{
"coupon": true,
"createdAt": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"gateway": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"products": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"price": 123,
"description": "<string>",
"image": "<string>"
}
],
"shipment": "PENDING",
"status": "PENDING",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedAt": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"affiliateCode": "<string>",
"affiliateCommission": {
"code": "<string>",
"name": "<string>",
"value": 123,
"email": "<string>"
},
"cpf": "<string>",
"metadata": {}
}
],
"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"
}