Updating Paddle Subscriptions

To modify an existing subscription in Paddle, you can use the update method from the Paddle subscriptions API. This allows you to change the items in a subscription and specify how billing should be handled for the changes.

Example Configuration

In the following example, we update a subscription identified by sub_01hv8y5ehszzq0yv20ttx3166y. We will add two items to the subscription, adjusting their quantities as needed. The prorationBillingMode is set to prorated_immediately, which means that any changes will be billed immediately based on the new quantities.

await paddle.subscriptions.update("sub_01hv8y5ehszzq0yv20ttx3166y", {
  "items": [
    { "priceId": "pri_01gm81eqze2vmmvhpjg13bfeqg", "quantity": 20 },
    { "priceId": "pri_01gm82kny0ad1tk358gxmsq87m", "quantity": 1 }
  ],
  "prorationBillingMode": "prorated_immediately"
});

Explanation of Parameters

  • priceId: This is the unique identifier for the pricing plan associated with the subscription item.
  • quantity: This indicates how many units of the item are being subscribed to.
  • prorationBillingMode: Setting this to prorated_immediately ensures that the billing reflects the changes right away, allowing for a seamless transition to the new subscription terms.

Conclusion

Using the Paddle API to update subscriptions is straightforward and allows for flexible billing adjustments. Ensure you have the correct priceId and desired quantities to avoid any issues during the update process.