Skip to main content

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

FieldTypeRequiredDescription
nameStringYesName of the product attribute (unique)
descriptionStringNoDescription of the product attribute(nullable)

Example Requests

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

Response Fields

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

{
"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"
}