Inventory API
Products
Create Digital Product
this api endpoint (post) (post) creates a digital product if the request succeeds it returns a product object docid 4hx r lwtyahq1 pey1da otherwise it will return an error permissions products create webhook event product events docid\ bfktivl3xva6ucdtrt5bz body parameters tax category string the products docid\ gaxf8cqa3te sjlpubl7a of the product pricing model array of objects an array of objects, each representing a pricing model associated with the product "pricing model" \[ { "currency" "eur", "price" 1200, "recommended seller price" 0, "acquisition price" 0 } ] currency string appendix docid\ kfbmx4q3dxjtduqf75yx1 the currency of the pricing model price integer the price of the item for this pricing model recommended seller price integer the recommended price set by the merchant for the product in this currency acquisition price integer the base purchase price of the product in this currency languages object the titles, subtitles, seo descriptions, seo titles and long descriptions of the product in all supported languages the minimum information required is a title in at least one language the object's keys are a appendix docid\ kfbmx4q3dxjtduqf75yx1 while the values are also objects with the content of the product note a language has to be activated on your account before it can be used exampe "languages" { "en" { "title" "blue t shirt", "description" "exclusive blue t shirt, just 100 pieces available", "seo title" "blue t shirt", "seo description" "exclusive blue t shirt, just 100 pieces available", "slug" "blue t shirt" }, "de" { // german content }, "sv" { // swedish content } } delivery type string determines how the digital product and its associated files will be delivered to the customer the possible values are file and url digital files array of strings each string in the array must be an asset object docid\ lrpr7r0iozzuquwvx8xus id required if the delivery type is set to file delivery url string the url where the file can be downloaded after a successful purchase required if delivery type is set to url license type string the licensing method of the digital product the possible values are list , autogenerated and none the default value is none licenses array of strings an array of strings each representing a license code required if license type is set to list note that if a license list is provided the unlimited stock parameter will be ignored and the stock will be determined from the number of licenses in this array the maximum allowed in a single request is 1000 unlimited stock boolean the default value is false required if stock is not present stock integer the available stock for this product you can ignore this parameter if unlimited stock is set to true stock limit warning integer if the product stock falls below this value, an email notification will be sent to you not supported for services with unlimited stock is set to true number of downloads number of downloads integer determines how many times a customer can download the digital files associated with this product supported for items with delivery type set to file max units integer the maximum amount of stock that can be purchased in a single order price min units integer the minimum amount of stock that can be purchased in a single order buyable boolean this attribute shows if the product is available for sale on sale boolean this attribute shows if there is a specific sale or promotion active currently active price discount allowed boolean determines if the product can have any discounts applied to it the default value is true reviews allowed boolean this attribute shows if customers can leave reviews for this item the default value is false price shown boolean determines if the product is currently visible in external assets the default value is true price exclude from feed boolean determines if the product will be included in third party feeds and product search engines price new from appendix docid\ kfbmx4q3dxjtduqf75yx1 the date the product was launched for sale as a brand new item price new to appendix docid\ kfbmx4q3dxjtduqf75yx1 after this date, the product will not be considered a brand new item price expiry date appendix docid\ kfbmx4q3dxjtduqf75yx1 after this date, the product will not be available for sale price release date appendix docid\ kfbmx4q3dxjtduqf75yx1 the date that the product will be released for sale gallery array of strings each string in the array must be an asset id related products array of strings an array of product ids, each representing a related product whitelist array of strings an array of iso country codes only customers from these countries can purchase this product custom attributes array of objects an array of objects each corresponding to a custom attribute configured on the product "custom attributes" \[ { "language" "en", "name" "attribute name", "value" "attribute value" } ] language string the language of the custom attribute name string this name of the custom attribute value string the value of the custom attribute custom fields array of objects an array of objects each corresponding to a custom field configured on the product "custom fields" \[ { "language" "en", "name" "field name", "type" "checkboxes", "values" \[ "value1", "value2" ] }, { "language" "en", "name" "name", "range from" 1709762400, "range to" 1711749600, "type" "date picker" } ] language string the language of the custom field name string this name of the custom field type string this type of the custom field the possible values are size , checkboxes , textfield , textarea , date picker values array of strings an array of strings, each represtive a value for the custom field available for custom fields with type " checkboxes " range from timestamp the starting range for the custom fields available for custom fields with type " range from " range to string the starting range for the custom fields available for custom fields with type " range to " require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/products/create/digital") 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 = { unlimited stock true, tax category "ebooks", pricing model \[ { currency "eur", price 10 } ], languages { en { title "my awesome product" } }, delivery type "url", delivery url "https //example com", number of downloads 10 } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/products/create/digital' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{"unlimited stock" true, "tax category" "ebooks", "pricing model" \[{"currency" "eur", "price" 10}],"languages" {"en" {"title" "my awesome product"}}, "delivery type" "url", "delivery url" "https //google com"}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { unlimited stock true, tax category "ebooks", pricing model \[ { currency "eur", price 1000 } ], languages { en { title "my awesome product" } }, delivery type "url", delivery url "https //example com", number of downloads 10 }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/products/create/digital", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "product" { "id" "b2af3994 2da0 4126 84d6 a4d206f3813a", "object" "product", "name" "my awesome product", "classification" "ebooks", "created" "2022 10 22 13 54 41 +0000", "created unix" 1666446881, "price" 1000, "currency" "eur", "gallery" \[], "in stock" true, "type" "digital product", "updated" "2022 10 22 13 54 41 +0000", "updated unix" 1666446881, "on sale" true, "discount allowed" true, "reviews allowed" false, "hide if no stock" true, "shown" true, "description" null, "seo description" null, "seo title" null, "stock" null, "tax calculation" "exclusive", "has variations" false, "unlimited stock" true, "pricing model" \[ { "id" "d50ddc33 6cc2 4ccb 86d8 72819cccb8c3", "object" "pricing model", "currency" "eur", "price" 1000, "recommended seller price" 0, "acquisition price" 0 } ], "custom attributes" null, "min units" null, "max units" null, "stock limit warning" null, "allow negative stock" false, "additional information" { "sample" false, "release date unix" null, "release date" null, "expiry date unix" null, "expiry date" null, "new from unix" null, "new from" null, "new to unix" null, "new to" null, "exclude from feed" false }, "languages" { "en" { "title" "my awesome product", "seo title" null, "description" null, "seo description" null, "slug" null } }, "number of downloads" 10, "digital files" \[], "delivery type" "url", "license type" "none", "licenses" \[], "related products" null, "delivery url" "https //example com", "is moss product" true }, "status" 200 }