Accounting API
Instalment Plans
Update Instalment Plan
this api endpoint (post) (post) updates an existing instalment plan if the request succeeds, it returns an instalment plan object docid\ gzq8y0kheq6ds0tzu6pfa path parameters id the id of the instalment plan to update body parameters label string the label of the instalment plan interval integer the interval of the instalment plan cycle string the billing cycle of the instalment plan the possible values are month , day , year and week instalments integer the total number of instalments to collect upfront decimal the percent amount to be collected upfront interest decimal the interest rate to be collect countries array of strings ( appendix docid\ kfbmx4q3dxjtduqf75yx1 ) the country whitelist of the instalment require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/instalments/update/ad99e198 c19b 4680 84e4 0209c2f943d4") 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 = { label "payment plan 3", interval 1, cycle "month", instalments 3 } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/instalments/update/ad99e198 c19b 4680 84e4 0209c2f943d4' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "label" "payment plan 3", "interval" 1, "cycle" "month", "instalments" 3 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { label "payment plan 3", interval 1, cycle "month", instalments 3 }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/instalments/update/ad99e198 c19b 4680 84e4 0209c2f943d4", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "instalment plan" { "object" "instalment plan", "label" "payment plan 3", "interval" 1, "cycle" "month", "upfront" 0, "interest" 0, "instalments" 3, "countries" null, "created at" 1682437120, "id" "ad99e198 c19b 4680 84e4 0209c2f943d4", "sales" 0, "customers" 0 } }