Retrieve a Product
Retrieves detailed information about a specific product by its slug.
HTTP Request
GET/api/shop/products/:slug
Authorization
Authorization
- Required: No
- Permission: Public (read-only)
- Authentication: Optional (affects `is_favorite` field)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| slug | string | Yes | URL-friendly product identifier |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Without authentication
4response = requests.get('http://www.example.com/api/shop/products/iphone-14-pro')
5print(response.json())
6
7# With authentication for favorites
8response = requests.get('http://www.example.com/api/shop/products/iphone-14-pro', headers={
9 'Authorization': 'Token <your_api_key>'
10})
11print(response.json())1# Without authentication
2curl "http://www.example.com/api/shop/products/iphone-14-pro"
3
4# With authentication
5curl "http://www.example.com/api/shop/products/iphone-14-pro" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the product |
| image | Object | Main product image data |
| code | String | Product code/SKU |
| title | String | Product title |
| slug | String | URL-friendly product identifier |
| stock_type | String | Type of stock management |
| in_stock | Boolean | Whether product is in stock |
| stock | Integer | Current stock quantity |
| regular_price | Decimal | Regular price of the product |
| sale_price | Decimal | Sale price (if on sale) |
| discount | Decimal | Discount amount |
| discount_percent | Decimal | Discount percentage |
| price | Decimal | Final calculated price |
| rating | Decimal | Average product rating |
| comments_count | Integer | Number of product comments/reviews |
| price_notes | String | Additional price information |
| excerpt | String | Short product description |
| is_favorite | Boolean | Whether product is in user's favorites (requires auth) |
| brand_data | Object | Brand information (`id`, `name`, `slug`) |
| category_data | Array[Object] | Categories information (`id`, `name`, `slug`) |
| attributes | Array[Object] | Product attributes (`id`, `name`, `values`) |
| images | Array[Object] | All product images |
| description | String | Full product description |
| created_at | String (ISO 8601) | Timestamp when product was created |
| updated_at | String (ISO 8601) | Timestamp when product was last updated |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File size in bytes (nullable) |
Brand Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the brand |
| name | String | Name of the brand |
Categories Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the category |
| name | String | Name of the category |
Attributes Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the attribute |
| name | String | Name of the attribute |
| values | Array[String] | Values of the attribute |
Example Response
{
"id": 59,
"image": {
"id": 3,
"type": "image",
"name": "logitech-mx-2",
"size": 3166,
"human_readable_size": "3.09 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/22/logitech-mx-2.jpg",
"width": 275,
"height": 183,
"mode": "RGB",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
"code": "857",
"title": "Bike",
"slug": "product-name10",
"stock_type": "limited",
"in_stock": true,
"stock": 10,
"regular_price": 121999,
"sale_price": 122000,
"discount": -1,
"discount_percent": 0,
"price": 122000,
"rating": 3.5,
"comments_count": 2,
"price_notes": "for each one",
"excerpt": "<p>Doloribus a consequatur natus laboriosam mollitia et totam. Dicta sit qui aut possimus officia tempora dicta vitae ab. Delectus dolores voluptas. Voluptas incidunt sit vel sapiente enim enim perspiciatis voluptatum ab. Repellendus et provident explicabo laudantium atque quos magni. Omnis dolorum totam qui reprehenderit facere.</p>",
"is_favorite": false,
"brand": {
"id": 1,
"name": "Logitech",
"slug": "logitech"
},
"categories": [
{
"id": 1,
"name": "کالای دیجیتال",
"slug": "digital-products"
},
{
"id": 2,
"name": "ماوس",
"slug": "mouse"
}
],
"attributes": [
{
"id": 1,
"name": "Color",
"values": [
"red"
]
},
{
"id": 2,
"name": "body",
"values": [
"Full Metal",
"Plastic"
]
}
],
"images": [
{
"id": 6,
"type": "image",
"name": "technology",
"size": 5123,
"human_readable_size": "5.00 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/12/02/technology.png",
"width": 225,
"height": 225,
"mode": "P",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
{
"id": 7,
"type": "image",
"name": "computers",
"size": 3284,
"human_readable_size": "3.21 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/12/02/computer.png",
"width": 235,
"height": 215,
"mode": "P",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
}
],
"description": "<p>long description for product</p>",
"created_at": "2025-12-27T12:26:43.168297Z",
"updated_at": "2025-12-27T15:28:18.364540Z"
}