---
title: "Apply swap profile"
method: POST
path: "/2026-04/subscription/{subscriptionId}/line/{lineId}/swap/apply"
---

# Apply swap profile

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

## Request

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

This endpoint allows you to apply a swap product to a subscription line item using either the general swap profile or a personalized swap profile.

## Path parameters

- `subscriptionId` string, required
- `lineId` string, required

## Request body

- object
  - `variantShopifyId` integer, required: The Shopify ID of the product variant to replace the existing subscription line item with.
  - `quantity` integer, required: The quantity of the selected product variant to be added to the subscription line item after the swap.
  - `swapProfileId` integer: The unique identifier of the personalized swap profile to apply while swapping the product. If provided, the pricing, discounts, and incentives configured in the specified personalized swap profile will be applied. If omitted, the swap will follow the rules configured in the general swap profile.

## Response `200`

- object
  - `success` boolean: Indicates whether the request was processed successfully.
  - `message` string: A message describing the result of the request.
  - `data` object: Returns null for this endpoint as no additional data is returned upon a successful swap.
  - `code` string: The response code indicating the outcome of the request.
  - `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/apply/post.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)
