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

# Get valid membership contract IDs for customer

> Retrieves a list of all valid (active, paused, or pending) membership contract IDs associated with a specific customer. This endpoint is useful for quickly checking which memberships a customer has without retrieving full contract details.

**Key Features:**
- **Quick Lookup**: Returns only contract IDs, not full contract details
- **Active Memberships Only**: Excludes cancelled or expired contracts
- **Set Response**: Returns unique contract IDs (no duplicates)
- **Fast Performance**: Lightweight query for list views

**Included Membership Statuses:**
- **ACTIVE**: Currently active recurring memberships
- **PAUSED**: Temporarily paused but valid memberships
- **PENDING**: Scheduled to start in the future

**Excluded Membership Statuses:**
- **CANCELLED**: Customer-cancelled memberships
- **EXPIRED**: Reached max cycles or end date
- **FAILED**: Failed billing with no recovery

**Common Use Cases:**
- **Membership Count**: Quickly determine how many active memberships a customer has
- **Access Control**: Verify customer has valid memberships before showing portal
- **List Navigation**: Build dropdown or list of customer's memberships
- **Bulk Operations**: Get all contract IDs for batch processing
- **Validation**: Check if customer has any active memberships
- **Dashboard Display**: Show membership count without full data

**Example Response:**
```json
[12345, 12346, 12389]
```

**Parameters:**
- **customerId** (required, path): The Shopify customer ID

**Response:**
Returns a Set of Long values representing valid membership contract IDs

**Authentication:** Requires API key authentication via X-API-Key header or api_key parameter



## OpenAPI

````yaml /memberships/admin-api-swagger.json get /api/external/v2/subscription-customers/valid/{customerId}
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for managing memberships, payments, and
    related operations. These APIs allow you to programmatically manage
    membership lifecycles, handle payments, configure products, and integrate
    membership functionality into your applications.
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://membership-admin.appstle.com
security: []
tags:
  - description: >-
      APIs for retrieving product swap/substitution options allowing members to
      exchange membership items based on configured swap rules and variant
      groups
    name: Product Swap Rules
  - description: >-
      APIs for managing customer payment methods, payment tokens, and payment
      method retrieval for memberships
    name: Customer Payment Methods
  - description: >-
      APIs for managing one-time product additions to upcoming membership
      orders, including adding, retrieving, and removing one-off items
    name: One-Time Add-Ons
  - description: >-
      APIs for managing membership contracts including creation, updates, status
      changes, line items, discounts, and billing operations
    name: Membership Contracts
  - description: >-
      APIs for retrieving historical discount code usage and redemption
      information for membership contracts
    name: Customer Discount History
  - description: >-
      APIs for managing customer portal settings including UI customization,
      text labels, feature toggles, and branding options for the member
      self-service portal
    name: Customer Portal Configuration
  - description: >-
      APIs for retrieving custom CSS styles applied to membership widgets and
      customer portal for theme customization
    name: Custom CSS Styling
  - description: >-
      APIs for managing membership cancellation flow settings including
      retention offers, survey questions, and cancel confirmation screens
    name: Cancellation Flow Configuration
  - description: >-
      APIs for managing membership billing attempts, recurring orders, payment
      retries, order history, and order skipping
    name: Billing & Orders
  - description: >-
      APIs for managing Shopify delivery profiles, shipping rates, zones, and
      free shipping configuration for membership memberships
    name: Shipping & Delivery Profiles
  - description: >-
      APIs for managing membership plan groups, including creating plans,
      configuring discounts, billing intervals, and assigning products to plans
    name: Membership Plans
  - description: >-
      APIs for retrieving product catalog, variants, pricing, and inventory
      information for memberships.
    name: Product & Inventory Data
  - description: >-
      APIs for managing shop-level membership settings, configuration, and
      general store information.
    name: Shop Settings
  - description: >-
      APIs for performing bulk/mass operations on multiple membership contracts
      including status updates, product replacements, and billing date changes.
    name: Bulk Operations
paths:
  /api/external/v2/subscription-customers/valid/{customerId}:
    get:
      tags:
        - Membership Contracts
      summary: Get valid membership contract IDs for customer
      description: >-
        Retrieves a list of all valid (active, paused, or pending) membership
        contract IDs associated with a specific customer. This endpoint is
        useful for quickly checking which memberships a customer has without
        retrieving full contract details.


        **Key Features:**

        - **Quick Lookup**: Returns only contract IDs, not full contract details

        - **Active Memberships Only**: Excludes cancelled or expired contracts

        - **Set Response**: Returns unique contract IDs (no duplicates)

        - **Fast Performance**: Lightweight query for list views


        **Included Membership Statuses:**

        - **ACTIVE**: Currently active recurring memberships

        - **PAUSED**: Temporarily paused but valid memberships

        - **PENDING**: Scheduled to start in the future


        **Excluded Membership Statuses:**

        - **CANCELLED**: Customer-cancelled memberships

        - **EXPIRED**: Reached max cycles or end date

        - **FAILED**: Failed billing with no recovery


        **Common Use Cases:**

        - **Membership Count**: Quickly determine how many active memberships a
        customer has

        - **Access Control**: Verify customer has valid memberships before
        showing portal

        - **List Navigation**: Build dropdown or list of customer's memberships

        - **Bulk Operations**: Get all contract IDs for batch processing

        - **Validation**: Check if customer has any active memberships

        - **Dashboard Display**: Show membership count without full data


        **Example Response:**

        ```json

        [12345, 12346, 12389]

        ```


        **Parameters:**

        - **customerId** (required, path): The Shopify customer ID


        **Response:**

        Returns a Set of Long values representing valid membership contract IDs


        **Authentication:** Requires API key authentication via X-API-Key header
        or api_key parameter
      operationId: getValidSubscriptionCustomerV2
      parameters:
        - description: Shopify customer ID
          example: 6789012345
          in: path
          name: customerId
          required: true
          schema:
            format: int64
            type: integer
        - description: API Key (Deprecated - Use Header X-API-Key instead)
          in: query
          name: api_key
          required: false
          schema:
            type: string
        - in: header
          name: X-API-Key
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: string
          description: >-
            Valid membership contract IDs retrieved successfully (may be empty
            set if customer has no active memberships)
        '400':
          content:
            '*/*':
              schema:
                items:
                  format: int64
                  type: integer
                type: array
                uniqueItems: true
          description: Invalid customer ID format
        '401':
          content:
            '*/*':
              schema:
                items:
                  format: int64
                  type: integer
                type: array
                uniqueItems: true
          description: Authentication required - invalid or missing API key
        '404':
          content:
            '*/*':
              schema:
                items:
                  format: int64
                  type: integer
                type: array
                uniqueItems: true
          description: Customer not found

````