Create Product Attribute
Creates a new product attribute
HTTP Request
POST/api/products/attributes/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO A 500 SERVER ERROR
Authorization
Authorization
- Required: Yes
- Permission: Staff with AttributePermission or Admin
- Permission Code: 1821
- Authentication: Token-based (Authorization: Token <your_api_key>)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Name of the product attribute (unique) |
| description | String | No | Description of the product attribute(nullable) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3url = "http://www.example.com/api/products/attributes"
4headers = {
5 "Authorization": "Token <your_api_key>",
6 "Content-Type": "application/json"
7}
8data = {
9 "name": "color",
10 "description": "color of the product"
11}
12response = requests.post(url, headers=headers, json=data)
13
14print(response.json())1# Create a new product attribute
2curl -X POST "http://www.example.com/api/products/attributes" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "name": "color",
7 "description": "color of the product"
8}'Response Fields
| 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
{
"id": 4,
"name": "ram_status",
"description": "the status of the ram as used/new",
"created_at": "2025-12-24T15:33:54.356317Z",
"updated_at": "2025-12-24T15:33:54.356325Z"
}