Apply custom upgrade

This endpoint allows you to upgrade an existing line of a subscription to a new product, quantity, billing frequency, delivery frequency, and pricing configuration

Token scope - Read & write subscriptions

Rate limit - Global pool (i.e. 50 requests per second per domain)

The Custom Upgrade API allows you to update an existing subscription by changing its product, quantity, billing/delivery frequency, and pricing in a single API request.

Use this API when you need to apply a custom upgrade configuration that is not defined by a preconfigured upgrade profile on Loop admin portal

Path param explained :

  • subscriptionId Id of the subscription. This can be passed in the following format :
    • {id} - where id is the Loop internal id of the subscription contract. This is the default path param format.
    • loop-{id} - where id is the Loop internal id of the subscription contract.
    • shopify-${id} - Where id is the shopifySubscriptionId of the subscription contract.

Key points to consider:

  • Choose one configuration approach: You can either pass sellingPlanId or use the combination of billingPolicy, deliveryPolicy, and customDiscount. These two approaches should not be used together.

  • Using sellingPlanId: Use the sellingPlanId request parameter to apply a specific selling plan configured in Loop to the new product. The selling plan is applied to the entire subscription, meaning all lines in the subscription will use the same selling plan with the configured discount. Each line should be available on the given selling plan. The discount for the new product is determined by the discount configuration of the selected selling plan.

  • Using custom billing, delivery, and discount configuration: Use billingPolicy, deliveryPolicy, and customDiscount to define a custom configuration for the new product. This new product should be available on this billing and delivery policy.

  • Using customDiscount: The customDiscount object allows you to specify the discount type and value to apply to the new product. The following discount types are supported:

    • NONE: No discount is applied. The product uses its base price.
    • FIXED_PRICE: Applies a fixed discount amount to the product's base price.
    • PERCENTAGE: Applies a percentage discount to the product's base price.
    • PRICE: Sets a fixed price for the product, regardless of its base price.
Path Params
string
required

The unique id of the subscription that needs to be upgraded

Body Params
integer
required

ID of the existing subscription line that needs to be upgraded

integer
required

Shopify variant ID of the new product

integer
required

Quantity of the new product

customDiscount
object

Discount to be applied on new product

billingPolicy
object

Billing frequency configuration

deliveryPolicy
object

Delivery frequency configuration

integer

The ID of the selling plan that needs to be applied to the product

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json