> ## 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.

# Update membership contract status

> Updates the status of an existing membership contract (ACTIVE, PAUSED, CANCELLED, or EXPIRED). This is one of the most critical operations for managing membership lifecycles.

**Supported Status Values:**
- **ACTIVE**: Membership is active and will process recurring billing
- **PAUSED**: Membership is temporarily paused, no billing will occur
- **CANCELLED**: Membership is permanently cancelled, no future billing
- **EXPIRED**: Membership has expired (typically used when max cycles reached)

**Pause Duration:**
- When pausing, you can optionally specify `pauseDurationCycle` to auto-resume after N cycles
- If not specified, membership remains paused until manually reactivated

**Business Rules & Validations:**
- **Customer Portal Restrictions**: When called from customer portal, additional validations apply:
  - Cannot modify frozen memberships (freeze till min cycle condition)
  - Must respect billing cycle limits configured by merchant
- **Contract Validation**: System validates that the contract belongs to the authenticated shop
- **Activity Logging**: All status changes are logged with source (merchant portal vs customer portal)

**Use Cases:**
- Customer wants to pause their membership temporarily
- Merchant needs to cancel a membership due to customer request
- Reactivating a paused membership
- Marking membership as expired when max cycles reached

**Authentication:** Requires authenticated shop user or customer portal token



## OpenAPI

````yaml /memberships/storefront-api-swagger.json put /memberships/cp/api/subscription-contracts-update-status
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for the customer-facing membership portal.
    These APIs enable customers to manage their memberships, 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/memberships/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: >-
      APIs for managing Shopify delivery profiles, shipping rates, zones, and
      free shipping configuration for subscription memberships
    name: Shipping & Delivery Profiles
  - description: >-
      APIs for managing shop-level membership settings, configuration, email
      domains, webhooks, and general store information
    name: Shop Settings
  - description: >-
      APIs for integrating loyalty programs with memberships including customer
      points lookup, earn options, redeem options, and point redemption
    name: Loyalty Integration
  - description: >-
      APIs for retrieving historical discount code usage and redemption
      information for membership contracts
    name: Customer Discount History
  - 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 one-time product additions to upcoming subscription
      orders, including adding, retrieving, and removing one-off items
    name: One-Time Add-Ons
  - description: >-
      APIs for managing membership/subscription plan groups, including creating
      plans, configuring discounts, billing intervals, and assigning products to
      plans
    name: Membership Plans
  - description: >-
      APIs for managing customer retention activities including cancellation
      feedback, retention action tracking, and activity export
    name: Customer Retention
  - description: >-
      APIs for retrieving custom CSS styles applied to subscription widgets and
      customer portal for theme customization
    name: Custom CSS Styling
  - 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 managing membership/subscription contracts including creation,
      updates, status changes, line items, discounts, and billing operations
    name: Membership Contracts
  - description: >-
      APIs for retrieving product catalog, variants, pricing, and inventory
      information for subscription memberships
    name: Product & Inventory Data
  - description: >-
      APIs for retrieving product swap/substitution options allowing members to
      exchange subscription items based on configured swap rules and variant
      groups
    name: Product Swap Rules
  - description: APIs for managing subscription product bundles and bundle configurations.
    name: Product Bundles
  - description: APIs for managing payment methods and billing information.
    name: Customer Payment Methods
paths:
  /memberships/cp/api/subscription-contracts-update-status:
    put:
      tags:
        - Membership Contracts
      summary: Update membership contract status
      description: >-
        Updates the status of an existing membership contract (ACTIVE, PAUSED,
        CANCELLED, or EXPIRED). This is one of the most critical operations for
        managing membership lifecycles.


        **Supported Status Values:**

        - **ACTIVE**: Membership is active and will process recurring billing

        - **PAUSED**: Membership is temporarily paused, no billing will occur

        - **CANCELLED**: Membership is permanently cancelled, no future billing

        - **EXPIRED**: Membership has expired (typically used when max cycles
        reached)


        **Pause Duration:**

        - When pausing, you can optionally specify `pauseDurationCycle` to
        auto-resume after N cycles

        - If not specified, membership remains paused until manually reactivated


        **Business Rules & Validations:**

        - **Customer Portal Restrictions**: When called from customer portal,
        additional validations apply:
          - Cannot modify frozen memberships (freeze till min cycle condition)
          - Must respect billing cycle limits configured by merchant
        - **Contract Validation**: System validates that the contract belongs to
        the authenticated shop

        - **Activity Logging**: All status changes are logged with source
        (merchant portal vs customer portal)


        **Use Cases:**

        - Customer wants to pause their membership temporarily

        - Merchant needs to cancel a membership due to customer request

        - Reactivating a paused membership

        - Marking membership as expired when max cycles reached


        **Authentication:** Requires authenticated shop user or customer portal
        token
      operationId: updateStatus
      parameters:
        - description: Membership contract ID (numeric ID, not Shopify GID)
          example: 123456789
          in: query
          name: contractId
          required: true
          schema:
            format: int64
            type: integer
        - description: New status value
          example: PAUSED
          in: query
          name: status
          required: true
          schema:
            enum:
              - ACTIVE
              - PAUSED
              - CANCELLED
              - EXPIRED
            type: string
        - description: >-
            Optional pause duration in billing cycles. When specified,
            membership will auto-resume after N cycles
          example: 2
          in: query
          name: pauseDurationCycle
          required: false
          schema:
            format: int32
            type: integer
      responses:
        '204':
          description: Membership status updated successfully (no content returned)
        '400':
          content:
            application/json:
              examples:
                Billing Cycle Limit:
                  description: Customer portal operation violates billing cycle limits
                  value:
                    detail: >-
                      Cannot perform this operation due to billing cycle
                      restrictions
                    errorKey: billing_cycle_limit
                    status: 400
                    title: Bad Request
                Contract Not Found:
                  description: Contract Not Found
                  value:
                    detail: Contract not found
                    entityName: subscriptionContractDetails
                    errorKey: notfound
                    status: 400
                    title: Bad Request
                Frozen Membership:
                  description: Customer portal attempting to modify frozen membership
                  value:
                    detail: >-
                      This membership is frozen until minimum billing cycles are
                      completed
                    errorKey: membership_frozen
                    status: 400
                    title: Bad Request
                Unauthorized Access:
                  description: Unauthorized Access
                  value:
                    detail: Unauthorized access to subscription contract
                    errorKey: unauthorized
                    status: 400
                    title: Bad Request
          description: Invalid request - validation failed
        '401':
          description: Authentication required
        '500':
          description: Internal server error - Shopify API failure or system error

````