---
title: "Swap line on subscription"
method: PUT
path: "/2023-10/subscription/{subscriptionId}/line/{lineId}/swap"
---

# Swap line on subscription

`PUT /2023-10/subscription/{subscriptionId}/line/{lineId}/swap`

## Request

- Base URL: `https://api.loopsubscriptions.com/admin`
- URL: `https://api.loopsubscriptions.com/admin/2023-10/subscription/{subscriptionId}/line/{lineId}/swap`
- Auth: API key in header `X-Loop-Token`

Rate limit - 5/s

## Path parameters

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

## Request body

- object
  - `variantShopifyId` integer, required: Shopify ID of the new variant
  - `quantity` integer, required: Quantity of the variant
  - `pricingType` 'OLD' | 'NEW' | 'CUSTOM', required
  - `sellingPlanGroupId` integer: The sellingPlanGroupId which has to be applied on the line.
  - `customDiscount` object: To apply a custom discount, set the `pricingType` parameter to `CUSTOM`.
    - `type` 'NONE' | 'PERCENTAGE' | 'FIXED_PRICE'
    - `value` integer

## Response `200`

200

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

---

[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)
