List Product Attributes
Retrieves a list of all product attributes with filtering, searching, and ordering capabilities.
HTTP Request
GET/api/products/attributes/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO AN EXTRA REDIRECT WITH 301 STATUS
Authorization
Authorization
- Required: Yes
- Permission: Staff with AttributePermission or Admin
- Permission Code: 1822
- Authentication: Token-based (Authorization: Token <your_api_key>)
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results to return per page |
| offset | integer | 0 | Number of results to skip before returning results |
| search | string | — | Search by `id`, `name` |
| ordering | string | — | Order by `id`, `name`, `created_at`, `updated_at` |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# List all product attributes
4response = requests.get('http://www.example.com/api/products/attributes/',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Search and filter attributes
10response = requests.get('http://www.example.com/api/products/attributes/', params={
11 'search': 'color',
12 'ordering': 'name',
13 'limit': 20
14}, headers={'Authorization': 'Token <your_api_key>'})
15print(response.json())1# List all product attributes
2curl -X GET "http://www.example.com/api/products/attributes/" \
3-H "Authorization: Token <your_api_key>"
4
5# Search and filter attributes
6curl -X GET "http://www.example.com/api/products/attributes?search=color&ordering=name&limit=20" \
7-H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of attribute objects |
Attribute Object Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the product attribute |
| name | String | Name of the attribute(unique) |
| description | Object | Description of the attribute |
| created_at | String (ISO 8601) | Timestamp when product attribute was created |
| updated_at | String (ISO 8601) | Timestamp when product attribute was last updated |
Example Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "Color",
"description": "color of the items",
"created_at": "2025-12-24T15:25:30.436298Z",
"updated_at": "2025-12-24T15:25:30.436303Z"
},
{
"id": 2,
"name": "RamType",
"description": "type of the ram",
"created_at": "2025-12-24T15:25:55.693234Z",
"updated_at": "2025-12-24T15:25:55.693240Z"
},
{
"id": 3,
"name": "BusSpeed",
"description": "Ram bus speed",
"created_at": "2025-12-24T15:26:26.560144Z",
"updated_at": "2025-12-24T15:26:26.560149Z"
}
]
}