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

# List Subscriptions

> Lists recurring plans (including add-ons) across customers, live or expired. Filter by customer, entity, plan, or status. Pages may hold fewer than `limit` rows while `has_more` is true.

export const DynamicResponseExample = ({json, statusCode = "200"}) => {
  const toCamelCase = str => {
    return str.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
  };
  const convertKeysToCamelCase = obj => {
    if (Array.isArray(obj)) {
      return obj.map(item => convertKeysToCamelCase(item));
    }
    if (obj !== null && typeof obj === "object") {
      return Object.keys(obj).reduce((acc, key) => {
        const camelKey = toCamelCase(key);
        acc[camelKey] = convertKeysToCamelCase(obj[key]);
        return acc;
      }, {});
    }
    return obj;
  };
  const [isTypeScript, setIsTypeScript] = useState(() => {
    if (typeof window !== "undefined") {
      try {
        const lang = localStorage.getItem("code");
        return JSON.parse(lang) === "typescript";
      } catch {
        return true;
      }
    }
    return true;
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      if (event.detail?.key === "code") {
        try {
          const value = JSON.parse(event.detail.value);
          setIsTypeScript(value === "typescript");
        } catch {}
      }
    };
    const pollInterval = setInterval(() => {
      try {
        const lang = localStorage.getItem("code");
        const value = JSON.parse(lang);
        setIsTypeScript(value === "typescript");
      } catch {}
    }, 300);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, []);
  const camelCaseJson = useMemo(() => convertKeysToCamelCase(json), [json]);
  const snakeCaseString = JSON.stringify(json, null, 2);
  const camelCaseString = JSON.stringify(camelCaseJson, null, 2);
  return <ResponseExample>
			{isTypeScript ? <CodeBlock language="json" filename={statusCode}>
					{camelCaseString}
				</CodeBlock> : <CodeBlock language="json" filename={statusCode}>
					{snakeCaseString}
				</CodeBlock>}
		</ResponseExample>;
};

export const DynamicResponseField = ({children, name, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedName = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(name) : name;
    } catch {
      return name;
    }
  }, [name, lang]);
  return <ResponseField name={resolvedName} {...props}>
			{children}
		</ResponseField>;
};

export const DynamicParamField = ({children, body, path, ...props}) => {
  const convertToCamelCase = str => {
    if (typeof str !== "string") return str;
    return str.replace(/[_-](\w)/g, (_, c) => c.toUpperCase());
  };
  const [lang, setLang] = useState(() => {
    if (typeof window !== "undefined") {
      const stored = localStorage.getItem("code");
      return stored || '"typescript"';
    }
    return '"typescript"';
  });
  useEffect(() => {
    const onMintlifyStorage = event => {
      const key = event.detail?.key;
      if (key === "code") {
        setLang(event.detail.value);
      }
    };
    const pollInterval = setInterval(() => {
      const current = localStorage.getItem("code");
      if (current && current !== lang) {
        setLang(current);
      }
    }, 500);
    document.addEventListener("mintlify-localstorage", onMintlifyStorage);
    return () => {
      document.removeEventListener("mintlify-localstorage", onMintlifyStorage);
      clearInterval(pollInterval);
    };
  }, [lang]);
  const resolvedBody = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(body) : body;
    } catch {
      return body;
    }
  }, [body, lang]);
  const resolvedPath = useMemo(() => {
    try {
      const value = JSON.parse(lang);
      const useCamelCase = value === "typescript";
      return useCamelCase ? convertToCamelCase(path) : path;
    } catch {
      return path;
    }
  }, [path, lang]);
  return <ParamField body={resolvedBody} path={resolvedPath} {...props}>
			{children}
		</ParamField>;
};

Lists recurring plans, including add-ons. By default only `active` and `scheduled` plans are returned; pass `statuses: ["expired"]` to see plans a customer no longer has.

<Note>
  `past_due` is a filter, not a status. A past-due plan is returned with `status: "active"` and `past_due: true`.
</Note>

<Note>
  A page can hold fewer than `limit` rows (even zero) while `has_more` is `true`. Keep paginating until `has_more` is `false`.
</Note>

### Body Parameters

<DynamicParamField body="customer_id" type="string">
  Only return rows for this customer. Omit to list across every customer.
</DynamicParamField>

<DynamicParamField body="entity_id" type="string">
  Only return rows for this entity. Requires customer\_id.
</DynamicParamField>

<DynamicParamField body="limit" type="integer">
  Number of items to return. Default 50, hard ceiling 200.
</DynamicParamField>

<DynamicParamField body="start_cursor" type="string">
  Opaque pagination cursor. Empty string (default) requests the first page; use next\_cursor from a prior response for subsequent pages.
</DynamicParamField>

<DynamicParamField body="statuses" type="('active' | 'scheduled' | 'past_due' | 'expired')[]">
  Statuses to include. Defaults to active and scheduled. past\_due matches plans with overdue payments, which read as status active with past\_due true.
</DynamicParamField>

<DynamicParamField body="plan_id" type="string">
  Only return rows for this plan.
</DynamicParamField>

### Response

<DynamicResponseField name="list" type="object[]">
  Rows on this page.

  <Expandable title="properties">
    <DynamicResponseField name="id" type="string">
      The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
    </DynamicResponseField>

    <DynamicResponseField name="plan_id" type="string">
      The unique identifier of the subscribed plan.
    </DynamicResponseField>

    <DynamicResponseField name="auto_enable" type="boolean">
      Whether the plan was automatically enabled for the customer.
    </DynamicResponseField>

    <DynamicResponseField name="add_on" type="boolean">
      Whether this is an add-on plan rather than a base subscription.
    </DynamicResponseField>

    <DynamicResponseField name="past_due" type="boolean">
      Whether the subscription has overdue payments.
    </DynamicResponseField>

    <DynamicResponseField name="canceled_at" type="number | null">
      Timestamp when the subscription was canceled, or null if not canceled.
    </DynamicResponseField>

    <DynamicResponseField name="expires_at" type="number | null">
      Timestamp when the subscription will expire, or null if no expiry set.
    </DynamicResponseField>

    <DynamicResponseField name="trial_ends_at" type="number | null">
      Timestamp when the trial period ends, or null if not on trial.
    </DynamicResponseField>

    <DynamicResponseField name="started_at" type="number">
      Timestamp when the subscription started.
    </DynamicResponseField>

    <DynamicResponseField name="current_period_start" type="number | null">
      Start timestamp of the current billing period.
    </DynamicResponseField>

    <DynamicResponseField name="current_period_end" type="number | null">
      End timestamp of the current billing period.
    </DynamicResponseField>

    <DynamicResponseField name="quantity" type="number">
      Number of units of this subscription (for per-seat plans).
    </DynamicResponseField>

    <DynamicResponseField name="scope" type="'customer' | 'entity'">
      Whether this subscription is attached at the customer level or entity level.
    </DynamicResponseField>

    <DynamicResponseField name="status" type="'active' | 'scheduled' | 'expired'">
      Current status of the subscription.
    </DynamicResponseField>

    <DynamicResponseField name="customer_id" type="string">
      The customer this row belongs to.
    </DynamicResponseField>

    <DynamicResponseField name="entity_id" type="string | null">
      The entity this row is scoped to, or null.
    </DynamicResponseField>

    <DynamicResponseField name="created_at" type="number">
      Timestamp when this row was created.
    </DynamicResponseField>
  </Expandable>
</DynamicResponseField>

<DynamicResponseField name="has_more" type="boolean">
  Whether more results exist. A page may hold fewer than `limit` items (even zero) while `has_more` is true, so paginate until `has_more` is false.
</DynamicResponseField>

<DynamicResponseField name="next_cursor" type="string | null">
  Pass as start\_cursor to fetch the next page. Null when has\_more is false.
</DynamicResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "list": [
      {
        "id": "sub_123",
        "plan_id": "pro",
        "auto_enable": false,
        "add_on": false,
        "status": "expired",
        "past_due": false,
        "canceled_at": 1771409161016,
        "expires_at": 1771409161016,
        "trial_ends_at": null,
        "started_at": 1768817161016,
        "current_period_start": null,
        "current_period_end": null,
        "quantity": 1,
        "scope": "customer",
        "customer_id": "cus_123",
        "entity_id": null,
        "created_at": 1768817161016
      }
    ],
    "has_more": false,
    "next_cursor": null
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi POST /v1/subscriptions.list
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.4.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/subscriptions.list:
    post:
      tags:
        - customers
      description: >-
        Lists recurring plans (including add-ons) across customers, live or
        expired. Filter by customer, entity, plan, or status. Pages may hold
        fewer than `limit` rows while `has_more` is true.
      operationId: listSubscriptions
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.4.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  description: >-
                    Only return rows for this customer. Omit to list across
                    every customer.
                entity_id:
                  type: string
                  description: Only return rows for this entity. Requires customer_id.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 200
                  default: 50
                  description: Number of items to return. Default 50, hard ceiling 200.
                start_cursor:
                  type: string
                  default: ''
                  description: >-
                    Opaque pagination cursor. Empty string (default) requests
                    the first page; use next_cursor from a prior response for
                    subsequent pages.
                statuses:
                  type: array
                  minItems: 1
                  items:
                    enum:
                      - active
                      - scheduled
                      - past_due
                      - expired
                    type: string
                  description: >-
                    Statuses to include. Defaults to active and scheduled.
                    past_due matches plans with overdue payments, which read as
                    status active with past_due true.
                plan_id:
                  type: string
                  description: Only return rows for this plan.
              title: ListSubscriptionsParams
              examples:
                - customer_id: cus_123
                  statuses:
                    - expired
                - plan_id: pro
                  statuses:
                    - past_due
            example:
              customer_id: cus_123
              statuses:
                - expired
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            The unique identifier of this subscription. If a
                            subscription_id was provided at attach time, it is
                            used; otherwise, falls back to the internal ID.
                        plan_id:
                          type: string
                          description: The unique identifier of the subscribed plan.
                        auto_enable:
                          type: boolean
                          description: >-
                            Whether the plan was automatically enabled for the
                            customer.
                        add_on:
                          type: boolean
                          description: >-
                            Whether this is an add-on plan rather than a base
                            subscription.
                        past_due:
                          type: boolean
                          description: Whether the subscription has overdue payments.
                        canceled_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the subscription was canceled, or
                            null if not canceled.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the subscription will expire, or null
                            if no expiry set.
                        trial_ends_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the trial period ends, or null if not
                            on trial.
                        started_at:
                          type: number
                          description: Timestamp when the subscription started.
                        current_period_start:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: Start timestamp of the current billing period.
                        current_period_end:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: End timestamp of the current billing period.
                        quantity:
                          type: number
                          description: >-
                            Number of units of this subscription (for per-seat
                            plans).
                        scope:
                          enum:
                            - customer
                            - entity
                          type: string
                          description: >-
                            Whether this subscription is attached at the
                            customer level or entity level.
                        status:
                          enum:
                            - active
                            - scheduled
                            - expired
                          type: string
                          description: Current status of the subscription.
                        customer_id:
                          type: string
                          description: The customer this row belongs to.
                        entity_id:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: The entity this row is scoped to, or null.
                        created_at:
                          type: number
                          description: Timestamp when this row was created.
                      required:
                        - id
                        - plan_id
                        - auto_enable
                        - add_on
                        - past_due
                        - canceled_at
                        - expires_at
                        - trial_ends_at
                        - started_at
                        - current_period_start
                        - current_period_end
                        - quantity
                        - status
                        - customer_id
                        - entity_id
                        - created_at
                    description: Rows on this page.
                  has_more:
                    type: boolean
                    description: >-
                      Whether more results exist. A page may hold fewer than
                      `limit` items (even zero) while `has_more` is true, so
                      paginate until `has_more` is false.
                  next_cursor:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Pass as start_cursor to fetch the next page. Null when
                      has_more is false.
                required:
                  - list
                  - has_more
                  - next_cursor
                examples:
                  - list:
                      - id: sub_123
                        plan_id: pro
                        auto_enable: false
                        add_on: false
                        status: expired
                        past_due: false
                        canceled_at: 1771409161016
                        expires_at: 1771409161016
                        trial_ends_at: null
                        started_at: 1768817161016
                        current_period_start: null
                        current_period_end: null
                        quantity: 1
                        scope: customer
                        customer_id: cus_123
                        entity_id: null
                        created_at: 1768817161016
                    has_more: false
                    next_cursor: null
              example:
                list:
                  - id: sub_123
                    plan_id: pro
                    auto_enable: false
                    add_on: false
                    status: expired
                    past_due: false
                    canceled_at: 1771409161016
                    expires_at: 1771409161016
                    trial_ends_at: null
                    started_at: 1768817161016
                    current_period_start: null
                    current_period_end: null
                    quantity: 1
                    scope: customer
                    customer_id: cus_123
                    entity_id: null
                    created_at: 1768817161016
                has_more: false
                next_cursor: null
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````