cURL
curl --request GET \
--url https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/', 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.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/",
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;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/")
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_bodyHttpResponse<String> response = Unirest.get("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "f15d1962-bba0-4e66-a147-f59a48935f29",
"cycle_number": 1,
"due_date": "2026-05-18T19:14:17.677041Z",
"amount": "100.00",
"status": "paid",
"total_attempts": 2,
"completed_at": "2026-05-18T19:15:02.123456Z",
"created_at": "2026-05-18T19:14:17.677041Z",
"attempts": [
{
"id": "d9abeb29-6c7d-46fa-938a-4fbce40be05d",
"attempt_number": 1,
"amount": "100.00",
"result": "failure",
"failure_reason": "Insufficient funds",
"scheduled_for": "2026-05-18T19:14:17.677041Z",
"started_at": "2026-05-18T19:14:18.123456Z",
"completed_at": "2026-05-18T19:14:20.789012Z",
"created_at": "2026-05-18T19:14:17.677041Z"
},
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attempt_number": 2,
"amount": "100.00",
"result": "success",
"failure_reason": null,
"scheduled_for": "2026-05-19T19:14:17.677041Z",
"started_at": "2026-05-19T19:14:18.000000Z",
"completed_at": "2026-05-19T19:14:22.000000Z",
"created_at": "2026-05-18T19:14:17.677041Z"
}
]
}{
"detail": "As credenciais de autenticação não foram fornecidas."
}{
"detail": "Não encontrado."
}Ciclos de Assinaturas
Obter Ciclo de Cobrança
Consulte os detalhes completos de um ciclo de cobrança específico, incluindo todas as tentativas de pagamento.
GET
/
public_api
/
subscriptions
/
{id}
/
billing-cycles
/
{cycle_id}
/
cURL
curl --request GET \
--url https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/', 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.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/",
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;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/")
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_bodyHttpResponse<String> response = Unirest.get("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/")
.header("Authorization", "Bearer <token>")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/subscriptions/{id}/billing-cycles/{cycle_id}/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "f15d1962-bba0-4e66-a147-f59a48935f29",
"cycle_number": 1,
"due_date": "2026-05-18T19:14:17.677041Z",
"amount": "100.00",
"status": "paid",
"total_attempts": 2,
"completed_at": "2026-05-18T19:15:02.123456Z",
"created_at": "2026-05-18T19:14:17.677041Z",
"attempts": [
{
"id": "d9abeb29-6c7d-46fa-938a-4fbce40be05d",
"attempt_number": 1,
"amount": "100.00",
"result": "failure",
"failure_reason": "Insufficient funds",
"scheduled_for": "2026-05-18T19:14:17.677041Z",
"started_at": "2026-05-18T19:14:18.123456Z",
"completed_at": "2026-05-18T19:14:20.789012Z",
"created_at": "2026-05-18T19:14:17.677041Z"
},
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attempt_number": 2,
"amount": "100.00",
"result": "success",
"failure_reason": null,
"scheduled_for": "2026-05-19T19:14:17.677041Z",
"started_at": "2026-05-19T19:14:18.000000Z",
"completed_at": "2026-05-19T19:14:22.000000Z",
"created_at": "2026-05-18T19:14:17.677041Z"
}
]
}{
"detail": "As credenciais de autenticação não foram fornecidas."
}{
"detail": "Não encontrado."
}Escopo
read subscriptions
Quando usar
- Para investigar uma cobrança específica que o cliente questionou
- Para analisar o histórico de tentativas de um ciclo pendente
- Para confirmar se um pagamento foi processado corretamente
O que a resposta inclui
A resposta traz o ciclo completo com o arrayattempts aninhado. Cada tentativa mostra:
| Campo | Descrição |
|---|---|
attempt_number | Número da tentativa (1ª, 2ª, 3ª…) |
result | success ou failure |
failure_reason | Motivo da falha, quando houver |
scheduled_for | Data agendada para a tentativa |
started_at | Quando a tentativa iniciou |
completed_at | Quando a tentativa finalizou |
Compare
scheduled_for com completed_at para identificar atrasos no processamento da cobrança.O
cycle_id deve ser o identificador retornado pelo endpoint de listagem de ciclos.Authorizations
Token de autenticação do tipo Bearer {access_token}, onde {access_token} é o token obtido no fluxo de autenticação.
Response
Corpo da resposta status 200
ID do ciclo de cobrança
Número do ciclo
Data de vencimento
Valor do ciclo
Status do ciclo (paid, pending, etc.)
Total de tentativas de cobrança
Data de criação
Lista de tentativas de cobrança
Show child attributes
Show child attributes
Data de conclusão
Was this page helpful?