Termination
Check our Reference Materials for more details about a payment connector.
Description
Cleeng Webhooks send notifications for the events that happen within the Cleeng system, one of these events is subscriptionReadyForTermination
.
Upon subscribing to this event, you will be receiving all the data necessary for performing the subscription termination process to the specified endpoint that was set up during Webhooks configuration.
A call must be made to Cleeng Payment API to terminate the subscription. This process terminates the subscription on the Cleeng platform side and revokes the subscriber's entitlement.
Process Flow
Note
Details of the implementation will depend on a specific payment gateway solution.
Step-by-Step Guide
Prerequisites
To start with this process, make sure that the following are in place:
- Webhooks - to learn more about how to configure and use Cleeng Webhooks, please click here. You can also find the list of available webhooks here.
You will need to subscribe to the following: subscriptionReadyForTermination
Note:
Please note that webhook handler should return "200" http status code meaning that it was successfully processed.
- Dunning Action Settings - to find out more click here.
Please note the grace period field in Dunning Action Settings. Grace period allows you to keep the subscription active after due to date. It gives an additional time to process payments before it terminates.
Terminate Subscription
To terminate a subscription on Cleeng side and revoke the subscriber's entitlement an API call should be made to Cleeng Payment API using PATCH /3.1/subscriptions/{subscriptionId}.
curl --request PATCH \
--url https://api.sandbox.cleeng.com/3.1/subscriptions/123456789 \
--header 'X-Publisher-Token: a1bcde_ef234GHIjKl5M-NoP-0rsTUWXYZQo6S7nAabCdeF8' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"status": "terminated"
}
'
Good to Know
When subscriptionReadyForTermination
webhook arrives, it also allows the connector to do some “cleaning”, for example: cancelling authorised payments.
Up Next
Congratulations! By now you should have all mandatory features implemented, including subscription initial purchase and recurring billing, as well as termination.
Go on to our Connector Checklist to make sure all is in place.
Once your connector is ready, please make sure that you display your offer with available payment methods (see Offer Display).
Updated 11 months ago