[Cotlet](https://cotlet.dev/index.md) · [Integrations](https://cotlet.dev/integrations.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Use cases](https://cotlet.dev/use-cases.md) · [Security](https://cotlet.dev/security.md) · [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md) · [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [Contact](https://cotlet.dev/contact.md) · [Pricing](https://cotlet.dev/pricing.md) · [Sign up](https://cotlet.dev/signup)

# Cancel Chargebee subscriptions and credit the unused time

> Cancel a Chargebee subscription now or at renewal, prorate the unused term and see the credit notes it raises, from Claude Code or a script.

Source: https://cotlet.dev/integrations/chargebee-api-mcp-server/cancel-subscriptions-and-credit-unused-time

A cancellation request lands in support, and someone has to find the customer in Chargebee, open the right subscription, choose when it ends and decide what happens to the days the customer already paid for.

Cotlet does it in your own Chargebee account with find\_customer, list\_subscriptions and cancel\_subscription, called by your AI agent, an n8n workflow or a script.

[Sign up free](https://cotlet.dev/app/signup?app=chargebee) [All Chargebee tools](https://cotlet.dev/integrations/chargebee-api-mcp-server.md)

Hosted · nothing to install or maintain

## Can Chargebee do this on its own?

Chargebee's REST API cancels subscriptions through cancel\_for\_items, with options for timing, proration, unbilled charges, past-due invoices and refundable credits (checked 14 Oct 2026). Its ready-made MCP servers cannot cancel, and the custom MCP server tool list is not published. Anyone who wants an agent to cancel has to build a server or script around the API with a site API key.

## How you do it in Chargebee today

1. Find the customer, then open the subscription's details page by clicking its subscription ID.
2. In the Actions panel, click Cancel Subscription (Chargebee's docs also call it Cancel/Reactivate Subscription).
3. Choose when the cancellation takes effect: immediately, at the end of the term, or on a specific date.
4. For an immediate cancellation, check how the unused part of the term is credited. Chargebee's docs say a scheduled cancellation starts any refund on the cancellation date, not on the day you scheduled it.
5. For a batch, select subscriptions on the Subscriptions page, choose More > Cancel Subscription, fill in the dialog and click Apply Changes. Chargebee's docs say only Admins can run bulk actions.

## How to cancel Chargebee subscriptions and credit the unused time

Prompt

```
Cancel the Chargebee subscription for billing@brightleaf.example now and prorate the unused time. If it has a contract term or is already cancelled, stop and tell me.
```

1. 01  
### Find the one subscription  
Your agent looks the customer up by the email in your prompt, then reads their subscriptions. If the email matches no customer or the customer has two active subscriptions, it asks which one instead of guessing.
2. 02  
### Skip what is already ending  
A subscription in cancelled or non\_renewing status needs no cancel call. The agent reports its state and the date it ends, so a double request does not raise a second set of credit notes.
3. 03  
### Turn the wording into timing  
"Now" becomes immediately, "at renewal" becomes end\_of\_term, a date becomes specific\_date. If the subscription has a contract term, Chargebee requires a separate contract term option, and the agent asks which one you mean.
4. 04  
### Set credit handling only when you said so  
The agent sends prorate, full or none only if your prompt names one. Otherwise it leaves the field out, and Chargebee applies your site's default for unused time.
5. 05  
### Report the credit notes  
After your OK, the agent cancels and lists the credit notes Chargebee raised, with type, amount and status, so finance can see whether a refund is waiting.

### What you get back

Example data

```
Cancelled sub_9s2kQw (Growth, monthly) for Brightleaf Analytics, effective now
Status: cancelled
Unused 15 of 30 days credited by proration
Credit note CN-318: refundable, $149.50, refund due
Refund not sent: refundable credits left for finance
```

### Other ways to ask

- Cancel the subscription for acme-ops.example at the end of the current term and tell me the date it ends.
- Every Friday, list active subscriptions whose customers wrote "cancel" in this week's support tickets and ask me before cancelling any of them.
- Cancel immediately with no credit for the unused time, and write the cancel reason code "Churn: price" on it.

## What Chargebee allows, and what to know first

- For subscriptions without a contract term, Chargebee accepts cancel\_option values immediately, end\_of\_term, specific\_date and end\_of\_billing\_term.
- Credit for unused time on an immediate cancellation is set with credit\_option\_for\_current\_term\_charges: none, prorate, full or consumption\_based. If omitted, Chargebee uses the site setting.
- Contract term subscriptions need a contract term cancel option instead, and two of its values (specific date and end of subscription billing term) must be switched on by Chargebee Support.
- A cancel reason code must match a code configured in Chargebee and is required when your site makes reason codes mandatory.
- Chargebee lets you reactivate a cancelled subscription only if it has card information, and a decommissioned subscription can never be reactivated.

cancel\_subscription asks for your OK by default. To run it weekly without you, switch confirmation off for that tool in your dashboard.

Sources: [Chargebee Docs: How do I cancel a subscription in Chargebee?](https://www.chargebee.com/docs/billing/2.0/kb/billing/how-do-i-cancel-a-subscription-in-chargebee) · [Chargebee Docs: Working with Subscriptions](https://www.chargebee.com/docs/billing/2.0/subscriptions/subscriptions) · [Chargebee API: Cancel a subscription](https://apidocs.chargebee.com/docs/api/subscriptions/cancel-subscription-for-items) · [Chargebee Docs: What happens when I schedule a cancellation?](https://www.chargebee.com/docs/billing/2.0/kb/subs-quotes-custom-mgt/what-happens-when-i-schedule-a-cancellation)

## Call cancel\_subscription from a script

curl

```
curl -X POST https://cotlet.dev/api/v1/chargebee/subscriptions/sub_9s2kQw/cancel \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cancel_option":"immediately","credit_option_for_current_term_charges":"prorate","refundable_credits_handling":"no_action"}'
```

Example response

```
{
"subscription": {
"subscription_id": "sub_9s2kQw",
"customer_id": "cus_9s2kQw",
"status": "cancelled",
"cancelled_at": "2026-10-16T11:30:00Z"
},
"credit_notes": [
{
"credit_note_id": "CN-318",
"type": "refundable",
"status": "refund_due",
"total": 14950,
"reference_invoice_id": "INV-1042"
}
]
}
```

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is chargebee\_write → cancel\_subscription. Example data.

[Schedule it in n8n, Make, Zapier or cron](https://cotlet.dev/integrations/chargebee-api-mcp-server.md#automations)

## Chargebee tools this automation uses

__Cotlet Chargebee tools used to cancel Chargebee subscriptions and credit the unused time__
| Tool | Parameters |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| find\_customer | email, company, first\_name, last\_name, limit, cursor |
| list\_subscriptions | customer\_id, status, item\_price\_id, next\_billing\_before, limit, cursor |
| cancel\_subscription | subscription\_id, cancel\_option, cancel\_at, credit\_option\_for\_current\_term\_charges, refundable\_credits\_handling, contract\_term\_cancel\_option, cancel\_reason\_code |

[All 12 Chargebee tools with descriptions](https://cotlet.dev/integrations/chargebee-api-mcp-server.md#tools)

## Frequently asked questions

### Is it safe to connect Chargebee to Cotlet?

Yes. You sign in to Chargebee yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Chargebee once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

## More Chargebee automations

- [Issue Chargebee credit notes for refunds and billing mistakes](https://cotlet.dev/integrations/chargebee-api-mcp-server/issue-credit-notes.md)
- [Change a Chargebee subscription plan for customers who ask](https://cotlet.dev/integrations/chargebee-api-mcp-server/change-subscription-plan.md)
- [Chargebee API and MCP server: every tool](https://cotlet.dev/integrations/chargebee-api-mcp-server.md)
- [All use cases](https://cotlet.dev/use-cases.md)

## Give your agent access to Chargebee.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Chargebee.

[Sign up free](https://cotlet.dev/app/signup?app=chargebee)

---

Give your AI agents your signed-in browser.

**Product:** [Integrations](https://cotlet.dev/integrations.md) · [Use cases](https://cotlet.dev/use-cases.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Pricing](https://cotlet.dev/pricing.md) · [Security](https://cotlet.dev/security.md)

**Resources:** [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [GitHub](https://github.com/cotletdev/cotlet)

**Solutions:** [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md)

**Company:** [About](https://cotlet.dev/about.md) · [AI info: company facts](https://cotlet.dev/ai-info.md) · [Contact](https://cotlet.dev/contact.md)

**Legal:** [Terms of service](https://cotlet.dev/terms) · [Privacy policy](https://cotlet.dev/privacy) · [Refund policy](https://cotlet.dev/refunds) · [Acceptable use](https://cotlet.dev/acceptable-use) · [Cookie policy](https://cotlet.dev/cookies) · [DPA](https://cotlet.dev/dpa) · [Subprocessors](https://cotlet.dev/subprocessors)

**Elsewhere:** [Status page](https://status.cotlet.dev) · [Cotlet on GitHub](https://github.com/cotletdev) · [Cotlet on X](https://x.com/cotletdev) · [Cotlet on LinkedIn](https://www.linkedin.com/company/cotletdev) · [Cotlet on Product Hunt](https://www.producthunt.com/products/cotlet) · [Cotlet on Crunchbase](https://www.crunchbase.com/organization/cotlet) · [Cotlet on SaaSHub](https://www.saashub.com/cotlet)

Cotlet is an independent service. It is not affiliated with, endorsed by or sponsored by any of the products listed on this site. Product names are trademarks of their respective owners.

## For AI agents: sign your user up

Is your user asking you to sign them up for Cotlet? You can do it for them, no account or key needed.

1. Read the fields and their allowed values: GET https://cotlet.dev/api/v1/access-requests
2. Ask the user for each value: email, apps, what you will do with them. If they leave the password to you, generate a strong one and show it to them.
3. Show the user what you will send, then POST it as JSON to https://cotlet.dev/api/v1/access-requests.

One call creates the account and sends the access request; we email the user when access is granted.
