> ## 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 a specific product swap by ID

> Retrieves detailed information about a specific product swap automation configuration. This endpoint returns complete details about the source products, destination products, swap triggers, and all associated settings.

**Response Details:**
- Complete swap configuration
- Source product variants with images and quantities
- Destination product variants with images and quantities
- Billing cycle triggers and conditions
- Discount carry-forward settings
- Email notification preferences
- Swap status and history

**Source and Destination Variants:**
Both source and destination variants are returned as JSON strings containing:
- Variant ID
- Display name/title
- Product image URL
- Quantity to swap
- Product metadata

**Swap Timing:**
- **forBillingCycle**: If set, swap occurs at this specific cycle number
- **checkForEveryRecurringOrder**: If true, swap happens on every order
- **updatedFirstOrder**: If true, can affect the initial subscription order

**Discount Handling:**
- **NONE**: No discount carried forward
- **PERCENTAGE**: Percentage discount is maintained
- **FIXED_AMOUNT**: Fixed amount discount is maintained
- **PRICE**: Specific price point is maintained

**Authentication:** Requires valid X-API-Key header



## OpenAPI

````yaml /subscription/admin-api-swagger.json get /api/external/v2/product-swaps/{id}
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/product-swaps/{id}:
    get:
      tags:
        - Product Catalog
      summary: Get a specific product swap by ID
      description: >-
        Retrieves detailed information about a specific product swap automation
        configuration. This endpoint returns complete details about the source
        products, destination products, swap triggers, and all associated
        settings.


        **Response Details:**

        - Complete swap configuration

        - Source product variants with images and quantities

        - Destination product variants with images and quantities

        - Billing cycle triggers and conditions

        - Discount carry-forward settings

        - Email notification preferences

        - Swap status and history


        **Source and Destination Variants:**

        Both source and destination variants are returned as JSON strings
        containing:

        - Variant ID

        - Display name/title

        - Product image URL

        - Quantity to swap

        - Product metadata


        **Swap Timing:**

        - **forBillingCycle**: If set, swap occurs at this specific cycle number

        - **checkForEveryRecurringOrder**: If true, swap happens on every order

        - **updatedFirstOrder**: If true, can affect the initial subscription
        order


        **Discount Handling:**

        - **NONE**: No discount carried forward

        - **PERCENTAGE**: Percentage discount is maintained

        - **FIXED_AMOUNT**: Fixed amount discount is maintained

        - **PRICE**: Specific price point is maintained


        **Authentication:** Requires valid X-API-Key header
      operationId: getProductSwap
      parameters:
        - in: header
          name: X-API-Key
          required: false
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                Success Response:
                  description: Success Response
                  value:
                    active: true
                    carryDiscountForward: true
                    checkForEveryRecurringOrder: false
                    contractsAffected: 145
                    createdAt: '2024-01-15T10:30:00Z'
                    description: Automatically swap to seasonal blend at cycle 4
                    destinationVariants: >-
                      [{"id":67890,"displayName":"Fall Blend Coffee -
                      12oz","imageSrc":"https://cdn.shopify.com/files/1/0000/0000/products/fall-blend.jpg","quantity":2,"price":"29.99"}]
                    discountCarryForward: PERCENTAGE
                    forBillingCycle: 4
                    id: 10782
                    name: Seasonal Coffee Rotation
                    shop: example-shop.myshopify.com
                    sourceVariants: >-
                      [{"id":12345,"displayName":"Summer Blend Coffee -
                      12oz","imageSrc":"https://cdn.shopify.com/files/1/0000/0000/products/summer-blend.jpg","quantity":2,"price":"29.99"}]
                    stopSwapEmails: false
                    updatedAt: '2024-01-15T10:30:00Z'
                    updatedFirstOrder: false
              schema:
                $ref: '#/components/schemas/ProductSwapDTO'
          description: Product swap successfully retrieved
        '400':
          content:
            application/json:
              example:
                detail: Product swap does not belong to this shop
                status: 400
                title: Invalid id
                type: https://example.com/errors/bad-request
          description: Invalid product swap ID
        '401':
          content:
            application/json:
              example:
                detail: Valid X-API-Key header is required
                status: 401
                title: Authentication required
                type: https://example.com/errors/unauthorized
          description: Authentication required
        '403':
          content:
            application/json:
              example:
                detail: API key does not have permission to view product swaps
                status: 403
                title: Insufficient permissions
                type: https://example.com/errors/forbidden
          description: Insufficient permissions to view product swap
        '404':
          content:
            application/json:
              example:
                detail: Product swap with ID 10782 not found
                status: 404
                title: Resource not found
                type: https://example.com/errors/not-found
          description: Product swap not found
components:
  schemas:
    ProductSwapDTO:
      properties:
        carryDiscountForward:
          type: boolean
        changeNextOrderDateBy:
          format: int32
          type: integer
        checkForEveryRecurringOrder:
          type: boolean
        destinationVariants:
          type: string
        discountCarryForward:
          enum:
            - NONE
            - EXISTING_PLAN
            - PRODUCT_PLAN
            - PRODUCT_THEN_EXISTING
          type: string
        forBillingCycle:
          format: int32
          type: integer
        id:
          format: int64
          type: integer
        name:
          type: string
        ruleSequence:
          format: int32
          type: integer
        shop:
          type: string
        sourceVariants:
          type: string
        stopSwapEmails:
          type: boolean
        updatedFirstOrder:
          type: boolean
      required:
        - shop
      type: object

````