Skip to Content

List Subscriptions

GET/subscriptions

Description

Retrieve a list of all subscriptions. The subscriptions are returned in descending order by creation date, with the most recent subscriptions appearing first.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your API keyyes

Query Parameters

NameTypeDescriptionRequired
limitnumberMaximum number of subscriptions to return (default: 10, max: 100).no
starting_afterstringCursor for pagination. Returns subscriptions after this ID.no
ending_beforestringCursor for pagination. Returns subscriptions before this ID.no
statusstringFilter by status: active, paused, cancelled, past_due, or expired.no
customer_idstringFilter subscriptions by customer ID.no
created_gtestringFilter subscriptions created on or after this ISO 8601 timestamp.no
created_ltestringFilter 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',
    },
  }
);

Start building

XO

Request Demo

Schedule a call with our team

Select a product
Arrow right

Start building
Grateful

Contact Us

We're here to help