{"id":1350,"date":"2026-03-23T08:04:54","date_gmt":"2026-03-23T08:04:54","guid":{"rendered":"https:\/\/doc.olxgroup.com\/api\/?p=1350"},"modified":"2026-03-23T08:04:54","modified_gmt":"2026-03-23T08:04:54","slug":"fixing-incorrect-category_id-errors-in-autovit-ro-api","status":"publish","type":"post","link":"https:\/\/doc.olxgroup.com\/api\/?p=1350","title":{"rendered":"Fixing Incorrect &#8220;category_id&#8221; errors in Autovit.ro API"},"content":{"rendered":"\n\n\t<p>One common issue when creating ads via the Autovit.ro API is using an incorrect <code dir=\"ltr\">category_id<\/code>. For example, a user might send <code dir=\"ltr\">\"category_id\": 57<\/code> when the correct value should be <code dir=\"ltr\">75<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<p>To fix this, you need to properly navigate the category taxonomy and identify the correct category ID.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step 1: Retrieve All Categories<\/strong>Start by requesting the full list of categories:<\/p>\n<code dir=\"ltr\">GET http:\/\/www.autovit.ro\/api\/open\/categories<\/code>\n<p>In the response, you may notice that <code dir=\"ltr\">\"Camioane\"<\/code> (Trucks) has the ID <code dir=\"ltr\">57<\/code>.<\/p>\n<p>&nbsp;<\/p>\n<strong>Step 2: Inspect the Parent Category<\/strong><br \/>\nNext, query the parent category directly:\n<code dir=\"ltr\">GET http:\/\/www.autovit.ro\/api\/open\/categories\/57\n<\/code>\n<strong>Step 3: Explore Subcategories<\/strong><br \/>\nFrom here, continue exploring the subcategories by querying their IDs (e.g., <code dir=\"ltr\">97<\/code>, <code dir=\"ltr\">59<\/code>, <code dir=\"ltr\">95<\/code>, <code dir=\"ltr\">89<\/code>, <code dir=\"ltr\">119<\/code>, etc.) until you find the correct one.\n<p>For example:<\/p>\n<code dir=\"ltr\">GET http:\/\/www.autovit.ro\/api\/open\/categories\/75\n<\/code>\n<p>This will return:<\/p>\n<code dir=\"ltr\">{\n    \"id\": 75,\n    \"names\": {\n        \"ro\": \"Autocare (autobuze)\",\n        \"en\": \"Buses\"\n    },\n    \"parent_id\": 57,\n    \"code\": \"autobuze\",\n    \"path_url\": \"camioane\/autobuze\",\n    \"depth\": 2,\n    \"parameters\": [ ... ]\n}<\/code>\n<p>&nbsp;<\/p>\n<strong>Step 4: Use the Correct <\/strong><code dir=\"ltr\"><strong>category_id<\/strong><\/code><br \/>\nOnce identified, use the correct <code dir=\"ltr\">category_id<\/code> (in this case <code dir=\"ltr\">75<\/code>) when creating your ad via a POST request.\nFor more details on how to create ads, please refer to the API documentation:<br \/>\n<a href=\"https:\/\/www.autovit.ro\/api\/doc\/\">https:\/\/www.autovit.ro\/api\/doc\/<\/a>\n<hr \/>\n<p>By carefully navigating the category tree, you can ensure that your ads are created in the correct category and avoid validation errors.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>One common issue when creating ads via the Autovit.ro API is using an incorrect category_id. For example, a user might send &#8220;category_id&#8221;: 57 when the correct value should be 75. &nbsp; To fix this, you need to properly navigate the category taxonomy and identify the correct category ID. &nbsp; Step 1: Retrieve All CategoriesStart by&#8230;  <a href=\"https:\/\/doc.olxgroup.com\/api\/?p=1350\" title=\"Read Fixing Incorrect &#8220;category_id&#8221; errors in Autovit.ro API\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/1350"}],"collection":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1350"}],"version-history":[{"count":0,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=\/wp\/v2\/posts\/1350\/revisions"}],"wp:attachment":[{"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doc.olxgroup.com\/api\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}