---
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/admin`
- URL: `https://api.loopsubscriptions.com/admin/2026-04/subscription/{subscriptionId}/line/{lineId}/swap`
- Auth: API key in header `X-Loop-Token`

This endpoint allows to update the existing line with a new line in a subscription contract.

## Path parameters

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

## Request body

- object
  - `variantShopifyId` integer, required: Shopify variant ID of the new product.
  - `quantity` integer, required: Quantity of the new variant.
  - `pricingType` 'OLD' | 'NEW' | 'CUSTOM', required: Defines which pricing is applied on the swapped line.
  - `sellingPlanGroupId` integer: Selling plan group to apply on the swapped line.
  - `customDiscount` object
    - `type` 'NONE' | 'PERCENTAGE' | 'FIXED_AMOUNT' | 'PRICE': Type of discount to be added on the swap line.
    - `value` number, float: Value of the discount.
  - `basePrice` number, float: Lets you set a custom base price for the swapped product

## Response `200`

Line swapped successfully

- object
  - `success` boolean
  - `message` string
  - `data` unknown
  - `code` string
  - `pageInfo` unknown

---

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