List Subscriptions
GET/subscriptionsDescription
Retrieve a list of all subscriptions. The subscriptions are returned in descending order by creation date, with the most recent subscriptions appearing first.
Headers
| Header | Description | Required |
|---|---|---|
| Authorization | Bearer token with your API key | yes |
Query Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| limit | number | Maximum number of subscriptions to return (default: 10, max: 100). | no |
| starting_after | string | Cursor for pagination. Returns subscriptions after this ID. | no |
| ending_before | string | Cursor for pagination. Returns subscriptions before this ID. | no |
| status | string | Filter by status: active, paused, cancelled, past_due, or expired. | no |
| customer_id | string | Filter subscriptions by customer ID. | no |
| created_gte | string | Filter subscriptions created on or after this ISO 8601 timestamp. | no |
| created_lte | string | Filter subscriptions created on or before this ISO 8601 timestamp. | no |
Example Request
const response = await fetch('https://checkout.exodus.com/subscriptions?limit=20&status=active', {
headers: {
Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
},
});Response
SUCCESSFUL RESPONSE
{
"object": "list",
"data": [
{
"id": "sub_1234567890abcdef",
"object": "subscription",
"amount": 2999,
"currency": "USD",
"interval": "monthly",
"name": "Pro Plan",
"status": "active",
"customer_id": "cus_0987654321fedcba",
"customer_email": "[email protected]",
"current_period_start": "2024-01-29T12:00:00Z",
"current_period_end": "2024-02-29T12:00:00Z",
"next_payment_at": "2024-02-29T12:00:00Z",
"metadata": {
"plan_id": "pro_monthly"
},
"created_at": "2024-01-15T12:00:00Z"
},
{
"id": "sub_abcdef1234567890",
"object": "subscription",
"amount": 9999,
"currency": "USD",
"interval": "yearly",
"name": "Enterprise Plan",
"status": "active",
"customer_id": "cus_fedcba0987654321",
"customer_email": "[email protected]",
"current_period_start": "2024-01-01T00:00:00Z",
"current_period_end": "2025-01-01T00:00:00Z",
"next_payment_at": "2025-01-01T00:00:00Z",
"metadata": {},
"created_at": "2024-01-01T00:00:00Z"
}
],
"has_more": true
}Pagination
Use cursor-based pagination to navigate through large result sets:
// Get the next page of results
const nextPage = await fetch(
'https://checkout.exodus.com/subscriptions?limit=20&starting_after=sub_abcdef1234567890',
{
headers: {
Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
},
}
);