---
title: "Swap a product for a bundle"
method: POST
path: "/customers/{customerId}/subscriptions/{subscriptionId}/swap-product-for-bab"
tags: ["Subscriptions"]
---

# Swap a product for a bundle

`POST /customers/{customerId}/subscriptions/{subscriptionId}/swap-product-for-bab`

## Request

- Base URL: `https://api.awtomic.com`
- URL: `https://api.awtomic.com/customers/{customerId}/subscriptions/{subscriptionId}/swap-product-for-bab`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/awtomic/apis/awtomic-api/docs/customers/:customerId/subscriptions/:subscriptionId/swap-product-for-bab/post.ts> (a function with typed inputs; its response is checked against the schema)

Swap a product for a bundle in a subscription contract. It will create new subscription contract lines for the bundle items and delete the previous subscription contract lines.

This endpoint is an abstraction of the "update lines" endpoint.

## Path parameters

- `customerId` string, required
- `subscriptionId` string, required

## Request body

- object
  - `bundleProps` object
  - `productVariantId` string
  - `selectedItems` string[]
  - `sellingPlan` object
    - `gId` string
  - `lineId` string

## Response `200`

Lines updated

- object
  - `subscriptionContractId` string
  - `lines` LineResponse[]
    - `updatedPrices` object
      - `computedPrice` object
      - `computedPricingPolicy` object
      - `line` string
    - `operation` string
    - `variantId` string
    - `id` string
    - `title` string
    - `variantTitle` string
    - `productId` string
    - `quantity` integer
    - `customAttributes` object[]
    - `oneTimeAddon` boolean
  - `subscriptionContract` SubscriptionDynamo
    - `SubscriptionId` string: Identifier
    - `SubscriptionStatus` string: Status
    - `NextBillingDate` string, date-time: Date of the next billing

## Other responses

- `400`: Validation error, or errorCode DUPLICATE_BOX_LINES when the edit would add a second line for a variant already in the box
- `409`: Another change to this subscription is still being saved (errorCode SUBSCRIPTION_UPDATE_IN_PROGRESS). Retry after it completes.

## Changes

- **2026-11-03** `5e6970981abe`: 1 info
  - added the non-success response with the status `409`

[Operation history](https://skmtc.dev/awtomic/apis/awtomic-api/changes/customers/:customerId/subscriptions/:subscriptionId/swap-product-for-bab/post.md)

---

[API](https://skmtc.dev/awtomic/apis/awtomic-api.md) - [All operations](https://skmtc.dev/awtomic/apis/awtomic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/awtomic/apis/awtomic-api/revisions/5e6970981abe?raw)
