List Subscriptions
Retrieve a list of all subscriptions with optional filtering
GET
/
api
/
v2
/
subscriptions
List Subscriptions
curl --request GET \
--url https://api.example.com/api/v2/subscriptionsimport requests
url = "https://api.example.com/api/v2/subscriptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/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.example.com/api/v2/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v2/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v2/subscriptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyList Subscriptions
Returns a paginated list of subscriptions, ordered by creation date (most recent first).Authentication
Authorization: Bearer glm_test_YOUR_API_KEY
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results per page (default: 10, max: 100) |
starting_after | string | Cursor for pagination (subscription ID) |
status | enum | Filter by status: trialing, active, past_due, cancelled, ended |
customer_id | string | Filter by customer ID |
Request
GET /api/v2/subscriptions?limit=10&status=active
Response
{
"data": [
{
"id": "sub_abc123",
"customer_id": "cus_xyz789",
"status": "active",
"amount_cents": 9900,
"interval": "monthly",
"next_billing_date": "2025-11-18T14:30:00Z",
"created_at": "2025-10-18T14:30:00Z"
}
],
"has_more": true,
"next_cursor": "sub_abc123"
}
Examples
curl "https://api.withgale.com/api/v2/subscriptions?status=active" \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Related Endpoints
โI
List Subscriptions
curl --request GET \
--url https://api.example.com/api/v2/subscriptionsimport requests
url = "https://api.example.com/api/v2/subscriptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/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.example.com/api/v2/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v2/subscriptions"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v2/subscriptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body