curl --request POST \
--url https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal \
--header 'X-Suby-Api-Key: <api-key>'import requests
url = "https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal"
headers = {"X-Suby-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Suby-Api-Key': '<api-key>'}};
fetch('https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal', 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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Suby-Api-Key: <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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Suby-Api-Key", "<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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal")
.header("X-Suby-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"subscription": {
"id": "sub_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"status": "INCOMPLETE",
"currentCycle": 123,
"totalCycles": 123,
"trialEndAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"currentCycleDueAt": "2023-11-07T05:31:56Z",
"renewalAttempt": 123,
"nextRenewalAttemptAt": "2023-11-07T05:31:56Z",
"lastDeclineCategory": "SOFT",
"priceCents": "1999",
"currency": "EUR",
"taxInclusive": true,
"purchaseAsBusiness": true,
"externalRef": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "CANCELED_BY_CUSTOMER",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY"
},
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com"
}
}
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Retry a failing renewal now
Bring the next dunning attempt forward on a PAST_DUE subscription.
It does not charge. It moves nextRenewalAttemptAt to now, and the renewal
sweep makes the attempt it was already going to make — on its own retry budget,
writing its own attempt record, exactly as a scheduled retry would. Poll the
subscription (or listen for subscription.*) for the outcome.
Anything other than PAST_DUE has no retry to bring forward and is refused with
422.
curl --request POST \
--url https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal \
--header 'X-Suby-Api-Key: <api-key>'import requests
url = "https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal"
headers = {"X-Suby-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Suby-Api-Key': '<api-key>'}};
fetch('https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal', 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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Suby-Api-Key: <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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Suby-Api-Key", "<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.beta.suby.fi/v3/subscriptions/{id}/retry-renewal")
.header("X-Suby-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beta.suby.fi/v3/subscriptions/{id}/retry-renewal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Suby-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"subscription": {
"id": "sub_abc123",
"organizationId": "<string>",
"customerId": "<string>",
"productId": "<string>",
"status": "INCOMPLETE",
"currentCycle": 123,
"totalCycles": 123,
"trialEndAt": "2023-11-07T05:31:56Z",
"cancelAtPeriodEnd": true,
"currentCycleDueAt": "2023-11-07T05:31:56Z",
"renewalAttempt": 123,
"nextRenewalAttemptAt": "2023-11-07T05:31:56Z",
"lastDeclineCategory": "SOFT",
"priceCents": "1999",
"currency": "EUR",
"taxInclusive": true,
"purchaseAsBusiness": true,
"externalRef": "<string>",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "CANCELED_BY_CUSTOMER",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"product": {
"id": "pro_abc123",
"name": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"status": "ACTIVE",
"priceCents": "<string>",
"currency": "<string>",
"recurringInterval": "DAY",
"recurringIntervalCount": 123,
"recurringCycleCount": 123,
"trialDurationCount": 123,
"trialDurationUnit": "DAY"
},
"customer": {
"id": "cus_abc123",
"email": "jsmith@example.com"
}
}
},
"message": "<string>"
}{
"success": false,
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found"
}{
"success": false,
"error": "NOT_FOUND",
"message": "Resource not found",
"data": "<unknown>"
}Authorizations
Secret API key. sk_live_… (production) or sk_sandbox_… (sandbox).
Headers
Optional key (≤255 chars, e.g. a UUID v4) that makes this POST safe to retry: the first request executes and its response is cached for 24h; a retry with the SAME key replays that response instead of re-executing (no duplicate payment/subscription). A reused key with a different request → 422 IDEMPOTENCY_KEY_CONFLICT; a retry while the first is still in flight → 409. See the Idempotency guide.
255"5f3b9c2e-1a4d-4f2b-9c31-7e2a1b6d8c04"
Path Parameters
"sub_abc123"
Was this page helpful?

