Before You Begin
Ensure you have:API Credentials
Valid API credentials and access token for authentication.
Account Setup
Proper account setup for your target country and business verification.
IP Whitelisting
Whitelist your server IP addresses for API access.
Webhook Endpoint
Set up a webhook URL to receive payment notifications.
Step 1: Cancel a Subscription
To cancel an existing subscription, send aPATCH request to the Cancel a Subscription endpoint.
Key Request Parameters
The request requires several key objects:Example Request
Below is an example usingcurl:
curl
Step 2: Handle the Response
Successful Response
A successful cancellation returns the subscription cancellation confirmation:Key Response Fields
Error Response
When a subscription cancellation fails, you’ll receive error information::Step 3: Track Transaction Status
After cancelling a subscription, monitor the status through these methods:Webhooks (Recommended)
Receive real-time notifications when transaction status changes. Most efficient for production environments.
Status API Endpoint
Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.
Business Portal View
Visual interface for monitoring transactions. Great for manual oversight and detailed transaction analysis.
Common Status Codes
Complete ReferenceView all status codes in our Transaction Status Documentation.
Testing Your Integration
Test Scenarios
Verify your integration handles these scenarios:- Successful Cancellation: Cancel an active subscription with valid credentials.
- Already Cancelled Subscription: Attempt to cancel already cancelled subscription.
- Nonexistent Subscription: Cancel a subscription that doesn’t exist.
- Authentication Errors: Cancel with invalid or missing authentication.
- Webhook Notifications: Confirm cancellation webhooks are triggered
Next Steps
After cancelling a subscription, you may need to perform additional actions:Create new subscription
Create a new subscription if the customer wishes to resume service with a
different plan or payment method.
Set up webhooks
Configure webhooks to receive real-time notifications for subscription
events.

