> ## 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 currently logged-in customer ID

> Returns the customer ID of the currently authenticated customer from their Shopify session. This endpoint is used by the customer portal UI to identify which customer is logged in.

**Use Cases:**
- Customer portal initialization - determine who's logged in
- Fetch customer-specific data (subscriptions, orders, settings)
- Validate customer session before displaying sensitive information
- Personalize customer portal UI with customer name/email

**How it works:**
- Customer must be logged in to their Shopify customer account
- Session is validated via Shopify App Proxy
- Returns Shopify customer ID (numeric)

**Important Notes:**
- This endpoint only works when called from the shop domain (via Shopify App Proxy)
- Customer must be logged in to Shopify
- Returns null if customer is not authenticated
- Do not use this for external API integrations - use External APIs with explicit customer ID instead

**Authentication:** Requires active Shopify customer session (browser-based)



## OpenAPI

````yaml /subscription/storefront-api-swagger.json get /subscriptions/cp/api/logged-in-customer
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for the customer-facing subscription portal.
    These APIs enable customers to manage their subscriptions, update billing
    information, modify delivery schedules, and access their account details
    through your storefront.


    **Important**: These APIs must be called from your shop's domain (e.g.,
    https://www.myshop.com/apps/subscriptions/cp/api/**) and require customer
    authentication. Unauthenticated requests will return a 401 Unauthorized
    error.
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://www.myshop.com/apps
security: []
tags:
  - description: >-
      Core customer portal APIs for managing customer account settings,
      authentication, and portal configurations.
    name: Customer Portal
  - description: >-
      APIs for customers to view and manage their subscription contracts
      including status updates, frequency changes, and cancellations.
    name: Subscription Management
  - description: >-
      APIs for retrieving and updating subscription contract details — delivery
      schedules, line items, addresses, billing cycles.
    name: Subscription Contracts
  - description: >-
      APIs for retrieving available subscription plans and selling plan
      configurations exposed to customers.
    name: Subscription Plans
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for retrieving aggregated subscription data and account-level
      subscription information for the signed-in customer.
    name: Subscription Data
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing payment methods, billing information, and processing
      subscription payments.
    name: Billing & Payments
  - description: >-
      APIs for retrieving product information, selling plans, variant data, and
      subscription-enabled products available to customers.
    name: Product Catalog
  - description: >-
      APIs for managing delivery schedules, shipping addresses, delivery
      methods, and tracking order status.
    name: Delivery & Shipping
  - description: >-
      APIs for handling subscription cancellations, retention activities, and
      customer feedback management.
    name: Customer Retention
  - description: >-
      APIs for integrating loyalty programs with subscriptions including points
      redemption and earning options.
    name: Loyalty Integration
  - description: >-
      APIs for accessing portal customization settings, translations, and theme
      configurations.
    name: Customization
  - description: >-
      APIs for retrieving promotional campaigns shown in the customer portal,
      tracking banner engagement, and redeeming campaign offers.
    name: Campaigns
  - description: >-
      APIs for local pickup and click-and-collect — listing pickup locations and
      resolving eligible pickup dates and time slots.
    name: Store Pickup
paths:
  /subscriptions/cp/api/logged-in-customer:
    get:
      tags:
        - Subscription Contracts
        - Customer Portal
      summary: Get currently logged-in customer ID
      description: >-
        Returns the customer ID of the currently authenticated customer from
        their Shopify session. This endpoint is used by the customer portal UI
        to identify which customer is logged in.


        **Use Cases:**

        - Customer portal initialization - determine who's logged in

        - Fetch customer-specific data (subscriptions, orders, settings)

        - Validate customer session before displaying sensitive information

        - Personalize customer portal UI with customer name/email


        **How it works:**

        - Customer must be logged in to their Shopify customer account

        - Session is validated via Shopify App Proxy

        - Returns Shopify customer ID (numeric)


        **Important Notes:**

        - This endpoint only works when called from the shop domain (via Shopify
        App Proxy)

        - Customer must be logged in to Shopify

        - Returns null if customer is not authenticated

        - Do not use this for external API integrations - use External APIs with
        explicit customer ID instead


        **Authentication:** Requires active Shopify customer session
        (browser-based)
      operationId: updateSubscriptionContractDetails_1
      responses:
        '200':
          content:
            application/json:
              examples:
                Logged in customer:
                  description: Logged in customer
                  value: 6548267876558
              schema:
                example: 6548267876558
                format: int64
                type: integer
          description: Customer ID retrieved successfully
        '401':
          content:
            '*/*':
              schema:
                format: int64
                type: integer
          description: Customer not logged in or invalid session

````