Operations API
Subscriptions
Cancel Subscription
this api endpoint (post) (post) cancels a subscription if the request succeeds, it returns a subscription object docid\ k0wuvfe yqdvzc3q awny permissions subscriptions edit webhook event subscription events docid v9nhlsjkke9ztmipzzh8 path parameters id the id of the subscription to cancel body parameters cancel behaviour string the possible values are immediate (subscription is cancelled instantly) and end of period (subscription cancels at the end of the current billing period) require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/subscriptions/cancel/210e2322 5851 4873 8bd7 e77a03122ce9") 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" response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/subscriptions/cancel/210e2322 5851 4873 8bd7 e77a03122ce9' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var requestoptions = { method 'post', headers myheaders }; fetch("https //api tamio com/v2/subscriptions/cancel/210e2322 5851 4873 8bd7 e77a03122ce9", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "subscription" { "id" "210e2322 5851 4873 8bd7 e77a03122ce9", "object" "subscription", "next billing date" null, "cancellation date" 1663371677, "completion date" null, "resumes at" null, "customer" { "id" "d6e56d9e d49e 475c ac81 406416ab8806", "name" "john", "last name" "doe", "email" "johndoe\@example com", "locale" "en" }, "products" \[ { "id" "957003bd dc98 422d 8dc7 44929e191a70", "name" "test billing plan" } ], "payment count" 1, "status" "cancelled", "gateway subscription id" "sub 1lio1mgvhw7af69dedhhcpib", "type" "subscription", "gateway" "stripe", "billing cycle" "month", "interval" 1, "currency" "eur", "price" 100 }, "status" 200 }