curl --request POST \
--url https://api.fintoc.com/v2/subscriptions/{id}/cancel \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v2/subscriptions/{id}/cancel"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v2/subscriptions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fintoc.com/v2/subscriptions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v2/subscriptions/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fintoc.com/v2/subscriptions/{id}/cancel")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/subscriptions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "sub_2c4mDcMaVxDx7nT3o5GbPMQbS2v",
"object": "subscription",
"billing_cycle_anchor": "2026-06-01T15:00:00Z",
"collection_method": "charge_automatically",
"created_at": "2026-06-01T15:00:00Z",
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"items": [
{
"id": "si_2c4mDfkPLLrLTCJ3wPCEHGYpkVf",
"object": "subscription_item",
"price": {
"currency": "CLP",
"product": {
"id": "prod_2c4mDgwQqkNwMHnXSc4DBjkbcWz",
"object": "product",
"created_at": "2026-06-01T15:00:00Z",
"description": "Access to every premium feature.",
"image_url": "https://example.com/image.png",
"metadata": {},
"mode": "live",
"name": "Premium plan"
},
"recurring": {
"interval": "month",
"interval_count": 1
},
"unit_amount": 10000
},
"quantity": 1
}
],
"metadata": {
"order_id": "12345"
},
"mode": "live",
"payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"status": "canceled",
"trial_end": null
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such invoicing/subscription: ",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"message": "The subscription is already canceled",
"code": "subscription_not_editable"
}
}Cancel a subscription
Cancels a subscription immediately. Canceled subscriptions stop generating invoices, and the cancellation does not affect invoices already issued. Canceling a subscription that is already canceled returns a subscription_not_editable error.
curl --request POST \
--url https://api.fintoc.com/v2/subscriptions/{id}/cancel \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v2/subscriptions/{id}/cancel"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v2/subscriptions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fintoc.com/v2/subscriptions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v2/subscriptions/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fintoc.com/v2/subscriptions/{id}/cancel")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v2/subscriptions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "sub_2c4mDcMaVxDx7nT3o5GbPMQbS2v",
"object": "subscription",
"billing_cycle_anchor": "2026-06-01T15:00:00Z",
"collection_method": "charge_automatically",
"created_at": "2026-06-01T15:00:00Z",
"customer": "cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu",
"items": [
{
"id": "si_2c4mDfkPLLrLTCJ3wPCEHGYpkVf",
"object": "subscription_item",
"price": {
"currency": "CLP",
"product": {
"id": "prod_2c4mDgwQqkNwMHnXSc4DBjkbcWz",
"object": "product",
"created_at": "2026-06-01T15:00:00Z",
"description": "Access to every premium feature.",
"image_url": "https://example.com/image.png",
"metadata": {},
"mode": "live",
"name": "Premium plan"
},
"recurring": {
"interval": "month",
"interval_count": 1
},
"unit_amount": 10000
},
"quantity": 1
}
],
"metadata": {
"order_id": "12345"
},
"mode": "live",
"payment_method": "pm_2c4mDhAbCdEfGhIjKlMnOpQrStu",
"status": "canceled",
"trial_end": null
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "id",
"message": "No such invoicing/subscription: ",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "invalid_request_error",
"message": "The subscription is already canceled",
"code": "subscription_not_editable"
}
}Authorizations
Path Parameters
The id of the subscription to cancel.
Response
The canceled subscription, with status set to canceled.
Unique identifier of the subscription.
"sub_2c4mDcMaVxDx7nT3o5GbPMQbS2v"
Type of the object. Always subscription.
ISO 8601 timestamp that anchors the billing cycle. Fintoc measures every billing period from this anchor. Unless you set the anchor when creating the subscription, Fintoc uses the creation time, or trial_end when a trial applies. Fintoc issues no invoice before the anchor.
"2026-06-01T15:00:00Z"
Method Fintoc uses to collect the invoices the subscription generates. One of charge_automatically (Fintoc charges the saved payment method) or send_invoice (Fintoc leaves each invoice open for you to collect).
charge_automatically, send_invoice "charge_automatically"
ISO 8601 timestamp of when the subscription was created.
"2026-06-01T15:00:00Z"
ID of the customer the subscription bills.
"cus_2c4mDe9NJyGmMzvCqLkXqAtjnRu"
Items the subscription bills for on every billing cycle.
Show child attributes
Show child attributes
Set of key-value pairs attached to the subscription.
{ "order_id": "12345" }
Mode of the object. One of live or test. test subscriptions use fake data for integration testing and do not collect real money.
live, test "live"
ID of the payment method associated with the subscription, or null if it has none. Fintoc charges it on every billing cycle when collection_method is charge_automatically.
"pm_2c4mDhAbCdEfGhIjKlMnOpQrStu"
Current status of the subscription. One of active, incomplete (the first invoice payment has not yet succeeded), trialing (the trial period has not ended), or canceled (the subscription stopped generating invoices).
active, canceled, incomplete, trialing "active"
ISO 8601 timestamp at which the trial period ends, or null if the subscription has no trial.
null
Was this page helpful?