Skip to main content
Question

[Web Billing] Cancel subscription API?

  • August 19, 2025
  • 3 replies
  • 129 views

Forum|alt.badge.img+8

According to the docs, the only way to cancel through Web purchases is via Dashboard > User > Cancel flow.  This is manual.  I’d like to create a programatic way to do this.  Does the `@revenuecat/purchases-js` allow for this?  I don’t see anything obvious.

This post has been closed for comments

3 replies

Forum|alt.badge.img+1
  • RevenueCat Staff
  • August 20, 2025

Hi ​@lucksp
You cannot cancel a subscription through @revenuecat/purchases-js on the frontend.
However you can use our API V2 endpoint from your backend to do so: https://www.revenuecat.com/docs/api-v2#tag/Subscription/operation/cancel-subscription

Also consider that the subscriber will receive access to the customer portal and will be able to cancel their subscription from there following the link sent to their email.

We intentionally limit all the modifications to subscriptions to:
1. Environments where we can identify the subscriber, like the customer portal, where the subscriber receives a personal token via email
2. API calls from your backend server where your secret API key is not exposed to the browser.

Please let me know if I can help you further and thanks for using RevenueCat Web Billing!


Forum|alt.badge.img+8
  • Author
  • Helper
  • August 20, 2025

Also consider that the subscriber will receive access to the customer portal and will be able to cancel their subscription from there following the link sent to their email.

 

OK thanks. Where is this portal accessed from ?

 


Forum|alt.badge.img+1
  • RevenueCat Staff
  • August 20, 2025

Hi ​@lucksp
Every time a customer subscribes through Web Billing they receive a confirmation email, in that email there’s a link to their personal customer portal. Also every time their subscription is renewed they will get a link to it in the renewal email.

You can find more info here:
https://www.revenuecat.com/docs/web/web-billing/customer-portal