Inventory API
Products
Create Billing Plan
this api endpoint (post) (post) creates a billing plan 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" \[ { "billing cycle" "month", "currency" "eur", "price" 1200, "interval" 2 } ] currency string appendix docid\ kfbmx4q3dxjtduqf75yx1 the currency of the pricing model price integer the price of the item for this pricing model billing cycle string the billing cycle of this pricing model available for products with type billing plan interval integer the billing interval of this pricing model available for products with type billing plan 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 } } unlimited stock boolean the default value is true if set to false , then the stock parameter is required stock integer the available stock for this product you can ignore this parameter if unlimited stock is set to true retries integer the number of retries that are allowed when the customer fails to pay for their billing plan charge shipping during trial boolean determines if the shipping cost will be charged during the trial period of a physical subscription available for billing plans with classification set to physical subscription cancel action string determines what action is taken when all available retries for a recurring payment have failed the possible values are pause and cancel cancel behaviour string determines how cancellations are handled the possible values are immediate and end of period descriptor string the statement descriptor of the billing plan the maximum number of characters is 20 trial period integer the trial period of the billing plan in days the default value is 0 stock limit warning integer if the product stock falls below this value, an email notification will be sent to you will be ignored if unlimited stock is set to true 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 object docid\ lrpr7r0iozzuquwvx8xus 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/billing plan") 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 "other", pricing model \[ { currency "eur", price 1000, billing cycle "month", interval 3 } ], languages { en { title "my awesome product" } }, trial period 10, descriptor "sub10 m3" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/products/create/billing plan' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{"unlimited stock" true, "tax category" "other", "pricing model" \[{"currency" "eur", "price" 10, "billing cycle" "month", "interval" 3}],"languages" {"en" {"title" "my awesome product"}}, "descriptor" "sub10 m3", "trial period" 10}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { unlimited stock true, tax category "other", pricing model \[ { currency "eur", price 10, billing cycle "month", interval 3 } ], languages { en { title "my awesome product" } }, trial period 10, descriptor "sub10 m3" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/products/create/billing plan", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "product" { "id" "58aa3cae 8596 4b70 9ba8 39d65f3b562c", "object" "product", "name" "my awesome product", "classification" "other", "created" "2022 10 22 00 46 58 +0000", "created unix" 1666399618, "price" 1000, "currency" "eur", "gallery" \[], "in stock" true, "type" "billing plan", "updated" "2022 10 22 00 46 59 +0000", "updated unix" 1666399619, "on sale" true, "discount allowed" true, "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, "reviews allowed" false, "related products" null, "pricing model" \[ { "id" "913ef284 f2a2 4c93 8614 4a1af60f0d84", "object" "pricing model", "currency" "eur", "price" 1000, "billing cycle" "month", "interval" 3, "stripe price id" "price 1lvvrbgvhw7af69dmfveojzk" } ], "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 } }, "billing cycle" "month", "interval" 3, "trial period" 10, "descriptor" "sub10m3", "retries" 3, "cancel action" "cancel", "cancel behaviour" "end of period", "is moss product" true }, "status" 200 }