API Playground

Test the list attributes endpoint with filters.

Authentication Required

You need to Login to test the API playground

List Attributes

Retrieve all custom attributes for the authenticated user

This endpoint allows you to retrieve all custom attributes defined for your account. You can filter the results by scope, type, and status.

The response includes both global and family-specific attributes with their complete configuration and metadata.

Note: This operation does not consume credits
Endpoint URL
GET https://api.commerceclarity.com/api/v1/attributes

Query Parameters

Parameter Type Required Description
scope string Optional Filter attributes by scope. Values: "global", "family"
type string Optional Filter attributes by type. Values: "text", "number", "boolean", "rich-text", "single-select", "multi-select"
is_enabled boolean Optional Filter by enabled status. Values: true, false

Request Examples

Basic Request
curl -X GET "https://api.commerceclarity.com/api/v1/attributes" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Filtered Request
curl -X GET "https://api.commerceclarity.com/api/v1/attributes?scope=global&type=text&is_enabled=true" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
PHP Example (Guzzle HTTP Client)
$client = new \GuzzleHttp\Client();

$response = $client->get('https://api.commerceclarity.com/api/v1/attributes', [
    'headers' => [
        'Authorization' => 'Bearer ' . $apiToken,
    ],
    'query' => [
        'scope' => 'global',
        'type' => 'text',
        'is_enabled' => true
    ]
]);

$data = json_decode($response->getBody(), true);
JavaScript Example (Fetch API)
const params = new URLSearchParams({
  scope: 'global',
  type: 'text',
  is_enabled: true
});

const response = await fetch(`https://api.commerceclarity.com/api/v1/attributes?${params}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${apiToken}`
  }
});

const data = await response.json();

Response Example

Success Response
{
  "status": "success",
  "data": [
    {
      "_id": "507f1f77bcf86cd799439011",
      "attribute_id": "color",
      "name": "Color",
      "type": "single-select",
      "scope": "global",
      "is_enabled": true,
      "is_essential": false,
      "description": "Product color attribute",
      "options": ["Red", "Blue", "Green"],
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "_id": "507f1f77bcf86cd799439012",
      "attribute_id": "warranty_period",
      "name": "Warranty Period",
      "type": "text",
      "scope": "family",
      "family_ids": ["507f1f77bcf86cd799439013"],
      "is_enabled": true,
      "is_essential": false,
      "description": "Product warranty information",
      "created_at": "2024-01-15T11:00:00Z",
      "updated_at": "2024-01-15T11:00:00Z"
    }
  ]
}