Skip to main content
Web payment cancellation
Updated over a week ago

Treefort may make a request to your cancel subscription endpoint to cancel a user’s subscription, for example in response to a user tapping “Cancel subscription” in your app or when a user is switching to a group membership.

When your cancel subscription endpoint receives a request you should make a request to the Treefort subscription PATCH endpoint to set the subscriptions canceledAt property to the current date. It’s up to whether to also set deactivatedAt to the current date as well, revoking the user’s access immediately, or to wait until the end of the billing period to make another request to the Treefort API to set deactivatedAt.

To prevent race conditions your API should not respond with a success status to a cancelation request from Treefort until your API has received a success response from the Treefort subscription PATCH endpoint. For more details on managing subscription state, see the subscription state docs.

Did this answer your question?