This endpoint allows you to replace an existing product in the subscription with a new product.

put/2026-04/subscription/{subscriptionId}/line/{lineId}/swap

Request

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

Path parameters

subscriptionIdinteger required

The unique identifier for a subscription in Loop.

lineIdinteger required

Loop ID of the line to swap

Request body

variantShopifyIdinteger required

The unique identifier of the variant in Shopify

quantityinteger required

The quantity of variant to be swapped

sellingPlanGroupIdinteger

The sellingPlanGroupId which has to be applied on the line

cancellationFlowIdinteger

This parameter is used to log the cancellation reason performance

Response

Line swapped successfully

successboolean
messagestring
codestring
pageInfounknown

Example response

{
  "success": true,
  "message": "Line swapped successfully",
  "data": {
    "id": 38402,
    "name": "Product 02",
    "shopifyId": "0cedcec7-b7bc-42d1-b8b0-32c4f31147d0",
    "variantShopifyId": 52329498280209,
    "quantity": 2,
    "price": "7650.00",
    "discountedPrice": 15300,
    "variantTitle": "Default Title"
  },
  "code": "SUCCESS"
}

Changes