This document outlines the API endpoints for managing taxonomy data (categories and brands) through the EasyCMS public API.
The taxonomy API endpoints allow you to create and update:
/set_category/)/set_brand/)For managing product tags, see Set Product Tags and Get Product Tags.
Each endpoint follows the same authentication and response patterns.
All requests require proper authentication:
Authorization1: {TOKEN} - Your API tokenusername: Your API usernamepassword: Your API password account: Your account domain/IDSee How to Create API Credentials for setting up API access.
https://easycms.fi/public_api/set_category/When cid is provided, the API updates the existing category. Only provided fields are updated.
When cid is NOT provided, the API creates a new category.
| Field | Type | Required (Create) | Description |
|---|---|---|---|
cid |
int | No | Category ID (required for update) |
category_name |
string/array | Yes | Category name (JSON array for multi-language or string) |
parent_id |
int | No | Parent category ID (0 for root) |
description |
string/array | No | Category description |
status |
int | No | Status (1=active, 0=inactive) |
visible |
int | No | Visibility (1=visible, 0=hidden) |
sort_order |
int | No | Sort order |
meta_title |
string | No | SEO meta title |
meta_desc |
string | No | SEO meta description |
image |
object | No | Image data (see Image Handling) |
curl -X POST 'https://easycms.fi/public_api/set_category/' \
-H 'Authorization1: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"account": "YOUR_ACCOUNT",
"category_name": {"en_GB": "Electronics", "fi_FI": "Elektroniikka"},
"parent_id": 0,
"description": {"en_GB": "Electronic devices and accessories"},
"status": 1,
"visible": 1
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://easycms.fi/public_api/set_category/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'username' => 'YOUR_USERNAME',
'password' => 'YOUR_PASSWORD',
'account' => 'YOUR_ACCOUNT',
'cid' => 5,
'category_name' => ['en_GB' => 'Updated Category Name', 'fi_FI' => 'Päivitetty Kategoria'],
'status' => 1
]),
CURLOPT_HTTPHEADER => array(
"Authorization1: YOUR_TOKEN",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
https://easycms.fi/public_api/set_brand/When bid is provided, the API updates the existing brand. Only provided fields are updated.
When bid is NOT provided, the API creates a new brand.
| Field | Type | Required (Create) | Description |
|---|---|---|---|
bid |
int | No | Brand ID (required for update) |
brand_name |
string/array | Yes | Brand name (JSON array for multi-language or string) |
description |
string/array | No | Brand description |
status |
int | No | Status (1=active, 0=inactive) |
visible |
int | No | Visibility (1=visible, 0=hidden) |
sort_order |
int | No | Sort order |
meta_title |
string | No | SEO meta title |
meta_desc |
string | No | SEO meta description |
image |
object | No | Image data (see Image Handling) |
curl -X POST 'https://easycms.fi/public_api/set_brand/' \
-H 'Authorization1: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"account": "YOUR_ACCOUNT",
"brand_name": {"en_GB": "Apple", "fi_FI": "Apple"},
"description": {"en_GB": "Apple Inc. products"},
"status": 1,
"visible": 1
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://easycms.fi/public_api/set_brand/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'username' => 'YOUR_USERNAME',
'password' => 'YOUR_PASSWORD',
'account' => 'YOUR_ACCOUNT',
'bid' => 10,
'brand_name' => ['en_GB' => 'Updated Brand Name'],
'status' => 1
]),
CURLOPT_HTTPHEADER => array(
"Authorization1: YOUR_TOKEN",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
All taxonomy endpoints support image operations through the image parameter.
"image": {
"filename": "category_image.jpg",
"base64": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
| Field | Type | Description |
|---|---|---|
filename |
string | Desired filename (optional, auto-generated if omitted) |
base64 |
string | Required - Base64 encoded image data (with or without data URI prefix) |
{
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"account": "YOUR_ACCOUNT",
"category_name": {"en_GB": "Electronics"},
"image": {
"filename": "electronics_category.jpg",
"base64": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}
}
{
"status": "success",
"message": "Category created successfully",
"data": {
"cid": 15,
"category": {
"cid": 15,
"category_name": {"en_GB": "Electronics", "fi_FI": "Elektroniikka"},
"parent_id": 0,
"status": 1
}
}
}
{
"status": "success",
"message": "Category updated successfully",
"data": {
"cid": 5,
"category": { /* full category data */ }
},
"changes": {
"category_name": {"old": "Old Name", "new": "Updated Name"},
"status": {"old": "0", "new": "1"}
}
}
{
"status": "error",
"error_code": "MISSING_REQUIRED_FIELDS",
"message": "Missing required field: category_name",
"missing_fields": ["category_name"]
}
| Code | HTTP Status | Description |
|---|---|---|
METHOD_NOT_ALLOWED |
405 | Only POST method is allowed |
UNAUTHORIZED |
401 | Invalid credentials or token |
CATEGORY_NOT_FOUND |
404 | Category with specified cid not found |
BRAND_NOT_FOUND |
404 | Brand with specified bid not found |
MISSING_REQUIRED_FIELDS |
400 | Required fields missing |
UPDATE_FAILED |
500 | Failed to update |
CREATE_FAILED |
500 | Failed to create |
All name and description fields support multi-language values. You can pass either:
{
"category_name": {
"en_GB": "Electronics",
"fi_FI": "Elektroniikka",
"sv_SE": "Elektronik"
}
}
{
"category_name": "Electronics"
}
When a simple string is provided, it's automatically converted to the default language (en_GB).
en_GB - English (Great Britain)fi_FI - Finnishsv_SE - Swedishes_ES - Spanishde_DE - Germanfr_FR - Frenchru_RU - Russianzh_CN - Chinese (Simplified)ja_JP - JapaneseCheck /get_languages endpoint for the full list of available languages.
parent_id exists (use 0 for root categories)status field and handle error codes appropriately