> ## 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 minimum billing cycles for subscription contract

> Sets the minimum number of billing cycles (payments) required before a customer can cancel their subscription. This is commonly used to enforce commitment periods or prevent early cancellations.

**Key Features:**
- **Commitment Enforcement**: Require customers to stay subscribed for a minimum period
- **Cancellation Prevention**: Blocks cancellation until minimum cycles are met
- **Contract Terms**: Implements contractual minimum billing requirements
- **Flexible Duration**: Set any number from 0 (no minimum) to higher values

**Common Use Cases:**
- **3-Month Minimum**: Set minCycles=3 for quarterly commitment
- **Annual Contract**: Set minCycles=12 for yearly subscriptions
- **Trial Completion**: Require 1-2 cycles before allowing cancellation
- **Remove Restriction**: Set minCycles=0 or null to remove minimum

**Behavior:**
- Customer portal will show "X cycles remaining until cancellation allowed"
- Cancellation button disabled until minimum met
- Does not affect pausing subscriptions
- Applies to future billing cycles, not retroactive

**Parameters:**
- **contractId** (required): The subscription contract ID
- **minCycles** (optional): Number of minimum cycles (null or 0 = no minimum)

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



## OpenAPI

````yaml /memberships/admin-api-swagger.json put /api/external/v2/subscription-contracts-update-min-cycles
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 managing Shopify delivery profiles, shipping rates, zones, and
      free shipping configuration for subscription memberships
    name: Shipping & Delivery Profiles
  - 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 subscription product bundles, bundle configurations,
      item grouping, and bundle-specific discount codes
    name: Product Bundles
  - 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 managing subscription bundle configuration settings including
      bundle behavior, pricing rules, and display options
    name: Bundle Settings
  - description: >-
      APIs for managing customer payment methods, payment tokens, and payment
      method retrieval for subscriptions
    name: Customer Payment Methods
  - 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 retrieving product catalog, variants, pricing, and inventory
      information for subscription 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-contracts-update-min-cycles:
    put:
      tags:
        - Membership Contracts
      summary: Update minimum billing cycles for subscription contract
      description: >-
        Sets the minimum number of billing cycles (payments) required before a
        customer can cancel their subscription. This is commonly used to enforce
        commitment periods or prevent early cancellations.


        **Key Features:**

        - **Commitment Enforcement**: Require customers to stay subscribed for a
        minimum period

        - **Cancellation Prevention**: Blocks cancellation until minimum cycles
        are met

        - **Contract Terms**: Implements contractual minimum billing
        requirements

        - **Flexible Duration**: Set any number from 0 (no minimum) to higher
        values


        **Common Use Cases:**

        - **3-Month Minimum**: Set minCycles=3 for quarterly commitment

        - **Annual Contract**: Set minCycles=12 for yearly subscriptions

        - **Trial Completion**: Require 1-2 cycles before allowing cancellation

        - **Remove Restriction**: Set minCycles=0 or null to remove minimum


        **Behavior:**

        - Customer portal will show "X cycles remaining until cancellation
        allowed"

        - Cancellation button disabled until minimum met

        - Does not affect pausing subscriptions

        - Applies to future billing cycles, not retroactive


        **Parameters:**

        - **contractId** (required): The subscription contract ID

        - **minCycles** (optional): Number of minimum cycles (null or 0 = no
        minimum)


        **Authentication:** Requires API key authentication via X-API-Key header
        or api_key parameter
      operationId: updateMinCyclesV2
      parameters:
        - description: Subscription contract ID
          example: 12345
          in: query
          name: contractId
          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
        - description: Minimum number of billing cycles required (null or 0 = no minimum)
          example: 3
          in: query
          name: minCycles
          required: false
          schema:
            format: int32
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
          description: >-
            Min cycles updated successfully, returns updated subscription
            contract
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
          description: Invalid request - contract not found or invalid parameters
        '401':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
          description: Authentication required - invalid or missing API key
        '404':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
          description: Subscription contract not found
components:
  schemas:
    SubscriptionContract:
      properties:
        billingAttempts:
          $ref: '#/components/schemas/BillingAttempts'
        billingPolicy:
          $ref: '#/components/schemas/BillingPolicy'
        createdAt:
          type: object
        customAttributes:
          items:
            $ref: '#/components/schemas/CustomAttribute1'
          type: array
        customer:
          $ref: '#/components/schemas/Customer'
        customerPaymentMethod:
          $ref: '#/components/schemas/CustomerPaymentMethod'
        deliveryMethod:
          $ref: '#/components/schemas/DeliveryMethod'
        deliveryPolicy:
          $ref: '#/components/schemas/DeliveryPolicy'
        deliveryPrice:
          $ref: '#/components/schemas/DeliveryPrice'
        discounts:
          $ref: '#/components/schemas/Discounts'
        get__typename:
          type: string
        id:
          type: string
        lastPaymentStatus:
          enum:
            - SUCCEEDED
            - FAILED
            - $UNKNOWN
          type: string
        lines:
          $ref: '#/components/schemas/Lines'
        nextBillingDate:
          type: object
        note:
          type: string
        originOrder:
          $ref: '#/components/schemas/OriginOrder'
        status:
          enum:
            - ACTIVE
            - PAUSED
            - CANCELLED
            - EXPIRED
            - FAILED
            - $UNKNOWN
          type: string
        updatedAt:
          type: object
      type: object
    BillingAttempts:
      properties:
        get__typename:
          type: string
        nodes:
          items:
            $ref: '#/components/schemas/Node3'
          type: array
      type: object
    BillingPolicy:
      properties:
        anchors:
          items:
            $ref: '#/components/schemas/Anchor'
          type: array
        get__typename:
          type: string
        interval:
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
            - $UNKNOWN
          type: string
        intervalCount:
          format: int32
          type: integer
        maxCycles:
          format: int32
          type: integer
        minCycles:
          format: int32
          type: integer
      type: object
    CustomAttribute1:
      properties:
        get__typename:
          type: string
        key:
          type: string
        value:
          type: string
      type: object
    Customer:
      properties:
        displayName:
          type: string
        email:
          deprecated: true
          type: string
        firstName:
          type: string
        get__typename:
          type: string
        id:
          type: string
        lastName:
          type: string
        phone:
          deprecated: true
          type: string
      type: object
    CustomerPaymentMethod:
      properties:
        get__typename:
          type: string
        id:
          type: string
        instrument:
          $ref: '#/components/schemas/Instrument'
        revokedAt:
          type: object
        revokedReason:
          enum:
            - AUTHORIZE_NET_GATEWAY_NOT_ENABLED
            - AUTHORIZE_NET_RETURNED_NO_PAYMENT_METHOD
            - FAILED_TO_UPDATE_CREDIT_CARD
            - STRIPE_API_AUTHENTICATION_ERROR
            - STRIPE_API_INVALID_REQUEST_ERROR
            - STRIPE_GATEWAY_NOT_ENABLED
            - STRIPE_RETURNED_NO_PAYMENT_METHOD
            - STRIPE_PAYMENT_METHOD_NOT_CARD
            - BRAINTREE_API_AUTHENTICATION_ERROR
            - BRAINTREE_GATEWAY_NOT_ENABLED
            - BRAINTREE_RETURNED_NO_PAYMENT_METHOD
            - BRAINTREE_PAYMENT_METHOD_NOT_CARD
            - PAYMENT_METHOD_VERIFICATION_FAILED
            - THREE_D_SECURE_FLOW_IN_VERIFICATION_NOT_IMPLEMENTED
            - MANUALLY_REVOKED
            - FAILED_TO_RETRIEVE_BILLING_ADDRESS
            - MERGED
            - CUSTOMER_REDACTED
            - TOO_MANY_CONSECUTIVE_FAILURES
            - CVV_ATTEMPTS_LIMIT_EXCEEDED
            - $UNKNOWN
          type: string
      type: object
    DeliveryMethod:
      properties:
        additionalInformation:
          $ref: '#/components/schemas/AdditionalInformation'
        brandedPromise:
          $ref: '#/components/schemas/BrandedPromise'
        get__typename:
          type: string
        id:
          type: string
        maxDeliveryDateTime:
          type: object
        methodType:
          enum:
            - SHIPPING
            - PICK_UP
            - NONE
            - RETAIL
            - LOCAL
            - PICKUP_POINT
            - $UNKNOWN
          type: string
        minDeliveryDateTime:
          type: object
        serviceCode:
          type: string
      type: object
    DeliveryPolicy:
      properties:
        anchors:
          items:
            $ref: '#/components/schemas/Anchor1'
          type: array
        get__typename:
          type: string
        interval:
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
            - $UNKNOWN
          type: string
        intervalCount:
          format: int32
          type: integer
      type: object
    DeliveryPrice:
      properties:
        amount:
          type: object
        currencyCode:
          enum:
            - USD
            - EUR
            - GBP
            - CAD
            - AFN
            - ALL
            - DZD
            - AOA
            - ARS
            - AMD
            - AWG
            - AUD
            - BBD
            - AZN
            - BDT
            - BSD
            - BHD
            - BIF
            - BYN
            - BZD
            - BMD
            - BTN
            - BAM
            - BRL
            - BOB
            - BWP
            - BND
            - BGN
            - MMK
            - KHR
            - CVE
            - KYD
            - XAF
            - CLP
            - CNY
            - COP
            - KMF
            - CDF
            - CRC
            - HRK
            - CZK
            - DKK
            - DJF
            - DOP
            - XCD
            - EGP
            - ERN
            - ETB
            - FKP
            - XPF
            - FJD
            - GIP
            - GMD
            - GHS
            - GTQ
            - GYD
            - GEL
            - GNF
            - HTG
            - HNL
            - HKD
            - HUF
            - ISK
            - INR
            - IDR
            - ILS
            - IRR
            - IQD
            - JMD
            - JPY
            - JEP
            - JOD
            - KZT
            - KES
            - KID
            - KWD
            - KGS
            - LAK
            - LVL
            - LBP
            - LSL
            - LRD
            - LYD
            - LTL
            - MGA
            - MKD
            - MOP
            - MWK
            - MVR
            - MRU
            - MXN
            - MYR
            - MUR
            - MDL
            - MAD
            - MNT
            - MZN
            - NAD
            - NPR
            - ANG
            - NZD
            - NIO
            - NGN
            - NOK
            - OMR
            - PAB
            - PKR
            - PGK
            - PYG
            - PEN
            - PHP
            - PLN
            - QAR
            - RON
            - RUB
            - RWF
            - WST
            - SHP
            - SAR
            - RSD
            - SCR
            - SLL
            - SGD
            - SDG
            - SOS
            - SYP
            - ZAR
            - KRW
            - SSP
            - SBD
            - LKR
            - SRD
            - SZL
            - SEK
            - CHF
            - TWD
            - THB
            - TJS
            - TZS
            - TOP
            - TTD
            - TND
            - TRY
            - TMT
            - UGX
            - UAH
            - AED
            - UYU
            - UZS
            - VUV
            - VES
            - VND
            - XOF
            - YER
            - ZMW
            - USDC
            - BYR
            - STD
            - STN
            - VED
            - VEF
            - XXX
            - $UNKNOWN
          type: string
        get__typename:
          type: string
      type: object
    Discounts:
      properties:
        get__typename:
          type: string
        nodes:
          items:
            $ref: '#/components/schemas/Node2'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo2'
      type: object
    Lines:
      properties:
        get__typename:
          type: string
        nodes:
          items:
            $ref: '#/components/schemas/Node'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
      type: object
    OriginOrder:
      properties:
        fulfillmentOrders:
          $ref: '#/components/schemas/FulfillmentOrders'
        get__typename:
          type: string
        id:
          type: string
        name:
          type: string
      type: object
    Node3:
      properties:
        completedAt:
          type: object
        createdAt:
          type: object
        get__typename:
          type: string
        id:
          type: string
        idempotencyKey:
          type: string
        ready:
          deprecated: true
          type: boolean
      type: object
    Anchor:
      properties:
        cutoffDay:
          format: int32
          type: integer
        day:
          format: int32
          type: integer
        get__typename:
          type: string
        month:
          format: int32
          type: integer
        type:
          enum:
            - WEEKDAY
            - MONTHDAY
            - YEARDAY
            - $UNKNOWN
          type: string
      type: object
    Instrument:
      properties:
        get__typename:
          type: string
      type: object
    AdditionalInformation:
      properties:
        get__typename:
          type: string
        instructions:
          type: string
      type: object
    BrandedPromise:
      properties:
        get__typename:
          type: string
        handle:
          type: string
        name:
          type: string
      type: object
    Anchor1:
      properties:
        cutoffDay:
          format: int32
          type: integer
        day:
          format: int32
          type: integer
        get__typename:
          type: string
        month:
          format: int32
          type: integer
        type:
          enum:
            - WEEKDAY
            - MONTHDAY
            - YEARDAY
            - $UNKNOWN
          type: string
      type: object
    Node2:
      properties:
        createdAt:
          type: object
        deliveredAt:
          type: object
        displayStatus:
          enum:
            - ATTEMPTED_DELIVERY
            - CANCELED
            - CONFIRMED
            - DELAYED
            - DELIVERED
            - FAILURE
            - FULFILLED
            - CARRIER_PICKED_UP
            - IN_TRANSIT
            - LABEL_PRINTED
            - LABEL_PURCHASED
            - LABEL_VOIDED
            - MARKED_AS_FULFILLED
            - NOT_DELIVERED
            - OUT_FOR_DELIVERY
            - READY_FOR_PICKUP
            - PICKED_UP
            - SUBMITTED
            - $UNKNOWN
          type: string
        estimatedDeliveryAt:
          type: object
        get__typename:
          type: string
        id:
          type: string
        inTransitAt:
          type: object
        name:
          type: string
        requiresShipping:
          type: boolean
        service:
          $ref: '#/components/schemas/Service'
        status:
          enum:
            - PENDING
            - OPEN
            - SUCCESS
            - CANCELLED
            - ERROR
            - FAILURE
            - $UNKNOWN
          type: string
        trackingInfo:
          items:
            $ref: '#/components/schemas/TrackingInfo'
          type: array
      type: object
    PageInfo2:
      properties:
        endCursor:
          type: string
        get__typename:
          type: string
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          type: string
      type: object
    Node:
      properties:
        get__typename:
          type: string
      type: object
    PageInfo:
      properties:
        endCursor:
          type: string
        get__typename:
          type: string
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          type: string
      type: object
    FulfillmentOrders:
      properties:
        get__typename:
          type: string
        nodes:
          items:
            $ref: '#/components/schemas/Node'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo2'
      type: object
    Service:
      properties:
        get__typename:
          type: string
        handle:
          type: string
        serviceName:
          type: string
        type:
          enum:
            - GIFT_CARD
            - MANUAL
            - THIRD_PARTY
            - $UNKNOWN
          type: string
      type: object
    TrackingInfo:
      properties:
        company:
          type: string
        get__typename:
          type: string
        number:
          type: string
        url:
          type: object
      type: object

````