> ## Documentation Index
> Fetch the complete documentation index at: https://devkit4ai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List All Subscriptions

> List all subscriptions across developer's projects with optional filtering

Retrieve all Stripe subscriptions across all projects owned by the authenticated developer. Supports filtering by project, test mode, and subscription status.

## Authentication

<Note>
  This endpoint requires developer authentication via OAuth2 Bearer Token.
</Note>

## Query Parameters

<ParamField query="project_id" type="string (UUID)">
  Filter subscriptions by specific project ID
</ParamField>

<ParamField query="test_mode" type="boolean">
  Filter by test mode (`true`) or live mode (`false`). If omitted, returns both.
</ParamField>

<ParamField query="status" type="string">
  Filter by subscription status: `active`, `canceled`, `incomplete`, `incomplete_expired`, `past_due`, `trialing`, `unpaid`
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number for pagination (minimum: 1)
</ParamField>

<ParamField query="page_size" type="integer" default="50">
  Number of results per page (1-100)
</ParamField>

## Response

<ResponseField name="subscriptions" type="array">
  Array of subscription objects with project information

  <Expandable title="Subscription Object">
    <ResponseField name="id" type="string (UUID)">
      Internal subscription record ID
    </ResponseField>

    <ResponseField name="project_id" type="string (UUID)">
      Project this subscription belongs to
    </ResponseField>

    <ResponseField name="project_name" type="string">
      Name of the project
    </ResponseField>

    <ResponseField name="provider" type="string">
      Payment provider (always "stripe")
    </ResponseField>

    <ResponseField name="user_id" type="string (UUID)">
      End user who owns this subscription
    </ResponseField>

    <ResponseField name="is_test_mode" type="boolean">
      Whether this is a test mode subscription
    </ResponseField>

    <ResponseField name="subscription_id" type="string">
      Stripe subscription ID (e.g., `sub_xxx`)
    </ResponseField>

    <ResponseField name="customer_id" type="string">
      Stripe customer ID (e.g., `cus_xxx`)
    </ResponseField>

    <ResponseField name="status" type="string">
      Subscription status
    </ResponseField>

    <ResponseField name="plan_name" type="string">
      Name of the subscribed plan
    </ResponseField>

    <ResponseField name="quantity" type="integer">
      Subscription quantity
    </ResponseField>

    <ResponseField name="current_period_start" type="string (datetime)">
      Start of current billing period
    </ResponseField>

    <ResponseField name="current_period_end" type="string (datetime)">
      End of current billing period
    </ResponseField>

    <ResponseField name="cancel_at" type="string (datetime)">
      Scheduled cancellation date
    </ResponseField>

    <ResponseField name="cancelled_at" type="string (datetime)">
      When the subscription was cancelled
    </ResponseField>

    <ResponseField name="created_at" type="string (datetime)">
      When the subscription record was created
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of subscriptions matching the filter
</ResponseField>

<ResponseField name="page" type="integer">
  Current page number
</ResponseField>

<ResponseField name="page_size" type="integer">
  Number of results per page
</ResponseField>

## Example Request

```bash theme={null}
curl "https://api.devkit4ai.com/api/v1/payments/subscriptions?status=active&page=1&page_size=10" \
  -H "Authorization: Bearer {developer_jwt}"
```

## Example Response

```json theme={null}
{
  "subscriptions": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "660e8400-e29b-41d4-a716-446655440001",
      "project_name": "My SaaS App",
      "provider": "stripe",
      "user_id": "770e8400-e29b-41d4-a716-446655440002",
      "is_test_mode": true,
      "subscription_id": "sub_1234567890",
      "customer_id": "cus_1234567890",
      "status": "active",
      "plan_name": "Pro Plan",
      "quantity": 1,
      "current_period_start": "2026-01-01T00:00:00Z",
      "current_period_end": "2026-02-01T00:00:00Z",
      "cancel_at": null,
      "cancelled_at": null,
      "created_at": "2026-01-01T00:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 10
}
```

## Use Cases

### View All Active Subscriptions

```bash theme={null}
curl "https://api.devkit4ai.com/api/v1/payments/subscriptions?status=active" \
  -H "Authorization: Bearer {developer_jwt}"
```

### Filter by Specific Project

```bash theme={null}
curl "https://api.devkit4ai.com/api/v1/payments/subscriptions?project_id=660e8400-e29b-41d4-a716-446655440001" \
  -H "Authorization: Bearer {developer_jwt}"
```

### View Only Live Mode Subscriptions

```bash theme={null}
curl "https://api.devkit4ai.com/api/v1/payments/subscriptions?test_mode=false" \
  -H "Authorization: Bearer {developer_jwt}"
```

## Related Pages

<CardGroup cols={2}>
  <Card title="List Transactions" icon="receipt" href="/cloud-api/payments/list-transactions">
    View payment transactions
  </Card>

  <Card title="Payment Statistics" icon="chart-bar" href="/cloud-api/payments/get-stats">
    Aggregated payment metrics
  </Card>

  <Card title="Project Subscriptions" icon="folder" href="/cloud-api/payments/stripe/list-project-subscriptions">
    View subscriptions for a specific project
  </Card>
</CardGroup>


## OpenAPI

````yaml GET /api/v1/payments/subscriptions
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/payments/subscriptions:
    get:
      tags:
        - Payments
      summary: List All Subscriptions
      description: >-
        List all subscriptions across developer's projects with optional
        filtering by project, test mode, and status.
      operationId: list_all_subscriptions_api_v1_payments_subscriptions_get
      parameters:
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Filter by project
            title: Project Id
          description: Filter by project
        - name: test_mode
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            description: Filter by test mode
            title: Test Mode
          description: Filter by test mode
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by status
            title: Status
          description: Filter by status
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 50
            title: Page Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregatedSubscriptionListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AggregatedSubscriptionListResponse:
      properties:
        subscriptions:
          items:
            $ref: '#/components/schemas/AggregatedSubscriptionResponse'
          type: array
          title: Subscriptions
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
      type: object
      required:
        - subscriptions
        - total
        - page
        - page_size
      title: AggregatedSubscriptionListResponse
      description: Paginated list of subscriptions across projects.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AggregatedSubscriptionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        project_name:
          type: string
          title: Project Name
        provider:
          type: string
          title: Provider
          default: stripe
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        is_test_mode:
          type: boolean
          title: Is Test Mode
        subscription_id:
          type: string
          title: Subscription Id
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
        status:
          type: string
          title: Status
        plan_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Plan Name
        quantity:
          type: integer
          title: Quantity
        current_period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Current Period Start
        current_period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Current Period End
        cancel_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Cancel At
        cancelled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Cancelled At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - project_id
        - project_name
        - is_test_mode
        - subscription_id
        - status
        - quantity
        - created_at
      title: AggregatedSubscriptionResponse
      description: Subscription with project info and provider.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: auth/login

````