Operations API
Subscriptions
Create Addon
this api endpoint (post) (post) creates an addon on a subscription if the request succeeds, it returns an addon object docid\ mj9mtn vfjiezu h3i7y7 permissions subscriptions edit webhook event subscription events docid v9nhlsjkke9ztmipzzh8 path parameters id the id of the subscription to update body parameters duration string the possible values are once , limited and recurring cost integer the cost of the addon description string a short description of the addon number of payments integer the total number of payments to collect for the addon required if duration is set to limited tax calculation string determines how the tax will be calculated for the addon the possible values are inclusive and exclusive the default value is exclusive vat classification string determines how the vat will be calculated for the addon the possible values are digital , physical and notax the default value is digital available for subscriptions with vat taxes enabled tax object a custom tax rate to apply on the addon label string the label of the tax rate rate decimal the tax rate percentage to apply require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/subscriptions/addons/create/775ad9db 4c78 4705 b1ac 4c371973a514") 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 = { description "extra 2 hours of technical support", percent 1000, duration "once" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/subscriptions/addons/create/775ad9db 4c78 4705 b1ac 4c371973a514' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "description" "extra 2 hours of technical support", "cost" 1000, "duration" "once" }'var myheaders = new headers(); myheaders append("accept", "application/json"); // replace your token here with your developer key myheaders append("authorization", "bearer your token here"); var data = { description "extra 2 hours of technical support", percent 1000, duration "once" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/subscriptions/addons/create/775ad9db 4c78 4705 b1ac 4c371973a514", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "addon" { "description" "extra 2 hours of technical support", "id" "d0478596 924e 4995 bc11 0ecbc6df7145", "duration" "once", "amount" 1000, "currency" "eur", "type" "subscription addon", "subscription id" "775ad9db 4c78 4705 b1ac 4c371973a514", "payment count" 0, "object" "addon", "number of payments" null } }