Retrieve
curl --request GET \
--url https://{defaultHost}/v1/subscription_protocol \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscription_protocol"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/subscription_protocol', 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://{defaultHost}/v1/subscription_protocol",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/subscription_protocol"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/subscription_protocol")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscription_protocol")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cf449fdb-4fd8-4e65-ac53-fb008eacbdbb",
"object": "subscription_protocol",
"bypass_duplicate_trials": false,
"cancel_behavior": "pending",
"cancel_window_enabled": false,
"cancel_window_days": 14,
"default_payment_method_detach_enabled": false,
"default_payment_method_fallback_enabled": true,
"downgrade_behavior": "pending",
"payment_retry_window_weeks": 1,
"preservation_enabled": false,
"preservation_locales": {
"reasons_title": "We're sad to see you go",
"reasons_description": "Before you cancel, please let us know the reason you're leaving.",
"skip_link": "Never mind, I don't want to cancel.",
"preserve_title": "Take {{ amount }} off your next payment?",
"preserve_description": "We'd be happy to offer you {{ amount }} off your next payment if you'd stay with us.",
"preserve_button": "Yes, I'll take it.",
"cancel_link": "No thanks, I'd still like to cancel."
},
"remind_at_period_percent_remaining": 10,
"remind_after_days": null,
"require_upfront_payment_method": true,
"revoke_purchases_on_past_due": false,
"upgrade_behavior": "immediate",
"preservation_coupon": "9c4c709a-4bf9-4066-8350-32e48420e6e3",
"created_at": 1796063996,
"updated_at": 1796063996
}Subscription Protocols
Retrieve
Retrieves details of the current account’s subscription protocol.
GET
/
v1
/
subscription_protocol
Retrieve
curl --request GET \
--url https://{defaultHost}/v1/subscription_protocol \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscription_protocol"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/subscription_protocol', 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://{defaultHost}/v1/subscription_protocol",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/subscription_protocol"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/subscription_protocol")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscription_protocol")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cf449fdb-4fd8-4e65-ac53-fb008eacbdbb",
"object": "subscription_protocol",
"bypass_duplicate_trials": false,
"cancel_behavior": "pending",
"cancel_window_enabled": false,
"cancel_window_days": 14,
"default_payment_method_detach_enabled": false,
"default_payment_method_fallback_enabled": true,
"downgrade_behavior": "pending",
"payment_retry_window_weeks": 1,
"preservation_enabled": false,
"preservation_locales": {
"reasons_title": "We're sad to see you go",
"reasons_description": "Before you cancel, please let us know the reason you're leaving.",
"skip_link": "Never mind, I don't want to cancel.",
"preserve_title": "Take {{ amount }} off your next payment?",
"preserve_description": "We'd be happy to offer you {{ amount }} off your next payment if you'd stay with us.",
"preserve_button": "Yes, I'll take it.",
"cancel_link": "No thanks, I'd still like to cancel."
},
"remind_at_period_percent_remaining": 10,
"remind_after_days": null,
"require_upfront_payment_method": true,
"revoke_purchases_on_past_due": false,
"upgrade_behavior": "immediate",
"preservation_coupon": "9c4c709a-4bf9-4066-8350-32e48420e6e3",
"created_at": 1796063996,
"updated_at": 1796063996
}Authorizations
Response
200 - application/json
Success
Specifies the minimum number of days that must pass since the last reminder (or subscription creation if no reminder has been sent) before a new reminder can be sent. For example, if set to 180, a reminder will only be sent if at least 180 days have passed since the last reminder. This prevents reminders from being sent too frequently across multiple subscription periods.
The coupon that is applied to subscriptions when a cancellation reason with coupon_enabled=true is selected and the susbcription is preserved.
Expandable – The associated preservation coupon ID.
Was this page helpful?