---
title: "Swap line"
method: PUT
path: "/2026-04/subscription/{subscriptionId}/line/{lineId}/swap"
---

# Swap line

`PUT /2026-04/subscription/{subscriptionId}/line/{lineId}/swap`

## Request

- Base URL: `https://api.loopsubscriptions.com/storefront`
- URL: `https://api.loopsubscriptions.com/storefront/2026-04/subscription/{subscriptionId}/line/{lineId}/swap`
- Auth: API key in header `Authorization`

This endpoint allows you to replace an existing product in the subscription with a new product.

## Path parameters

- `subscriptionId` integer, required
- `lineId` integer, required

## Request body

- object
  - `variantShopifyId` integer, required: The unique identifier of the variant in Shopify
  - `quantity` integer, required: The quantity of variant to be swapped
  - `sellingPlanGroupId` integer: The sellingPlanGroupId which has to be applied on the line
  - `cancellationFlowId` integer: This parameter is used to log the cancellation reason performance

## Response `200`

Line swapped successfully

- object
  - `success` boolean
  - `message` string
  - `data` object
    - `id` integer
    - `name` string
    - `shopifyId` string
    - `variantShopifyId` integer
    - `quantity` integer
    - `price` string
    - `discountedPrice` integer
    - `variantTitle` string
    - `sku` unknown
  - `code` string
  - `pageInfo` unknown

## Changes

- **2026-11-03** `1ff6a5700816`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/loopwork/apis/storefront-api/changes/2026-04/subscription/:subscriptionId/line/:lineId/swap/put.md)

---

[API](https://skmtc.dev/loopwork/apis/storefront-api.md) - [All operations](https://skmtc.dev/loopwork/apis/storefront-api/llms.txt) - [OpenAPI document](https://skmtc.dev/loopwork/apis/storefront-api/revisions/1ff6a5700816?raw)
