curl --request GET \
--url https://api-global.fastpaybrasil.com/v1/subscriptions/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-global.fastpaybrasil.com/v1/subscriptions/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api-global.fastpaybrasil.com/v1/subscriptions/{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-global.fastpaybrasil.com/v1/subscriptions/{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: Basic <encoded-value>"
],
]);
$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-global.fastpaybrasil.com/v1/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-global.fastpaybrasil.com/v1/subscriptions/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"status": "active",
"currentPeriodStart": "2024-01-15T10:30:00.000Z",
"currentPeriodEnd": "2024-02-15T10:30:00.000Z",
"billingDay": 15,
"cancelledAt": null,
"cancellationType": null,
"refunded": false,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"plan": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly"
},
"customer": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "John Doe",
"email": "[email protected]"
},
"merchant": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"tradeName": "Loja Exemplo"
},
"charges": [
{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"billingCycle": 1,
"billingPeriodStart": "2024-01-15T10:30:00.000Z",
"billingPeriodEnd": "2024-02-15T10:30:00.000Z",
"amount": 99.9,
"currency": "BRL",
"status": "paid",
"pspTransactionId": "12345",
"failureReason": null,
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"metadata": {
"referralCode": "PROMO2024"
}
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Subscription not found"
}Get subscription by ID
Returns complete details of a subscription, including charge history.
curl --request GET \
--url https://api-global.fastpaybrasil.com/v1/subscriptions/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-global.fastpaybrasil.com/v1/subscriptions/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api-global.fastpaybrasil.com/v1/subscriptions/{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-global.fastpaybrasil.com/v1/subscriptions/{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: Basic <encoded-value>"
],
]);
$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-global.fastpaybrasil.com/v1/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-global.fastpaybrasil.com/v1/subscriptions/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"status": "active",
"currentPeriodStart": "2024-01-15T10:30:00.000Z",
"currentPeriodEnd": "2024-02-15T10:30:00.000Z",
"billingDay": 15,
"cancelledAt": null,
"cancellationType": null,
"refunded": false,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"plan": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "Plano Premium Mensal",
"price": 99.9,
"currency": "BRL",
"recurrenceType": "monthly"
},
"customer": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"name": "John Doe",
"email": "[email protected]"
},
"merchant": {
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"tradeName": "Loja Exemplo"
},
"charges": [
{
"id": "2RhQg9M7ZCg3X3nMb9W1kX8Q",
"billingCycle": 1,
"billingPeriodStart": "2024-01-15T10:30:00.000Z",
"billingPeriodEnd": "2024-02-15T10:30:00.000Z",
"amount": 99.9,
"currency": "BRL",
"status": "paid",
"pspTransactionId": "12345",
"failureReason": null,
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"metadata": {
"referralCode": "PROMO2024"
}
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Subscription not found"
}Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Path Parameters
Unique subscription identifier
Response
Successfully retrieved subscription
Unique subscription identifier
"2RhQg9M7ZCg3X3nMb9W1kX8Q"
Subscription status
pending_activation, pending_card_activation, active, cancelled, paused, expired "active"
Current billing period start
"2024-01-15T10:30:00.000Z"
Current billing period end
"2024-02-15T10:30:00.000Z"
Billing day of the month
15
Cancellation timestamp
null
Type of cancellation
regret, regular null
Whether the subscription was refunded
false
Creation timestamp
"2024-01-15T10:30:00.000Z"
Last update timestamp
"2024-01-15T10:30:00.000Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Charge history
Show child attributes
Show child attributes
Additional metadata
{ "referralCode": "PROMO2024" }