put
https://api.loopsubscriptions.com/admin/2023-10/subscription//line//swap
This endpoint allows to update the existing line with a new line in a subscription contract.
Token scope - Read & write subscription contracts
Rate limit - Global pool (i.e. 50 requests per second per domain)
Body parameters explained
variantShopifyId- Shopify id of the variant with which the existing line is being swapped.quantity- Quantity of the new variant which is being swapped with the existing lineItem.pricingType- Define the pricingType for the new line added.OLD- The selling plan discount associated with the previous line would be applied to the new swapped line.NEW- The selling plan discount associated with the new line would be applied to the new swapped line.CUSTOM- Apply custom discount to the new swapped line.
customDiscount- Apply a custom discount to the new swapped line. Select thepricingTypeasCUSTOMto apply a custom discount.sellingPlanGroupId- ThesellingPlanGroupIdrefers to the selling plan group ID associated with the variant that will be swapped.- If the
sellingPlanGroupIdis not provided, the system will assign the plan based on the priority of the available selling plan groups. - If the provided
sellingPlanGroupIdis invalid or does not exist, an error will be thrown.
- If the
basePrice- Sets a custom base price for the swapped product for the specific subscription. The swapped product will use this price instead of the base price configured for the product in Shopify. This value should be greater then or equal to 0 and can take decimal values
