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

# Swap line

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

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 — Custom discount configuration for the swapped line.
    - `type` 'NONE' | 'PERCENTAGE' | 'FIXED_PRICE' — Type of discount to be added on the swap line.
    - `value` integer — Value of the discount.

## Response `200`

200

- object
  - `success` boolean — Indicates if the request was successful.
  - `message` string — Response message.
  - `data` unknown
  - `code` string — Response status code.

---

[API](https://skmtc.dev/loopwork/apis/storefront-api.md) · [All operations](https://skmtc.dev/loopwork/apis/storefront-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/loopwork/storefront-api/revisions/1524500daa02/schema)
