Skip to main content

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

ParameterTypeDefaultDescription
limitinteger10Number of results to return per page
offsetinteger0Number of results to skip before returning results
searchstringSearch by `id`, `name`
orderingstringOrder by `id`, `name`, `created_at`, `updated_at`

Example Requests

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())

Response Fields

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of attribute objects

Attribute Object Structure

FieldTypeDescription
idIntegerUnique ID of the product attribute
nameStringName of the attribute(unique)
descriptionObjectDescription of the attribute
created_atString (ISO 8601)Timestamp when product attribute was created
updated_atString (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"
}
]
}