openapi: 3.0.1
info:
  title: Customer Portal APIs
  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.
  version: 0.0.1
servers:
  - url: https://www.myshop.com/apps
tags:
  - name: Customer Portal
    description: >-
      Core customer portal APIs for managing customer account settings,
      authentication, and portal configurations.
  - name: Subscription Management
    description: >-
      APIs for customers to view and manage their subscription contracts
      including status updates, frequency changes, and cancellations.
  - name: Billing & Payments
    description: >-
      APIs for managing payment methods, billing information, and processing
      subscription payments.
  - name: Product Catalog
    description: >-
      APIs for retrieving product information, selling plans, variant data, and
      subscription-enabled products available to customers.
  - name: Delivery & Shipping
    description: >-
      APIs for managing delivery schedules, shipping addresses, delivery
      methods, and tracking order status.
  - name: Customer Retention
    description: >-
      APIs for handling subscription cancellations, retention activities, and
      customer feedback management.
  - name: Loyalty Integration
    description: >-
      APIs for integrating loyalty programs with subscriptions including points
      redemption and earning options.
  - name: Customization
    description: >-
      APIs for accessing portal customization settings, translations, and theme
      configurations.
paths:
  /subscriptions/cp/api/update-contract-order-note/{contractId}:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateSubscriptionContractOrderNote
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: orderNote
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContractDetailsDTO'
  /subscriptions/cp/api/v2/subscription-contracts-add-sectioned-line-item/{contractId}:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: addSectionedLineItem
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SectionedBundleRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: object
  /subscriptions/cp/api/v2/subscription-contracts-add-line-item:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: addLineItem
      parameters:
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: quantity
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: variantId
          in: query
          required: false
          schema:
            type: string
        - name: isOneTimeProduct
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/update-classic-bab-subscription/{contractId}:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateLineItemQuantity
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UpdateClassicBABSubscription'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts/sync-shipping-price/{contractId}:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: mayBeUpdateShippingPricing
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
  /subscriptions/cp/api/subscription-contracts-update-status:
    put:
      tags:
        - Subscription Management
      summary: Update subscription contract status
      description: >-
        Updates the status of a subscription contract to ACTIVE, PAUSED, or
        CANCELLED. This endpoint manages the lifecycle of subscriptions with
        automatic state tracking and notifications.


        **Status Transitions:**

        - **ACTIVE**: Resumes a paused subscription, enabling future billing and
        deliveries

        - **PAUSED**: Temporarily suspends all billing and deliveries until
        manually resumed

        - **CANCELLED**: Permanently terminates the subscription (irreversible)


        **Key Features:**

        - Validates status transitions (prevents same-status updates)

        - Tracks status change timestamps for audit trails

        - Sends automated email notifications to customers

        - Creates detailed activity logs for each status change

        - Handles concurrent modifications with automatic retry

        - Adjusts next billing date when resuming subscriptions


        **Permission Requirements (Customer Portal):**

        When called from customer portal context:

        - PAUSED status requires 'pauseResumeSub' permission

        - ACTIVE status (resuming) requires 'resumeSub' permission  

        - CANCELLED status requires 'cancelSub' permission

        - External API calls bypass these permission checks


        **Status Change Side Effects:**

        - **Activating**: Recalculates next billing date, marks activation
        timestamp

        - **Pausing**: Stops all scheduled orders, marks pause timestamp

        - **Cancelling**: Terminates subscription permanently, marks
        cancellation timestamp


        **Error Recovery:**

        The system automatically handles:

        - Invalid discount codes by removing them and retrying

        - Concurrent modifications by retrying the operation

        - This ensures reliable status updates in production environments


        **Important Notes:**

        - Status values are case-insensitive

        - Cancelled subscriptions cannot be reactivated

        - Paused subscriptions retain all settings and can be resumed

        - Email notifications are sent automatically unless internally
        suppressed


        **Authentication:** Requires valid X-API-Key header
      operationId: updateStatus
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: status
          in: query
          required: true
          schema:
            type: string
        - name: pauseDurationCycle
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pauseFeedback
          in: query
          required: false
          schema:
            type: string
        - name: pauseReason
          in: query
          required: false
          schema:
            type: string
      responses:
        '204':
          description: Status successfully updated - No content returned
          headers:
            X-Alert:
              description: Success message
              style: simple
              schema:
                type: string
                example: Subscription Updated
          content:
            '*/*':
              schema:
                type: string
        '400':
          description: Invalid request parameters or business rule violation
          content:
            application/json:
              examples:
                Invalid Status Value:
                  description: Invalid Status Value
                  value:
                    type: https://example.com/errors/bad-request
                    title: UserGeneratedError:Invalid subscription status
                    status: 400
                    detail: 'Status must be one of: ACTIVE, PAUSED, CANCELLED'
                Same Status Update:
                  description: Same Status Update
                  value:
                    type: https://example.com/errors/bad-request
                    title: Contract already in same status
                    status: 400
                    detail: Subscription is already ACTIVE. No update needed.
                Contract Not Found:
                  description: Contract Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: No contract found for status update
                    status: 400
                    detail: Subscription contract with ID 123456789 not found
                Invalid Contract ID:
                  description: Invalid Contract ID
                  value:
                    type: https://example.com/errors/bad-request
                    title: Invalid contract ID
                    status: 400
                    detail: Contract ID must be a positive number
                Reactivate Cancelled Subscription:
                  description: Reactivate Cancelled Subscription
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Cannot reactivate cancelled
                      subscription
                    status: 400
                    detail: >-
                      Cancelled subscriptions cannot be reactivated. Please
                      create a new subscription.
        '401':
          description: Authentication required - missing or invalid API key
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid API key is required to access this endpoint
        '403':
          description: Insufficient permissions to modify subscription status
          content:
            application/json:
              examples:
                API Key Permissions:
                  description: API Key Permissions
                  value:
                    type: https://example.com/errors/forbidden
                    title: Insufficient permissions
                    status: 403
                    detail: >-
                      API key does not have permission to modify subscription
                      contracts
                Customer Portal - Pause Permission:
                  description: Customer Portal - Pause Permission
                  value:
                    type: https://example.com/errors/forbidden
                    title: Customer permission denied
                    status: 403
                    detail: Customer does not have permission to pause subscriptions
        '404':
          description: Subscription contract not found
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: Resource not found
                status: 404
                detail: >-
                  Subscription contract with ID 123456789 not found in the
                  system
        '422':
          description: Unable to process the status update due to Shopify API constraints
          content:
            application/json:
              examples:
                Shopify API Error:
                  description: Shopify API Error
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: UserGeneratedError:Unable to update subscription status
                    status: 422
                    detail: >-
                      Shopify API error: Cannot modify subscription during
                      active billing attempt
                Invalid Discount Code:
                  description: Invalid Discount Code
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: Contract draft discount with title SUMMER20 is invalid
                    status: 422
                    detail: >-
                      Invalid discount code detected. System will automatically
                      remove and retry.
  /subscriptions/cp/api/subscription-contracts-update-shipping-address:
    put:
      tags:
        - Subscription Management
      summary: Update subscription delivery address and method
      description: >-
        Updates the shipping address or delivery method for a subscription
        contract. Supports standard shipping, local delivery, and pickup options
        with comprehensive address validation.


        **Delivery Method Types:**

        - **SHIPPING**: Standard shipping to customer address (default)

        - **LOCAL**: Local delivery within specified zip codes

        - **PICK_UP**: Customer pickup at designated location


        **Key Features:**

        - Zip code restrictions for customer portal access

        - Optional ShipperHQ address validation

        - Automatic phone number handling for local delivery

        - Email notifications to customers

        - Shipping price recalculation

        - Activity log tracking with old/new addresses


        **Zip Code Validation (Customer Portal Only):**

        When called from customer portal:

        - Standard shipping: Validates against 'allowToSpecificZipCode' setting

        - Local delivery: Validates against
        'allowToSpecificZipCodeForLocalDelivery' setting

        - External API calls bypass zip code restrictions


        **Address Validation:**

        - If ShipperHQ is configured, addresses are validated for deliverability

        - Invalid addresses will return appropriate error messages

        - Helps prevent failed deliveries and shipping issues


        **Special Handling:**

        - Local delivery addresses missing phone numbers are auto-populated

        - Uses customer's phone if available, otherwise defaults to placeholder

        - Handles missing address components gracefully


        **Post-Update Actions:**

        - Sends 'SHIPPING_ADDRESS_UPDATED' email to customer

        - Creates activity log with address change details

        - Triggers asynchronous shipping price recalculation

        - May remove invalid discount codes automatically


        **Important Notes:**

        - Province codes should use ISO 3166-2 format (e.g., 'NY' for New York)

        - Country codes should use ISO 3166-1 alpha-2 format (e.g., 'US')

        - Phone numbers should include country code for international addresses

        - Pickup locations must be pre-configured in Shopify


        **Authentication:** Requires valid X-API-Key header
      operationId: updateShippingAddress
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: New shipping address and delivery method details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeShippingAddressVM'
            examples:
              Standard Shipping Address:
                description: Standard Shipping Address
                value:
                  methodType: SHIPPING
                  firstName: John
                  lastName: Doe
                  company: Acme Corp
                  address1: 456 New Street
                  address2: Suite 200
                  city: Los Angeles
                  provinceCode: CA
                  countryCode: US
                  zip: '90001'
                  phone: '+12135551234'
              Local Delivery Address:
                description: Local Delivery Address
                value:
                  methodType: LOCAL
                  firstName: Jane
                  lastName: Smith
                  address1: 789 Local Ave
                  city: Brooklyn
                  provinceCode: NY
                  countryCode: US
                  zip: '11201'
                  phone: '+17185551234'
              Pickup Location:
                description: Pickup Location
                value:
                  methodType: PICK_UP
                  pickupLocationId: gid://shopify/DeliveryLocationGroup/123456
              International Address:
                description: International Address
                value:
                  methodType: SHIPPING
                  firstName: Pierre
                  lastName: Dubois
                  address1: 123 Rue de la Paix
                  city: Paris
                  provinceCode: '75'
                  countryCode: FR
                  zip: '75001'
                  phone: '+33123456789'
        required: true
      responses:
        '200':
          description: Shipping address successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    id: gid://shopify/SubscriptionContract/123456789
                    status: ACTIVE
                    nextBillingDate: '2024-03-01T00:00:00Z'
                    customer:
                      id: gid://shopify/Customer/987654321
                      email: customer@example.com
                    deliveryMethod:
                      __typename: SubscriptionDeliveryMethodShipping
                      address:
                        address1: 456 New Street
                        address2: Suite 200
                        city: Los Angeles
                        provinceCode: CA
                        countryCode: US
                        zip: '90001'
                        firstName: John
                        lastName: Doe
                        company: Acme Corp
                        phone: '+12135551234'
                    deliveryPrice:
                      amount: '7.99'
                      currencyCode: USD
        '400':
          description: Invalid request parameters or business rule violation
          content:
            application/json:
              examples:
                Zip Code Not Allowed:
                  description: Zip Code Not Allowed
                  value:
                    type: https://example.com/errors/bad-request
                    title: 'UserGeneratedError: That zip code is not allowed'
                    status: 400
                    detail: >-
                      Delivery to zip code 12345 is not available for this
                      subscription
                Invalid Address (ShipperHQ):
                  description: Invalid Address (ShipperHQ)
                  value:
                    type: https://example.com/errors/bad-request
                    title: Address validation failed
                    status: 400
                    detail: >-
                      The provided address could not be validated. Please check
                      the address details.
                Missing Required Fields:
                  description: Missing Required Fields
                  value:
                    type: https://example.com/errors/bad-request
                    title: Validation error
                    status: 400
                    detail: 'Required fields missing: address1, city, countryCode'
                Invalid Method Type:
                  description: Invalid Method Type
                  value:
                    type: https://example.com/errors/bad-request
                    title: Invalid delivery method
                    status: 400
                    detail: 'Method type must be one of: SHIPPING, LOCAL, PICK_UP'
                Shop Settings Not Found:
                  description: Shop Settings Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: 'Shop settings not found for shop: example-store'
                    status: 400
                    detail: Store configuration is missing or incomplete
        '401':
          description: Authentication required - missing or invalid API key
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid API key is required to access this endpoint
        '403':
          description: Insufficient permissions to modify subscription
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: >-
                  API key does not have permission to modify subscription
                  contracts
        '404':
          description: Subscription contract not found
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: Resource not found
                status: 404
                detail: Subscription contract with ID 123456789 not found
        '422':
          description: Unable to process the address update due to Shopify API constraints
          content:
            application/json:
              examples:
                Shopify API Error:
                  description: Shopify API Error
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: UserGeneratedError:Unable to update delivery address
                    status: 422
                    detail: >-
                      Shopify API error: Invalid province code for selected
                      country
                Invalid Pickup Location:
                  description: Invalid Pickup Location
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: UserGeneratedError:Pickup location not configured
                    status: 422
                    detail: The specified pickup location is not available
  /subscriptions/cp/api/subscription-contracts-update-payment-method:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updatePaymentMethod
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
  /subscriptions/cp/api/subscription-contracts-update-order-note/{contractId}:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateOrderNote
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: orderNote
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: boolean
  /subscriptions/cp/api/subscription-contracts-update-line-item-quantity:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateLineItemQuantity_1
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: quantity
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: lineId
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-update-line-item-attributes:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateLineItemAttributes
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: lineId
          in: query
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/AttributeInfo'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-update-frequency-by-selling-plan:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateFrequencyBySellingPlan
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: sellingPlanId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-update-existing-payment-method:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateExistingPaymentMethod
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: paymentMethodId
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
  /subscriptions/cp/api/subscription-contracts-update-delivery-method:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateDeliveryMethod
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: delivery-method-title
          in: query
          required: true
          schema:
            type: string
        - name: delivery-method-code
          in: query
          required: true
          schema:
            type: string
        - name: delivery-method-presentment-title
          in: query
          required: true
          schema:
            type: string
        - name: delivery-method-id
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
  /subscriptions/cp/api/subscription-contracts-update-billing-interval:
    put:
      tags:
        - Billing & Payments
      summary: Update billing interval for a subscription contract
      description: >-
        Updates the billing frequency (how often the customer is charged) for a
        subscription contract. This comprehensive operation recalculates billing
        dates, adjusts pricing, updates selling plans, and may also modify
        delivery intervals.


        **Key Features:**

        - Changes billing frequency while maintaining subscription continuity

        - Automatically adjusts delivery interval when linked to billing

        - Recalculates next billing date based on store settings

        - Reprices all line items for the new frequency

        - Finds and applies matching selling plans

        - Handles anchor day adjustments for consistent billing

        - Validates prepaid subscription constraints


        **Billing Interval Types:**

        - **DAY**: Daily billing (use with caution)

        - **WEEK**: Weekly billing (e.g., every 1, 2, 3 weeks)

        - **MONTH**: Monthly billing (e.g., every 1, 2, 3 months)

        - **YEAR**: Annual billing


        **Validation Rules:**

        - Cannot set the same interval as current (no-op prevention)

        - For prepaid subscriptions: billing interval must exceed delivery
        interval

        - Example: Can't bill monthly if delivering weekly (would be paying for
        1 delivery but receiving 4)


        **Next Billing Date Calculation:**

        The system uses sophisticated logic to determine the new billing date:

        1. Starts from current or last successful billing date

        2. Applies store timezone and order time preferences

        3. Ensures date is in the future

        4. Respects day-of-week preferences if configured

        5. May keep current date if 'enableChangeFromNextBillingDate' is false


        **Side Effects:**

        - **Delivery Interval**: Updated if currently equal to billing interval

        - **Line Item Pricing**: Recalculated based on new frequency multiplier

        - **Selling Plans**: Finds and applies best matching plans for products

        - **Anchor Days**: Updates billing anchor for consistent scheduling

        - **Email Notifications**: Sends 'ORDER_FREQUENCY_UPDATED' to customer

        - **Activity Logs**: Records both billing and delivery changes


        **Prepaid vs Pay-Per-Delivery:**

        - Pay-per-delivery: Billing and delivery intervals typically match

        - Prepaid: Customer pays upfront for multiple deliveries

        - This endpoint enforces prepaid logic to prevent undercharging


        **Authentication:** Requires valid X-API-Key header
      operationId: updateBillingInterval
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: intervalCount
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: interval
          in: query
          required: true
          schema:
            type: string
            enum:
              - DAY
              - WEEK
              - MONTH
              - YEAR
              - $UNKNOWN
      responses:
        '200':
          description: Billing interval updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    id: gid://shopify/SubscriptionContract/123456789
                    status: ACTIVE
                    nextBillingDate: '2024-04-01T12:00:00Z'
                    customer:
                      id: gid://shopify/Customer/987654321
                      email: customer@example.com
                    billingPolicy:
                      interval: MONTH
                      intervalCount: 2
                      anchors:
                        - type: MONTHDAY
                          day: 1
                    deliveryPolicy:
                      interval: MONTH
                      intervalCount: 2
                    lines:
                      edges:
                        - node:
                            id: gid://shopify/SubscriptionLine/111111
                            quantity: 1
                            variantId: gid://shopify/ProductVariant/42549172011164
                            currentPrice:
                              amount: '59.98'
                              currencyCode: USD
                            sellingPlanId: gid://shopify/SellingPlan/222222
                            sellingPlanName: Deliver every 2 months
                            pricingPolicy:
                              basePrice:
                                amount: '29.99'
                                currencyCode: USD
        '400':
          description: Invalid request parameters or business rule violation
          content:
            application/json:
              examples:
                Same Interval Error:
                  description: Same Interval Error
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Billing interval cannot be the same as
                      old billing interval
                    status: 400
                    detail: The subscription is already set to bill every 1 month
                Prepaid Validation Error:
                  description: Prepaid Validation Error
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Billing interval cannot be less than or
                      equal to delivery interval for prepaid contracts
                    status: 400
                    detail: >-
                      Cannot bill monthly for weekly deliveries in prepaid
                      subscriptions
                Invalid Interval Count:
                  description: Invalid Interval Count
                  value:
                    type: https://example.com/errors/bad-request
                    title: Invalid interval count
                    status: 400
                    detail: Interval count must be between 1 and 365
                Invalid Interval Type:
                  description: Invalid Interval Type
                  value:
                    type: https://example.com/errors/bad-request
                    title: Invalid interval type
                    status: 400
                    detail: 'Interval must be one of: DAY, WEEK, MONTH, YEAR'
                Contract Not Found:
                  description: Contract Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: Subscription contract not found
                    status: 400
                    detail: No subscription contract found with ID 123456789
        '401':
          description: Authentication required - missing or invalid API key
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid API key is required to access this endpoint
        '403':
          description: Insufficient permissions to update billing interval
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: >-
                  API key does not have permission to modify subscription
                  contracts
        '404':
          description: Subscription contract not found
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: Resource not found
                status: 404
                detail: Subscription contract with ID 123456789 not found
        '422':
          description: Billing interval update failed due to Shopify constraints
          content:
            application/json:
              examples:
                No Matching Selling Plan:
                  description: No Matching Selling Plan
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: No selling plan available
                    status: 422
                    detail: No selling plan found for the requested billing frequency
                Shopify API Error:
                  description: Shopify API Error
                  value:
                    type: https://example.com/errors/unprocessable-entity
                    title: Unable to update billing interval
                    status: 422
                    detail: >-
                      Shopify API error: Cannot modify subscription during
                      active billing attempt
  /subscriptions/cp/api/subscription-contracts-update-billing-date:
    put:
      tags:
        - Billing & Payments
      summary: Update next billing date for a subscription contract
      description: >-
        Reschedules the next billing date for an active subscription contract.
        This endpoint allows you to change when the next order will be created
        and processed.


        **Key Features:**

        - Updates the next billing date to the specified date

        - Optionally reschedules all future orders based on the new date

        - Syncs the updated date to Shopify

        - Sends confirmation email to customer


        **The rescheduleFutureOrder Parameter:**

        - **true** (default): Updates the next billing date AND recalculates all
        future queued orders based on the new date. Use this to shift the entire
        billing schedule.

        - **false**: Only updates the next billing date. Other queued orders
        remain unchanged. Use this for one-time date adjustments.


        **Important Notes:**

        - The new date must be in the future (with 10 minute grace period)

        - Date is validated against the shop's timezone

        - If anchor days are configured, future orders may align to those
        anchors


        **Process Flow:**

        1. Validates the contract exists and belongs to the shop

        2. Validates the new date is not in the past

        3. Updates the billing attempt to the new date

        4. Syncs the updated nextBillingDate to Shopify

        5. If rescheduleFutureOrder=true, regenerates the queue from the new
        date

        6. Sends confirmation email to customer

        7. Records activity log entry


        **Date Format:**

        - Must be ISO 8601 format with timezone

        - Examples: `2024-03-15T12:00:00Z`, `2024-03-15T12:00:00+05:30`

        - URL encode the date when passing as query parameter


        **Timezone Handling:**

        - The provided date is used as-is for the billing attempt

        - Validation (past date check) uses the shop's configured timezone

        - All dates in the response are in UTC (Z suffix)


        **Date Restrictions (Customer Portal Only):**

        When called from customer portal context:

        - Minimum days from today (skipDaysFromCurrentDate setting)

        - Maximum days from today (billingDateRestrictToDays setting)

        - External API calls bypass these restrictions


        **Authentication:** Requires valid X-API-Key header
      operationId: updateNextBillingDate
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: nextBillingDate
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: rescheduleFutureOrder
          in: query
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: >-
            Billing date successfully updated. The response contains the updated
            subscription contract from Shopify with the new nextBillingDate.
          headers:
            X-Application-Context:
              description: Application context with alert message
              style: simple
              schema:
                type: string
                example: 'appname:Subscription Updated:'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    __typename: SubscriptionContract
                    id: gid://shopify/SubscriptionContract/123456789
                    status: ACTIVE
                    nextBillingDate: '2024-03-15T12:00:00Z'
                    updatedAt: '2024-02-15T10:30:00Z'
                    billingPolicy:
                      interval: MONTH
                      intervalCount: 1
                    customer:
                      email: customer@example.com
                      displayName: John Doe
        '400':
          description: Invalid request or date validation failed
          content:
            application/json:
              examples:
                Date in Past:
                  summary: Billing date cannot be in the past
                  description: Date in Past
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      The billing date you are trying to set
                      (2024-01-01T00:00:00Z) is in the past. Billing dates
                      cannot be updated to a time that has already passed.
                      Please select a future billing date.
                    status: 400
                    detail: The billing date must be a future date
                    instance: >-
                      /api/external/v2/subscription-contracts-update-billing-date
                Date Outside Allowed Range:
                  summary: Customer portal date restrictions
                  description: Date Outside Allowed Range
                  value:
                    type: https://example.com/errors/bad-request
                    title: Can't reschedule on this 2024-12-31T00:00:00Z
                    status: 400
                    detail: >-
                      The selected date is outside the allowed range for
                      rescheduling
                    instance: >-
                      /api/external/v2/subscription-contracts-update-billing-date
                Contract Not Found:
                  summary: Invalid contract ID
                  description: Contract Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: Contract does not exist
                    status: 400
                    detail: No subscription contract found with the specified ID
                    instance: >-
                      /api/external/v2/subscription-contracts-update-billing-date
                Invalid Date Format:
                  summary: Date must be ISO 8601 format
                  description: Invalid Date Format
                  value:
                    type: https://example.com/errors/bad-request
                    title: Invalid date format
                    status: 400
                    detail: >-
                      Date must be in ISO 8601 format with timezone (e.g.,
                      2024-03-15T12:00:00Z or 2024-03-15T12:00:00+05:30)
                    instance: >-
                      /api/external/v2/subscription-contracts-update-billing-date
                Shopify API Error:
                  summary: Failed to sync with Shopify
                  description: Shopify API Error
                  value:
                    type: https://example.com/errors/bad-request
                    title: UserGeneratedError:Unable to update billing date
                    status: 400
                    detail: >-
                      Shopify returned an error when attempting to update the
                      billing date
                    instance: >-
                      /api/external/v2/subscription-contracts-update-billing-date
        '401':
          description: Authentication required
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid X-API-Key header is required
                instance: /api/external/v2/subscription-contracts-update-billing-date
        '403':
          description: Insufficient permissions to update billing date
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: >-
                  API key does not have permission to modify subscription
                  contracts
                instance: /api/external/v2/subscription-contracts-update-billing-date
        '404':
          description: Subscription contract not found
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: Resource not found
                status: 404
                detail: >-
                  Subscription contract with the specified ID not found in the
                  system
                instance: /api/external/v2/subscription-contracts-update-billing-date
  /subscriptions/cp/api/subscription-contracts-remove-line-item:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: removeLineItem
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: lineId
          in: query
          required: true
          schema:
            type: string
        - name: removeDiscount
          in: query
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-remove-discount:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: removeDiscount
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: discountCode
          in: query
          required: false
          schema:
            type: string
        - name: customerId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: discountId
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-product-custom-attributes:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateSubscriptionContractProductLineItemAttribute
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: lineId
          in: query
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/AttributeInfo'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-freeze-status-detail:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: subscriptionContractFreezeStatusDetails
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FreezeStatusWrapper'
  /subscriptions/cp/api/subscription-contracts-cancellation-discount:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: addCancellationDiscount
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: feedback
          in: query
          required: false
          schema:
            type: string
        - name: cancellationReason
          in: query
          required: false
          schema:
            type: string
        - name: eventSource
          in: query
          required: false
          schema:
            type: string
            enum:
              - PAUSE
              - CANCELLATION
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-apply-discount:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: applyDiscountCode
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: discountCode
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contract-one-offs-update-quantity:
    put:
      tags:
        - subscription-contract-one-off-resource
      operationId: updateOneOffQuantity
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: billingAttemptId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: variantId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: quantity
          in: query
          required: true
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
  /subscriptions/cp/api/subscription-contract-one-offs-by-contractId-and-billing-attempt-id:
    put:
      tags:
        - subscription-contract-one-off-resource
      operationId: saveOneOffBy
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: billingAttemptId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: variantId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: variantHandle
          in: query
          required: true
          schema:
            type: string
        - name: quantity
          in: query
          required: false
          schema:
            type: integer
            format: int32
            default: 1
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
    delete:
      tags:
        - subscription-contract-one-off-resource
      description: Delete One-time Product from Customer Portal
      operationId: deleteOneOff
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: billingAttemptId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: variantId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
  /subscriptions/cp/api/subscription-contract-details/swap-bab-product:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: swapBABProduct
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapSingleBABProduct'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contract-details/subscription-fulfillment/reschedule:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: rescheduleOrderFulfillment
      parameters:
        - name: fulfillmentId
          in: query
          required: true
          schema:
            type: string
        - name: deliveryDate
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
  /subscriptions/cp/api/subscription-contract-details:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: updateSubscriptionContractDetails
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionContractDetailsDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContractDetailsDTO'
  /subscriptions/cp/api/subscription-billing-attempts/unskip-order/{id}:
    put:
      tags:
        - Billing & Payments
      summary: Unskip a previously skipped order
      description: >-
        Reverses a skip action on a billing attempt. The order will be restored
        to QUEUED status and will be processed on its scheduled date.


        **Important Notes:**

        - Only works on billing attempts with SKIPPED status

        - Must be done before the scheduled billing date

        - Cannot unskip after the billing date has passed

        - Activity logs are created for audit trail


        **Use Cases:**

        - Customer changes their mind about skipping

        - Correct accidental skip actions

        - Restore delivery after resolving temporary issue


        **Authentication:** Requires valid X-API-Key header
      operationId: unSkipOrder
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: subscriptionContractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Order successfully unskipped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Cannot unskip - not in SKIPPED status or date passed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/skip-upcoming-order:
    put:
      tags:
        - Billing & Payments
      summary: Skip the next upcoming order for a subscription
      description: >-
        Skips the next scheduled billing attempt for a subscription contract
        without requiring the billing attempt ID. Automatically finds and skips
        the earliest QUEUED billing attempt.


        **Convenience Feature:**

        - No need to know the specific billing attempt ID

        - Automatically finds the next order

        - Ideal for "skip next order" functionality in customer portals


        **Use Cases:**

        - Simple "skip next delivery" button in customer portal

        - Quick skip without looking up billing attempt details

        - One-click skip functionality


        **Authentication:** Requires valid X-API-Key header
      operationId: skipFirstUpcomingOrder
      parameters:
        - name: subscriptionContractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Next order successfully skipped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: No queued billing attempts found
          content:
            application/json:
              example:
                type: https://example.com/errors/bad-request
                title: No upcoming orders
                status: 400
                detail: No queued billing attempts found for this subscription
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/skip-order/{id}:
    put:
      tags:
        - Billing & Payments
      summary: Skip a specific order
      description: >-
        Skips a specific billing attempt by ID. The order will not be processed
        on its scheduled date. This is useful when customers want to skip a
        particular delivery without canceling their subscription.


        **Important Behaviors:**

        - Only QUEUED billing attempts can be skipped

        - Skipped orders remain in the system with SKIPPED status

        - Future orders are not affected

        - Can be unskipped before the scheduled date if needed

        - Activity logs are created for audit trail


        **Use Cases:**

        - Customer is on vacation

        - Customer has excess inventory

        - Temporary delivery pause for one cycle


        **Authentication:** Requires valid X-API-Key header
      operationId: skipOrder
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: subscriptionContractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: isCancellationFlow
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: skipCycle
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: isPrepaid
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Order successfully skipped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Cannot skip order - already processed or invalid status
          content:
            application/json:
              example:
                type: https://example.com/errors/bad-request
                title: Cannot skip order
                status: 400
                detail: Billing attempt is not in QUEUED status
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/skip-failed-order:
    put:
      tags:
        - subscription-billing-attempt-resource
      operationId: skipFailedOrder
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/retry-failed-billing-attempt:
    put:
      tags:
        - subscription-billing-attempt-resource
      operationId: retryFailedBillingAttempt
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: boolean
  /subscriptions/cp/api/subscription-billing-attempts/reschedule-order/{id}:
    put:
      tags:
        - Billing & Payments
      summary: Reschedule a billing attempt to a new date
      description: >-
        Changes the scheduled billing date for a billing attempt. This allows
        customers to adjust when their next order will be processed.


        **Rescheduling Options:**

        - Move to earlier date (if allowed by shop settings)

        - Move to later date

        - Optionally reschedule all future orders by the same offset


        **Important Behaviors:**

        - Only QUEUED billing attempts can be rescheduled

        - New date must be in the future

        - Can affect future billing schedule if rescheduleFutureOrder is true

        - Activity logs are created for audit trail


        **Use Cases:**

        - Customer wants to delay next delivery

        - Customer wants to receive order earlier

        - Adjust delivery schedule to align with customer needs

        - Coordinate deliveries with customer vacation/travel


        **Authentication:** Requires valid X-API-Key header
      operationId: rescheduleOrder
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: rescheduleFutureOrder
          in: query
          required: true
          schema:
            type: boolean
        - name: billingDate
          in: query
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Order successfully rescheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Invalid date or cannot reschedule
          content:
            application/json:
              example:
                type: https://example.com/errors/bad-request
                title: Invalid reschedule date
                status: 400
                detail: New billing date must be in the future
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/refund-fulfillment/{id}:
    put:
      tags:
        - Customer Portal
      summary: Process refund for subscription order
      description: >-
        Processes a refund for a fulfilled subscription order. This creates a
        refund in Shopify and returns the money to the customer's original
        payment method.


        **What it does:**

        1. Validates order is eligible for refund (fulfilled, not already
        refunded)

        2. Creates refund transaction in Shopify

        3. Processes refund with payment gateway

        4. Updates order status to 'Refunded'

        5. Sends refund confirmation email to customer

        6. Logs refund activity


        **Refund Eligibility:**

        - Order must be fulfilled

        - Cannot already be refunded

        - Must be within merchant's refund policy window

        - Payment gateway must support refunds


        **Refund Processing:**

        - Refund is processed to original payment method

        - Takes 5-10 business days to appear in customer's account

        - Processing fees are typically not refunded

        - Partial refunds are supported (if configured)


        **Important Warnings:**

        - This action cannot be undone

        - Refunded orders cannot be un-refunded

        - Inventory is restocked automatically

        - Refunds may incur gateway fees


        **Authentication:** Customer must be logged in and own the subscription
      operationId: refundFulfillment
      parameters:
        - name: id
          in: path
          description: Billing attempt ID to refund
          required: true
          schema:
            type: integer
            format: int64
        - name: subscriptionContractId
          in: query
          description: Subscription contract ID for validation
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Refund processed successfully
          content:
            application/json:
              example:
                success: true
                refundId: '123456'
                refundAmount: 44.49
                message: >-
                  Refund processed successfully. Amount will appear in 5-10
                  business days.
        '400':
          description: Order cannot be refunded or refund failed
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
        '401':
          description: Customer not logged in or doesn't own this subscription
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
  /subscriptions/cp/api/subscription-billing-attempts/fix-billing-attempt-in-progress/{id}:
    put:
      tags:
        - subscription-billing-attempt-resource
      operationId: fixBillingAttemptInProgress
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: string
  /subscriptions/cp/api/subscription-billing-attempts/attempt-billing/{id}:
    put:
      tags:
        - Billing & Payments
      summary: Trigger immediate billing for an order
      description: >-
        Immediately processes a billing attempt, creating an order in Shopify.
        This bypasses the scheduled billing date and processes the order right
        away.


        **Important Notes:**

        - Requires shop permission 'enableImmediatePlaceOrder'

        - Only QUEUED billing attempts can be processed

        - Creates an actual order in Shopify

        - Charges the customer's payment method immediately

        - Cannot be undone once processed


        **Use Cases:**

        - Customer requests early delivery

        - Process order immediately after resolving payment issue

        - Manual order processing for special cases


        **Authentication:** Requires valid X-API-Key header and shop permission
      operationId: attemptBilling
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Billing processed successfully
          content:
            '*/*':
              schema:
                type: boolean
        '400':
          description: Cannot process billing - invalid status
          content:
            '*/*':
              schema:
                type: boolean
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                type: boolean
        '403':
          description: Shop does not have permission to place immediate orders
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Permission denied
                status: 403
                detail: Shop does not have enableImmediatePlaceOrder permission
  /subscriptions/cp/api/subscription-billing-attempts:
    put:
      tags:
        - Billing & Payments
      summary: Update subscription billing attempt
      description: >-
        Updates an existing subscription billing attempt. This endpoint allows
        modification of billing attempt details such as billing date, order
        note, and other attributes.


        **Important Notes:**

        - Only QUEUED billing attempts can be updated

        - Cannot update attempts that are already processed or failed

        - Billing attempt must belong to the authenticated shop


        **Authentication:** Requires valid X-API-Key header
      operationId: updateSubscriptionBillingAttempt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        required: true
      responses:
        '200':
          description: Billing attempt successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Invalid request or billing attempt cannot be updated
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/skip-unskip-subscription-contracts-product:
    put:
      tags:
        - subscription-contract-details-put-resource
      operationId: skipAndUnSkipProductLineItem
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: lineId
          in: query
          required: true
          schema:
            type: string
        - name: isSkip
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/update-custom-note-attributes:
    post:
      tags:
        - Subscription Management
      summary: Update custom attributes on a subscription contract
      description: >-
        Updates or replaces custom key-value attributes on a subscription
        contract. These attributes are stored with the subscription and can be
        used to track custom data, preferences, or metadata that's important for
        your business processes.


        **Custom Attributes Overview:**

        Custom attributes are key-value pairs that allow you to store additional
        information on subscriptions. They are:

        - Visible in the Shopify admin and accessible via API

        - Included in order data when subscription orders are created

        - Preserved across subscription lifecycle events

        - Useful for integrations and custom workflows


        **Update Modes:**

        - **Merge Mode (overwriteExistingAttributes=false)**: Adds new
        attributes and updates existing ones with matching keys. Other
        attributes remain unchanged.

        - **Replace Mode (overwriteExistingAttributes=true)**: Completely
        replaces all existing attributes with the provided list.


        **Common Use Cases:**

        - Store gift messages or special instructions

        - Track referral sources or marketing campaigns

        - Add internal reference numbers or tracking codes

        - Store customer preferences or customization options

        - Integration data for third-party systems


        **Important Notes:**

        - Attribute keys should not conflict with Shopify's reserved attributes

        - Both keys and values are stored as strings

        - Changes are logged in the activity history

        - Invalid discount codes may be automatically removed during update


        **Authentication:** Requires valid X-API-Key header
      operationId: updateOrderNoteAttributes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAttributesRequest'
        required: true
      responses:
        '200':
          description: Attributes successfully updated
          content:
            application/json:
              examples:
                Success Response:
                  description: Success Response
                  value:
                    message: Attributes updated successfully
        '400':
          description: Invalid request parameters
          content:
            application/json:
              examples:
                Missing Contract ID:
                  description: Missing Contract ID
                  value:
                    type: https://example.com/errors/bad-request
                    title: Validation Error
                    status: 400
                    detail: Subscription contract ID is required
                Contract Not Found:
                  description: Contract Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: UserGeneratedError:Subscription contract not found
                    status: 400
                    detail: No subscription contract found with the specified ID
        '401':
          description: Authentication required - missing or invalid API key
        '403':
          description: Insufficient permissions to update subscription contracts
  /subscriptions/cp/api/subscription-contract-details/split-existing-contract:
    post:
      tags:
        - Subscription Management
      summary: Split or duplicate an existing subscription contract
      description: >-
        Creates a new subscription contract by either splitting (moving) or
        duplicating selected line items from an existing contract. This endpoint
        allows you to divide a subscription into multiple contracts or create a
        copy with specific products.


        **Split vs Duplicate Mode:**

        - **Split (isSplitContract=true)**: Moves the selected line items from
        the original contract to a new contract. The original contract will no
        longer contain these items.

        - **Duplicate (isSplitContract=false)**: Creates a new contract with
        copies of the selected line items while keeping them in the original
        contract.


        **Important Notes:**

        - When splitting, at least one subscription product must remain in the
        original contract

        - The new contract inherits all settings from the original: customer,
        payment method, billing/delivery policies, shipping address, and custom
        attributes

        - Billing schedule is automatically generated for the new contract

        - One-time products and free products don't count towards the minimum
        product requirement


        **Use Cases:**

        - Split a subscription when customer wants different delivery schedules
        for different products

        - Create a gift subscription from an existing subscription

        - Separate products for different shipping addresses

        - Duplicate a subscription for testing or backup purposes


        **Authentication:** Requires valid X-API-Key header
      operationId: splitExistingContract
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: isSplitContract
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: attemptBilling
          in: query
          required: false
          schema:
            type: boolean
            default: false
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
        required: true
      responses:
        '200':
          description: Contract successfully split/duplicated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    id: gid://shopify/SubscriptionContract/987654321
                    status: ACTIVE
                    nextBillingDate: '2024-02-15T00:00:00Z'
                    originOrder:
                      id: gid://shopify/Order/123456789
                    customer:
                      id: gid://shopify/Customer/111111
                      email: customer@example.com
                    billingPolicy:
                      interval: MONTH
                      intervalCount: 1
                    deliveryPolicy:
                      interval: MONTH
                      intervalCount: 1
                    lines:
                      edges:
                        - node:
                            id: gid://shopify/SubscriptionLine/222222
                            quantity: 2
                            variantId: gid://shopify/ProductVariant/333333
                            title: Premium Coffee - Medium Roast
                            currentPrice:
                              amount: '29.99'
                              currencyCode: USD
                    customAttributes:
                      - key: _origin_type
                        value: SPLIT_CONTRACT
                      - key: _original_contract_id
                        value: '123456789'
        '400':
          description: Invalid request parameters or business rule violation
          content:
            application/json:
              examples:
                All Products Selected:
                  description: All Products Selected
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:All products cannot be selected, at
                      least one product is required in the current contract.
                    status: 400
                    detail: >-
                      When splitting a contract, you cannot move all products.
                      At least one subscription product must remain.
                Contract Not Found:
                  description: Contract Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Subscription contract not found for
                      given contract id
                    status: 400
                    detail: >-
                      The specified contract ID does not exist or you don't have
                      access to it
                No Payment Method:
                  description: No Payment Method
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:No Payment methods found for the
                      customer
                    status: 400
                    detail: >-
                      The original contract's customer must have a valid payment
                      method
                Invalid Line IDs:
                  description: Invalid Line IDs
                  value:
                    type: https://example.com/errors/bad-request
                    title: No valid line items found
                    status: 400
                    detail: None of the provided line IDs exist in the contract
        '401':
          description: Authentication required - missing or invalid API key
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
        '403':
          description: Insufficient permissions to split subscription contracts
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contract-details/replace-variants-v3:
    post:
      tags:
        - Subscription Management
      summary: Replace product variants in a subscription contract
      description: >-
        Replaces existing product variants with new ones in a subscription
        contract. This endpoint supports both regular subscription products and
        one-time products, allowing you to swap products, update quantities, and
        manage the product mix in a subscription.


        **Key Features:**

        - **Bulk Replace**: Replace multiple products at once by providing lists
        of old and new variants

        - **Line-Specific Replace**: Target a specific line item using oldLineId
        for precise replacement

        - **Quantity Management**: Set new quantities for replaced products

        - **One-Time Products**: Add or remove one-time purchase products
        independently

        - **Discount Preservation**: Configurable discount carry-forward logic


        **Discount Carry Forward Options:**

        - **PRODUCT_THEN_EXISTING**: First tries to apply the new product's
        selling plan discount, then falls back to existing discount

        - **PRODUCT_PLAN**: Always uses the new product's selling plan discount

        - **EXISTING_PLAN**: Maintains the existing product's discount structure


        **Important Notes:**

        - At least one regular subscription product must remain in the contract

        - One-time products and free products don't count towards the minimum
        product requirement

        - The system automatically handles pricing adjustments based on
        billing/delivery intervals

        - Shipping prices are automatically recalculated after changes


        **Use Cases:**

        - Product upgrades/downgrades (e.g., switching coffee blend or size)

        - Quantity adjustments during product swap

        - Adding limited-time or seasonal products as one-time purchases

        - Bulk product replacements for subscription migrations


        **Authentication:** Requires valid X-API-Key header
      operationId: replaceVariantsV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceVariantsInfoV3'
        required: true
      responses:
        '200':
          description: Products successfully replaced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    id: gid://shopify/SubscriptionContract/123456789
                    status: ACTIVE
                    nextBillingDate: '2024-02-15T00:00:00Z'
                    lines:
                      edges:
                        - node:
                            id: gid://shopify/SubscriptionLine/999999
                            quantity: 3
                            variantId: gid://shopify/ProductVariant/888888
                            title: Premium Coffee - Dark Roast
                            variantTitle: 1kg / Whole Bean
                            currentPrice:
                              amount: '35.99'
                              currencyCode: USD
                            pricingPolicy:
                              basePrice:
                                amount: '39.99'
                                currencyCode: USD
                              cycleDiscounts:
                                - afterCycle: 1
                                  adjustmentType: PERCENTAGE
                                  adjustmentValue:
                                    percentage: 10
                        - node:
                            id: gid://shopify/SubscriptionLine/777777
                            quantity: 1
                            variantId: gid://shopify/ProductVariant/666666
                            title: Coffee Filters - Pack of 100
                            currentPrice:
                              amount: '9.99'
                              currencyCode: USD
                            customAttributes:
                              - key: _one_time_product
                                value: 'true'
        '400':
          description: Invalid request parameters or business rule violation
          content:
            application/json:
              examples:
                No Variants Specified:
                  description: No Variants Specified
                  value:
                    type: https://example.com/errors/bad-request
                    title: UserGeneratedError:No variants to add or remove
                    status: 400
                    detail: You must specify at least one variant to add or remove
                Same Source and Destination:
                  description: Same Source and Destination
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Source and destination variants cannot
                      be same
                    status: 400
                    detail: You cannot replace a variant with itself
                Variant Not Found:
                  description: Variant Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Old variants didn't match with the
                      existing variants
                    status: 400
                    detail: >-
                      The specified old variant IDs do not exist in the
                      subscription
                Product Not Found:
                  description: Product Not Found
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      Product Variant not found for ID:
                      gid://shopify/ProductVariant/999999
                    status: 400
                    detail: The new variant ID does not exist in your store
                Last Product Removal:
                  description: Last Product Removal
                  value:
                    type: https://example.com/errors/bad-request
                    title: >-
                      UserGeneratedError:Cannot remove line item. Atleast one
                      subscription product must be present in a subscription
                    status: 400
                    detail: >-
                      This operation would remove all subscription products from
                      the contract
        '401':
          description: Authentication required - missing or invalid API key
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
        '403':
          description: Insufficient permissions to modify subscription contracts
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contract-details/replace-variants-v2:
    post:
      tags:
        - subscription-contract-details-post-resource
      operationId: replaceVariantsV2
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: newVariantId
          in: query
          required: true
          schema:
            type: string
        - name: quantity
          in: query
          required: true
          schema:
            type: integer
            format: int32
        - name: oldLineId
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contract-details/merge-contract:
    post:
      tags:
        - subscription-contract-details-post-resource
      operationId: splitExistingContract_1
      parameters:
        - name: sourceContractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: destinationContractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/product-swaps-by-variant-groups/{contractId}:
    post:
      tags:
        - Product Catalog
      summary: Get product swap variant groups for a contract
      description: >-
        Retrieves product swap variant groups for the next 10 billing cycles of
        a specific subscription contract. This endpoint calculates and returns
        which products will be swapped to in future billing cycles based on
        configured swap automations.


        **Response Structure:**

        Returns a 2D array (List<List<VariantQuantity>>):

        - **Outer array**: Represents the next 10 billing cycles

        - **Inner arrays**: Contains the variant(s) that will be swapped to for
        that specific cycle

        - **Index 0**: Variants for the next (upcoming) billing cycle

        - **Index 1**: Variants for the cycle after that

        - And so on for the next 10 cycles


        **Variant Details:**

        Each variant object includes:

        - **variantId**: Shopify variant ID

        - **quantity**: Number of units to swap

        - **title**: Variant title (e.g., "Medium Roast - 12oz")

        - **image**: Product/variant image URL

        - **productTitle**: Full product name

        - **productId**: Shopify product GID

        - **variantTitle**: Full display name combining product and variant
        titles

        - **swapId**: ID of the swap automation rule that triggered this swap


        **How It Works:**

        1. Takes the current products in the subscription

        2. Applies configured swap automations for the next 10 cycles

        3. Calculates which products will be swapped based on:
           - Billing cycle number
           - Swap rule configurations (forBillingCycle, checkForEveryRecurringOrder)
           - Rule sequence/priority
        4. Returns the projected product lineup for each cycle


        **Use Cases:**

        - Preview upcoming product swaps in customer portals

        - Show customers their subscription product timeline

        - Build interactive swap calendars

        - Display "what you'll receive" for future orders

        - Debug and verify swap automation configurations


        **Important Notes:**

        - Returns 10 cycles even if no swaps are configured (returns current
        products)

        - Multiple variants in an inner array means multiple products will be in
        that order

        - Empty inner arrays indicate no products for that cycle (rare edge
        case)

        - The swapId can be used to trace which automation rule triggered the
        swap


        **Authentication:** Requires valid X-API-Key header
      operationId: getProductSwapsByVariantId
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariantQuantityInfo'
        required: true
      responses:
        '200':
          description: >-
            Product swap variant groups returned successfully - Returns
            swappable variants for the next 10 billing cycles. Each element in
            the outer array represents the variants that will be swapped to for
            a specific billing cycle.
          content:
            application/json:
              examples:
                Success Response:
                  description: >-
                    Array of arrays - outer array represents billing cycles,
                    inner arrays contain variants for that cycle
                  value:
                    - - variantId: 12345
                        quantity: 2
                        title: Medium Roast - 12oz
                        image: >-
                          https://cdn.shopify.com/files/1/0000/0000/products/medium-roast.jpg
                        productTitle: House Blend Coffee
                        productId: gid://shopify/Product/98765
                        variantTitle: House Blend Coffee - Medium Roast - 12oz
                        swapId: 1001
                      - variantId: 12346
                        quantity: 1
                        title: Light Roast - 8oz
                        image: >-
                          https://cdn.shopify.com/files/1/0000/0000/products/light-roast.jpg
                        productTitle: Morning Blend Coffee
                        productId: gid://shopify/Product/98766
                        variantTitle: Morning Blend Coffee - Light Roast - 8oz
                        swapId: 1001
                    - - variantId: 67890
                        quantity: 2
                        title: Dark Roast - 12oz
                        image: >-
                          https://cdn.shopify.com/files/1/0000/0000/products/dark-roast.jpg
                        productTitle: Bold Blend Coffee
                        productId: gid://shopify/Product/88765
                        variantTitle: Bold Blend Coffee - Dark Roast - 12oz
                        swapId: 1002
        '400':
          description: Invalid contract ID or contract doesn't belong to authenticated shop
          content:
            application/json:
              example:
                type: https://example.com/errors/bad-request
                title: Invalid contract
                status: 400
                detail: Contract does not belong to this shop
        '401':
          description: Authentication required
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid X-API-Key header is required
        '403':
          description: Insufficient permissions to view product swaps
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: API key does not have permission to view product swaps
        '404':
          description: Contract not found or no swap groups available
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: No swap groups found
                status: 404
                detail: No product swap variant groups available for this contract
  /subscriptions/cp/api/loyalty-integration/redeem:
    post:
      tags:
        - Customer Portal
      summary: Redeem loyalty points for a reward
      description: >-
        Allows a customer to redeem their loyalty points for a specific reward
        option. This deducts points from their balance and generates a discount
        code or applies the reward.


        **What happens:**

        1. Validates customer has enough points

        2. Deducts points from customer's balance

        3. Generates discount code (for discount rewards)

        4. Records redemption in customer's history

        5. Returns discount code or confirmation


        **Reward Types:**

        - **Discount codes**: Generates unique code customer can use at checkout

        - **Auto-apply discounts**: Automatically applied to next order

        - **Free products**: Adds free product to next order

        - **Free shipping**: Waives shipping on next order


        **Important Notes:**

        - Points are deducted immediately and cannot be refunded

        - Discount codes typically expire after 30 days

        - Some rewards have minimum purchase requirements

        - Rewards cannot be combined with other discounts (depends on
        configuration)


        **Use Cases:**

        - Customer clicks 'Redeem' button in customer portal

        - Apply points at checkout

        - Redeem points for subscription discount


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: redeemPoints
      parameters:
        - name: customerId
          in: query
          description: Customer ID (Shopify GraphQL ID format)
          required: true
          schema:
            type: string
          example: gid://shopify/Customer/6548267876558
        - name: redeemOptionId
          in: query
          description: ID of the redemption option to redeem
          required: true
          schema:
            type: integer
            format: int64
          example: 1
        - name: points
          in: query
          description: Number of points to redeem (for variable point redemptions)
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Points redeemed successfully
          content:
            application/json:
              examples:
                Discount code generated:
                  description: Discount code generated
                  value: LOYALTY500-ABC123
        '400':
          description: Insufficient points or invalid redemption option
          content:
            '*/*':
              schema:
                type: string
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                type: string
  /subscriptions/cp/api/customer-retention-activities:
    post:
      tags:
        - customer-retention-activity-resource
      operationId: createCustomerRetentionActivity
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRetentionActivityDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CustomerRetentionActivityDTO'
  /subscriptions/cp/api/customer-account-api/initiate:
    post:
      tags:
        - Customer Portal
      summary: Initiate Customer Account API OAuth flow
      description: >-
        Initiates the OAuth 2.0 authorization flow for Shopify's Customer
        Account API. This endpoint is used when a customer wants to grant the
        subscription app access to their Shopify customer account data.


        **What is Customer Account API?**

        Shopify's Customer Account API allows apps to access customer data
        (orders, addresses, payment methods) on behalf of the customer. This
        requires customer consent through an OAuth flow.


        **How it works:**

        1. Customer portal calls this endpoint with a return URL

        2. Backend generates PKCE challenge and state parameter

        3. Returns authorization URL to redirect customer to Shopify

        4. Customer authorizes on Shopify

        5. Shopify redirects back to callback endpoint with authorization code

        6. Callback endpoint exchanges code for access token


        **Important Notes:**

        - Requires customer to be logged in to the Shopify store

        - Only works with stores that have 'New Customer Accounts' enabled

        - Uses PKCE (Proof Key for Code Exchange) for security

        - State parameter prevents CSRF attacks

        - Access tokens are stored securely and used for subsequent Customer
        Account API calls


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: initiateOAuth
      requestBody:
        description: OAuth initiation request with return URL
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InitiateOAuthRequest'
            examples:
              Initiate OAuth Request:
                description: Initiate OAuth Request
                value:
                  returnUrl: https://myshop.com/account/subscriptions
        required: true
      responses:
        '200':
          description: OAuth flow initiated successfully
          content:
            application/json:
              examples:
                Success Response:
                  description: Success Response
                  value:
                    authorizationUrl: >-
                      https://shopify.com/12345/auth/oauth/authorize?client_id=...
                    state: random-state-value-for-csrf-protection
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
        '503':
          description: >-
            Customer Account API not available - New Customer Accounts not
            enabled
          content:
            application/json:
              example:
                error: oidc_discovery_failed
                message: >-
                  Customer Account API is not available for this shop. Please
                  ensure New Customer Accounts is enabled.
  /subscriptions/cp/api/customer-account-api/graphql:
    post:
      tags:
        - Customer Portal
      summary: Proxy GraphQL queries to Shopify Customer Account API
      description: >-
        Executes GraphQL queries against Shopify's Customer Account API on
        behalf of the authenticated customer. This endpoint handles token
        management, refresh, and authentication automatically.


        **What you can query:**

        - Customer profile information

        - Order history and details

        - Saved addresses

        - Payment methods

        - Subscriptions (via Customer Account API schema)


        **Token Management:**

        - Automatically uses stored access token

        - Refreshes expired tokens automatically

        - Returns 401 if customer needs to re-authenticate


        **Example Queries:**

        ```graphql

        query {
          customer {
            id
            emailAddress { emailAddress }
            defaultAddress { address1 city }
          }
        }

        ```


        **Authentication:** Customer must be logged in and have completed OAuth
        flow
      operationId: proxyGraphQL
      requestBody:
        description: GraphQL query and optional variables
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
            examples:
              GraphQL Request:
                description: GraphQL Request
                value:
                  query: query { customer { id emailAddress { emailAddress } } }
                  variables: {}
        required: true
      responses:
        '200':
          description: GraphQL query executed successfully
          content:
            application/json:
              example:
                data:
                  customer:
                    id: gid://shopify/Customer/123
                    emailAddress:
                      emailAddress: customer@example.com
        '400':
          description: Invalid GraphQL query
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
        '401':
          description: Customer not authenticated or tokens expired
          content:
            application/json:
              example:
                error: no_valid_token
                message: Customer needs to authenticate
  /subscriptions/cp/api/v2/data/addresses:
    get:
      tags:
        - subscription-data-resource
      operationId: getCustomerAddressesForCPV2
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Address'
  /subscriptions/cp/api/subscription-customers:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionCustomer
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Customer'
  /subscriptions/cp/api/subscription-contract-details/shopify/customer/payment-methods:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getShopifyCustomerPaymentDetailsForCp
      parameters:
        - name: allowRevokedMethod
          in: query
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentMethods'
  /subscriptions/cp/api/subscription-billing-attempts/top-orders:
    get:
      tags:
        - Billing & Payments
      summary: Get upcoming orders (top orders)
      description: >-
        Retrieves upcoming (queued) billing attempts for a subscription contract
        or customer. Returns the next scheduled orders that have not yet been
        processed.


        **Query Options:**

        - Filter by contract ID to see upcoming orders for a specific
        subscription

        - Filter by customer ID to see all upcoming orders for a customer

        - Results are ordered by billing date (earliest first)


        **Use Cases:**

        - Display "Your Next Order" in customer portal

        - Show upcoming delivery schedule

        - Calculate upcoming charges

        - Preview next order contents


        **Authentication:** Requires valid X-API-Key header
      operationId: getTopOrdersForCp
      parameters:
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully retrieved upcoming orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Invalid contract or customer ID
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/past-orders:
    get:
      tags:
        - Billing & Payments
      summary: Get past orders
      description: >-
        Retrieves paginated list of past (processed) billing attempts for a
        subscription contract or customer. Includes successful orders, failed
        attempts, and skipped orders.


        **Filter Options:**

        - By contract ID: Get order history for specific subscription

        - By customer ID: Get all orders across all customer subscriptions

        - Pagination: Control page size and page number


        **Order Information:**

        - Billing attempt status (SUCCESS, FAILED, SKIPPED)

        - Shopify order ID for successful attempts

        - Billing date and processing date

        - Order total and line items

        - Error messages for failed attempts


        **Authentication:** Requires valid X-API-Key header
      operationId: getPastOrdersForCP
      parameters:
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: pageable
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Pageable'
      responses:
        '200':
          description: Successfully retrieved past orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '400':
          description: Invalid parameters
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
  /subscriptions/cp/api/subscription-billing-attempts/past-orders/report:
    get:
      tags:
        - Billing & Payments
      summary: Get past orders report with detailed filtering
      description: >-
        Retrieves a detailed report of past billing attempts with advanced
        filtering options. This endpoint provides comprehensive data for
        analytics, troubleshooting, and reporting purposes.


        **Filter Options:**

        - By status: SUCCESS, FAILED, SKIPPED

        - By date range: Filter by billing date range

        - By attempt count: Filter by number of retry attempts

        - By contract status: Filter by subscription contract status

        - By contract ID: Get report for specific subscription


        **Response Includes:**

        - Detailed billing attempt information

        - Shopify exception details for failed attempts (optional)

        - Retry attempt count

        - Processing timestamps

        - Order totals and line items


        **Authentication:** Requires valid X-API-Key header
      operationId: getPastOrdersReportForCP
      parameters:
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: status
          in: query
          required: true
          schema:
            type: string
            enum:
              - SUCCESS
              - FAILURE
              - REQUESTING
              - PROGRESS
              - QUEUED
              - SKIPPED
              - SOCIAL_CONNECTION_NULL
              - CONTRACT_CANCELLED
              - CONTRACT_ENDED
              - CONTRACT_PAUSED
              - AUTO_CHARGE_DISABLED
              - SHOPIFY_EXCEPTION
              - SKIPPED_DUNNING_MGMT
              - SKIPPED_INVENTORY_MGMT
              - IMMEDIATE_TRIGGERED
              - SECURITY_CHALLENGE
              - CONTRACT_PAUSED_MAX_CYCLES
              - REFUNDED
              - SKIPPED_DEMO_SHOP
              - SKIPPED_SHOP_INFO_NOT_FOUND
              - SKIPPED_BILLING_DATE_STALE
              - SKIPPED_DUNNING_NOT_CONFIGURED
        - name: includeShopifyException
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: fromDay
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: toDay
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: attemptCount
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: billingErrorsKeys
          in: query
          required: false
          schema:
            type: string
        - name: customerName
          in: query
          required: false
          schema:
            type: string
        - name: errorMessage
          in: query
          required: false
          schema:
            type: string
        - name: contractStatus
          in: query
          required: false
          schema:
            type: string
        - name: pageable
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Pageable'
      responses:
        '200':
          description: Successfully retrieved report
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
        '400':
          description: Invalid filter parameters
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
        '403':
          description: Insufficient permissions
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBillingAttemptDetails'
  /subscriptions/cp/api/loyalty-integration/redeem-options:
    get:
      tags:
        - Customer Portal
      summary: Get available loyalty point redemption options
      description: >-
        Returns all available rewards that the customer can redeem their loyalty
        points for. This shows customers what they can spend their points on.


        **Common Redemption Options:**

        - Discount codes (e.g., $5 off for 500 points)

        - Percentage discounts (e.g., 10% off for 1000 points)

        - Free shipping rewards

        - Free products or samples

        - Exclusive access to sales


        **Response includes:**

        - Redemption option ID

        - Name and description

        - Points cost

        - Reward value (dollar amount or percentage)

        - Availability (minimum purchase, restrictions)

        - Whether customer has enough points


        **Filtering:**

        - Only shows active redemption options

        - Filters based on customer's tier/VIP level

        - Shows whether customer has sufficient points


        **Use Cases:**

        - Display 'Redeem Points' section in customer portal

        - Show available rewards in checkout

        - Encourage customers to save points for bigger rewards


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: getRedeemOptionsForCP
      responses:
        '200':
          description: Redemption options retrieved successfully
          content:
            application/json:
              example:
                - id: 1
                  name: $5 Off Coupon
                  description: Get $5 off your next order
                  pointsCost: 500
                  rewardValue: 5
                  rewardType: FIXED_AMOUNT
                  canRedeem: true
                - id: 2
                  name: 15% Off Entire Order
                  description: Get 15% off your entire order
                  pointsCost: 1500
                  rewardValue: 15
                  rewardType: PERCENTAGE
                  canRedeem: true
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LoyaltyPointRedemptionRule'
  /subscriptions/cp/api/loyalty-integration/customer:
    get:
      tags:
        - Customer Portal
      summary: Get customer loyalty points and rewards data
      description: >-
        Retrieves the loyalty/rewards program data for the currently logged-in
        customer. This includes points balance, tier status, and available
        rewards.


        **Supported Loyalty Programs:**

        - Appstle Loyalty & Rewards

        - Yotpo Loyalty & Referrals

        - Smile.io (via Appstle integration)


        **What you get:**

        - Current points balance

        - Points pending (from recent orders)

        - VIP tier/level

        - Points history

        - Available reward redemptions


        **Use Cases:**

        - Display points balance in customer portal

        - Show available rewards customer can redeem

        - Display VIP tier badge

        - Show points expiration dates


        **Authentication:** Customer must be logged in via Shopify customer
        session


        **Note:** Requires loyalty app integration to be configured in merchant
        settings
      operationId: fetchCustomerDetailForCP
      responses:
        '200':
          description: Loyalty data retrieved successfully
          content:
            application/json:
              example:
                pointsBalance: 1250
                pointsPending: 150
                tierName: Gold
                pointsToNextTier: 250
                customerEmail: customer@example.com
        '400':
          description: Loyalty integration not configured for this shop
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/LoyaltyCustomerDataResponse'
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/LoyaltyCustomerDataResponse'
  /subscriptions/cp/api/logged-in-customer:
    get:
      tags:
        - 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':
          description: Customer ID retrieved successfully
          content:
            application/json:
              schema:
                type: integer
                format: int64
                example: 6548267876558
              examples:
                Logged in customer:
                  description: Logged in customer
                  value: 6548267876558
        '401':
          description: Customer not logged in or invalid session
          content:
            '*/*':
              schema:
                type: integer
                format: int64
  /subscriptions/cp/api/label-translations/locale:
    get:
      tags:
        - label-translations-resource
      operationId: getCPLabelsByLocaleAndType
      parameters:
        - name: locale
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/LabelTranslationsInfo'
  /subscriptions/cp/api/bundle-discount-rules:
    get:
      tags:
        - bundle-integration-resource
      operationId: getBundleDiscountRules
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BundleDiscountRuleDTO'
  /subscriptions/cp/api/v3/subscription-bundlings/external/get-bundle/{handle}:
    get:
      tags:
        - subscription-bundling-resource
      operationId: getValidSubscriptionCustomerV2
      parameters:
        - name: handle
          in: path
          description: Customer Handle
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBundlingResponseV3'
  /subscriptions/cp/api/v2/data/currencies:
    get:
      tags:
        - subscription-data-resource
      operationId: getEnabledCurrenciesDataV2
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  type: string
                  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
  /subscriptions/cp/api/v2/data/countries:
    get:
      tags:
        - subscription-data-resource
      operationId: getCountriesDataV2
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                uniqueItems: true
                type: array
                items:
                  $ref: '#/components/schemas/Country'
  /subscriptions/cp/api/upcoming-subscription-contract-one-offs-by-contractId:
    get:
      tags:
        - subscription-contract-one-off-resource
      operationId: getOneOffForContractNextOrder
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
  /subscriptions/cp/api/subscription-payment-infos/{contractId}:
    get:
      tags:
        - subscription-payment-info-resource
      operationId: getSubscriptionPaymentInfo
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionPaymentInfoDTO'
  /subscriptions/cp/api/subscription-groups/all-selling-plans:
    get:
      tags:
        - subscription-group-resource
      operationId: getAllSellingPlans
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FrequencyInfoDTO'
  /subscriptions/cp/api/subscription-customers/valid/{id}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getValidSubscriptionCustomer
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                uniqueItems: true
                type: array
                items:
                  type: integer
                  format: int64
  /subscriptions/cp/api/subscription-customers-detail/valid/{id}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getValidSubscriptionCustomerDetails
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionContractDetailsDTO'
  /subscriptions/cp/api/subscription-custom-csses/{id}:
    get:
      tags:
        - Customer Portal
      summary: Get custom CSS for customer portal
      description: >-
        Retrieves the custom CSS styling configuration for the customer portal.
        This endpoint returns all custom CSS rules that have been configured to
        customize the appearance, layout, and branding of the subscription
        customer portal.


        **What is Custom CSS?**

        Custom CSS allows merchants to fully customize the visual appearance of
        their customer portal beyond the basic theme settings. This enables
        complete brand alignment and creates a seamless experience that matches
        the merchant's main store design.


        **Custom CSS Capabilities:**

        - **Layout Customization**:
          - Modify page layouts and spacing
          - Adjust grid and flexbox configurations
          - Control responsive breakpoints
          - Customize navigation and sidebars

        - **Typography**:
          - Custom fonts and font families
          - Font sizes, weights, and line heights
          - Letter spacing and text transforms
          - Heading and paragraph styles

        - **Colors and Branding**:
          - Brand color palette application
          - Custom background colors and gradients
          - Button and link styling
          - Hover and focus states
          - Border colors and shadows

        - **Component Styling**:
          - Subscription card appearances
          - Form input styling
          - Button designs and interactions
          - Modal and dialog boxes
          - Navigation menus
          - Product images and thumbnails

        - **Advanced Features**:
          - CSS animations and transitions
          - Media queries for responsive design
          - Pseudo-elements and pseudo-classes
          - Custom icons using CSS
          - Transform and filter effects

        **CSS Structure:**

        The returned CSS includes:

        - Global styles for portal-wide consistency

        - Component-specific styles

        - Responsive design rules

        - Theme overrides

        - Custom animations

        - Print styles (optional)


        **Common CSS Selectors Available:**

        ```css

        /* Portal container */

        .subscription-portal { }


        /* Subscription cards */

        .subscription-card { }

        .subscription-card-header { }

        .subscription-card-body { }


        /* Buttons */

        .btn-primary { }

        .btn-secondary { }

        .btn-cancel { }


        /* Forms */

        .form-control { }

        .form-group { }

        .form-label { }


        /* Navigation */

        .portal-nav { }

        .nav-item { }


        /* Product displays */

        .product-item { }

        .product-image { }

        .product-title { }

        ```


        **Use Cases:**

        - Apply custom branding to match main store design

        - Create unique visual experiences for different customer segments

        - Implement seasonal or promotional themes

        - Enhance mobile responsiveness

        - Add accessibility improvements (high contrast, larger fonts)

        - A/B test different portal designs

        - Integrate with design systems

        - Implement dark mode or theme switching


        **Important Notes:**

        - CSS is sanitized for security (XSS prevention)

        - Certain properties may be restricted for security reasons

        - External resources (fonts, images) must use HTTPS

        - CSS is cached for performance - changes may take a few minutes to
        propagate

        - Invalid CSS syntax is automatically filtered out

        - Some core portal elements have !important styles that cannot be
        overridden


        **Best Practices:**

        - Use specific selectors to avoid conflicts

        - Test across different browsers and devices

        - Keep CSS organized with comments

        - Use CSS variables for maintainability

        - Minify CSS for production performance

        - Consider accessibility in color choices (WCAG compliance)

        - Provide fallbacks for advanced CSS features


        **Security Considerations:**

        - CSS is sanitized to prevent code injection

        - External URLs are validated

        - JavaScript in CSS is blocked (e.g., expression(), behavior())

        - Data URIs are validated for malicious content


        **Authentication:** Requires valid X-API-Key header
      operationId: getSubscriptionCustomCss
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Custom CSS successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionCustomCssDTO'
              examples:
                Success Response:
                  description: Success Response
                  value: |-
                    {
                      "id": 12345,
                      "shop": "example-shop.myshopify.com",
                      "customCss": "/* Global Portal Styles */\n" +
                        ".subscription-portal {\n" +
                        "  font-family: 'Helvetica Neue', Arial, sans-serif;\n" +
                        "  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n" +
                        "  min-height: 100vh;\n" +
                        "}\n\n" +
                        "/* Subscription Cards */\n" +
                        ".subscription-card {\n" +
                        "  border-radius: 12px;\n" +
                        "  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n" +
                        "  background: white;\n" +
                        "  padding: 24px;\n" +
                        "  margin-bottom: 16px;\n" +
                        "  transition: transform 0.2s ease, box-shadow 0.2s ease;\n" +
                        "}\n\n" +
                        ".subscription-card:hover {\n" +
                        "  transform: translateY(-2px);\n" +
                        "  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);\n" +
                        "}\n\n" +
                        "/* Primary Button Styling */\n" +
                        ".btn-primary {\n" +
                        "  background-color: #4A90E2;\n" +
                        "  border-color: #4A90E2;\n" +
                        "  color: white;\n" +
                        "  font-weight: 600;\n" +
                        "  padding: 12px 24px;\n" +
                        "  border-radius: 6px;\n" +
                        "  transition: all 0.3s ease;\n" +
                        "}\n\n" +
                        ".btn-primary:hover {\n" +
                        "  background-color: #357ABD;\n" +
                        "  border-color: #357ABD;\n" +
                        "  transform: scale(1.02);\n" +
                        "}\n\n" +
                        "/* Form Inputs */\n" +
                        ".form-control {\n" +
                        "  border: 2px solid #E0E0E0;\n" +
                        "  border-radius: 6px;\n" +
                        "  padding: 10px 14px;\n" +
                        "  font-size: 14px;\n" +
                        "}\n\n" +
                        ".form-control:focus {\n" +
                        "  border-color: #4A90E2;\n" +
                        "  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);\n" +
                        "  outline: none;\n" +
                        "}\n\n" +
                        "/* Responsive Design */\n" +
                        "@media (max-width: 768px) {\n" +
                        "  .subscription-card {\n" +
                        "    padding: 16px;\n" +
                        "  }\n" +
                        "  .btn-primary {\n" +
                        "    width: 100%;\n" +
                        "  }\n" +
                        "}",
                      "enabled": true,
                      "version": 2,
                      "lastModified": "2024-02-20T14:45:00Z",
                      "createdAt": "2024-01-15T10:30:00Z",
                      "updatedAt": "2024-02-20T14:45:00Z"
                    }
        '401':
          description: Authentication required
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid X-API-Key header is required
        '403':
          description: Insufficient permissions to view custom CSS
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: API key does not have permission to view custom CSS settings
        '404':
          description: Custom CSS not found - No custom CSS has been configured
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: CSS not found
                status: 404
                detail: No custom CSS has been configured for this shop
  /subscriptions/cp/api/subscription-contracts/contract/{contractId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionContractRaw
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts/contract-external/{contractId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionContractRawExternal
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContract'
  /subscriptions/cp/api/subscription-contracts-is-overwrite-anchor-day:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: isOverwriteAnchorDay
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: intervalCount
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: interval
          in: query
          required: false
          schema:
            type: string
            enum:
              - DAY
              - WEEK
              - MONTH
              - YEAR
              - $UNKNOWN
        - name: nextBillingDate
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: boolean
  /subscriptions/cp/api/subscription-contracts-email-magic-link:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: emailMagicLink
      parameters:
        - name: email
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: string
  /subscriptions/cp/api/subscription-contract-one-offs-by-contractId:
    get:
      tags:
        - subscription-contract-one-off-resource
      operationId: getOneOffsForSubscriptionContract
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
  /subscriptions/cp/api/subscription-contract-details/subscription-fulfillments/{contractId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionFulfillments
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Order'
  /subscriptions/cp/api/subscription-contract-details/subscription-fulfillments/order/{orderId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionFulfillmentsForOrder
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Node'
  /subscriptions/cp/api/subscription-contract-details/customer/{contractId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getSubscriptionOrderNote
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionContractDetailsDTO'
  /subscriptions/cp/api/subscription-contract-details/current-cycle/{contractId}:
    get:
      tags:
        - subscription-contract-details-resource
      operationId: getCurrentCycleOfSubscriptionContract
      parameters:
        - name: contractId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: integer
                format: int32
  /subscriptions/cp/api/subscription-bundlings/single-product:
    get:
      tags:
        - subscription-bundling-resource
      operationId: findByShopAndBuildABoxTypeSingle
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscriptionBundlingDTO'
  /subscriptions/cp/api/subscription-bundlings/by-token/{token}:
    get:
      tags:
        - subscription-bundling-resource
      operationId: getSubscriptionBundling
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBundlingDTO'
  /subscriptions/cp/api/subscription-bundle-settings/{id}:
    get:
      tags:
        - subscription-bundle-settings-resource
      operationId: getSubscriptionBundleSettings
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBundleSettingsDTO'
  /subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}:
    get:
      tags:
        - subscription-billing-attempt-resource
      operationId: securityChallengeActionURL
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: string
  /subscriptions/cp/api/subscription-billing-attempts/refund-preview/{id}:
    get:
      tags:
        - Customer Portal
      summary: Calculate refund amount preview
      description: >-
        Calculates the refund amount that would be issued if a specific
        subscription order fulfillment were refunded. This provides a preview
        without actually processing the refund.


        **What it calculates:**

        - Total refund amount (order amount minus processing fees)

        - Restocking fees (if applicable)

        - Gateway fees that cannot be refunded

        - Net refund amount customer will receive


        **Use Cases:**

        - Show customer how much they'll get back before confirming refund

        - Display refund breakdown in customer portal

        - Validate refund eligibility


        **Important Notes:**

        - This is a preview only - does not process refund

        - Refund amount may vary based on payment gateway

        - Some gateways don't refund processing fees

        - Refunds can only be issued for fulfilled orders


        **Authentication:** Customer must be logged in and own the subscription
      operationId: calculateRefundPreview
      parameters:
        - name: id
          in: path
          description: Billing attempt ID
          required: true
          schema:
            type: integer
            format: int64
        - name: subscriptionContractId
          in: query
          description: Subscription contract ID for validation
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Refund preview calculated successfully
          content:
            application/json:
              example:
                orderAmount: 45.99
                processingFees: 1.5
                restockingFee: 0
                refundAmount: 44.49
                currency: USD
        '400':
          description: Order cannot be refunded (not fulfilled, already refunded, etc.)
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
        '401':
          description: Customer not logged in or doesn't own this subscription
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
  /subscriptions/cp/api/shop-infos-by-current-login:
    get:
      tags:
        - shopify-shop-info-resource
      operationId: getShopInfoByCurrentLogin
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ShopInfoResponseDTO'
  /subscriptions/cp/api/shop-customizations/css/{category}:
    get:
      tags:
        - shop-customization-resource
      operationId: getShopCustomizationCss
      parameters:
        - name: category
          in: path
          required: true
          schema:
            type: string
            enum:
              - PRODUCT_PAGE_WIDGET
              - CUSTOMER_PORTAL
              - BUILD_A_BOX
              - CART_PAGE_WIDGET
              - BUNDLING
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  type: string
  /subscriptions/cp/api/product-infos/variant-data/{variantIds}:
    get:
      tags:
        - product-info-resource
      operationId: getVariantDataByVariantIds
      parameters:
        - name: variantIds
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                uniqueItems: true
                type: array
                items:
                  $ref: '#/components/schemas/AsProductVariant'
  /subscriptions/cp/api/orders/{orderId}/live-status:
    get:
      tags:
        - order-status-resource
      operationId: getOrderLiveStatus
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/OrderLiveStatusDTO'
  /subscriptions/cp/api/loyalty-integration/earn-options:
    get:
      tags:
        - Customer Portal
      summary: Get available ways to earn loyalty points
      description: >-
        Returns all active point earning campaigns and rules that the customer
        can participate in. This shows customers how they can earn more points.


        **Common Earning Methods:**

        - Points per dollar spent on purchases

        - Bonus points for first subscription

        - Points for referring friends

        - Birthday bonus points

        - Social media follows (Instagram, Facebook, Twitter)

        - Product reviews

        - Account creation bonus


        **Response includes:**

        - Campaign name and description

        - Points awarded

        - Action required (e.g., 'Follow on Instagram')

        - Icon/image URL

        - Terms and conditions


        **Use Cases:**

        - Display 'Ways to Earn' section in customer portal

        - Show earning opportunities on product pages

        - Encourage customer engagement


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: getEarnOptions
      parameters:
        - name: customerId
          in: query
          description: Customer ID (optional, auto-detected from session)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Earning options retrieved successfully
          content:
            application/json:
              example:
                - name: Purchase Rewards
                  description: Earn 5 points for every $1 spent
                  pointsAmount: 5
                  action: Make a purchase
                - name: Refer a Friend
                  description: Earn 500 points when your friend makes their first purchase
                  pointsAmount: 500
                  action: Share referral link
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LoyaltyPointEarnCampaign'
  /subscriptions/cp/api/delivery-profiles/get-locations:
    get:
      tags:
        - delivery-profile-resource
      operationId: getLocations
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ShopFulfillmentLocation'
  /subscriptions/cp/api/data/variant-contextual-pricing:
    get:
      tags:
        - Subscription Management
      summary: Get variant contextual pricing
      description: >-
        Retrieves contextual pricing information for a product variant based on
        currency and country. This endpoint provides localized pricing data for
        international subscriptions and multi-currency support.


        **Pricing Information Returned:**

        - Base price in specified currency

        - Compare-at price (if applicable)

        - Country-specific pricing adjustments

        - Tax information for the region

        - Currency conversion data


        **Parameters:**

        - `variantId` - Shopify variant ID (required)

        - `currencyCode` - ISO 4217 currency code (e.g., USD, EUR, GBP)
        (required)

        - `countryCode` - ISO 3166-1 country code (e.g., US, GB, CA) (optional)


        **Use Cases:**

        - Display localized pricing in customer portal

        - Calculate subscription totals for international customers

        - Support multi-currency subscriptions

        - Show accurate pricing based on customer location

        - Validate pricing before subscription creation


        **Important Notes:**

        - Requires Shopify Markets or multi-currency setup

        - Prices are returned in the requested currency

        - Country-specific pricing takes precedence over currency-only pricing

        - Returns 404 if variant doesn't exist or isn't available in specified
        market


        **Authentication:** Requires valid api_key parameter
      operationId: getVariantContextualPricing
      parameters:
        - name: variantId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: countryCode
          in: query
          required: false
          schema:
            type: string
        - name: currencyCode
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Contextual pricing retrieved successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductVariant'
        '400':
          description: Invalid currency or country code
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductVariant'
        '401':
          description: Invalid API key
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductVariant'
        '404':
          description: Variant not found or not available in specified market
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductVariant'
  /subscriptions/cp/api/data/v2/products-selling-plans:
    get:
      tags:
        - subscription-data-resource
      description: Get Products Selling Plans
      operationId: getProductSellingPlanDataV2
      parameters:
        - name: productIds
          in: query
          description: Product IDs
          required: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: integer
              format: int64
        - name: variantIds
          in: query
          description: Variant IDs
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: integer
              format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FrequencyInfoDTO'
  /subscriptions/cp/api/data/subscription-products:
    get:
      tags:
        - subscription-data-resource
      operationId: getSubscriptionProductsData
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscribedProductVariantInfo'
  /subscriptions/cp/api/data/shop-delivery-options:
    get:
      tags:
        - subscription-data-resource
      operationId: getShopDeliveryOptions
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Node'
  /subscriptions/cp/api/data/selling-plan-products:
    get:
      tags:
        - subscription-data-resource
      operationId: getSubscriptionProductsData_1
      parameters:
        - name: sellingPlanIds
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubscribedProductVariantInfo'
  /subscriptions/cp/api/data/products1:
    get:
      tags:
        - subscription-data-resource
      operationId: getProductsData
      parameters:
        - name: search
          in: query
          required: false
          schema:
            type: string
        - name: next
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: vendor
          in: query
          required: false
          schema:
            type: string
        - name: tags
          in: query
          required: false
          schema:
            type: string
        - name: sorting
          in: query
          required: false
          schema:
            type: string
        - name: productType
          in: query
          required: false
          schema:
            type: string
        - name: sellingPlanIds
          in: query
          required: false
          schema:
            type: string
        - name: size
          in: query
          required: false
          schema:
            type: integer
            format: int32
            default: 10
        - name: productSelectionOption
          in: query
          required: true
          schema:
            type: string
            enum:
              - ALL_PRODUCTS
              - PRODUCTS_FROM_ALL_PLANS
              - PRODUCTS_FROM_CURRENT_PLAN
        - name: purchaseOption
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductData'
  /subscriptions/cp/api/data/products-selling-plans:
    get:
      tags:
        - Subscription Management
      summary: Get selling plans for products
      description: >-
        Retrieves all selling plans (subscription plans) associated with a set
        of products. This endpoint is useful for determining which subscription
        options are available for specific products.


        **Selling Plan Information:**

        - Selling plan ID and name

        - Billing and delivery frequencies

        - Pricing policies (discounts)

        - Plan description and options

        - Product associations


        **Use Cases:**

        - Display subscription options on product pages

        - Validate subscription plan availability

        - Build subscription plan selector UI

        - Sync plan data across systems


        **Request:**

        - Accepts multiple product IDs as comma-separated values

        - Returns aggregated selling plans from all products


        **Authentication:** Requires valid api_key parameter
      operationId: getProductSellingPlanData
      parameters:
        - name: productIds
          in: query
          description: Product IDs
          required: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: integer
              format: int64
      responses:
        '200':
          description: Selling plans retrieved successfully
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Node'
        '400':
          description: Invalid product IDs
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Node'
        '401':
          description: Invalid API key
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Node'
  /subscriptions/cp/api/data/products:
    get:
      tags:
        - Subscription Management
      summary: Get products data with pagination
      description: >-
        Retrieves paginated product catalog data from Shopify, optionally
        filtered by search term, selling plans, or subscription contracts. This
        endpoint provides access to your store's product catalog with
        subscription-specific information.


        **What This Endpoint Returns:**

        Product information including:

        - Product ID, title, handle, and description

        - Product images and media

        - Variants with pricing and availability

        - Associated selling plans (subscription plans)

        - Product status and tags

        - Vendor and product type


        **Pagination:**

        Uses cursor-based pagination for efficient data retrieval:

        - `next=true` - Get next page of results

        - `cursor` - Pagination cursor from previous response

        - Returns cursor for next page in response


        **Filtering Options:**


        1. **Search** (`search` parameter):
           - Search by product title, description, or SKU
           - Partial matching supported
           - Case-insensitive

        2. **Selling Plan Filter** (`sellingPlanIds` parameter):
           - Filter products by subscription plans
           - Comma-separated list of selling plan IDs
           - Only returns products with specified plans

        3. **Contract Filter** (`contractId` parameter):
           - Get products available for specific subscription
           - Useful for product swap functionality
           - Returns products compatible with contract

        **Use Cases:**

        - Display product catalog in custom subscription UI

        - Build product selection for subscription creation

        - Implement product swap functionality

        - Search products for subscription management

        - Sync product data to external systems


        **Authentication:** Requires valid api_key parameter
      operationId: getProductsData_1
      parameters:
        - name: search
          in: query
          required: false
          schema:
            type: string
        - name: next
          in: query
          required: false
          schema:
            type: boolean
            default: false
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: contractId
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: sellingPlanIds
          in: query
          required: false
          schema:
            type: string
        - name: sendAllData
          in: query
          required: false
          schema:
            type: boolean
        - name: purchaseOption
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Products retrieved successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductData'
        '400':
          description: Invalid request parameters
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductData'
        '401':
          description: Invalid API key
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProductData'
  /subscriptions/cp/api/data/product-handles:
    get:
      tags:
        - subscription-data-resource
      operationId: getProductHandles
      parameters:
        - name: productIds
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: string
  /subscriptions/cp/api/data/product:
    get:
      tags:
        - Subscription Management
      summary: Get single product data by ID
      description: >-
        Retrieves detailed information for a specific product by its Shopify
        product ID. Returns complete product details including all variants,
        images, and selling plan associations.


        **Product Information Returned:**

        - Basic Details: Title, description, handle, status

        - Variants: All product variants with pricing

        - Images: Product images and variant-specific images

        - Selling Plans: Associated subscription plans

        - Metadata: Tags, vendor, product type

        - Options: Color, size, and other variant options


        **Use Cases:**

        - Display product details in subscription management UI

        - Validate product availability for subscriptions

        - Get pricing information for subscription creation

        - Fetch product data for order processing


        **Authentication:** Requires valid api_key parameter
      operationId: getProductData
      parameters:
        - name: productId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Product retrieved successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Product'
        '401':
          description: Invalid API key
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Product'
        '404':
          description: Product not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Product'
  /subscriptions/cp/api/data/contract-delivery-options:
    get:
      tags:
        - Subscription Management
      summary: Get delivery options for subscription contract
      description: >-
        Retrieves all valid delivery methods available for a specific
        subscription contract. Returns shipping profiles and delivery options
        based on the contract's delivery address and product characteristics.


        **Delivery Information Returned:**

        - Available shipping profiles

        - Delivery methods for each profile

        - Shipping rates and costs

        - Delivery speed (standard, express, etc.)

        - Method names and descriptions

        - Eligibility based on address and products


        **Filtering Behavior:**

        By default, returns only delivery methods valid for the contract:

        - Matches delivery address country/region

        - Compatible with subscription products

        - Available for contract weight/dimensions


        **Include All Methods:**

        Use header `X-Include-All-Methods: true` to return all delivery methods
        regardless of eligibility. Useful for admin UIs where you want to show
        all options.


        **Use Cases:**

        - Display delivery method selector in customer portal

        - Allow customers to change shipping method

        - Calculate shipping costs for subscription

        - Validate delivery method during subscription updates

        - Show upgrade options (standard to express)


        **Common Scenarios:**


        **Customer Portal - Change Delivery Speed:**

        1. Call this endpoint with contractId

        2. Display available methods to customer

        3. Customer selects preferred method

        4. Update subscription with new delivery method ID


        **Subscription Creation - Delivery Selection:**

        1. Get delivery options for draft contract

        2. Present options during checkout/signup

        3. Create subscription with selected method


        **Important Notes:**

        - Delivery options depend on current contract address

        - Changing address may change available methods

        - Costs may vary based on products in subscription

        - Some methods may have minimum order requirements

        - International shipping may have additional restrictions


        **Authentication:** Requires X-API-Key header
      operationId: getContractDeliveryOptions
      parameters:
        - name: contractId
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: X-Include-All-Methods
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Delivery options retrieved successfully
          content:
            application/json:
              examples:
                Success Response:
                  description: Success Response
                  value:
                    - profileId: 12345
                      profileName: Standard Shipping
                      methods:
                        - id: method_123
                          name: Standard Delivery (5-7 days)
                          code: STANDARD
                          price: '5.99'
                          currency: USD
                        - id: method_124
                          name: Express Delivery (2-3 days)
                          code: EXPRESS
                          price: '12.99'
                          currency: USD
        '401':
          description: Invalid API key
          content:
            application/json:
              example:
                error: Invalid API key
        '403':
          description: Access denied - Contract belongs to different shop
          content:
            application/json:
              example:
                error: Unauthorized access to contract
        '404':
          description: Contract not found
          content:
            application/json:
              example:
                error: Subscription contract not found
  /subscriptions/cp/api/customer-portal-settings/{id}:
    get:
      tags:
        - Customer Portal
      summary: Get customer portal settings
      description: >-
        Retrieves the customer portal configuration and settings for the
        authenticated shop. The customer portal is the self-service interface
        where subscribers can manage their subscriptions, update payment
        methods, modify delivery addresses, and more.


        **What is the Customer Portal?**

        The customer portal is a dedicated web interface that allows your
        subscribers to manage their subscription accounts independently. This
        reduces support burden and improves customer experience by enabling
        self-service subscription management.


        **Settings Returned:**

        - **Display Configuration**:
          - Portal theme and branding settings
          - Custom colors and logo
          - Layout preferences
          - Custom CSS selectors

        - **Feature Toggles**:
          - Enable/disable subscription pausing
          - Enable/disable order skipping
          - Enable/disable product swapping
          - Enable/disable frequency changes
          - Enable/disable quantity modifications
          - Enable/disable address editing
          - Enable/disable payment method updates
          - Enable/disable subscription cancellation

        - **Subscription Management Options**:
          - Maximum pause duration allowed
          - Minimum subscription duration requirements
          - Skip limits per billing cycle
          - Product swap availability
          - One-time product add-ons

        - **Communication Settings**:
          - Email notification preferences
          - Custom portal messaging
          - Support contact information
          - Help text and instructions

        - **Access Control**:
          - Portal authentication method
          - Password requirements
          - Magic link settings
          - Session duration

        - **Advanced Options**:
          - Custom domain configuration
          - Redirect URLs
          - Webhook endpoints
          - Analytics tracking settings

        **Use Cases:**

        - Display customer portal with correct branding and theme

        - Determine which features are available to subscribers

        - Build custom portal interfaces using your settings

        - Sync portal configuration across systems

        - Validate subscription management capabilities

        - Configure third-party integrations


        **Important Notes:**

        - Settings are shop-specific and unique per merchant

        - Some features may be restricted based on subscription plan

        - Changes to settings are reflected immediately in the portal

        - Custom CSS must be valid and secure

        - Portal URL is typically: shop-domain.com/apps/subscriptions


        **Common Configuration Scenarios:**


        **1. Standard Self-Service Portal:**

        - Allow pausing (up to 3 months)

        - Allow skipping (max 2 consecutive orders)

        - Allow frequency changes

        - Allow quantity updates

        - Allow address editing

        - Enable payment method updates

        - Enable cancellation with feedback


        **2. Locked-Down Portal (Minimal Self-Service):**

        - Disable pausing

        - Disable skipping

        - Disable cancellation (require support contact)

        - Allow address editing only

        - Allow payment method updates only


        **3. Full-Service Portal (Maximum Flexibility):**

        - Enable all subscription management features

        - Allow unlimited pauses and skips

        - Enable product swapping

        - Enable one-time add-ons

        - Allow subscription splitting/merging

        - Custom branding and domain


        **Authentication:** Requires valid X-API-Key header
      operationId: getCustomerPortalSettings
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Customer portal settings successfully retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalSettingsDTO'
              examples:
                Success Response:
                  description: Success Response
                  value:
                    id: 12345
                    shop: example-shop.myshopify.com
                    portalEnabled: true
                    customDomain: subscriptions.example.com
                    allowPause: true
                    maxPauseDuration: 90
                    allowSkip: true
                    maxConsecutiveSkips: 2
                    allowFrequencyChange: true
                    allowQuantityChange: true
                    allowProductSwap: true
                    allowAddressEdit: true
                    allowPaymentMethodUpdate: true
                    allowCancellation: true
                    requireCancellationReason: true
                    enableOneTimeProducts: true
                    minimumSubscriptionCycles: 3
                    theme:
                      primaryColor: '#4A90E2'
                      secondaryColor: '#50E3C2'
                      accentColor: '#F5A623'
                      fontFamily: '''Helvetica Neue'', Arial, sans-serif'
                      logoUrl: >-
                        https://cdn.shopify.com/s/files/1/0000/0000/files/logo.png
                      customCss: '.subscription-card { border-radius: 8px; }'
                    authentication:
                      method: MAGIC_LINK
                      sessionDuration: 3600
                      requireEmailVerification: true
                    notifications:
                      sendSkipConfirmation: true
                      sendPauseConfirmation: true
                      sendFrequencyChangeConfirmation: true
                      sendCancellationConfirmation: true
                    supportContact:
                      email: support@example.com
                      phone: +1-800-123-4567
                      chatEnabled: true
                    createdAt: '2024-01-15T10:30:00Z'
                    updatedAt: '2024-02-20T14:45:00Z'
        '401':
          description: Authentication required
          content:
            application/json:
              example:
                type: https://example.com/errors/unauthorized
                title: Authentication required
                status: 401
                detail: Valid X-API-Key header is required
        '403':
          description: Insufficient permissions to view customer portal settings
          content:
            application/json:
              example:
                type: https://example.com/errors/forbidden
                title: Insufficient permissions
                status: 403
                detail: API key does not have permission to view portal settings
        '404':
          description: >-
            Customer portal settings not found - Settings may not be initialized
            yet
          content:
            application/json:
              example:
                type: https://example.com/errors/not-found
                title: Settings not found
                status: 404
                detail: >-
                  Customer portal settings have not been configured for this
                  shop
  /subscriptions/cp/api/customer-account-api/status:
    get:
      tags:
        - Customer Portal
      summary: Check Customer Account API authentication status
      description: >-
        Checks whether the current customer has valid Customer Account API
        tokens stored. Used by the customer portal to determine if the customer
        needs to authenticate.


        **Use Cases:**

        - Check if customer is authenticated before making Customer Account API
        GraphQL calls

        - Determine whether to show 'Connect Account' button in UI

        - Validate token validity before attempting sensitive operations


        **Response:**

        Returns authentication status and customer ID.


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: checkAuthStatus
      responses:
        '200':
          description: Authentication status retrieved successfully
          content:
            application/json:
              examples:
                Authenticated:
                  description: Authenticated
                  value:
                    authenticated: true
                    customerId: '123456789'
                Not Authenticated:
                  description: Not Authenticated
                  value:
                    authenticated: false
                    customerId: '123456789'
        '401':
          description: Customer not logged in
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: object
  /subscriptions/cp/api/customer-account-api/oauth/callback:
    get:
      tags:
        - Customer Portal
      summary: Handle OAuth callback from Shopify
      description: >-
        OAuth 2.0 callback endpoint that receives the authorization code from
        Shopify after customer authorization. This endpoint is called
        automatically by Shopify after the customer authorizes the app.


        **Flow:**

        1. Shopify redirects customer here with authorization code and state

        2. Validates state parameter to prevent CSRF

        3. Exchanges authorization code for access token using PKCE verifier

        4. Validates ID token (JWT) from Shopify

        5. Stores access token and refresh token securely

        6. Redirects customer back to original return URL


        **Security:**

        - Validates state parameter matches stored value

        - Uses PKCE code verifier to exchange authorization code

        - Validates ID token signature and claims

        - State expires after 10 minutes


        **Error Handling:**

        - If customer denies authorization, redirects with error parameter

        - If token exchange fails, redirects with error parameter

        - All errors are logged for debugging


        **Note:** This endpoint should not be called directly - it's invoked by
        Shopify's OAuth redirect.
      operationId: handleOAuthCallback
      parameters:
        - name: code
          in: query
          description: Authorization code from Shopify (if successful)
          required: false
          schema:
            type: string
          example: abc123...
        - name: state
          in: query
          description: State parameter for CSRF protection
          required: true
          schema:
            type: string
        - name: error
          in: query
          description: Error code if authorization failed
          required: false
          schema:
            type: string
          example: access_denied
        - name: error_description
          in: query
          description: Human-readable error description
          required: false
          schema:
            type: string
      responses:
        '302':
          description: Redirects to return URL with success or error parameter
        '400':
          description: Invalid or missing OAuth parameters
  /subscriptions/cp/api/customer-account-api/logout:
    get:
      tags:
        - Customer Portal
      summary: Logout from Customer Account API
      description: >-
        Logs out the customer from the Customer Account API session. This can be
        initiated either by the customer clicking logout in the customer portal,
        or by Shopify's end session callback.


        **What it does:**

        - Deletes stored access and refresh tokens

        - Initiates Shopify's end session flow (if tokens available)

        - Redirects to return URL or back to customer portal


        **Two scenarios:**

        1. **App-initiated logout**: Customer clicks logout in portal
           - Portal calls this endpoint with return URL
           - Tokens deleted, redirects to Shopify end session endpoint
           - Shopify redirects back to return URL

        2. **Shopify-initiated logout**: Customer logs out globally from Shopify
           - Shopify calls this endpoint with id_token_hint
           - Tokens deleted, returns success

        **Important:**

        - This only logs out from Customer Account API, not from Shopify
        customer account

        - Customer will need to re-authenticate to use Customer Account API
        features again

        - Does not affect regular customer portal access (subscription
        management)


        **Authentication:** Optional - can be called from Shopify without
        authentication
      operationId: handleLogout
      parameters:
        - name: return_url
          in: query
          description: URL to redirect to after logout
          required: false
          schema:
            type: string
          example: https://myshop.com/account
        - name: id_token_hint
          in: query
          description: ID token for Shopify-initiated logout (optional)
          required: false
          schema:
            type: string
        - name: shop
          in: query
          description: Shop domain (optional, for Shopify-initiated logout)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Logout successful (when no redirect configured)
        '302':
          description: Redirects to Shopify end session endpoint or return URL
  /subscriptions/cp/api/cancellation-managements/{id}:
    get:
      tags:
        - cancellation-management-resource
      operationId: getCancellationManagement
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CancellationManagementDTO'
  /subscriptions/cp/api/subscription-contracts/{id}:
    delete:
      tags:
        - subscription-contract-details-resource
      operationId: deleteSubscriptionContract
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: cancellationFeedback
          in: query
          required: false
          schema:
            type: string
        - name: cancellationNote
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
components:
  schemas:
    SubscriptionContractDetailsDTO:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        graphSubscriptionContractId:
          type: string
        subscriptionContractId:
          type: integer
          format: int64
        billingPolicyInterval:
          type: string
        billingPolicyIntervalCount:
          type: integer
          format: int32
        currencyCode:
          type: string
        customerId:
          type: integer
          format: int64
        graphCustomerId:
          type: string
        deliveryPolicyInterval:
          type: string
        deliveryPolicyIntervalCount:
          type: integer
          format: int32
        status:
          type: string
        graphOrderId:
          type: string
        orderId:
          type: integer
          format: int64
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        nextBillingDate:
          type: string
          format: date-time
        orderAmount:
          type: number
          format: double
        orderName:
          type: string
        customerName:
          type: string
        customerEmail:
          type: string
        subscriptionCreatedEmailSent:
          type: boolean
        endsAt:
          type: string
          format: date-time
        startsAt:
          type: string
          format: date-time
        subscriptionCreatedEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
        minCycles:
          type: integer
          format: int32
        maxCycles:
          type: integer
          format: int32
        customerFirstName:
          type: string
        customerLastName:
          type: string
        autoCharge:
          type: boolean
        importedId:
          type: string
        stopUpComingOrderEmail:
          type: boolean
        pausedFromActive:
          type: boolean
        subscriptionCreatedSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
            - PHONE_NUMBER_EMPTY
        phone:
          type: string
        activatedOn:
          type: string
          format: date-time
        pausedOn:
          type: string
          format: date-time
        cancelledOn:
          type: string
          format: date-time
        contractDetailsJSON:
          type: string
        deletedVariantIds:
          type: string
        cancellationFeedback:
          type: string
        orderNote:
          type: string
        orderNoteAttributes:
          type: string
        allowDeliveryPriceOverride:
          type: boolean
        disableFixEmptyQueue:
          type: boolean
        orderAmountUSD:
          type: number
          format: double
        originType:
          type: string
          enum:
            - STORE_FRONT
            - IMPORTED
            - SPLIT_ATTEMPT_BILLING
            - SPLIT_CONTRACT
        originalContractId:
          type: integer
          format: int64
        cancellationNote:
          type: string
        subscriptionType:
          type: string
          enum:
            - REGULAR_SUBSCRIPTION
            - BUILD_A_BOX_CLASSIC
            - BUILD_A_BOX_SINGLE_PRODUCT
            - BUNDLING_CLASSIC
            - BUNDLING_MIX_AND_MATCH
            - SECTIONED_BUNDLE
            - VOLUME_DISCOUNT
        subscriptionTypeIdentifier:
          type: string
        upcomingEmailBufferDays:
          type: integer
          format: int32
        upcomingEmailTaskUrl:
          type: string
        contractAmount:
          type: number
          format: double
        contractAmountUSD:
          type: number
          format: double
        lastSuccessfulOrder:
          type: string
        totalSuccessfulOrders:
          type: integer
          format: int32
        lifetimeValue:
          type: number
          format: double
        lifetimeValueUSD:
          type: number
          format: double
        allowDeliveryAddressOverride:
          type: boolean
        billingDateAfterTrial:
          type: string
          format: date-time
        pauseReason:
          type: string
        pauseFeedback:
          type: string
        pauseTillDate:
          type: string
          format: date-time
        pauseDurationCycle:
          type: integer
          format: int32
        emailBouncedOrFailed:
          type: boolean
        updatingQueue:
          type: boolean
        customerTag:
          type: string
        queueUpdatedAt:
          type: string
          format: date-time
        orderAmountShopCurrency:
          type: number
          format: double
        orderAmountContractCurrency:
          type: number
          format: double
        billingCountryCode:
          type: string
        deliveryCountryCode:
          type: string
    SectionedBundleItems:
      type: object
      properties:
        id:
          type: integer
          format: int32
        sectionedVariantInfos:
          type: array
          items:
            $ref: '#/components/schemas/SectionedVariantInfo'
    SectionedBundleRequest:
      type: object
      properties:
        bundleUniqueId:
          type: string
        sectionedBundleItems:
          type: array
          items:
            $ref: '#/components/schemas/SectionedBundleItems'
    SectionedVariantInfo:
      type: object
      properties:
        variantId:
          type: string
        variantQty:
          type: integer
          format: int32
    AdjustmentValue:
      type: object
      properties:
        get__typename:
          type: string
    Amount:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    Anchor:
      type: object
      properties:
        get__typename:
          type: string
        cutoffDay:
          type: integer
          format: int32
        day:
          type: integer
          format: int32
        month:
          type: integer
          format: int32
        type:
          type: string
          enum:
            - WEEKDAY
            - MONTHDAY
            - YEARDAY
            - $UNKNOWN
    Anchor1:
      type: object
      properties:
        get__typename:
          type: string
        cutoffDay:
          type: integer
          format: int32
        day:
          type: integer
          format: int32
        month:
          type: integer
          format: int32
        type:
          type: string
          enum:
            - WEEKDAY
            - MONTHDAY
            - YEARDAY
            - $UNKNOWN
    BasePrice:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    BillingAttempts:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node3'
    BillingPolicy:
      type: object
      properties:
        get__typename:
          type: string
        interval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
            - $UNKNOWN
        intervalCount:
          type: integer
          format: int32
        anchors:
          type: array
          items:
            $ref: '#/components/schemas/Anchor'
        maxCycles:
          type: integer
          format: int32
        minCycles:
          type: integer
          format: int32
    ComputedPrice:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    CurrentPrice:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    CustomAttribute:
      type: object
      properties:
        get__typename:
          type: string
        key:
          type: string
        value:
          type: string
    CustomAttribute1:
      type: object
      properties:
        get__typename:
          type: string
        key:
          type: string
        value:
          type: string
    Customer:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        email:
          type: string
          deprecated: true
        displayName:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        phone:
          type: string
          deprecated: true
    CustomerPaymentMethod:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        instrument:
          $ref: '#/components/schemas/Instrument'
        revokedAt:
          type: object
        revokedReason:
          type: string
          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
    CycleDiscount:
      type: object
      properties:
        get__typename:
          type: string
        afterCycle:
          type: integer
          format: int32
        computedPrice:
          $ref: '#/components/schemas/ComputedPrice'
        adjustmentType:
          type: string
          enum:
            - PERCENTAGE
            - FIXED_AMOUNT
            - PRICE
            - $UNKNOWN
        adjustmentValue:
          $ref: '#/components/schemas/AdjustmentValue'
    DeliveryMethod:
      type: object
      properties:
        get__typename:
          type: string
    DeliveryPolicy:
      type: object
      properties:
        get__typename:
          type: string
        interval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
            - $UNKNOWN
        intervalCount:
          type: integer
          format: int32
        anchors:
          type: array
          items:
            $ref: '#/components/schemas/Anchor1'
    DeliveryPrice:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    Discount:
      type: object
      properties:
        get__typename:
          type: string
    DiscountAllocation:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          $ref: '#/components/schemas/Amount'
        discount:
          $ref: '#/components/schemas/Discount'
    Discounts:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node2'
        pageInfo:
          $ref: '#/components/schemas/PageInfo2'
    FulfillmentOrders:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node1'
        pageInfo:
          $ref: '#/components/schemas/PageInfo1'
    Instrument:
      type: object
      properties:
        get__typename:
          type: string
    LineDiscountedPrice:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    Lines:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
    Node:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        sellingPlanId:
          type: string
        sellingPlanName:
          type: string
        productId:
          type: string
        sku:
          type: string
        title:
          type: string
        variantId:
          type: string
        quantity:
          type: integer
          format: int32
        customAttributes:
          type: array
          items:
            $ref: '#/components/schemas/CustomAttribute'
        lineDiscountedPrice:
          $ref: '#/components/schemas/LineDiscountedPrice'
        variantImage:
          $ref: '#/components/schemas/VariantImage'
        variantTitle:
          type: string
        currentPrice:
          $ref: '#/components/schemas/CurrentPrice'
        discountAllocations:
          type: array
          items:
            $ref: '#/components/schemas/DiscountAllocation'
        pricingPolicy:
          $ref: '#/components/schemas/PricingPolicy'
        taxable:
          type: boolean
    Node1:
      type: object
      properties:
        get__typename:
          type: string
        fulfillAt:
          type: object
        id:
          type: string
        status:
          type: string
          enum:
            - OPEN
            - IN_PROGRESS
            - CANCELLED
            - INCOMPLETE
            - CLOSED
            - SCHEDULED
            - ON_HOLD
            - $UNKNOWN
    Node2:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        title:
          type: string
        value:
          $ref: '#/components/schemas/Value'
        recurringCycleLimit:
          type: integer
          format: int32
        targetType:
          type: string
          enum:
            - LINE_ITEM
            - SHIPPING_LINE
            - $UNKNOWN
        type:
          type: string
          enum:
            - MANUAL
            - CODE_DISCOUNT
            - AUTOMATIC_DISCOUNT
            - $UNKNOWN
        rejectionReason:
          type: string
          enum:
            - NOT_FOUND
            - NO_ENTITLED_LINE_ITEMS
            - QUANTITY_NOT_IN_RANGE
            - PURCHASE_NOT_IN_RANGE
            - CUSTOMER_NOT_ELIGIBLE
            - USAGE_LIMIT_REACHED
            - CUSTOMER_USAGE_LIMIT_REACHED
            - CURRENTLY_INACTIVE
            - NO_ENTITLED_SHIPPING_LINES
            - INCOMPATIBLE_PURCHASE_TYPE
            - INTERNAL_ERROR
            - $UNKNOWN
    Node3:
      type: object
      properties:
        get__typename:
          type: string
        completedAt:
          type: object
        createdAt:
          type: object
        id:
          type: string
        idempotencyKey:
          type: string
        ready:
          type: boolean
    OriginOrder:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        name:
          type: string
        fulfillmentOrders:
          $ref: '#/components/schemas/FulfillmentOrders'
    PageInfo:
      type: object
      properties:
        get__typename:
          type: string
        hasPreviousPage:
          type: boolean
        hasNextPage:
          type: boolean
        startCursor:
          type: string
        endCursor:
          type: string
    PageInfo1:
      type: object
      properties:
        get__typename:
          type: string
        hasPreviousPage:
          type: boolean
        hasNextPage:
          type: boolean
        startCursor:
          type: string
        endCursor:
          type: string
    PageInfo2:
      type: object
      properties:
        get__typename:
          type: string
        hasPreviousPage:
          type: boolean
        hasNextPage:
          type: boolean
        startCursor:
          type: string
        endCursor:
          type: string
    PricingPolicy:
      type: object
      properties:
        get__typename:
          type: string
        basePrice:
          $ref: '#/components/schemas/BasePrice'
        cycleDiscounts:
          type: array
          items:
            $ref: '#/components/schemas/CycleDiscount'
    SubscriptionContract:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        createdAt:
          type: object
        updatedAt:
          type: object
        nextBillingDate:
          type: object
        status:
          type: string
          enum:
            - ACTIVE
            - PAUSED
            - CANCELLED
            - EXPIRED
            - FAILED
            - $UNKNOWN
        deliveryPrice:
          $ref: '#/components/schemas/DeliveryPrice'
        lastPaymentStatus:
          type: string
          enum:
            - SUCCEEDED
            - FAILED
            - $UNKNOWN
        billingPolicy:
          $ref: '#/components/schemas/BillingPolicy'
        deliveryPolicy:
          $ref: '#/components/schemas/DeliveryPolicy'
        lines:
          $ref: '#/components/schemas/Lines'
        customerPaymentMethod:
          $ref: '#/components/schemas/CustomerPaymentMethod'
        deliveryMethod:
          $ref: '#/components/schemas/DeliveryMethod'
        originOrder:
          $ref: '#/components/schemas/OriginOrder'
        customer:
          $ref: '#/components/schemas/Customer'
        discounts:
          $ref: '#/components/schemas/Discounts'
        note:
          type: string
        customAttributes:
          type: array
          items:
            $ref: '#/components/schemas/CustomAttribute1'
        billingAttempts:
          $ref: '#/components/schemas/BillingAttempts'
    Value:
      type: object
      properties:
        get__typename:
          type: string
    VariantImage:
      type: object
      properties:
        get__typename:
          type: string
        transformedSrc:
          type: object
          deprecated: true
    UpdateClassicBABSubscription:
      type: object
      properties:
        quantity:
          type: integer
          format: int32
        variantId:
          type: integer
          format: int64
        productId:
          type: integer
          format: int64
        lineId:
          type: string
    ChangeShippingAddressVM:
      type: object
      properties:
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        phone:
          type: string
        province:
          type: string
        zip:
          type: string
        country:
          type: string
        countryCode:
          type: string
        provinceCode:
          type: string
        company:
          type: string
        locationId:
          type: string
        methodType:
          type: string
    AttributeInfo:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
    FreezeStatusWrapper:
      type: object
      properties:
        freezeStatus:
          type: boolean
        errorMessage:
          type: string
    SubscriptionContractOneOffDTO:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier of the one-time product record
          format: int64
          readOnly: true
          example: 12345
        shop:
          pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*\.myshopify\.com$
          type: string
          description: The Shopify store domain that owns this subscription
          example: example-store.myshopify.com
        billingAttemptId:
          minimum: 1
          type: integer
          description: >-
            The billing attempt ID this one-time product is associated with.
            This determines which upcoming order will include this product.
          format: int64
          example: 54321
        subscriptionContractId:
          minimum: 1
          type: integer
          description: The subscription contract ID this one-time product belongs to
          format: int64
          example: 98765
        variantId:
          minimum: 1
          type: integer
          description: The Shopify product variant ID for this one-time product
          format: int64
          example: 42549172011164
        variantHandle:
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          type: string
          description: >-
            The handle/slug of the product variant for URL-friendly
            identification
          example: premium-coffee-blend-500g
        quantity:
          maximum: 999
          minimum: 1
          type: integer
          description: The quantity of this product to include in the order
          format: int32
          example: 2
        price:
          maximum: 999999.99
          minimum: 0
          type: number
          description: >-
            The price per unit of this product in the shop's base currency. This
            may include any applicable discounts.
          format: double
          example: 19.99
      description: >-
        Represents a one-time product added to a subscription contract for a
        specific billing attempt
    ReplaceVariantsInfoV3:
      required:
        - contractId
        - shop
      type: object
      properties:
        shop:
          type: string
          description: The Shop of the subscription contract to modify
          example: abcStore.myshopify.com
        contractId:
          type: integer
          description: The ID of the subscription contract to modify
          format: int64
          example: 123456789
        oldVariants:
          type: array
          description: >-
            List of variant IDs to remove from the subscription. These are
            numeric Shopify variant IDs. Either provide oldVariants OR
            oldLineId, not both.
          example:
            - 42549172011164
            - 42549172022222
          items:
            type: integer
            description: >-
              List of variant IDs to remove from the subscription. These are
              numeric Shopify variant IDs. Either provide oldVariants OR
              oldLineId, not both.
            format: int64
        newVariants:
          type: object
          additionalProperties:
            type: integer
            description: >-
              Map of new variant IDs to their quantities. Key is the numeric
              Shopify variant ID, value is the desired quantity. If a variant
              already exists in the subscription and the system is configured to
              update existing quantities, the quantity will be added to the
              existing quantity.
            format: int32
          description: >-
            Map of new variant IDs to their quantities. Key is the numeric
            Shopify variant ID, value is the desired quantity. If a variant
            already exists in the subscription and the system is configured to
            update existing quantities, the quantity will be added to the
            existing quantity.
          example:
            '42549172033333': 2
            '42549172044444': 1
        newOneTimeVariants:
          type: object
          additionalProperties:
            type: integer
            description: >-
              Map of one-time product variant IDs to add with their quantities.
              These products will be charged only once with the next order and
              won't recur. Useful for add-ons, samples, or limited-time offers.
            format: int32
          description: >-
            Map of one-time product variant IDs to add with their quantities.
            These products will be charged only once with the next order and
            won't recur. Useful for add-ons, samples, or limited-time offers.
          example:
            '42549172066666': 1
            '42549172077777': 2
        oldOneTimeVariants:
          type: array
          description: >-
            List of one-time product variant IDs to remove from the
            subscription. Only removes one-time products that haven't been
            fulfilled yet.
          example:
            - 42549172055555
            - 42549172088888
          items:
            type: integer
            description: >-
              List of one-time product variant IDs to remove from the
              subscription. Only removes one-time products that haven't been
              fulfilled yet.
            format: int64
        oldLineId:
          type: string
          description: >-
            Specific subscription line ID to replace. Use this for targeted
            replacement of a single line item. When provided, oldVariants should
            be empty. Format: gid://shopify/SubscriptionLine/[ID]
          example: gid://shopify/SubscriptionLine/987654321
        eventSource:
          type: string
          enum:
            - CUSTOMER_PORTAL
            - MERCHANT_PORTAL
            - SHOPIFY_EVENT
            - SYSTEM_EVENT
            - MERCHANT_PORTAL_BULK_AUTOMATION
            - MERCHANT_EXTERNAL_API
            - SHOPIFY_FLOW
        carryForwardDiscount:
          type: string
          description: >-
            Determines how discounts are applied to new products when replacing
            variants. If not specified, uses the merchant's default setting.
          example: PRODUCT_THEN_EXISTING
          enum:
            - NONE
            - EXISTING_PLAN
            - PRODUCT_PLAN
            - PRODUCT_THEN_EXISTING
            - PRODUCT_THEN_EXISTING
            - PRODUCT_PLAN
            - EXISTING_PLAN
        stopSwapEmails:
          type: boolean
          description: >-
            If true, suppresses email notifications about the product swap.
            Default is false (emails will be sent).
          example: false
          default: false
      description: >-
        Product replacement configuration for subscription contracts. Allows
        replacing existing subscription products with new ones, managing
        quantities, and handling one-time purchases.
    SwapSingleBABProduct:
      type: object
      properties:
        replaceVariantsInfo:
          $ref: '#/components/schemas/ReplaceVariantsInfoV3'
        attributeInfoList:
          type: array
          items:
            $ref: '#/components/schemas/AttributeInfo'
    SubscriptionBillingAttemptDTO:
      required:
        - retryingNeeded
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        billingAttemptId:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAILURE
            - REQUESTING
            - PROGRESS
            - QUEUED
            - SKIPPED
            - SOCIAL_CONNECTION_NULL
            - CONTRACT_CANCELLED
            - CONTRACT_ENDED
            - CONTRACT_PAUSED
            - AUTO_CHARGE_DISABLED
            - SHOPIFY_EXCEPTION
            - SKIPPED_DUNNING_MGMT
            - SKIPPED_INVENTORY_MGMT
            - IMMEDIATE_TRIGGERED
            - SECURITY_CHALLENGE
            - CONTRACT_PAUSED_MAX_CYCLES
            - REFUNDED
            - SKIPPED_DEMO_SHOP
            - SKIPPED_SHOP_INFO_NOT_FOUND
            - SKIPPED_BILLING_DATE_STALE
            - SKIPPED_DUNNING_NOT_CONFIGURED
        billingDate:
          type: string
          format: date-time
        contractId:
          type: integer
          format: int64
        attemptCount:
          type: integer
          format: int32
        attemptTime:
          type: string
          format: date-time
        graphOrderId:
          type: string
        orderId:
          type: integer
          format: int64
        orderAmount:
          type: number
          format: double
        orderName:
          type: string
        retryingNeeded:
          type: boolean
        transactionFailedEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
        upcomingOrderEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
        applyUsageCharge:
          type: boolean
        recurringChargeId:
          type: integer
          format: int64
        transactionRate:
          type: number
          format: double
        usageChargeStatus:
          type: string
          enum:
            - SUCCESS
            - FAILED
            - TO_BE_TRIED
        transactionFailedSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - PHONE_NUMBER_EMPTY
        upcomingOrderSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
            - PHONE_NUMBER_EMPTY
        billingAttemptResponseMessage:
          type: string
        progressAttemptCount:
          type: integer
          format: int32
        orderNote:
          type: string
        variantList:
          type: array
          items:
            $ref: '#/components/schemas/VariantQuantity'
        securityChallengeSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CONTRACT_CANCELLED
        orderAmountUSD:
          type: number
          format: double
        orderCancelReason:
          type: string
          enum:
            - CUSTOMER
            - DECLINED
            - FRAUD
            - INVENTORY
            - STAFF
            - OTHER
            - $UNKNOWN
        orderCancelledAt:
          type: string
          format: date-time
        orderClosed:
          type: boolean
        orderClosedAt:
          type: string
          format: date-time
        orderConfirmed:
          type: boolean
        orderDisplayFinancialStatus:
          type: string
          enum:
            - PENDING
            - AUTHORIZED
            - PARTIALLY_PAID
            - PARTIALLY_REFUNDED
            - VOIDED
            - PAID
            - REFUNDED
            - EXPIRED
            - $UNKNOWN
        orderDisplayFulfillmentStatus:
          type: string
          enum:
            - UNFULFILLED
            - PARTIALLY_FULFILLED
            - FULFILLED
            - RESTOCKED
            - PENDING_FULFILLMENT
            - OPEN
            - IN_PROGRESS
            - ON_HOLD
            - SCHEDULED
            - REQUEST_DECLINED
            - $UNKNOWN
        orderProcessedAt:
          type: string
          format: date-time
        lastShippingUpdatedAt:
          type: string
          format: date-time
        inventorySkippedAttemptCount:
          type: integer
          format: int32
        inventorySkippedRetryingNeeded:
          type: boolean
        orderAttributes:
          type: array
          items:
            $ref: '#/components/schemas/AttributeInfo'
        partialLinesSkipped:
          type: string
          enum:
            - INVENTORY_MANAGEMENT
            - MANUAL
        orderAmountContractCurrency:
          type: number
          format: double
    VariantQuantity:
      type: object
      properties:
        variantId:
          type: integer
          format: int64
        quantity:
          type: integer
          format: int32
        title:
          type: string
        image:
          type: string
        productTitle:
          type: string
        productId:
          type: string
        variantTitle:
          type: string
        swapId:
          type: integer
          format: int64
    OrderNoteAttribute:
      required:
        - key
      type: object
      properties:
        key:
          type: string
          description: >-
            The attribute key. Should be a unique identifier for this attribute.
            Use descriptive keys like 'gift_message', 'delivery_instructions',
            etc.
          example: gift_message
        value:
          type: string
          description: >-
            The attribute value. Can be any string value including JSON-encoded
            data. Set to empty string to clear an attribute.
          example: Happy Birthday! Enjoy your subscription!
      description: A custom attribute consisting of a key and value
    UpdateAttributesRequest:
      required:
        - customAttributesList
        - subscriptionContractId
      type: object
      properties:
        subscriptionContractId:
          type: integer
          description: The ID of the subscription contract to update
          format: int64
          example: 123456789
        customAttributesList:
          type: array
          description: >-
            List of custom attributes to set on the subscription contract. Each
            attribute is a key-value pair that will be stored with the
            subscription.
          items:
            $ref: '#/components/schemas/OrderNoteAttribute'
      description: Request to update custom attributes on a subscription contract
    VariantQuantityInfo:
      type: object
      properties:
        variantQuantityList:
          type: array
          items:
            $ref: '#/components/schemas/VariantQuantity'
    CustomerRetentionActivityDTO:
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        contractId:
          type: integer
          format: int64
        activityOn:
          type: string
          format: date-time
        retentionAction:
          type: string
        cancellationReason:
          type: string
        discountApplied:
          type: string
        additionalInfo:
          type: string
        eventSource:
          type: string
          enum:
            - PAUSE
            - CANCELLATION
    InitiateOAuthRequest:
      type: object
      properties:
        returnUrl:
          type: string
    GraphQLRequest:
      type: object
      properties:
        query:
          type: string
        variables:
          type: object
          additionalProperties:
            type: object
    Address:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        formattedArea:
          type: string
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        company:
          type: string
        lastName:
          type: string
        phone:
          type: string
        countryCodeV2:
          type: string
          enum:
            - AF
            - AX
            - AL
            - DZ
            - AD
            - AO
            - AI
            - AG
            - AR
            - AM
            - AW
            - AC
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - KH
            - CA
            - CV
            - BQ
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - GF
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GP
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - XK
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MQ
            - MR
            - MU
            - YT
            - MX
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - AN
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MK
            - 'NO'
            - OM
            - PK
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - QA
            - CM
            - RE
            - RO
            - RU
            - RW
            - BL
            - SH
            - KN
            - LC
            - MF
            - PM
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - KR
            - SS
            - ES
            - LK
            - VC
            - SD
            - SR
            - SJ
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TA
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - US
            - UM
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - WF
            - EH
            - YE
            - ZM
            - ZW
            - ZZ
            - $UNKNOWN
        country:
          type: string
        firstName:
          type: string
        name:
          type: string
        provinceCode:
          type: string
        province:
          type: string
        zip:
          type: string
        formatted:
          type: array
          items:
            type: string
        validationResultSummary:
          type: string
          enum:
            - NO_ISSUES
            - ERROR
            - WARNING
            - $UNKNOWN
    PaymentMethods:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
    Pageable:
      type: object
      properties:
        page:
          minimum: 0
          type: integer
          format: int32
        size:
          minimum: 1
          type: integer
          format: int32
        sort:
          type: array
          items:
            type: string
    SubscriptionBillingAttempt:
      required:
        - retryingNeeded
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        billingAttemptId:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - FAILURE
            - REQUESTING
            - PROGRESS
            - QUEUED
            - SKIPPED
            - SOCIAL_CONNECTION_NULL
            - CONTRACT_CANCELLED
            - CONTRACT_ENDED
            - CONTRACT_PAUSED
            - AUTO_CHARGE_DISABLED
            - SHOPIFY_EXCEPTION
            - SKIPPED_DUNNING_MGMT
            - SKIPPED_INVENTORY_MGMT
            - IMMEDIATE_TRIGGERED
            - SECURITY_CHALLENGE
            - CONTRACT_PAUSED_MAX_CYCLES
            - REFUNDED
            - SKIPPED_DEMO_SHOP
            - SKIPPED_SHOP_INFO_NOT_FOUND
            - SKIPPED_BILLING_DATE_STALE
            - SKIPPED_DUNNING_NOT_CONFIGURED
        billingDate:
          type: string
          format: date-time
        contractId:
          type: integer
          format: int64
        attemptCount:
          type: integer
          format: int32
        attemptTime:
          type: string
          format: date-time
        graphOrderId:
          type: string
        orderId:
          type: integer
          format: int64
        orderAmount:
          type: number
          format: double
        orderName:
          type: string
        retryingNeeded:
          type: boolean
        transactionFailedEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
        upcomingOrderEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
        applyUsageCharge:
          type: boolean
        recurringChargeId:
          type: integer
          format: int64
        transactionRate:
          type: number
          format: double
        usageChargeStatus:
          type: string
          enum:
            - SUCCESS
            - FAILED
            - TO_BE_TRIED
        transactionFailedSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - PHONE_NUMBER_EMPTY
        upcomingOrderSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
            - PHONE_NUMBER_EMPTY
        billingAttemptResponseMessage:
          type: string
        progressAttemptCount:
          type: integer
          format: int32
        orderNote:
          type: string
        securityChallengeSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CONTRACT_CANCELLED
        orderAmountUSD:
          type: number
          format: double
        lastShippingUpdatedAt:
          type: string
          format: date-time
        inventorySkippedAttemptCount:
          type: integer
          format: int32
        inventorySkippedRetryingNeeded:
          type: boolean
        partialLinesSkipped:
          type: string
          enum:
            - INVENTORY_MANAGEMENT
            - MANUAL
        orderAmountContractCurrency:
          type: number
          format: double
    SubscriptionBillingAttemptDetails:
      type: object
      properties:
        subscriptionBillingAttempt:
          $ref: '#/components/schemas/SubscriptionBillingAttempt'
        subscriptionContractDetails:
          $ref: '#/components/schemas/SubscriptionContractDetails'
    SubscriptionContractDetails:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        graphSubscriptionContractId:
          type: string
        subscriptionContractId:
          type: integer
          format: int64
        billingPolicyInterval:
          type: string
        billingPolicyIntervalCount:
          type: integer
          format: int32
        currencyCode:
          type: string
        customerId:
          type: integer
          format: int64
        graphCustomerId:
          type: string
        deliveryPolicyInterval:
          type: string
        deliveryPolicyIntervalCount:
          type: integer
          format: int32
        status:
          type: string
        graphOrderId:
          type: string
        orderId:
          type: integer
          format: int64
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        nextBillingDate:
          type: string
          format: date-time
        orderAmount:
          type: number
          format: double
        orderName:
          type: string
        customerName:
          type: string
        customerEmail:
          type: string
        subscriptionCreatedEmailSent:
          type: boolean
        endsAt:
          type: string
          format: date-time
        startsAt:
          type: string
          format: date-time
        subscriptionCreatedEmailSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
        minCycles:
          type: integer
          format: int32
        maxCycles:
          type: integer
          format: int32
        customerFirstName:
          type: string
        customerLastName:
          type: string
        autoCharge:
          type: boolean
        importedId:
          type: string
        stopUpComingOrderEmail:
          type: boolean
        pausedFromActive:
          type: boolean
        subscriptionCreatedSmsSentStatus:
          type: string
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_PAUSED_STATUS
            - PHONE_NUMBER_EMPTY
        phone:
          type: string
        activatedOn:
          type: string
          format: date-time
        pausedOn:
          type: string
          format: date-time
        cancelledOn:
          type: string
          format: date-time
        contractDetailsJSON:
          type: string
        deletedVariantIds:
          type: string
        cancellationFeedback:
          type: string
        orderNote:
          type: string
        orderNoteAttributes:
          type: string
        allowDeliveryPriceOverride:
          type: boolean
        disableFixEmptyQueue:
          type: boolean
        orderAmountUSD:
          type: number
          format: double
        originType:
          type: string
          enum:
            - STORE_FRONT
            - IMPORTED
            - SPLIT_ATTEMPT_BILLING
            - SPLIT_CONTRACT
        originalContractId:
          type: integer
          format: int64
        cancellationNote:
          type: string
        subscriptionType:
          type: string
          enum:
            - REGULAR_SUBSCRIPTION
            - BUILD_A_BOX_CLASSIC
            - BUILD_A_BOX_SINGLE_PRODUCT
            - BUNDLING_CLASSIC
            - BUNDLING_MIX_AND_MATCH
            - SECTIONED_BUNDLE
            - VOLUME_DISCOUNT
        subscriptionTypeIdentifier:
          type: string
        upcomingEmailBufferDays:
          type: integer
          format: int32
        upcomingEmailTaskUrl:
          type: string
        contractAmount:
          type: number
          format: double
        contractAmountUSD:
          type: number
          format: double
        lastSuccessfulOrder:
          type: string
        totalSuccessfulOrders:
          type: integer
          format: int32
        lifetimeValue:
          type: number
          format: double
        lifetimeValueUSD:
          type: number
          format: double
        allowDeliveryAddressOverride:
          type: boolean
        billingDateAfterTrial:
          type: string
          format: date-time
        pauseReason:
          type: string
        pauseFeedback:
          type: string
        pauseTillDate:
          type: string
          format: date-time
        pauseDurationCycle:
          type: integer
          format: int32
        emailBouncedOrFailed:
          type: boolean
        updatingQueue:
          type: boolean
        customerTag:
          type: string
        queueUpdatedAt:
          type: string
          format: date-time
        orderAmountShopCurrency:
          type: number
          format: double
        orderAmountContractCurrency:
          type: number
          format: double
        billingCountryCode:
          type: string
        deliveryCountryCode:
          type: string
    LoyaltyPointRedemptionRule:
      type: object
      properties:
        id:
          type: integer
          format: int64
        icon:
          type: string
        pointsCostText:
          type: string
        description:
          type: string
        type:
          type: string
        name:
          type: string
        requiredMinimumPointsToRedeem:
          type: number
          format: double
        requiredMaximumPointsToRedeem:
          type: number
          format: double
        enableMinimumPointsToRedeem:
          type: boolean
        enableMaximumPointsToRedeem:
          type: boolean
        minimumPointsLabel:
          type: string
        maximumPointsLabel:
          type: string
    LoyaltyCustomerDataResponse:
      type: object
      properties:
        availablePointsBalance:
          type: integer
          format: int64
    LabelTranslationsInfo:
      type: object
      properties:
        isDefault:
          type: boolean
        locale:
          type: string
        value:
          type: string
    BundleDiscountRuleDTO:
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - PAUSED
            - DRAFT
        customerIncludeTags:
          type: string
        discountType:
          type: string
          enum:
            - PERCENTAGE
            - FIXED_AMOUNT
            - FIXED_BUNDLE_AMOUNT
            - TIERED_DISCOUNT
            - NO_DISCOUNT
            - FREE_GIFT
        discountValue:
          type: number
          format: double
        products:
          type: string
        variants:
          type: string
        sequenceNo:
          type: integer
          format: int32
        bundleType:
          type: string
          enum:
            - MIX_AND_MATCH
            - CLASSIC
            - INFINITE
            - CUSTOMIZE_BUNDLE
            - CLASSIC_BUILD_A_BOX
            - SINGLE_PRODUCT_BUILD_A_BOX
            - VOLUME_DISCOUNT
            - DISCOUNTED_PRICING
            - SHIPPING_DISCOUNT
            - BUY_X_GET_Y
            - SECTIONED_BUNDLE
        settings:
          type: string
        bundleProductId:
          type: integer
          format: int64
        bundleVariantId:
          type: string
        productHandle:
          type: string
        discountId:
          type: string
        price:
          type: number
          format: double
        numberOfProducts:
          type: integer
          format: int32
        subscriptionBundlingEnabled:
          type: boolean
        subscriptionId:
          type: integer
          format: int64
        minProductCount:
          type: integer
          format: int32
        maxProductCount:
          type: integer
          format: int32
        uniqueRef:
          type: string
        bundleRedirect:
          type: string
          enum:
            - CART
            - CHECKOUT
            - CUSTOM
            - NONE
        customRedirectURL:
          type: string
        minOrderAmount:
          type: number
          format: double
        tieredDiscount:
          type: string
        productViewStyle:
          type: string
          enum:
            - QUICK_ADD
            - VIEW_DETAILS
        singleProductSettings:
          type: string
        trackInventory:
          type: boolean
        sellingPlanType:
          type: string
          enum:
            - BUNDLE_LEVEL
            - PRODUCT_LEVEL
        clearCart:
          type: string
          enum:
            - DEFAULT
            - ENABLED
            - DISABLED
        minPrice:
          type: number
          format: double
        maxPrice:
          type: number
          format: double
        externalBuildABoxId:
          type: integer
          format: int64
        variantVisibilityType:
          type: string
          enum:
            - SHOW_VARIANTS_AS_INDIVIDUAL
            - SHOW_VARIANTS_AS_OPTIONS
        subTitle:
          type: string
        freeShipping:
          type: boolean
        themeType:
          type: string
          enum:
            - THEME_ONE
            - THEME_TWO
        showBundleInProductPage:
          type: boolean
        combinedWithProductDiscount:
          type: boolean
        combinedWithShippingDiscount:
          type: boolean
        combinedWithOrderDiscount:
          type: boolean
        allowedTags:
          type: string
        restrictTags:
          type: string
        selectionType:
          type: string
          enum:
            - FIXED
            - FLEXIBLE
        bundleHtml:
          type: string
        discountedVariants:
          type: string
        allowedCountries:
          type: string
        appliesOn:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
            - BOTH
            - ONE_TIME
            - SUBSCRIPTION
        purchaseRequirement:
          type: string
          enum:
            - MINIMUM_AMOUNT
            - MINIMUM_QUANTITY
            - NO_REQUIREMENT
        productDiscountType:
          type: string
          enum:
            - SELECTED_PRODUCT
            - EACH_PRODUCT
        countrySelectionType:
          type: string
          enum:
            - ALL_COUNTRY
            - SELECTED_COUNTRY
        discountApplyApproach:
          type: string
          enum:
            - SHOPIFY_DISCOUNT_FUNCTION
            - SHOPIFY_DISCOUNT_API
        discountedProductChooseType:
          type: string
          enum:
            - CHOOSE_ALL
            - CHOOSE_ONE
            - CHOOSE_SPECIFIC
        internalName:
          type: string
        sections:
          type: string
        limitToUsePerCustomer:
          type: integer
          format: int32
        discountedVariantSelectionLimit:
          type: integer
          format: int32
        hideOneTimePurchase:
          type: boolean
        hideSubscriptionPurchase:
          type: boolean
        maxOrderAmount:
          type: number
          format: double
        collectionData:
          type: string
        productSelectionType:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
        tag:
          type: string
        productChooseType:
          type: string
          enum:
            - CHOOSE_ALL
            - CHOOSE_ONE
            - CHOOSE_SPECIFIC
        variantSelectionLimit:
          type: integer
          format: int32
        discountTargetType:
          type: string
          enum:
            - PRODUCT
            - VARIANT
        enableSubscription:
          type: boolean
        subscriptionWidgetPosition:
          type: string
          enum:
            - ABOVE
            - BELOW
        subscribeTitle:
          type: string
        subscribeSubtitle:
          type: string
        subscriptionPreselected:
          type: boolean
        getYAppliesOn:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
            - BOTH
            - ONE_TIME
            - SUBSCRIPTION
        announcementBarMessage:
          type: string
        automaticDiscountNodeId:
          type: string
        recurringCycleLimit:
          type: integer
          format: int32
        automaticShippingDiscountNodeId:
          type: string
        scheduledBundleRule:
          type: boolean
        bundleActiveFrom:
          type: string
          format: date-time
        bundleActiveTo:
          type: string
          format: date-time
        bundleSubType:
          type: string
          enum:
            - BUY_X_GET_Y
        discountAppliesOn:
          type: string
          enum:
            - PER_QUANTITY
            - PER_ORDER
            - PER_LINE_ITEM
        layoutType:
          type: string
          enum:
            - LAYOUT_ONE
            - LAYOUT_TWO
            - LAYOUT_THREE
            - LAYOUT_FOUR
        style:
          type: string
        labels:
          type: string
        upsells:
          type: string
        enableVolumeDiscountUpsell:
          type: boolean
        combos:
          type: string
        subscriptionBundleLink:
          type: string
        hasOptionChanges:
          type: boolean
        hasProductChanges:
          type: boolean
        enableAnnouncementBar:
          type: boolean
        topBarFreeShippingMessage:
          type: string
        topBarPercentDiscountMessage:
          type: string
        topBarFixedDiscountMessage:
          type: string
        topBarDiscountRequiredQuantityMessage:
          type: string
        topBarDiscountRequiredAmountMessage:
          type: string
        topBarDiscountUnlockTitlePrefix:
          type: string
        enableSequentialProductLoading:
          type: boolean
        sequentialProductsPerBatch:
          type: integer
          format: int32
        showPricesWithoutDecimal:
          type: boolean
        showClassicBundleWidgetInChildProduct:
          type: boolean
        showUnitPrice:
          type: boolean
        unitLabel:
          type: string
        includedSubscriptionPlans:
          type: string
        excludeSubscriptionPlans:
          type: string
        showPriceOfChosenProductsOnly:
          type: boolean
        showPriceWithSubscriptionPrice:
          type: boolean
        perRowItem:
          type: string
          enum:
            - TWO
            - THREE
        borderRadius:
          type: integer
          format: int32
        cardGap:
          type: integer
          format: int32
        totalVisitor:
          type: integer
          format: int64
        totalOrderValue:
          type: number
          format: double
        averageOrderValue:
          type: number
          format: double
        conversionRate:
          type: integer
          format: int64
        cardBackgroundColor:
          type: string
        cardBorderColor:
          type: string
        cardHoverColor:
          type: string
        selectedCardBackgroundColor:
          type: string
        selectedCardBorderColor:
          type: string
        blockTitleColor:
          type: string
        tierTitleColor:
          type: string
        tierSubTitleColor:
          type: string
        tierPriceColor:
          type: string
        tierFullPriceColor:
          type: string
        saveBadgeBackgroundColor:
          type: string
        saveBadgeTextColor:
          type: string
        badgesBackgroundColor:
          type: string
        badgesTextColor:
          type: string
        tierFreeGiftBackgroundColor:
          type: string
        tierFreeGiftTextColor:
          type: string
        blockTitleFontSize:
          type: integer
          format: int32
        blockTitleFontStyle:
          type: string
        tierTitleFontSize:
          type: integer
          format: int32
        tierTitleFontStyle:
          type: string
        tierSubTitleFontSize:
          type: integer
          format: int32
        tierSubTitleFontStyle:
          type: string
        saveBadgeFontSize:
          type: integer
          format: int32
        saveBadgeFontStyle:
          type: string
        tierPriceFontSize:
          type: integer
          format: int32
        tierPriceFontStyle:
          type: string
        tierFullPriceFontSize:
          type: integer
          format: int32
        tierFullPriceFontStyle:
          type: string
        tierUnitLabelFontSize:
          type: integer
          format: int32
        tierUnitLabelFontStyle:
          type: string
        tierFreeGiftTitleFontSize:
          type: integer
          format: int32
        tierFreeGiftTitleFontStyle:
          type: string
        tierFreeGiftPriceFontSize:
          type: integer
          format: int32
        tierFreeGiftPriceFontStyle:
          type: string
        subscriptionTitleTextColor:
          type: string
        subscriptionSubTitleTextColor:
          type: string
        otherProductsProductTitleColor:
          type: string
        otherProductsButtonBackgroundColor:
          type: string
        otherProductsButtonTextColor:
          type: string
        otherProductsModalOverlayColor:
          type: string
        otherProductsModalHeadingLabelColor:
          type: string
        otherProductsModalProductTitleColor:
          type: string
        otherProductsModalPriceColor:
          type: string
        otherProductsModalFullPriceColor:
          type: string
        otherProductsModalButtonBackgroundColor:
          type: string
        otherProductsModalButtonTextColor:
          type: string
        subscriptionTitleFontSize:
          type: integer
          format: int32
        subscriptionSubTitleFontSize:
          type: integer
          format: int32
        otherProductsImageSize:
          type: integer
          format: int32
        otherProductsProductTitleSize:
          type: integer
          format: int32
        otherProductsModalImageSize:
          type: integer
          format: int32
        otherProductsModalProductTitleTextSize:
          type: integer
          format: int32
        otherProductsModalProductPriceTextSize:
          type: integer
          format: int32
        dedicatedSubscriptionLayout:
          type: string
          enum:
            - LAYOUT_ONE
            - LAYOUT_TWO
            - LAYOUT_THREE
        badgesStyles:
          type: string
          enum:
            - TRIANGLES
            - NORMAL
        oneTimeTitle:
          type: string
        oneTimeSubtitle:
          type: string
        otherProductsModalSubtitleLabel:
          type: string
        headingTextColor:
          type: string
        buttonBackgroundColor:
          type: string
        productCardBackgroundColor:
          type: string
        bundlePageBackgroundColor:
          type: string
        disabledTextColor:
          type: string
        fieldDisabledBackgroundColor:
          type: string
        primaryDisabledTextColor:
          type: string
        primaryDisabledColor:
          type: string
        primaryHoverColor:
          type: string
        secondaryTextColor:
          type: string
        primaryTextColor:
          type: string
        primaryColor:
          type: string
    ProductInfo:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        productId:
          type: integer
          format: int64
        productTitle:
          type: string
        productHandle:
          type: string
    SubscriptionBundling:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        subscriptionBundlingEnabled:
          type: boolean
        subscriptionId:
          type: integer
          format: int64
        minProductCount:
          type: integer
          format: int32
        maxProductCount:
          type: integer
          format: int32
        discount:
          type: number
          format: double
        uniqueRef:
          type: string
        bundleRedirect:
          type: string
          enum:
            - CART
            - CHECKOUT
            - CUSTOM
            - NONE
        customRedirectURL:
          type: string
        minOrderAmount:
          type: number
          format: double
        tieredDiscount:
          type: string
        productViewStyle:
          type: string
          enum:
            - QUICK_ADD
            - VIEW_DETAILS
        buildABoxType:
          type: string
          enum:
            - CLASSIC
            - SINGLE_PRODUCT
            - MIX_AND_MATCH
            - INFINITE
            - CUSTOMIZE_BUNDLE
            - CLASSIC_BUILD_A_BOX
            - SINGLE_PRODUCT_BUILD_A_BOX
            - VOLUME_DISCOUNT
            - DISCOUNTED_PRICING
            - SHIPPING_DISCOUNT
            - BUY_X_GET_Y
            - SECTIONED_BUNDLE
        singleProductSettings:
          type: string
        subscriptionGroup:
          type: string
        bundleTopHtml:
          type: string
        bundleBottomHtml:
          type: string
        proceedToCheckoutButtonText:
          type: string
        chooseProductsText:
          type: string
        name:
          type: string
        trackInventory:
          type: boolean
        allowOneTimePurchase:
          type: boolean
        thirdPartyRule:
          type: boolean
        selectionType:
          type: string
          enum:
            - FIXED
            - FLEXIBLE
        variants:
          type: string
        discountedVariants:
          type: string
        sections:
          type: string
        appliesOn:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
            - BOTH
            - ONE_TIME
            - SUBSCRIPTION
        productDiscountType:
          type: string
          enum:
            - SELECTED_PRODUCT
            - EACH_PRODUCT
        collectionData:
          type: string
        productSelectionType:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
        sellingPlanIds:
          type: string
        minUniqueProductCheck:
          type: boolean
    SubscriptionBundlingResponseV3:
      type: object
      properties:
        bundle:
          $ref: '#/components/schemas/SubscriptionBundling'
        subscriptionPlanProductInfoMap:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ProductInfo'
        subscriptionPlanVariantMap:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        subscriptionGroupPlans:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionGroupPlan'
        subscription:
          $ref: '#/components/schemas/SubscriptionGroupPlan'
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductInfo'
        variants:
          type: array
          items:
            type: string
    SubscriptionGroupPlan:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        groupName:
          type: string
        subscriptionId:
          type: integer
          format: int64
        productCount:
          type: integer
          format: int32
        productVariantCount:
          type: integer
          format: int32
        infoJson:
          type: string
        productIds:
          type: string
        variantIds:
          type: string
        variantProductIds:
          type: string
        translations:
          type: string
    Code:
      type: object
      properties:
        get__typename:
          type: string
        countryCode:
          type: string
          enum:
            - AF
            - AX
            - AL
            - DZ
            - AD
            - AO
            - AI
            - AG
            - AR
            - AM
            - AW
            - AC
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - KH
            - CA
            - CV
            - BQ
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - GF
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GP
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - XK
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MQ
            - MR
            - MU
            - YT
            - MX
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - AN
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MK
            - 'NO'
            - OM
            - PK
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - QA
            - CM
            - RE
            - RO
            - RU
            - RW
            - BL
            - SH
            - KN
            - LC
            - MF
            - PM
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - KR
            - SS
            - ES
            - LK
            - VC
            - SD
            - SR
            - SJ
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TA
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - US
            - UM
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - WF
            - EH
            - YE
            - ZM
            - ZW
            - ZZ
            - $UNKNOWN
        restOfWorld:
          type: boolean
    Country:
      type: object
      properties:
        get__typename:
          type: string
        name:
          type: string
        code:
          $ref: '#/components/schemas/Code'
        provinces:
          type: array
          items:
            $ref: '#/components/schemas/Province'
    Province:
      type: object
      properties:
        get__typename:
          type: string
        code:
          type: string
        id:
          type: string
        name:
          type: string
    SubscriptionPaymentInfoDTO:
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        contractId:
          type: integer
          format: int64
        paymentMethodId:
          type: string
        instrumentType:
          type: string
        cardLastDigits:
          type: string
        cardExpiryMonth:
          type: integer
          format: int32
        cardExpiryYear:
          type: integer
          format: int32
        cardHolderName:
          type: string
        cardBrand:
          type: string
        cardExpiresSoon:
          type: boolean
        cardSource:
          type: string
        baAddress1:
          type: string
        baCity:
          type: string
        baCountry:
          type: string
        baCountryCode:
          type: string
        baProvince:
          type: string
        baProvinceCode:
          type: string
        baZip:
          type: string
        baFirstName:
          type: string
        baLastName:
          type: string
        baName:
          type: string
    AppstleCycle:
      type: object
      properties:
        afterCycle:
          minimum: 1
          type: integer
          description: The billing cycle number after which this pricing applies
          format: int32
          example: 3
        discountType:
          type: string
          description: Type of discount to apply in pricing cycles
          example: PERCENTAGE
          enum:
            - PERCENTAGE
            - FIXED
            - PRICE
            - SHIPPING
            - FREE_PRODUCT
            - PERCENTAGE
            - FIXED
            - PRICE
            - SHIPPING
            - FREE_PRODUCT
        value:
          type: number
          description: >-
            Discount value. For PERCENTAGE: 0-100 (e.g., 10 for 10% off). For
            FIXED: amount to subtract from price. For PRICE: new fixed price.
            For SHIPPING: shipping discount amount. For FREE_PRODUCT: not used
            (set freeVariantId or freeProductHandle instead)
          format: double
          example: 10
        freeVariantId:
          type: integer
          description: >-
            Variant ID of a free product to add when discountType is
            FREE_PRODUCT
          format: int64
          example: 42549172011164
        freeProductHandle:
          type: string
          description: >-
            Product handle of a free product to add when discountType is
            FREE_PRODUCT
          example: free-gift-product
        repeatingCycle:
          type: boolean
          description: Whether this pricing should repeat for subsequent cycles
          example: true
        repeatingNumberOfCycle:
          minimum: 1
          type: integer
          description: >-
            Number of cycles to repeat this pricing for when repeatingCycle is
            true
          format: int32
          example: 6
        preventDuplicationFreeProduct:
          type: boolean
          description: Prevent adding duplicate free products if already in cart
          example: true
      description: Custom pricing cycle configuration for subscription line items
    FrequencyInfoDTO:
      type: object
      properties:
        frequencyCount:
          type: integer
          format: int32
        frequencyInterval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
        billingFrequencyCount:
          type: integer
          format: int32
        payAsYouGoPrepaidBillingFrequencyCount:
          type: integer
          format: int32
        billingFrequencyInterval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
        frequencyName:
          type: string
        frequencyDescription:
          type: string
        discountOffer:
          type: number
          format: double
        discountOffer2:
          type: number
          format: double
        afterCycle1:
          type: integer
          format: int32
        afterCycle2:
          type: integer
          format: int32
        discountType:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
            - PRICE
        discountType2:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
            - PRICE
        discountEnabled:
          type: boolean
        discountEnabled2:
          type: boolean
        discountEnabledMasked:
          type: boolean
        discountEnabled2Masked:
          type: boolean
        id:
          type: string
        frequencyType:
          type: string
          enum:
            - ON_PURCHASE_DAY
            - ON_SPECIFIC_DAY
        specificDayValue:
          type: integer
          format: int32
        specificMonthValue:
          type: integer
          format: int32
        specificDayEnabled:
          type: boolean
        maxCycles:
          type: integer
          format: int32
        minCycles:
          type: integer
          format: int32
        cutOff:
          type: integer
          format: int32
        prepaidFlag:
          type: string
        idNew:
          type: string
        planType:
          type: string
          enum:
            - PAY_AS_YOU_GO
            - PREPAID
            - ADVANCED_PREPAID
            - PAY_AS_YOU_GO_PREPAID
        deliveryPolicyPreAnchorBehavior:
          type: string
          enum:
            - ASAP
            - NEXT
            - $UNKNOWN
        freeTrialEnabled:
          type: boolean
        freeTrialCount:
          type: integer
          format: int32
        freeTrialInterval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
        memberOnly:
          type: boolean
        nonMemberOnly:
          type: boolean
        memberInclusiveTags:
          type: string
        memberExclusiveTags:
          type: string
        formFieldJson:
          type: string
        upcomingOrderEmailBuffer:
          type: integer
          format: int32
        frequencySequence:
          type: integer
          format: int32
        groupName:
          type: string
        groupId:
          type: integer
          format: int64
        repeatingCycle:
          type: boolean
        repeatingNumberOfCycle:
          type: integer
          format: int32
        keepOriginalNextBillingDateAfterTrial:
          type: boolean
        defaultSelectedPlan:
          type: boolean
        inventoryPolicyReserve:
          type: string
          enum:
            - ON_FULFILLMENT
            - ON_SALE
            - $UNKNOWN
        appstleCycles:
          type: array
          items:
            $ref: '#/components/schemas/AppstleCycle'
    SubscriptionCustomCssDTO:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        customCss:
          type: string
        customerPoratlCSS:
          type: string
        bundlingCSS:
          type: string
        bundlingIframeCSS:
          type: string
    Order:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        fulfillmentOrders:
          $ref: '#/components/schemas/FulfillmentOrders'
    SubscriptionBundlingDTO:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        subscriptionBundlingEnabled:
          type: boolean
        subscriptionId:
          type: integer
          format: int64
        minProductCount:
          type: integer
          format: int32
        maxProductCount:
          type: integer
          format: int32
        discount:
          type: number
          format: double
        uniqueRef:
          type: string
        groupName:
          type: string
        subscriptionBundleLink:
          type: string
        bundleRedirect:
          type: string
          enum:
            - CART
            - CHECKOUT
            - CUSTOM
            - NONE
        customRedirectURL:
          type: string
        minOrderAmount:
          type: number
          format: double
        tieredDiscount:
          type: string
        productViewStyle:
          type: string
          enum:
            - QUICK_ADD
            - VIEW_DETAILS
        buildABoxType:
          type: string
          enum:
            - CLASSIC
            - SINGLE_PRODUCT
            - MIX_AND_MATCH
            - INFINITE
            - CUSTOMIZE_BUNDLE
            - CLASSIC_BUILD_A_BOX
            - SINGLE_PRODUCT_BUILD_A_BOX
            - VOLUME_DISCOUNT
            - DISCOUNTED_PRICING
            - SHIPPING_DISCOUNT
            - BUY_X_GET_Y
            - SECTIONED_BUNDLE
        singleProductSettings:
          type: string
        subscriptionGroup:
          type: string
        bundleTopHtml:
          type: string
        bundleBottomHtml:
          type: string
        proceedToCheckoutButtonText:
          type: string
        chooseProductsText:
          type: string
        name:
          type: string
        trackInventory:
          type: boolean
        allowOneTimePurchase:
          type: boolean
        thirdPartyRule:
          type: boolean
        selectionType:
          type: string
          enum:
            - FIXED
            - FLEXIBLE
        variants:
          type: string
        discountedVariants:
          type: string
        sections:
          type: string
        appliesOn:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
            - BOTH
            - ONE_TIME
            - SUBSCRIPTION
        productDiscountType:
          type: string
          enum:
            - SELECTED_PRODUCT
            - EACH_PRODUCT
        collectionData:
          type: string
        productSelectionType:
          type: string
          enum:
            - PRODUCT
            - COLLECTION
        sellingPlanIds:
          type: string
        minUniqueProductCheck:
          type: boolean
    SubscriptionBundleSettingsDTO:
      required:
        - addButtonText
        - myDeliveryText
        - proceedToCheckoutButtonText
        - productsToProceedText
        - selectMinimumProductButtonText
        - selectedFrequencyLabelText
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        selectedFrequencyLabelText:
          type: string
        addButtonText:
          type: string
        selectMinimumProductButtonText:
          type: string
        productsToProceedText:
          type: string
        proceedToCheckoutButtonText:
          type: string
        myDeliveryText:
          type: string
        bundleTopHtml:
          type: string
        bundleBottomHtml:
          type: string
        failedToAddTitleText:
          type: string
        okBtnText:
          type: string
        failedToAddMsgText:
          type: string
        buttonColor:
          type: string
        backgroundColor:
          type: string
        pageBackgroundColor:
          type: string
        buttonBackgroundColor:
          type: string
        variantNotAvailable:
          type: string
        bundleRedirect:
          type: string
          enum:
            - CART
            - CHECKOUT
            - CUSTOM
        isBundleWithoutScroll:
          type: boolean
        descriptionLength:
          type: integer
          format: int32
        currencySwitcherClassName:
          type: string
        productPriceFormatField:
          type: string
        customRedirectURL:
          type: string
        viewProduct:
          type: string
        productDetails:
          type: string
        editQuantity:
          type: string
        cart:
          type: string
        shoppingCart:
          type: string
        title:
          type: string
        tieredDiscount:
          type: string
        subtotal:
          type: string
        checkoutMessage:
          type: string
        continueShopping:
          type: string
        spendAmountGetDiscount:
          type: string
        buyQuantityGetDiscount:
          type: string
        removeItem:
          type: string
        showCompareAtPrice:
          type: boolean
        enableRedirectToProductPage:
          type: boolean
        disableProductDescription:
          type: boolean
        enableDisplayProductVendor:
          type: boolean
        enableDisplayProductType:
          type: boolean
        enableCustomAdvancedFields:
          type: boolean
        hideProductSearchBox:
          type: boolean
        productFilterConfig:
          type: string
        enableProductDetailButton:
          type: boolean
        enableShowProductBasePrice:
          type: boolean
        enableClearCartSelectedProducts:
          type: boolean
        enableSkieyBABHeader:
          type: boolean
        enableOpeningSidebar:
          type: boolean
        rightSidebarHTML:
          type: string
        leftSidebarHTML:
          type: string
        isMergeIntoSingleBABVariantDropdown:
          type: boolean
        enableEditQuantityTextbox:
          type: boolean
        displayUnavailableProduct:
          type: boolean
        allowAddUnavailableProduct:
          type: boolean
        showOrderNoteField:
          type: boolean
        showSubLoyaltyTable:
          type: boolean
        restrictPriceRateCalculation:
          type: boolean
        disableProductCardImageSlider:
          type: boolean
        skipFilterVariantsByAllocationsId:
          type: boolean
        openingSidebarType:
          type: string
          enum:
            - DEFAULT
            - MAX_QUANTITY
            - STOP_AUTO_OPEN
            - MIN_AMOUNT
        moveOneTimePurchaseToTop:
          type: boolean
        skipFirstPage:
          type: boolean
        congratsMessageText:
          type: string
        spentText:
          type: string
        quantityLabel:
          type: string
        variantLabelTextV2:
          type: string
        itemsText:
          type: string
        shopCustomizationData:
          type: array
          items:
            $ref: '#/components/schemas/UpdateShopCustomizationRequest'
        productTitleFontColor:
          type: string
        additionalProperty:
          type: object
          additionalProperties:
            type: object
          writeOnly: true
    UpdateShopCustomizationRequest:
      type: object
      properties:
        id:
          type: integer
          format: int64
        labelId:
          type: integer
          format: int64
        value:
          type: string
    ShopInfoResponseDTO:
      type: object
      properties:
        shop:
          type: string
        passwordEnabled:
          type: boolean
        buildBoxVersion:
          type: string
          enum:
            - V1
            - V2
            - V2_IFRAME
        allowLocalDelivery:
          type: boolean
        allowLocalPickup:
          type: boolean
        fordeerEnabled:
          type: boolean
        enableChangeFromNextBillingDate:
          type: boolean
        useStorefrontAPI:
          type: boolean
        looxReviewsEnabled:
          type: boolean
        changeNextOrderDateOnBillingAttempt:
          type: boolean
        regenerateScheduleOnManualAttempt:
          type: boolean
        customerPortalMode:
          type: string
          enum:
            - IFRAME
            - NO_IFRAME
            - V3
            - V3_IFRAME
        localOrderHour:
          type: integer
          format: int32
        localOrderMinute:
          type: integer
          format: int32
        appstleLoyaltyIntegrated:
          type: boolean
        allowShipping:
          type: boolean
        appstleBundleIntegrated:
          type: boolean
    AsProductVariant:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        inventoryPolicy:
          type: string
          enum:
            - DENY
            - CONTINUE
            - $UNKNOWN
        inventoryQuantity:
          type: integer
          format: int32
        title:
          type: string
        price:
          type: object
        inventoryItem:
          $ref: '#/components/schemas/InventoryItem'
        product:
          $ref: '#/components/schemas/Product'
    InventoryItem:
      type: object
      properties:
        get__typename:
          type: string
        tracked:
          type: boolean
        requiresShipping:
          type: boolean
    Product:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        title:
          type: string
        handle:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
            - DRAFT
            - UNLISTED
            - $UNKNOWN
    OrderLiveStatusDTO:
      type: object
      properties:
        graphOrderId:
          type: string
        orderId:
          type: integer
          format: int64
        orderName:
          type: string
        orderCancelReason:
          type: string
          enum:
            - CUSTOMER
            - DECLINED
            - FRAUD
            - INVENTORY
            - STAFF
            - OTHER
            - $UNKNOWN
        orderCancelledAt:
          type: string
          format: date-time
        orderClosed:
          type: boolean
        orderClosedAt:
          type: string
          format: date-time
        orderConfirmed:
          type: boolean
        orderDisplayFinancialStatus:
          type: string
          enum:
            - PENDING
            - AUTHORIZED
            - PARTIALLY_PAID
            - PARTIALLY_REFUNDED
            - VOIDED
            - PAID
            - REFUNDED
            - EXPIRED
            - $UNKNOWN
        orderDisplayFulfillmentStatus:
          type: string
          enum:
            - UNFULFILLED
            - PARTIALLY_FULFILLED
            - FULFILLED
            - RESTOCKED
            - PENDING_FULFILLMENT
            - OPEN
            - IN_PROGRESS
            - ON_HOLD
            - SCHEDULED
            - REQUEST_DECLINED
            - $UNKNOWN
        orderProcessedAt:
          type: string
          format: date-time
        orderCreatedAt:
          type: string
          format: date-time
        currencyCode:
          type: string
        totalPrice:
          type: string
        subtotalPrice:
          type: string
        totalTax:
          type: string
        totalShipping:
          type: string
        totalDiscount:
          type: string
        shippingAddress:
          $ref: '#/components/schemas/ShippingAddressDTO'
        shippingMethod:
          type: string
    ShippingAddressDTO:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        province:
          type: string
        country:
          type: string
        zip:
          type: string
        formatted:
          type: array
          items:
            type: string
    LoyaltyPointEarnCampaign:
      type: object
      properties:
        id:
          type: integer
          format: int64
        type:
          type: string
        name:
          type: string
        createAt:
          type: string
          format: date-time
        updateAt:
          type: string
          format: date-time
        details:
          type: string
        reward_text:
          type: string
        productData:
          type: string
        basePoints:
          type: integer
          format: int32
    ShopFulfillmentLocation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        pickupEnabled:
          type: boolean
    ContextualPricing:
      type: object
      properties:
        get__typename:
          type: string
        price:
          $ref: '#/components/schemas/Price'
    Media:
      type: object
      properties:
        get__typename:
          type: string
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
    Price:
      type: object
      properties:
        get__typename:
          type: string
        amount:
          type: object
        currencyCode:
          type: string
          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
    ProductVariant:
      type: object
      properties:
        get__typename:
          type: string
        id:
          type: string
        title:
          type: string
        media:
          $ref: '#/components/schemas/Media'
        product:
          $ref: '#/components/schemas/Product'
        price:
          type: object
        contextualPricing:
          $ref: '#/components/schemas/ContextualPricing'
        sku:
          type: string
    SubscribedProductVariantInfo:
      type: object
      properties:
        id:
          type: integer
          format: int64
        title:
          type: string
        handle:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
            - DRAFT
            - UNLISTED
            - $UNKNOWN
    ProductData:
      type: object
      properties:
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
        productHandleData:
          type: object
          additionalProperties:
            type: string
    CustomerPortalSettingsDTO:
      required:
        - amountLbl
        - cancelAccordionTitle
        - cancelFreqBtnText
        - cancelSubscriptionBtnText
        - cardExpiryText
        - cardHolderNameText
        - cardLastFourDigitText
        - cardTypeText
        - editFrequencyBtnText
        - nextOrderDateLbl
        - nextOrderText
        - noSubscriptionMessage
        - orderFrequencyText
        - orderNoLbl
        - paymentDetailAccordionTitle
        - paymentInfoText
        - paymentMethodTypeText
        - quantityLbl
        - shop
        - statusLbl
        - statusText
        - subscriptionNoText
        - totalProductsText
        - upcomingOrderAccordionTitle
        - updateFreqBtnText
        - updatePaymentBtnText
        - updatePaymentMessage
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        orderFrequencyText:
          type: string
        totalProductsText:
          type: string
        nextOrderText:
          type: string
        statusText:
          type: string
        cancelSubscriptionBtnText:
          type: string
        noSubscriptionMessage:
          type: string
        subscriptionNoText:
          type: string
        updatePaymentMessage:
          type: string
        cardLastFourDigitText:
          type: string
        cardExpiryText:
          type: string
        cardHolderNameText:
          type: string
        cardTypeText:
          type: string
        paymentMethodTypeText:
          type: string
        cancelAccordionTitle:
          type: string
        paymentDetailAccordionTitle:
          type: string
        upcomingOrderAccordionTitle:
          type: string
        paymentInfoText:
          type: string
        updatePaymentBtnText:
          type: string
        nextOrderDateLbl:
          type: string
        statusLbl:
          type: string
        quantityLbl:
          type: string
        amountLbl:
          type: string
        orderNoLbl:
          type: string
        editFrequencyBtnText:
          type: string
        cancelFreqBtnText:
          type: string
        updateFreqBtnText:
          type: string
        pauseResumeSub:
          type: boolean
        changeNextOrderDate:
          type: boolean
        cancelSub:
          type: boolean
        changeOrderFrequency:
          type: boolean
        createAdditionalOrder:
          type: boolean
        manageSubscriptionButtonText:
          type: string
        editChangeOrderBtnText:
          type: string
        cancelChangeOrderBtnText:
          type: string
        updateChangeOrderBtnText:
          type: string
        editProductButtonText:
          type: string
        deleteButtonText:
          type: string
        updateButtonText:
          type: string
        cancelButtonText:
          type: string
        addProductButtonText:
          type: string
        addProductLabelText:
          type: string
        activeBadgeText:
          type: string
        closeBadgeText:
          type: string
        skipOrderButtonText:
          type: string
        productLabelText:
          type: string
        seeMoreDetailsText:
          type: string
        hideDetailsText:
          type: string
        productInSubscriptionText:
          type: string
        subTotalLabelText:
          type: string
        paymentNotificationText:
          type: string
        editProductFlag:
          type: boolean
        deleteProductFlag:
          type: boolean
        showShipment:
          type: boolean
        magicLinkEmailFlag:
          type: boolean
        addAdditionalProduct:
          type: boolean
        successText:
          type: string
        cancelSubscriptionConfirmPrepaidText:
          type: string
        cancelSubscriptionConfirmPayAsYouGoText:
          type: string
        cancelSubscriptionPrepaidButtonText:
          type: string
        cancelSubscriptionPayAsYouGoButtonText:
          type: string
        upcomingFulfillmentText:
          type: string
        creditCardText:
          type: string
        endingWithText:
          type: string
        weekText:
          type: string
        dayText:
          type: string
        monthText:
          type: string
        yearText:
          type: string
        skipBadgeText:
          type: string
        queueBadgeText:
          type: string
        shippingLabelText:
          type: string
        failureText:
          type: string
        sendEmailText:
          type: string
        chooseDifferentProductActionText:
          type: string
        chooseDifferentProductText:
          type: string
        confirmSkipFulfillmentBtnText:
          type: string
        confirmSkipOrder:
          type: string
        skipFulfillmentButtonText:
          type: string
        confirmCommonText:
          type: string
        orderNowDescriptionText:
          type: string
        discountDetailsTitleText:
          type: string
        emailAddressText:
          type: string
        emailMagicLinkText:
          type: string
        retriveMagicLinkText:
          type: string
        validEmailMessage:
          type: string
        saveButtonText:
          type: string
        orderDateText:
          type: string
        address1LabelText:
          type: string
        address2LabelText:
          type: string
        companyLabelText:
          type: string
        cityLabelText:
          type: string
        countryLabelText:
          type: string
        firstNameLabelText:
          type: string
        lastNameLabelText:
          type: string
        phoneLabelText:
          type: string
        provinceLabelText:
          type: string
        zipLabelText:
          type: string
        addressHeaderTitleText:
          type: string
        changeShippingAddressFlag:
          type: boolean
        updateEditShippingButtonText:
          type: string
        cancelEditShippingButtonText:
          type: string
        pauseSubscriptionText:
          type: string
        resumeSubscriptionText:
          type: string
        pauseBadgeText:
          type: string
        customerPortalSettingJson:
          type: string
        productFilterConfig:
          type: string
        discountNoteTitle:
          type: string
        initialDiscountNoteDescription:
          type: string
        afterCycleDiscountNoteDescription:
          type: string
        productRemovedTooltip:
          type: string
        deliveryPriceText:
          type: string
        shippingOptionText:
          type: string
        nextDeliveryDate:
          type: string
        everyLabelText:
          type: string
        orderNoteFlag:
          type: boolean
        orderNoteText:
          type: string
        useUrlWithCustomerId:
          type: boolean
        expiredTokenText:
          type: string
        portalLoginLinkText:
          type: string
        localeDate:
          type: string
        productSelectionOption:
          type: string
          enum:
            - ALL_PRODUCTS
            - PRODUCTS_FROM_ALL_PLANS
            - PRODUCTS_FROM_CURRENT_PLAN
        includeOutOfStockProduct:
          type: boolean
        customerIdText:
          type: string
        helloNameText:
          type: string
        goBackButtonText:
          type: string
        changeVariantLabelText:
          type: string
        provinceCodeLabelText:
          type: string
        countryCodeLabelText:
          type: string
        pleaseWaitLoaderText:
          type: string
        openBadgeText:
          type: string
        cancelSubscriptionMinimumBillingIterationsMessage:
          type: string
        topHtml:
          type: string
        bottomHtml:
          type: string
        updateShipmentBillingDate:
          type: boolean
        discountCodeText:
          type: string
        discountCodeApplyButtonText:
          type: string
        discountCode:
          type: boolean
        applySellingPlanBasedDiscount:
          type: boolean
        overrideDaysToRescheduleOrder:
          type: boolean
        applySubscriptionDiscountForOtp:
          type: boolean
        applySubscriptionDiscount:
          type: boolean
        allowSwapWhenContractIsFreeze:
          type: boolean
        removeDiscountCodeAutomatically:
          type: boolean
        removeDiscountCodeLabel:
          type: string
        enableSplitContract:
          type: boolean
        splitContractMessage:
          type: string
        splitContractText:
          type: string
        enableMergeContract:
          type: boolean
        subscriptionDiscountTypeUnit:
          type: string
          enum:
            - PERCENTAGE
            - AMOUNT
        subscriptionDiscount:
          type: number
          format: double
        upSellMessage:
          type: string
        freezeOrderTillMinCycle:
          type: boolean
        freezeUpdateSubscriptionMessage:
          type: string
        subscriptionContractFreezeMessage:
          type: string
        preventCancellationBeforeDaysMessage:
          type: string
        offerDiscountOnCancellation:
          type: boolean
        enableSkipFulFillment:
          type: boolean
        discountPercentageOnCancellation:
          type: string
        discountMessageOnCancellation:
          type: string
        discountRecurringCycleLimitOnCancellation:
          type: string
        frequencyChangeWarningTitle:
          type: string
        frequencyChangeWarningDescription:
          type: string
        discountCouponRemoveText:
          type: string
        pleaseSelectText:
          type: string
        shippingAddressNotAvailableText:
          type: string
        sellingPlanNameText:
          type: string
        discountCouponNotAppliedText:
          type: string
        shopPayPaymentUpdateText:
          type: string
        addOneTimeProduct:
          type: boolean
        allowOrderNow:
          type: boolean
        selectProductLabelText:
          type: string
        purchaseOptionLabelText:
          type: string
        finishLabelText:
          type: string
        nextBtnText:
          type: string
        previousBtnText:
          type: string
        closeBtnText:
          type: string
        deleteConfirmationMsgText:
          type: string
        deleteMsgText:
          type: string
        yesBtnText:
          type: string
        noBtnText:
          type: string
        oneTimePurchaseNoteText:
          type: string
        clickHereText:
          type: string
        productAddMessageText:
          type: string
        choosePurchaseOptionLabelText:
          type: string
        oneTimePurchaseMessageText:
          type: string
        contractUpdateMessageText:
          type: string
        oneTimePurchaseDisplayMessageText:
          type: string
        addProductFinishedMessageText:
          type: string
        contractErrorMessageText:
          type: string
        addToSubscriptionTitleCP:
          type: string
        oneTimePurchaseTitleCP:
          type: string
        seeMoreProductBtnText:
          type: string
        viewAttributeLabelText:
          type: string
        attributeNameLabelText:
          type: string
        swapProductLabelText:
          type: string
        swapProductSearchBarText:
          type: string
        enableSwapProductFeature:
          type: boolean
        enableTabletForceView:
          type: boolean
        swapProductBtnText:
          type: string
        attributeValue:
          type: string
        addNewButtonText:
          type: string
        attributeHeadingText:
          type: string
        enableViewAttributes:
          type: boolean
        enableSkipIndividualProduct:
          type: boolean
        enableEditOrderNotes:
          type: boolean
        showSellingPlanFrequencies:
          type: boolean
        totalPricePerDeliveryText:
          type: string
        fulfilledText:
          type: string
        dateFormat:
          type: string
        discountCouponAppliedText:
          type: string
        subscriptionPausedMessageText:
          type: string
        subscriptionActivatedMessageText:
          type: string
        unableToUpdateSubscriptionStatusMessageText:
          type: string
        selectCancellationReasonLabelText:
          type: string
        upcomingOrderChangePopupSuccessTitleText:
          type: string
        upcomingOrderChangePopupSuccessDescriptionText:
          type: string
        upcomingOrderChangePopupSuccessClosebtnText:
          type: string
        upcomingOrderChangePopupFailureTitleText:
          type: string
        upcomingOrderChangePopupFailureDescriptionText:
          type: string
        upcomingOrderChangePopupFailureClosebtnText:
          type: string
        variantIdsToFreezeEditRemove:
          type: string
        preventCancellationBeforeDays:
          type: string
        preventAddRemoveSwapBeforeDays:
          type: string
        allowCancellationBeforeDays:
          type: string
        allowAddRemoveSwapBeforeDays:
          type: string
        disAllowVariantIdsForOneTimeProductAdd:
          type: string
        disAllowProductIdsForOneTimeProductAdd:
          type: string
        disAllowVariantIdsForSubscriptionProductAdd:
          type: string
        allowProductIdsForSubscriptionProductAdd:
          type: string
        hideAddSubscriptionProductSection:
          type: boolean
        allowOnlyOneTimeProductOnAddProductFlag:
          type: boolean
        requireFieldMessage:
          type: string
        validNumberRequiredMessage:
          type: string
        variantLbl:
          type: string
        priceLbl:
          type: string
        oneTimePurchaseOnlyText:
          type: string
        rescheduleText:
          type: string
        popUpSuccessMessage:
          type: string
        popUpErrorMessage:
          type: string
        orderNowText:
          type: string
        upcomingOrderPlaceNowAlertText:
          type: string
        upcomingOrderSkipAlertText:
          type: string
        deliveryFrequencyText:
          type: string
        editDeliveryInternalText:
          type: string
        maxCycleText:
          type: string
        minCycleText:
          type: string
        selectProductToAdd:
          type: string
        searchProductBtnText:
          type: string
        areyousureCommonMessageText:
          type: string
        areyousureResumeMessageText:
          type: string
        areyousurePauseMessageText:
          type: string
        editCommonText:
          type: string
        viewMoreText:
          type: string
        variantLblText:
          type: string
        totalLblText:
          type: string
        deleteProductTitleText:
          type: string
        greetingText:
          type: string
        productLblText:
          type: string
        hasBeenRemovedText:
          type: string
        orderTotalText:
          type: string
        addDiscountCodeText:
          type: string
        addDiscountCodeAlertText:
          type: string
        removeDiscountCodeAlertText:
          type: string
        shopPayLblText:
          type: string
        paypalLblText:
          type: string
        unknownPaymentReachoutUsText:
          type: string
        addToOrderLabelText:
          type: string
        upcomingTabTitle:
          type: string
        scheduledTabTitle:
          type: string
        historyTabTitle:
          type: string
        noOrderNotAvailableMessage:
          type: string
        continueText:
          type: string
        confirmSwapText:
          type: string
        confirmAddProduct:
          type: string
        minQtyToAllowDuringAddProduct:
          type: integer
          format: int32
        allowSplitContract:
          type: boolean
        enableSwapProductVariant:
          type: boolean
        enableEditAttributes:
          type: boolean
        discountAccordionTitle:
          type: string
        redeemRewardsTextV2:
          type: string
        rewardsTextV2:
          type: string
        yourRewardsTextV2:
          type: string
        yourAvailableRewardsPointsTextV2:
          type: string
        cancellationDateTitleText:
          type: string
        pauseTillDateTitleText:
          type: string
        selectedCancellationReasonTitleText:
          type: string
        selectedPauseReasonTitleText:
          type: string
        cancellationNoteTitleText:
          type: string
        pauseNoteTitleText:
          type: string
        selectSplitMethodLabelText:
          type: string
        splitWithOrderPlacedSelectOptionText:
          type: string
        splitWithoutOrderPlacedSelectOptionText:
          type: string
        contractCancelledBadgeText:
          type: string
        chooseAnotherPaymentMethodTitleText:
          type: string
        selectPaymentMethodTitleText:
          type: string
        changePaymentMessage:
          type: string
        updatePaymentMethodTitleText:
          type: string
        enableRedirectMyAccountButton:
          type: boolean
        reschedulingPolicies:
          type: string
        enableRedirectToProductPage:
          type: boolean
        enableAllowOnlyOneDiscountCode:
          type: boolean
        upcomingTabHeaderHTML:
          type: string
        schedulesTabHeaderHTML:
          type: string
        historyTabHeaderHTML:
          type: string
        allowedProductIdsForOneTimeProductAdd:
          type: string
        allowToAddProductQuantityMinMaxReached:
          type: boolean
        allowReschedulingContractTrialPeriod:
          type: boolean
        allowToEditQuantityIfProductOutOfStock:
          type: boolean
        displayCountryByLanguage:
          type: boolean
        allowToEditQuantityInSingleBABProduct:
          type: boolean
        fromDeliveryDateAddDay:
          type: integer
          format: int32
        toDeliveryDateAddDay:
          type: integer
          format: int32
        showNextOrderDeliveryDate:
          type: boolean
        singleBABDeletedProductPlaceholderImage:
          type: string
        allowToSpecificZipCode:
          type: string
        allowToSpecificZipCodeForLocalDelivery:
          type: string
        customJs:
          type: string
        allowAddOneTimeProductOrderIdPrepaid:
          type: boolean
        discountMessageOnPause:
          type: string
        swapMessageOnPause:
          type: string
        giftMessageOnPause:
          type: string
        skipMessageOnPause:
          type: string
        pauseMessageOnPause:
          type: string
        changeDateMessageOnPause:
          type: string
        changeAddressMessageOnPause:
          type: string
        updateFrequencyMessageOnPause:
          type: string
        skipDaysFromCurrentDate:
          type: integer
          format: int32
        skipDaysToCurrentDate:
          type: integer
          format: int32
        goBackRedirectLink:
          type: string
        resumeSub:
          type: boolean
        allowToSameReasonAgain:
          type: boolean
        deleteOneTimePurchaseProduct:
          type: boolean
        billingDateRestrictFromDate:
          type: string
        billingDateRestrictToDays:
          type: integer
          format: int32
        multiCurrencyAvailable:
          type: boolean
        babProductBadgeTextV2:
          type: string
        addAdditionalProductInBAB:
          type: boolean
        disableRescheduleTimeSelector:
          type: boolean
        filterDeliveryFrequencyOnCustomerTags:
          type: boolean
        customerPortalLandingPage:
          type: string
        pauseAccordionTitle:
          type: string
        disabledKeyFieldFlag:
          type: boolean
        discountCarryForward:
          type: string
          enum:
            - NONE
            - EXISTING_PLAN
            - PRODUCT_PLAN
            - PRODUCT_THEN_EXISTING
        allowProductTagsForSubscriptionProductAdd:
          type: string
        disAllowProductTagsForSubscriptionProductAdd:
          type: string
        allowEditQuantityPrepaidSeparatePlan:
          type: boolean
        enableUpsellProducts:
          type: boolean
        maxIterationReachedText:
          type: string
        nextTierAmountTieredDiscountText:
          type: string
        nextTierPercentageTieredDiscountText:
          type: string
        amountTieredDiscountText:
          type: string
        percentageTieredDiscountText:
          type: string
        sectionTitleText:
          type: string
        sectionMinMaxTextV2:
          type: string
        sectionedBabBadgeText:
          type: string
        noDeliveryMethodLabelText:
          type: string
        selectedProductLabelTextV2:
          type: string
        discountAppliedTextV2:
          type: string
        minProductsInSubscriptionContract:
          type: string
        addToSubscriptionDiscriptionTextV2:
          type: string
        splitContractConfirmButtonText:
          type: string
        welcomeText:
          type: string
        enableProductDescription:
          type: boolean
        allowToAutoAddProduct:
          type: boolean
        rescheduleOrderDescription:
          type: string
        splitWithoutOrderPlacedSelectOptionHelpText:
          type: string
        splitWithOrderPlacedSelectOptionHelpText:
          type: string
        splitContractNoteText:
          type: string
        retryFailedOrderConfirmationTextV2:
          type: string
        retryFailedOrderDescriptionTextV2:
          type: string
        enableUpdateDeliveryMethod:
          type: boolean
        shopCustomizationData:
          type: array
          items:
            $ref: '#/components/schemas/UpdateShopCustomizationRequest'
        editQuantityLabelText:
          type: string
    CancellationManagementDTO:
      required:
        - shop
      type: object
      properties:
        id:
          type: integer
          format: int64
        shop:
          type: string
        cancellationType:
          type: string
          enum:
            - CANCEL_IMMEDIATELY
            - CANCELLATION_INSTRUCTIONS
            - CUSTOMER_RETENTION_FLOW
            - CANCEL_AFTER_PAUSE
        cancellationInstructionsText:
          type: string
        cancellationReasonsJSON:
          type: string
        pauseInstructionsText:
          type: string
        pauseDurationCycle:
          type: integer
          format: int32
        enableDiscountEmail:
          type: boolean
        discountEmailAddress:
          type: string
        pauseType:
          type: string
          enum:
            - PAUSE_IMMEDIATELY
            - PAUSE_INSTRUCTIONS
            - CUSTOMER_RETENTION_FLOW
        pauseReasonsJSON:
          type: string
        dynamicallyPauseCycleOnCancellation:
          type: boolean
x-tagGroups:
  - name: Core Features
    tags:
      - Customer Portal
      - Subscription Management
      - Billing & Payments
      - Product Catalog
  - name: Additional Features
    tags:
      - Delivery & Shipping
      - Customer Retention
      - Loyalty Integration
      - Customization
