Updating and creating category objects
Endpoints
1. Bulk category creation
- Method:
POST - URL:
{domain}/external/category/bulk-create/
Allows you to create several categories at the same time.
Query example:
curl --location --request POST '<https://example.com/external/category/bulk-create/'>\
--header 'API-Token: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '[
{
"position": 24,
"name_ro": "Category 1",
"name_ru": "Category 1",
"name_en": "Category 1",
"name_uk": "Category 1",
"slug_ro": "category-1-ro",
"slug_ru": "category-1-ru",
"slug_en": "category-1-en",
"slug_uk": "category-1-uk",
"hide": false,
"image": null,
"promo_img": null,
"description_ro": "Category description in Romanian",
"description_ru": "Description of the category in Russian",
"description_en": "Category description in English",
"description_uk": "Description of the category in Ukrainian language",
"description_position": "bottom",
"group_category_id": 100,
"meta_description_ro": "Description for SEO in Romanian",
"meta_description_ru": "Description for SEO in Russian",
"meta_description_en": "SEO description in English",
"meta_description_uk": "Description for Ukrainian SEO",
"meta_title_ro": "Meta title Romanian",
"meta_title_ru": "Russian meta title",
"meta_title_en": "Meta title in English",
"meta_title_uk": "Ukrainian meta title",
"meta_keywords_ro": "Romanian, keywords",
"meta_keywords_ru": "Russian, keywords, words",
"meta_keywords_en": "english, meta, keywords",
"meta_keywords_uk": "Ukrainian, keywords, words",
"meta_image": null,
"show_18_popup": false,
"category_id": null
}
]'
2. Mass category update
- Method:
PUT - URL:
{domain}/external/category/bulk-update/
Allows you to update multiple categories at the same time. If the category with the passed id does not exist, the server will return an error.
Query example:
curl --location --request PUT '<https://example.com/external/category/bulk-update/'>\
--header 'API-Token: YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '[
{
"id": 7201,
"position": 24,
"name_ro": "Updated Category 1",
"name_ru": "Updated Category 1",
"name_en": "Updated Category 1",
"name_uk": "Category 1 updated",
"slug_ro": "updated-category-1-ro",
"slug_ru": "updated-category-1-ru",
"slug_en": "updated-category-1-en",
"slug_uk": "updated-category-1-uk",
"hide": false,
"image": "https://example.com/images/new_image.jpg",
"promo_img": null,
"description_ro": "Updated category description in Romanian",
"description_ru": "Updated category description in Russian",
"description_en": "Updated category description in English",
"description_uk": "Updated description of the category in Ukrainian language",
"description_position": "top",
"group_category_id": 101,
"meta_description_ro": "Updated SEO description in Romanian",
"meta_description_ru": "Updated SEO description in Russian",
"meta_description_en": "Updated SEO description in English",
"meta_description_uk": "Ukrainian SEO description updates",
"meta_title_ro": "Updated Romanian meta title",
"meta_title_ru": "Updated Russian meta title",
"meta_title_en": "Updated meta title in English",
"meta_title_uk": "Updated meta title Ukrainian",
"meta_keywords_ro": "updated, keywords",
"meta_keywords_ru": "updated, keywords",
"meta_keywords_en": "updated, meta, keywords",
"meta_keywords_uk": "updated, keywords, words",
"meta_image": "https://example.com/images/updated_image.jpg",
"show_18_popup": false
}
]'
Notes:
To create categories:
The
idfield is not transmitted; the server automatically creates a new object.- To update categories:
The
idfield is required. Ifidis not supplied or the category is missing, the server will return an error.- Missing values :
If there are no language-specific values, you can pass
nullor the empty string ("").
Was the article helpful?
Yes, thank you! Unfortunately no