Retrieve detailed information about a specific store including all its products
curl --request GET \
--url https://api.example.com/api/v1/stores/{id}/{
"id": 1,
"url": "http://api.example.com/api/v1/stores/awesome-electronics/",
"brand_name": "Awesome Electronics",
"about": "We specialize in consumer electronics and accessories with fast shipping and excellent customer service. Founded in 2020, we've served over 10,000 customers with quality products.",
"products_sold": 1247,
"owner": 42,
"followers": [15, 23, 89, 102, 156, 203],
"product_set": [
{
"id": 101,
"name": "Wireless Bluetooth Headphones",
"slug": "wireless-bluetooth-headphones",
"description": "Premium sound quality with active noise cancellation",
"price": "79.99",
"stock_quantity": 45,
"quantity_sold": 234,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-15T10:30:00Z"
},
{
"id": 102,
"name": "USB-C Fast Charging Cable",
"slug": "usb-c-fast-charging-cable",
"description": "Durable braided cable with fast charging support",
"price": "12.99",
"stock_quantity": 200,
"quantity_sold": 567,
"category": "Accessories",
"is_available": true,
"created_at": "2025-02-01T14:20:00Z"
},
{
"id": 103,
"name": "Portable Power Bank 20000mAh",
"slug": "portable-power-bank-20000mah",
"description": "High-capacity power bank for on-the-go charging",
"price": "34.99",
"stock_quantity": 78,
"quantity_sold": 446,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-20T09:15:00Z"
}
]
}
This endpoint returns detailed information about a single store, including the complete list of products the store sells. Use the store’s slug identifier to retrieve the data.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/klvxn/ecommerce-api/llms.txt
Use this file to discover all available pages before exploring further.
awesome-electronics for a store named “Awesome Electronics”ProductListSerializer from catalogue/serializers.py{
"id": 1,
"url": "http://api.example.com/api/v1/stores/awesome-electronics/",
"brand_name": "Awesome Electronics",
"about": "We specialize in consumer electronics and accessories with fast shipping and excellent customer service. Founded in 2020, we've served over 10,000 customers with quality products.",
"products_sold": 1247,
"owner": 42,
"followers": [15, 23, 89, 102, 156, 203],
"product_set": [
{
"id": 101,
"name": "Wireless Bluetooth Headphones",
"slug": "wireless-bluetooth-headphones",
"description": "Premium sound quality with active noise cancellation",
"price": "79.99",
"stock_quantity": 45,
"quantity_sold": 234,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-15T10:30:00Z"
},
{
"id": 102,
"name": "USB-C Fast Charging Cable",
"slug": "usb-c-fast-charging-cable",
"description": "Durable braided cable with fast charging support",
"price": "12.99",
"stock_quantity": 200,
"quantity_sold": 567,
"category": "Accessories",
"is_available": true,
"created_at": "2025-02-01T14:20:00Z"
},
{
"id": 103,
"name": "Portable Power Bank 20000mAh",
"slug": "portable-power-bank-20000mah",
"description": "High-capacity power bank for on-the-go charging",
"price": "34.99",
"stock_quantity": 78,
"quantity_sold": 446,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-20T09:15:00Z"
}
]
}
product_set on the Store modelstores/models.py:8-39stores/models.py:32-34 - Computed from product_set.count()stores/models.py:36-38 - Sum of all product quantity_sold valuesstores/serializers.py:22-28 - Uses ProductListSerializer for nested products# In Django ORM (backend implementation)
store = Store.objects.get(slug='awesome-electronics')
products = store.product_set.all() # All products for this store
total_sold = store.products_sold # Computed property
const storeSlug = 'awesome-electronics';
const response = await fetch(`https://api.example.com/api/v1/stores/${storeSlug}/`);
const store = await response.json();
console.log(`${store.brand_name} - ${store.followers.length} followers`);
console.log(`Products: ${store.product_set.length}`);
console.log(`Total Sales: ${store.products_sold}`);
// Get all products from a specific store
const products = store.product_set;
products.forEach(product => {
console.log(`${product.name} - $${product.price} (${product.stock_quantity} in stock)`);
});
// Calculate store metrics
const totalRevenue = store.product_set.reduce((sum, product) => {
return sum + (parseFloat(product.price) * product.quantity_sold);
}, 0);
const averageProductPrice = store.product_set.reduce((sum, p) =>
sum + parseFloat(p.price), 0) / store.product_set.length;
console.log(`Total Revenue: $${totalRevenue.toFixed(2)}`);
console.log(`Average Price: $${averageProductPrice.toFixed(2)}`);
// Find available products in a price range
const affordableProducts = store.product_set.filter(product =>
product.is_available && parseFloat(product.price) < 50
);
{
"detail": "Not found."
}
IsAuthenticated)VendorOnly permission)VendorOnly permission)stores/views.py:27-35
slug as the lookup field, not the numeric IDStoreInstanceSerializer includes the full product_set for detailed viewsproducts_sold value is computed in real-time from all productsis_vendor=True and is_staff=True flagscurl --request GET \
--url https://api.example.com/api/v1/stores/{id}/{
"id": 1,
"url": "http://api.example.com/api/v1/stores/awesome-electronics/",
"brand_name": "Awesome Electronics",
"about": "We specialize in consumer electronics and accessories with fast shipping and excellent customer service. Founded in 2020, we've served over 10,000 customers with quality products.",
"products_sold": 1247,
"owner": 42,
"followers": [15, 23, 89, 102, 156, 203],
"product_set": [
{
"id": 101,
"name": "Wireless Bluetooth Headphones",
"slug": "wireless-bluetooth-headphones",
"description": "Premium sound quality with active noise cancellation",
"price": "79.99",
"stock_quantity": 45,
"quantity_sold": 234,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-15T10:30:00Z"
},
{
"id": 102,
"name": "USB-C Fast Charging Cable",
"slug": "usb-c-fast-charging-cable",
"description": "Durable braided cable with fast charging support",
"price": "12.99",
"stock_quantity": 200,
"quantity_sold": 567,
"category": "Accessories",
"is_available": true,
"created_at": "2025-02-01T14:20:00Z"
},
{
"id": 103,
"name": "Portable Power Bank 20000mAh",
"slug": "portable-power-bank-20000mah",
"description": "High-capacity power bank for on-the-go charging",
"price": "34.99",
"stock_quantity": 78,
"quantity_sold": 446,
"category": "Electronics",
"is_available": true,
"created_at": "2025-01-20T09:15:00Z"
}
]
}