Cancel User Payment Subscription from external app

pkaur17
Participant

Hi, We are using hubspot payments and subscriptions for our website. Is there any way to cancel payment subscription from our website via api or any workflow trigger inside hubspot account?

1 Accepted solution
GLePage
Solution
Contributor

Hi All. I can't confirm if this works, because I only found this yesterday, but you can set a "Subscription End Date" in a workflow using the "date the step was taken". I assume this will "cancel" the subscription on that date. It's a workaround, but may well get the job done.

View solution in original post

3 Replies 3
GLePage
Solution
Contributor

Hi All. I can't confirm if this works, because I only found this yesterday, but you can set a "Subscription End Date" in a workflow using the "date the step was taken". I assume this will "cancel" the subscription on that date. It's a workaround, but may well get the job done.

HMir
Member

@pkaur17 wrote:

Hi, We are using hubspot payments and subscriptions for our website. Is there any way to cancel payment subscription from our website via api or any workflow trigger inside hubspot account?


To cancel a payment subscription from your website using HubSpot, you can leverage either the HubSpot API or set up a workflow within your HubSpot account. Using the API, you can send a DELETE request to the HubSpot Subscriptions API endpoint, providing the subscription ID and your access token for authentication.

This allows you to programmatically manage subscriptions directly from your website. For instance, using a Python script with the requests library, you can send a DELETE request to https://api.hubapi.com/crm/v3/objects/subscriptions/{subscriptionId} with the appropriate headers. Alternatively, you can set up a workflow in HubSpot to automate subscription cancellations based on specific triggers.

First, create a custom property if needed, then navigate to Automation > Workflows in HubSpot, create a new workflow or edit an existing one, and set the enrollment trigger to match your criteria for cancellation. Add an action to the workflow that makes an HTTP request to the HubSpot API endpoint to cancel the subscription, ensuring seamless integration and automation from within HubSpot.

0 Upvotes
pkaur17
Participant

@HMirI don't think there is any Hubspot API Endpoint available to cancel PAyment Subscription.
Though I tried the DELETE request to https://api.hubapi.com/crm/v3/objects/subscriptions/{subscriptionId}and got this in response

[
	'status' => 'error',
	'message' => 'The scope needed for this API call isn't available for public use. If you have questions, contact support or post in our developer forum.',
	'correlationId' => 'a***-***-***-
5', 'links' => [ 'support' => 'https://help.hubspot.com/', 'forum' => 'https://community.hubspot.com/t5/APIs-Integrations/bd-p/integrations' ], 'category' => 'MISSING_SCOPES' ]

Without specific API endpoint , I am not sure how is it possible.

0 Upvotes