Cancel subscription
curl --request POST \
--url https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'Fox-Secret: <fox-secret>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel"
payload = { "reason": "<string>" }
headers = {
"Fox-Secret": "<fox-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Fox-Secret': '<fox-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.funnelfox.io/public/v1/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.funnelfox.io/public/v1/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_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Fox-Secret: <fox-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Fox-Secret", "<fox-secret>")
req.Header.Add("Content-Type", "application/json")
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.funnelfox.io/public/v1/subscriptions/{id}/cancel")
.header("Fox-Secret", "<fox-secret>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Fox-Secret"] = '<fox-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"psp_id": "<string>",
"status": "created",
"profile": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"preview": true
},
"funnel": {
"id": "<string>",
"title": "<string>",
"alias": "<string>",
"type": "default"
},
"funnel_version": 123,
"session": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"locale": "<string>",
"user_agent": "<string>"
},
"price": 100,
"currency": "<string>",
"price_usd": 100,
"billing_interval": "day",
"billing_interval_count": 123,
"payment_provider": "stripe",
"renews": true,
"sandbox": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"period_starts_at": "2023-11-07T05:31:56Z",
"funnel_locale": "<string>",
"experiment": {
"id": "<string>",
"title": "<string>",
"alias": "<string>",
"enabled": true
},
"product_id": "<string>",
"product": {
"id": "<string>",
"name": "<string>",
"status": "active"
},
"trial_offer": "free",
"trial_transaction_id": "<string>",
"period_ends_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>",
"renewed_at": "2023-11-07T05:31:56Z",
"upgrades_to": "<string>",
"custom_entitlement": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}API Reference
Cancel subscription
Cancels an subscription. You can provide a reason for cancellation in the request body. If no reason is provided, a default reason will be used: “User requested cancellation”. If a subscription has been deleted or already canceled, a corresponding error will be returned. Supported PSPs: - Stripe - Paddle - Solidgate - Paypal - FunnelFox Payments
POST
/
subscriptions
/
{id}
/
cancel
Cancel subscription
curl --request POST \
--url https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel \
--header 'Content-Type: application/json' \
--header 'Fox-Secret: <fox-secret>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel"
payload = { "reason": "<string>" }
headers = {
"Fox-Secret": "<fox-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Fox-Secret': '<fox-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.funnelfox.io/public/v1/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.funnelfox.io/public/v1/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_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Fox-Secret: <fox-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Fox-Secret", "<fox-secret>")
req.Header.Add("Content-Type", "application/json")
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.funnelfox.io/public/v1/subscriptions/{id}/cancel")
.header("Fox-Secret", "<fox-secret>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.funnelfox.io/public/v1/subscriptions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Fox-Secret"] = '<fox-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"psp_id": "<string>",
"status": "created",
"profile": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"preview": true
},
"funnel": {
"id": "<string>",
"title": "<string>",
"alias": "<string>",
"type": "default"
},
"funnel_version": 123,
"session": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"locale": "<string>",
"user_agent": "<string>"
},
"price": 100,
"currency": "<string>",
"price_usd": 100,
"billing_interval": "day",
"billing_interval_count": 123,
"payment_provider": "stripe",
"renews": true,
"sandbox": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"period_starts_at": "2023-11-07T05:31:56Z",
"funnel_locale": "<string>",
"experiment": {
"id": "<string>",
"title": "<string>",
"alias": "<string>",
"enabled": true
},
"product_id": "<string>",
"product": {
"id": "<string>",
"name": "<string>",
"status": "active"
},
"trial_offer": "free",
"trial_transaction_id": "<string>",
"period_ends_at": "2023-11-07T05:31:56Z",
"paused_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancellation_reason": "<string>",
"renewed_at": "2023-11-07T05:31:56Z",
"upgrades_to": "<string>",
"custom_entitlement": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Headers
Project Secret Key
Example:
"secret_"
Path Parameters
Subscription ID
Body
application/json
Cancellation reason
Response
subscription cancelled successfully
Available options:
created, trialing, active, paused, cancelled, expired, unpaid Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Monetary amount in cents (e.g., $1.00 = 100 cents)
Example:
100
Monetary amount in cents (e.g., $1.00 = 100 cents)
Example:
100
Available options:
day, week, month, year Available options:
stripe, paddle, paypal, braintree, solidgate Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
free, paid Was this page helpful?
