Inventory API
Categories
Create Category
this api endpoint (post) (post) creates a new category if the request succeeds it returns a category object docid\ ghdgklvkr09tcebqg9ilu webhook event category events docid 7jdgdmvbp2vtc25 n i1o body parameters slug string the slug of the category used with tamio sites and pages config object the titles, subtitles, seo descriptions, seo titles and descriptions of the category in all supported languages the minimum information required is a title in at least one language the keys of the object are a appendix docid\ kfbmx4q3dxjtduqf75yx1 while the values are also objects with the content of the category note a language has to be activated on your account before it can be used exampe "config" { "en" { "title" "washing machines", "slug" "washing machines", "description" "affortable, durable washing machines ", "seo title" "washing machines", "seo description" "affortable, durable washing machines " }, "de" { // german content }, "sv" { // swedish content } } icon string the icon of the category used on tamio sites and pages status boolean whether the category is currently active an active category is shown on tamio sites and pages asset id string the id of an asset object docid\ lrpr7r0iozzuquwvx8xus to use as the default image of the category parent id string the id of the parent category where you want the category to be created require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/categories/create") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" data = { config { en { 	 title "washing machines" 	 } }, slug "washing machines", parent id "e6df3338 8a59 4096 b515 02e61ba97846" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/categories/create' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "config" { "en" { "title" "washing machines" } }, "slug" "washing machines", "parent id" "e6df3338 8a59 4096 b515 02e61ba97846"}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { config { en { 	 title "washing machines" 	 } }, slug "washing machines", parent id "e6df3338 8a59 4096 b515 02e61ba97846" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/categories/create", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "category" { "id" "0298df64 16c4 4b42 b1c4 b9d5c8678685", "image" null, "asset id" null, "parent id" "e6df3338 8a59 4096 b515 02e61ba97846", "slug" "washing machines", "icon" null, "object" "category", "status" true, "name" "washing machines", "created at" 1667837076, "config" { "en" { "description" null, "seo description" null, "seo title" null, "slug" "washing machines", "title" "washing machines" } }, "number of subcategories" 0, "number of products" 0, "path" "61fab71e c65f 4a02 90ff f424c6cabc69/e6df3338 8a59 4096 b515 02e61ba97846", "label path" "electronics/appliances" }, "status" 200 }