Skip to main content
Localpayment allows you to cancel active subscriptions when customers no longer wish to continue their recurring payments. This guide details the process for canceling a subscription through Localpayment’s API, including immediate cancellations and end-of-billing period options.

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 a PATCH request to the Cancel a Subscription endpoint.

Key Request Parameters

The request requires several key objects:

Example Request

Below is an example using curl:
curl
ImportantOnce a subscription is cancelled, it cannot be reactivated. You will need to create a new subscription if the customer wishes to resume service.

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:
  1. Successful Cancellation: Cancel an active subscription with valid credentials.
  2. Already Cancelled Subscription: Attempt to cancel already cancelled subscription.
  3. Nonexistent Subscription: Cancel a subscription that doesn’t exist.
  4. Authentication Errors: Cancel with invalid or missing authentication.
  5. 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.
Last modified on November 10, 2026