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

# Hide subscriptions in bulk

> Hides multiple subscription contracts from customer view in bulk. This operation allows merchants to quickly hide subscriptions from appearing in the customer portal without canceling or deleting them.

**What Does 'Hide' Mean?**
Hiding a subscription makes it invisible to customers in their customer portal while keeping the subscription data intact. The subscription is not deleted or canceled - it's simply hidden from the customer's view. This is useful for:
- Temporarily removing subscriptions from customer access
- Managing test or dummy subscriptions
- Handling subscription disputes or issues
- Preparing subscriptions for migration or cleanup

**Key Features:**
- **Bulk Operation**: Process multiple subscriptions in a single request
- **Non-Destructive**: Subscriptions are hidden, not deleted
- **Reversible**: Hidden subscriptions can be unhidden later
- **Asynchronous Processing**: Large batches are processed in the background
- **Conflict Detection**: Prevents multiple simultaneous bulk operations

**Operation Modes:**
1. **Specific Subscriptions**: Provide a list of subscription contract IDs to hide
2. **All Subscriptions**: Set allSubscriptions=true to hide all active subscriptions (use with caution)

**How It Works:**
1. Submit a request with subscription IDs or allSubscriptions flag
2. System validates the subscription IDs belong to your shop
3. A bulk automation task is created and queued
4. Each subscription is marked as hidden
5. Subscriptions disappear from customer portal immediately
6. Subscriptions remain in merchant admin for management

**Request Body Structure:**
```json
{
  "subscriptionIds": [
    "gid://shopify/SubscriptionContract/123456",
    "gid://shopify/SubscriptionContract/123457",
    "gid://shopify/SubscriptionContract/123458"
  ]
}
```

**Use Cases:**
- **Subscription Cleanup**: Hide test or duplicate subscriptions created during setup
- **Customer Service**: Temporarily hide problematic subscriptions while resolving issues
- **Migration Preparation**: Hide old subscriptions before migrating to new plans
- **Dispute Management**: Hide subscriptions involved in billing disputes
- **Seasonal Management**: Hide seasonal subscriptions during off-season
- **Batch Processing**: Clean up subscriptions that meet certain criteria

**Important Notes:**
- Only one bulk operation can run at a time per shop
- If a bulk operation is already in progress, the request will fail with 400 error
- Subscription IDs must be in Shopify GraphQL ID format (gid://shopify/SubscriptionContract/xxxxx)
- Hidden subscriptions stop appearing in customer portal but remain active for billing
- You can unhide subscriptions later through the admin interface
- Using allSubscriptions=true will hide ALL subscriptions - use with extreme caution

**Processing Time:**
- Small batches (<100): Usually complete within seconds
- Medium batches (100-1000): May take 1-2 minutes
- Large batches (>1000): May take several minutes to hours
- Progress can be tracked through the bulk automation status endpoint

**Best Practices:**
- Always specify exact subscription IDs rather than using allSubscriptions=true
- Test with a small batch first before processing large numbers
- Keep track of hidden subscription IDs for future reference
- Document the reason for hiding subscriptions for audit purposes
- Monitor bulk operation status to ensure completion
- Consider notifying customers before hiding their subscriptions

**Workflow Example:**
1. Identify subscriptions to hide (e.g., test subscriptions with specific tags)
2. Extract their subscription contract IDs
3. Call this endpoint with the list of IDs
4. Verify 204 No Content response indicating successful queue
5. Monitor processing status through admin or status endpoint
6. Confirm subscriptions are hidden from customer portal

**Error Scenarios:**
- Another bulk operation is running: 400 error with message about operation in progress
- Invalid subscription IDs: Silently skips invalid IDs, processes valid ones
- Unauthorized subscription access: Only subscriptions belonging to your shop are processed
- Empty subscription list: Operation completes successfully with no action

**Authentication:** Requires valid api_key parameter (X-API-Key header support coming soon)



## OpenAPI

````yaml /subscription/admin-api-swagger.json post /api/external/v2/bulk-automations/hide-subscriptions
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for managing subscriptions, payments, and
    related operations. These APIs allow you to programmatically manage
    subscription lifecycles, handle payments, configure products, and integrate
    subscription functionality into your applications.
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://subscription-admin.appstle.com
security: []
tags:
  - description: >-
      Core APIs for managing the complete subscription lifecycle including
      creation, updates, pausing, resuming, and cancellation of subscriptions.
    name: Subscription Management
  - description: >-
      APIs for managing subscription payment methods, processing payments,
      handling payment retries, and updating billing information.
    name: Subscription Payments
  - description: >-
      APIs for managing subscription contracts including delivery schedules,
      pricing, order notes, billing cycles, and shipping addresses.
    name: Subscription Contracts
  - description: >-
      APIs for managing products within subscriptions including adding,
      removing, updating quantities, and swapping products.
    name: Subscription Products
  - description: >-
      APIs for handling billing operations, payment processing, and financial
      transactions related to subscriptions.
    name: Billing & Payments
  - description: >-
      APIs for managing discounts and promotional codes applied to
      subscriptions.
    name: Subscription Discounts
  - 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 managing subscription plans, pricing tiers, and plan
      configurations.
    name: Subscription Plans
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing the product catalog including product information,
      variants, and inventory.
    name: Product Catalog
  - description: >-
      APIs for managing operational settings, configurations, and administrative
      functions.
    name: Operations & Settings
  - description: >-
      APIs powering the customer-facing portal where subscribers can manage
      their own subscriptions.
    name: Customer Portal
  - description: APIs for managing customer information, profiles, and account details.
    name: Customers
  - description: >-
      APIs for retrieving aggregated subscription data, customer subscription
      history, and account-level subscription information.
    name: Subscription Data
  - description: >-
      APIs for managing delivery profiles, shipping rates, free shipping
      configuration, and delivery method options on subscriptions.
    name: Delivery & Shipping
  - description: >-
      APIs for managing storefront customization including custom CSS, theme
      settings, label translations, and merchant-defined widget configuration.
    name: Customization
  - description: >-
      APIs for configuring cancellation flows, retention offers, cancellation
      reason management, and win-back automation.
    name: Customer Retention
paths:
  /api/external/v2/bulk-automations/hide-subscriptions:
    post:
      tags:
        - Operations & Settings
      summary: Hide subscriptions in bulk
      description: >-
        Hides multiple subscription contracts from customer view in bulk. This
        operation allows merchants to quickly hide subscriptions from appearing
        in the customer portal without canceling or deleting them.


        **What Does 'Hide' Mean?**

        Hiding a subscription makes it invisible to customers in their customer
        portal while keeping the subscription data intact. The subscription is
        not deleted or canceled - it's simply hidden from the customer's view.
        This is useful for:

        - Temporarily removing subscriptions from customer access

        - Managing test or dummy subscriptions

        - Handling subscription disputes or issues

        - Preparing subscriptions for migration or cleanup


        **Key Features:**

        - **Bulk Operation**: Process multiple subscriptions in a single request

        - **Non-Destructive**: Subscriptions are hidden, not deleted

        - **Reversible**: Hidden subscriptions can be unhidden later

        - **Asynchronous Processing**: Large batches are processed in the
        background

        - **Conflict Detection**: Prevents multiple simultaneous bulk operations


        **Operation Modes:**

        1. **Specific Subscriptions**: Provide a list of subscription contract
        IDs to hide

        2. **All Subscriptions**: Set allSubscriptions=true to hide all active
        subscriptions (use with caution)


        **How It Works:**

        1. Submit a request with subscription IDs or allSubscriptions flag

        2. System validates the subscription IDs belong to your shop

        3. A bulk automation task is created and queued

        4. Each subscription is marked as hidden

        5. Subscriptions disappear from customer portal immediately

        6. Subscriptions remain in merchant admin for management


        **Request Body Structure:**

        ```json

        {
          "subscriptionIds": [
            "gid://shopify/SubscriptionContract/123456",
            "gid://shopify/SubscriptionContract/123457",
            "gid://shopify/SubscriptionContract/123458"
          ]
        }

        ```


        **Use Cases:**

        - **Subscription Cleanup**: Hide test or duplicate subscriptions created
        during setup

        - **Customer Service**: Temporarily hide problematic subscriptions while
        resolving issues

        - **Migration Preparation**: Hide old subscriptions before migrating to
        new plans

        - **Dispute Management**: Hide subscriptions involved in billing
        disputes

        - **Seasonal Management**: Hide seasonal subscriptions during off-season

        - **Batch Processing**: Clean up subscriptions that meet certain
        criteria


        **Important Notes:**

        - Only one bulk operation can run at a time per shop

        - If a bulk operation is already in progress, the request will fail with
        400 error

        - Subscription IDs must be in Shopify GraphQL ID format
        (gid://shopify/SubscriptionContract/xxxxx)

        - Hidden subscriptions stop appearing in customer portal but remain
        active for billing

        - You can unhide subscriptions later through the admin interface

        - Using allSubscriptions=true will hide ALL subscriptions - use with
        extreme caution


        **Processing Time:**

        - Small batches (<100): Usually complete within seconds

        - Medium batches (100-1000): May take 1-2 minutes

        - Large batches (>1000): May take several minutes to hours

        - Progress can be tracked through the bulk automation status endpoint


        **Best Practices:**

        - Always specify exact subscription IDs rather than using
        allSubscriptions=true

        - Test with a small batch first before processing large numbers

        - Keep track of hidden subscription IDs for future reference

        - Document the reason for hiding subscriptions for audit purposes

        - Monitor bulk operation status to ensure completion

        - Consider notifying customers before hiding their subscriptions


        **Workflow Example:**

        1. Identify subscriptions to hide (e.g., test subscriptions with
        specific tags)

        2. Extract their subscription contract IDs

        3. Call this endpoint with the list of IDs

        4. Verify 204 No Content response indicating successful queue

        5. Monitor processing status through admin or status endpoint

        6. Confirm subscriptions are hidden from customer portal


        **Error Scenarios:**

        - Another bulk operation is running: 400 error with message about
        operation in progress

        - Invalid subscription IDs: Silently skips invalid IDs, processes valid
        ones

        - Unauthorized subscription access: Only subscriptions belonging to your
        shop are processed

        - Empty subscription list: Operation completes successfully with no
        action


        **Authentication:** Requires valid api_key parameter (X-API-Key header
        support coming soon)
      operationId: hideSubscriptionsV2
      parameters:
        - description: Your API Key
          in: query
          name: api_key
          required: true
          schema:
            type: string
        - description: allSubscriptions
          in: query
          name: allSubscriptions
          required: false
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionContractIdsWrapper'
        required: true
      responses:
        '204':
          content:
            application/json:
              examples:
                Success Response:
                  description: Success Response
                  value: {}
          description: >-
            Bulk hide operation successfully queued and initiated. Subscriptions
            will be hidden asynchronously.
        '400':
          content:
            application/json:
              examples:
                Invalid Request Body:
                  description: Invalid Request Body
                  value:
                    detail: Request body must contain valid subscription contract IDs
                    status: 400
                    title: Invalid subscription IDs
                    type: https://example.com/errors/bad-request
                Operation Already Running:
                  description: Operation Already Running
                  value:
                    detail: >-
                      UserGeneratedError: Bulk request for current shop is
                      already in progress
                    entityName: bulkAutomation
                    status: 400
                    title: Bulk operation in progress
                    type: https://example.com/errors/bad-request
          description: >-
            Bad request - bulk operation already in progress or invalid
            parameters
        '401':
          content:
            application/json:
              example:
                detail: Valid api_key parameter is required
                status: 401
                title: Authentication required
                type: https://example.com/errors/unauthorized
          description: Authentication required - Missing or invalid API key
        '403':
          content:
            application/json:
              example:
                detail: API key does not have permission to hide subscriptions
                status: 403
                title: Insufficient permissions
                type: https://example.com/errors/forbidden
          description: Insufficient permissions to perform bulk hide operations
        '500':
          content:
            application/json:
              example:
                detail: >-
                  An unexpected error occurred while initiating the bulk hide
                  operation
                status: 500
                title: Internal server error
                type: https://example.com/errors/internal-server-error
          description: Internal server error during bulk operation initialization
components:
  schemas:
    SubscriptionContractIdsWrapper:
      properties:
        subscriptionIds:
          type: string
      type: object

````