List
curl --request GET \
--url https://api.paygentic.io/v0/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions', 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.paygentic.io/v0/subscriptions",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.paygentic.io/v0/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions")
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_body{
"data": [
{
"id": "sub_z1a2b3c4d5e6f7g8",
"object": "subscription",
"versionPolicy": "floating",
"autoCharge": false,
"taxExempt": false,
"createdAt": "2024-01-10T08:00:00Z",
"customerId": "cus_q3r4s5t6u7v8w9x0",
"endingAt": null,
"estimatedTaxRate": 8.5,
"name": "StartupXYZ - Image Generation Service",
"payment": null,
"planId": "plan_t9u0v1w2x3y4z5a6",
"startedAt": "2024-01-10T08:00:00Z",
"elapsedPeriodBilling": "none",
"billingStartsAt": "2024-01-10T08:00:00Z",
"billingAnchor": "2024-01-10T08:00:00Z",
"billingCadence": "P1M",
"status": "active",
"terminatedAt": null,
"terminatedBy": null,
"terminationReason": null,
"updatedAt": "2024-01-10T08:00:00Z"
},
{
"id": "sub_j1k2l3m4n5o6p7q8",
"object": "subscription",
"versionPolicy": "floating",
"autoCharge": true,
"taxExempt": true,
"createdAt": "2024-02-01T14:45:30Z",
"customerId": "cus_r9s0t1u2v3w4x5y6",
"endingAt": "2024-12-31T23:59:59Z",
"estimatedTaxRate": 0,
"name": "Analytics Co - Data Platform Enterprise",
"payment": null,
"planId": "plan_z7a8b9c0d1e2f3g4",
"startedAt": "2024-02-01T14:45:30Z",
"elapsedPeriodBilling": "none",
"billingStartsAt": "2024-02-01T14:45:30Z",
"billingAnchor": "2024-02-01T14:00:00Z",
"billingCadence": "P1M",
"status": "active",
"terminatedAt": null,
"terminatedBy": null,
"terminationReason": null,
"updatedAt": "2024-02-15T09:20:00Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 2
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Subscriptions
List
GET
/
v0
/
subscriptions
List
curl --request GET \
--url https://api.paygentic.io/v0/subscriptions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.paygentic.io/v0/subscriptions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.paygentic.io/v0/subscriptions', 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.paygentic.io/v0/subscriptions",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.paygentic.io/v0/subscriptions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/subscriptions")
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_body{
"data": [
{
"id": "sub_z1a2b3c4d5e6f7g8",
"object": "subscription",
"versionPolicy": "floating",
"autoCharge": false,
"taxExempt": false,
"createdAt": "2024-01-10T08:00:00Z",
"customerId": "cus_q3r4s5t6u7v8w9x0",
"endingAt": null,
"estimatedTaxRate": 8.5,
"name": "StartupXYZ - Image Generation Service",
"payment": null,
"planId": "plan_t9u0v1w2x3y4z5a6",
"startedAt": "2024-01-10T08:00:00Z",
"elapsedPeriodBilling": "none",
"billingStartsAt": "2024-01-10T08:00:00Z",
"billingAnchor": "2024-01-10T08:00:00Z",
"billingCadence": "P1M",
"status": "active",
"terminatedAt": null,
"terminatedBy": null,
"terminationReason": null,
"updatedAt": "2024-01-10T08:00:00Z"
},
{
"id": "sub_j1k2l3m4n5o6p7q8",
"object": "subscription",
"versionPolicy": "floating",
"autoCharge": true,
"taxExempt": true,
"createdAt": "2024-02-01T14:45:30Z",
"customerId": "cus_r9s0t1u2v3w4x5y6",
"endingAt": "2024-12-31T23:59:59Z",
"estimatedTaxRate": 0,
"name": "Analytics Co - Data Platform Enterprise",
"payment": null,
"planId": "plan_z7a8b9c0d1e2f3g4",
"startedAt": "2024-02-01T14:45:30Z",
"elapsedPeriodBilling": "none",
"billingStartsAt": "2024-02-01T14:45:30Z",
"billingAnchor": "2024-02-01T14:00:00Z",
"billingCadence": "P1M",
"status": "active",
"terminatedAt": null,
"terminatedBy": null,
"terminationReason": null,
"updatedAt": "2024-02-15T09:20:00Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 2
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Query Parameters
Return subscriptions in any of these statuses. Repeat the parameter to pass several, e.g. ?status=active&status=pending_payment. Omit it to return every status. An SDK leaves an empty list out of the request, so an empty list also returns every status: check for one before calling if it should match nothing.
Available options:
active, terminated, pending_payment Was this page helpful?