curl --request PATCH \
--url https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retries_enabled": true,
"attempts": 5,
"period_days": 16,
"failed_charge_enabled": {
"first": true,
"intermediate": true,
"last": true
},
"failed_charge_texts": {
"first": "<string>",
"intermediate": "<string>",
"last": "<string>"
},
"failed_charge_buttons": {
"first": "<string>",
"intermediate": "<string>"
},
"monthly_report_enabled": true
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery"
payload = {
"retries_enabled": True,
"attempts": 5,
"period_days": 16,
"failed_charge_enabled": {
"first": True,
"intermediate": True,
"last": True
},
"failed_charge_texts": {
"first": "<string>",
"intermediate": "<string>",
"last": "<string>"
},
"failed_charge_buttons": {
"first": "<string>",
"intermediate": "<string>"
},
"monthly_report_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
retries_enabled: true,
attempts: 5,
period_days: 16,
failed_charge_enabled: {first: true, intermediate: true, last: true},
failed_charge_texts: {first: '<string>', intermediate: '<string>', last: '<string>'},
failed_charge_buttons: {first: '<string>', intermediate: '<string>'},
monthly_report_enabled: true
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery', 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://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'retries_enabled' => true,
'attempts' => 5,
'period_days' => 16,
'failed_charge_enabled' => [
'first' => true,
'intermediate' => true,
'last' => true
],
'failed_charge_texts' => [
'first' => '<string>',
'intermediate' => '<string>',
'last' => '<string>'
],
'failed_charge_buttons' => [
'first' => '<string>',
'intermediate' => '<string>'
],
'monthly_report_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery"
payload := strings.NewReader("{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"is_pro": true,
"retries": {
"enabled": true,
"schedule": "standard",
"attempts": 123,
"period_days": 123,
"retry_days": [
123
]
},
"upcoming_reminders": {
"enabled": true,
"reminders": [
{
"days": 123,
"text": "<string>"
}
],
"saved_reminders": [
{
"days": 123,
"text": "<string>"
}
],
"locked_reminder_days": [
123
]
},
"failed_charge_notification": {
"first": {
"enabled": true,
"text": "<string>",
"button": "<string>"
},
"intermediate": {
"enabled": true,
"text": "<string>",
"button": "<string>"
},
"last": {
"enabled": true,
"text": "<string>"
}
},
"monthly_report": {
"enabled": true
},
"limits": {
"reminders_max": 123,
"reminder_days_min": 123,
"reminder_days_max": 123,
"attempts_min": 123,
"attempts_max": 123,
"period_days_min": 123,
"period_days_max": 123,
"standard_attempts": 123,
"standard_period_days": 123,
"text_max_length": 123,
"button_max_length": 123
}
}
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}Update revenue recovery settings
Changes payment retries, failed charge notifications and the monthly report; only the passed fields change.
curl --request PATCH \
--url https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"retries_enabled": true,
"attempts": 5,
"period_days": 16,
"failed_charge_enabled": {
"first": true,
"intermediate": true,
"last": true
},
"failed_charge_texts": {
"first": "<string>",
"intermediate": "<string>",
"last": "<string>"
},
"failed_charge_buttons": {
"first": "<string>",
"intermediate": "<string>"
},
"monthly_report_enabled": true
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery"
payload = {
"retries_enabled": True,
"attempts": 5,
"period_days": 16,
"failed_charge_enabled": {
"first": True,
"intermediate": True,
"last": True
},
"failed_charge_texts": {
"first": "<string>",
"intermediate": "<string>",
"last": "<string>"
},
"failed_charge_buttons": {
"first": "<string>",
"intermediate": "<string>"
},
"monthly_report_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
retries_enabled: true,
attempts: 5,
period_days: 16,
failed_charge_enabled: {first: true, intermediate: true, last: true},
failed_charge_texts: {first: '<string>', intermediate: '<string>', last: '<string>'},
failed_charge_buttons: {first: '<string>', intermediate: '<string>'},
monthly_report_enabled: true
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery', 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://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'retries_enabled' => true,
'attempts' => 5,
'period_days' => 16,
'failed_charge_enabled' => [
'first' => true,
'intermediate' => true,
'last' => true
],
'failed_charge_texts' => [
'first' => '<string>',
'intermediate' => '<string>',
'last' => '<string>'
],
'failed_charge_buttons' => [
'first' => '<string>',
'intermediate' => '<string>'
],
'monthly_report_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery"
payload := strings.NewReader("{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/subscriptions/revenue-recovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"retries_enabled\": true,\n \"attempts\": 5,\n \"period_days\": 16,\n \"failed_charge_enabled\": {\n \"first\": true,\n \"intermediate\": true,\n \"last\": true\n },\n \"failed_charge_texts\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\",\n \"last\": \"<string>\"\n },\n \"failed_charge_buttons\": {\n \"first\": \"<string>\",\n \"intermediate\": \"<string>\"\n },\n \"monthly_report_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"is_pro": true,
"retries": {
"enabled": true,
"schedule": "standard",
"attempts": 123,
"period_days": 123,
"retry_days": [
123
]
},
"upcoming_reminders": {
"enabled": true,
"reminders": [
{
"days": 123,
"text": "<string>"
}
],
"saved_reminders": [
{
"days": 123,
"text": "<string>"
}
],
"locked_reminder_days": [
123
]
},
"failed_charge_notification": {
"first": {
"enabled": true,
"text": "<string>",
"button": "<string>"
},
"intermediate": {
"enabled": true,
"text": "<string>",
"button": "<string>"
},
"last": {
"enabled": true,
"text": "<string>"
}
},
"monthly_report": {
"enabled": true
},
"limits": {
"reminders_max": 123,
"reminder_days_min": 123,
"reminder_days_max": 123,
"attempts_min": 123,
"attempts_max": 123,
"period_days_min": 123,
"period_days_max": 123,
"standard_attempts": 123,
"standard_period_days": 123,
"text_max_length": 123,
"button_max_length": 123
}
}
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"code": "<string>",
"current_plan": "<string>",
"upgrade_url": "<string>"
}Authorizations
API token from the Zenedu dashboard
Path Parameters
Bot ID
Body
Only the passed fields change.
Repeat a failed scheduled charge by the schedule; off = the subscription is cancelled right after the failed charge
flexible needs the Pro plan
standard, flexible Flexible schedule: number of attempts, at most one per day; pass together with period_days and not more than period_days
1 <= x <= 10Flexible schedule: recovery period in days after the failed scheduled charge; pass together with attempts
3 <= x <= 30Switch per stage; any plan
Show child attributes
Show child attributes
Own text per stage, Telegram HTML with placeholders {{name}}, {{offer}}, {{price}}, {{next_attempt_date}}; blank = the default text (Pro)
Show child attributes
Show child attributes
Text of the «Pay with another card» button under the first and intermediate notifications; blank = the default text (Pro)
Show child attributes
Show child attributes
Response
Revenue recovery settings
Show child attributes
Show child attributes