Skip to main content
GET
/
v1
/
subscriptions
/
{id}
/
cycles
/
{cycleId}
Recuperar detalhes de um cycle específico
curl --request GET \
  --url https://api.malga.io/v1/subscriptions/{id}/cycles/{cycleId} \
  --header 'X-Api-Key: <api-key>' \
  --header 'X-Client-Id: <api-key>'
import requests

url = "https://api.malga.io/v1/subscriptions/{id}/cycles/{cycleId}"

headers = {
"X-Client-Id": "<api-key>",
"X-Api-Key": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}};

fetch('https://api.malga.io/v1/subscriptions/{id}/cycles/{cycleId}', 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.malga.io/v1/subscriptions/{id}/cycles/{cycleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Client-Id: <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.malga.io/v1/subscriptions/{id}/cycles/{cycleId}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-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.get("https://api.malga.io/v1/subscriptions/{id}/cycles/{cycleId}")
.header("X-Client-Id", "<api-key>")
.header("X-Api-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.malga.io/v1/subscriptions/{id}/cycles/{cycleId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = '<api-key>'
request["X-Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "01985cf8-9877-7c09-bbf6-2cceb3384a61",
  "customerId": "2a8b64ce-904c-4256-b79a-49525808609c",
  "merchantId": "225d39bc-1fbb-480a-90bd-f0caad05d2d0",
  "cycle": 1,
  "status": "authorized",
  "createdAt": "2025-07-30T20:14:12.599715Z",
  "paymentHistory": [
    {
      "id": "84ec50c5-1fb4-4d6b-bbff-fedc47ba9fa3",
      "createdAt": "2025-07-30T20:14:12.608115Z",
      "chargeId": "6f2a0713-c4cd-4e2d-8603-69855902676d",
      "status": "authorized"
    }
  ]
}

Authorizations

X-Client-Id
string
header
required
X-Api-Key
string
header
required

Path Parameters

id
string<uuid>
required

Id da assinatura

cycleId
string<uuid>
required

Id do cycle

Response

200 - application/json

Success

id
string<uuid>

Identificador do cycle

Example:

"01985cf8-9877-7c09-bbf6-2cceb3384a61"

customerId
string<uuid>

Identificador do cliente

Example:

"2a8b64ce-904c-4256-b79a-49525808609c"

merchantId
string<uuid>

Identificador do merchant

Example:

"225d39bc-1fbb-480a-90bd-f0caad05d2d0"

cycle
integer

Número do cycle

Example:

1

status
enum<string>

Status do cycle

Available options:
scheduled,
pending,
authorized,
failed,
retrying,
canceled
Example:

"authorized"

createdAt
string<date-time>

Data de criação do cycle

Example:

"2025-07-30T20:14:12.599715Z"

paymentHistory
object[]

Histórico de pagamentos do cycle