> ## Documentation Index
> Fetch the complete documentation index at: https://developers.appstle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove one-time product from subscription order

> Removes a previously added one-time product from a specific subscription order. This permanently deletes the one-time product from the specified billing attempt. The operation is idempotent - attempting to delete a non-existent product will succeed without error.

**Important Notes:**
- Only removes the product from the specified billing attempt
- Cannot remove products from billing attempts that are already processed
- Activity logs are created for audit trails
- Returns the updated list of all one-time products for the contract

**Use Cases:**
- Allow customers to remove unwanted add-ons before order processing
- Clean up cart-like functionality in customer portals
- Programmatically manage one-time product selections
- Implement "undo" functionality for product additions

**Business Rules:**
- Contract must belong to the authenticated shop
- The specific combination of contractId + billingAttemptId + variantId identifies the product to remove
- No error is thrown if the product doesn't exist (idempotent operation)

**Authentication:** Requires valid X-API-Key header that identifies the shop



## OpenAPI

````yaml /subscription/admin-api-swagger.json delete /api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for managing subscriptions, payments, and
    related operations. These APIs allow you to programmatically manage
    subscription lifecycles, handle payments, configure products, and integrate
    subscription functionality into your applications.
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://subscription-admin.appstle.com
security: []
tags:
  - description: >-
      Core APIs for managing the complete subscription lifecycle including
      creation, updates, pausing, resuming, and cancellation of subscriptions.
    name: Subscription Management
  - description: >-
      APIs for managing subscription payment methods, processing payments,
      handling payment retries, and updating billing information.
    name: Subscription Payments
  - description: >-
      APIs for managing subscription contracts including delivery schedules,
      pricing, order notes, billing cycles, and shipping addresses.
    name: Subscription Contracts
  - description: >-
      APIs for managing products within subscriptions including adding,
      removing, updating quantities, and swapping products.
    name: Subscription Products
  - description: >-
      APIs for handling billing operations, payment processing, and financial
      transactions related to subscriptions.
    name: Billing & Payments
  - description: >-
      APIs for managing discounts and promotional codes applied to
      subscriptions.
    name: Subscription Discounts
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for managing subscription plans, pricing tiers, and plan
      configurations.
    name: Subscription Plans
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing the product catalog including product information,
      variants, and inventory.
    name: Product Catalog
  - description: >-
      APIs for managing operational settings, configurations, and administrative
      functions.
    name: Operations & Settings
  - description: >-
      APIs powering the customer-facing portal where subscribers can manage
      their own subscriptions.
    name: Customer Portal
  - description: APIs for managing customer information, profiles, and account details.
    name: Customers
  - description: >-
      APIs for retrieving aggregated subscription data, customer subscription
      history, and account-level subscription information.
    name: Subscription Data
  - description: >-
      APIs for managing delivery profiles, shipping rates, free shipping
      configuration, and delivery method options on subscriptions.
    name: Delivery & Shipping
  - description: >-
      APIs for managing storefront customization including custom CSS, theme
      settings, label translations, and merchant-defined widget configuration.
    name: Customization
  - description: >-
      APIs for configuring cancellation flows, retention offers, cancellation
      reason management, and win-back automation.
    name: Customer Retention
paths:
  /api/external/v2/subscription-contract-one-offs-by-contractId-and-billing-attempt-id:
    delete:
      tags:
        - Subscription One-Time Products
      summary: Remove one-time product from subscription order
      description: >-
        Removes a previously added one-time product from a specific subscription
        order. This permanently deletes the one-time product from the specified
        billing attempt. The operation is idempotent - attempting to delete a
        non-existent product will succeed without error.


        **Important Notes:**

        - Only removes the product from the specified billing attempt

        - Cannot remove products from billing attempts that are already
        processed

        - Activity logs are created for audit trails

        - Returns the updated list of all one-time products for the contract


        **Use Cases:**

        - Allow customers to remove unwanted add-ons before order processing

        - Clean up cart-like functionality in customer portals

        - Programmatically manage one-time product selections

        - Implement "undo" functionality for product additions


        **Business Rules:**

        - Contract must belong to the authenticated shop

        - The specific combination of contractId + billingAttemptId + variantId
        identifies the product to remove

        - No error is thrown if the product doesn't exist (idempotent operation)


        **Authentication:** Requires valid X-API-Key header that identifies the
        shop
      operationId: deleteOneOffByV2
      parameters:
        - deprecated: true
          description: API Key (Deprecated - Use X-API-Key header instead)
          example: sk_live_1234567890abcdef
          in: query
          name: api_key
          required: false
          schema:
            type: string
        - description: >-
            API Key for authentication. This key identifies your shop and must
            be included in the X-API-Key header.
          example: sk_live_1234567890abcdef
          in: header
          name: X-API-Key
          required: true
          schema:
            type: string
        - description: The unique identifier of the subscription contract
          example: 98765
          in: query
          name: contractId
          required: true
          schema:
            format: int64
            minimum: 1
            type: integer
        - description: The billing attempt ID that contains the product to remove
          example: 54321
          in: query
          name: billingAttemptId
          required: true
          schema:
            format: int64
            minimum: 1
            type: integer
        - description: The Shopify product variant ID to remove from the one-time purchases
          example: 42549172011164
          in: query
          name: variantId
          required: true
          schema:
            format: int64
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                All Products Removed:
                  description: >-
                    Last one-time product was removed. Contract now has no
                    one-time products.
                  value: []
                Multiple Products Remain:
                  description: >-
                    One product removed, multiple products remain across
                    different billing attempts
                  value:
                    - billingAttemptId: 54321
                      id: 12347
                      price: 14.99
                      quantity: 1
                      shop: example-store.myshopify.com
                      subscriptionContractId: 98765
                      variantHandle: seasonal-blend-250g
                      variantId: 42549172011166
                    - billingAttemptId: 54322
                      id: 12348
                      price: 39.99
                      quantity: 1
                      shop: example-store.myshopify.com
                      subscriptionContractId: 98765
                      variantHandle: coffee-grinder-manual
                      variantId: 42549172011167
                Product Didn't Exist:
                  description: >-
                    Attempted to remove non-existent product. Operation
                    succeeds, returns existing products.
                  value:
                    - billingAttemptId: 54322
                      id: 12346
                      price: 8.99
                      quantity: 1
                      shop: example-store.myshopify.com
                      subscriptionContractId: 98765
                      variantHandle: coffee-filters-pack-100
                      variantId: 42549172011165
                Product Removed Successfully:
                  description: >-
                    Product was removed. Response shows remaining one-time
                    products.
                  value:
                    - billingAttemptId: 54321
                      id: 12345
                      price: 19.99
                      quantity: 2
                      shop: example-store.myshopify.com
                      subscriptionContractId: 98765
                      variantHandle: premium-coffee-blend-500g
                      variantId: 42549172011164
              schema:
                items:
                  $ref: '#/components/schemas/SubscriptionContractOneOffDTO'
                type: array
          description: >-
            Successfully removed the one-time product or product didn't exist.
            Returns all remaining one-time products for the contract.
        '400':
          content:
            application/json:
              examples:
                Invalid Parameter Format:
                  description: Invalid Parameter Format
                  value:
                    detail: >-
                      Failed to convert value of type 'java.lang.String' to
                      required type 'java.lang.Long'; For input string:
                      'invalid'
                    status: 400
                    title: Bad Request
                    type: https://example.com/probs/bad-request
                Missing Required Parameter:
                  description: Missing Required Parameter
                  value:
                    detail: >-
                      Required request parameter 'variantId' for method
                      parameter type Long is not present
                    status: 400
                    title: Bad Request
                    type: https://example.com/probs/bad-request
              schema:
                $ref: '#/components/schemas/Problem'
          description: Invalid request parameters
        '401':
          content:
            application/json:
              example:
                detail: Full authentication is required to access this resource
                status: 401
                title: Unauthorized
                type: https://example.com/probs/unauthorized
              schema:
                $ref: '#/components/schemas/Problem'
          description: Authentication required - missing or invalid API key
        '403':
          content:
            application/json:
              example:
                detail: Access denied - contract does not belong to authenticated shop
                status: 403
                title: Forbidden
                type: https://example.com/probs/forbidden
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Forbidden - contract belongs to different shop or insufficient
            permissions
components:
  schemas:
    SubscriptionContractOneOffDTO:
      description: >-
        Represents a one-time product added to a subscription contract for a
        specific billing attempt
      properties:
        billingAttemptId:
          description: >-
            The billing attempt ID this one-time product is associated with.
            This determines which upcoming order will include this product.
          example: 54321
          format: int64
          minimum: 1
          type: integer
        id:
          description: Unique identifier of the one-time product record
          example: 12345
          format: int64
          readOnly: true
          type: integer
        price:
          description: >-
            The price per unit of this product in the shop's base currency. This
            may include any applicable discounts.
          example: 19.99
          format: double
          maximum: 999999.99
          minimum: 0
          type: number
        quantity:
          description: The quantity of this product to include in the order
          example: 2
          format: int32
          maximum: 999
          minimum: 1
          type: integer
        shop:
          description: The Shopify store domain that owns this subscription
          example: example-store.myshopify.com
          pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*\.myshopify\.com$
          type: string
        subscriptionContractId:
          description: The subscription contract ID this one-time product belongs to
          example: 98765
          format: int64
          minimum: 1
          type: integer
        variantHandle:
          description: >-
            The handle/slug of the product variant for URL-friendly
            identification
          example: premium-coffee-blend-500g
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          type: string
        variantId:
          description: The Shopify product variant ID for this one-time product
          example: 42549172011164
          format: int64
          minimum: 1
          type: integer
      required:
        - shop
      type: object
    Problem:
      properties:
        detail:
          type: string
        instance:
          format: uri
          type: string
        parameters:
          additionalProperties:
            type: object
          type: object
        status:
          $ref: '#/components/schemas/StatusType'
        title:
          type: string
        type:
          format: uri
          type: string
      type: object
    StatusType:
      properties:
        reasonPhrase:
          type: string
        statusCode:
          format: int32
          type: integer
      type: object

````