Apply swap profile

Changed on

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.

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

Path parameters

subscriptionIdstring required

The unique identifier of the subscription in Loop.

lineIdstring required

The unique identifier of the subscription line item for which swap products are being retrieved.

Request body

variantShopifyIdinteger required

The Shopify ID of the product variant to replace the existing subscription line item with.

quantityinteger required

The quantity of the selected product variant to be added to the subscription line item after the swap.

swapProfileIdinteger

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

successboolean

Indicates whether the request was processed successfully.

messagestring

A message describing the result of the request.

dataobject

Returns null for this endpoint as no additional data is returned upon a successful swap.

codestring

The response code indicating the outcome of the request.

pageInfounknown

Example response

{
  "success": true,
  "message": "Swap applied successfully",
  "code": "SUCCESS"
}

Changes