First-party app
Chargebee

Chargebee

Manage Chargebee customers, subscriptions, invoices, payments and the product catalog via the Chargebee API v2 (Product Catalog 2.0).

stable Commerce & PaymentsFinance & Accounting

About

Chargebee ships in the w6w first-party pack. It declares 17 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.chargebee
Version
0.1.2
Author
w6w
Licence
MIT
Categories
Commerce & Payments · Finance & Accounting

Overview

Chargebee runs subscription billing for a lot of SaaS and recurring-revenue businesses, and this app lets a workflow act directly on that billing data. Create and look up customers, list and inspect subscriptions, and drive the full subscription lifecycle — cancel, pause and resume — without leaving your workflow.

On the money side, list invoices, pull up a specific one, and collect payment against it. Browse the product catalog (items and item prices) to know what you’re billing for, check a customer’s saved payment sources, and pull the raw event stream for anything Chargebee recorded on an account.

This app targets accounts on Chargebee’s Product Catalog 2.0 — the newer of Chargebee’s two mutually exclusive catalog models. Customer, invoice and payment actions work regardless, but subscription and catalog actions expect a Product Catalog 2.0 site.

Build with Chargebee

Three routes to the same 17 actions. The Workflow tab is generated from Chargebee's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Cancel Subscription

cancel-subscription

Cancel a subscription immediately, at term end or on a specific date, with control over prorated credits, unbilled charges and outstanding receivables.

Collect Payment For Invoice

collect-payment

Attempt to collect payment against a specific invoice, in full or for a partial amount, optionally charging a named payment source.

Create Customer

create-customer

Create a customer, optionally with a billing address and metadata. Payment details are deliberately not accepted here — use Chargebee's payment source APIs for those.

Create Subscription

create-subscription

Create a subscription for an existing customer from one or more item prices. Requires a site on Product Catalog 2.0.

Get Customer

get-customer

Retrieve a single customer by id, with their primary card if one is on file.

Get Invoice

get-invoice

Retrieve a single invoice by id, with control over how many of its line items come back.

Get Subscription

get-subscription

Retrieve a single subscription by id, along with its customer. Reflects the current state, not any scheduled changes.

List Customers

list-customers

List customers one page at a time, optionally filtered by email, name, company or auto-collection setting.

List Events

list-events

List Chargebee events — the same records webhooks deliver — filtered by type, source, webhook delivery status or when they occurred.

List Invoices

list-invoices

List invoices one page at a time, optionally filtered by customer, subscription, status, recurring flag or date range.

List Item Prices

list-item-prices

List item prices — the priced, per-currency variants of a catalog item, and the source of the item price ids Create Subscription needs. Product Catalog 2.0 only.

List Items

list-items

List product catalog items (plans, addons and charges), optionally filtered by family, type, status or name. Product Catalog 2.0 only.

List Payment Sources

list-payment-sources

List a customer's stored payment methods and their validity, to find the payment source id to charge.

List Subscriptions

list-subscriptions

List subscriptions one page at a time, optionally filtered by customer, item, item price or status.

Pause Subscription

pause-subscription

Pause a subscription immediately, at term end or on a date, optionally scheduling when it resumes.

Resume Subscription

resume-subscription

Resume a paused subscription immediately or on a date, with control over how charges accrued during the pause and any unpaid invoices are handled.

Update Customer

update-customer

Update a customer's contact details, billing preferences or metadata. Only the fields you fill in are sent, so blanks never overwrite stored values.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Chargebee's real ids.

{
  "manifestVersion": "2",
  "name": "chargebee-example",
  "steps": [
    {
      "id": "collect-payment",
      "uses": {
        "app": "io.w6w.chargebee",
        "action": "collect-payment",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "invoiceId": "<invoiceId>"
      }
    }
  ]
}

Here are some of the things you can do

  • Collect Payment For Invoice

    perform
    collect-payment
  • Create Customer

    perform
    create-customer
  • Create Subscription

    perform
    create-subscription
  • Get Customer

    read
    get-customer
  • Get Invoice

    read
    get-invoice

+12 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Chargebee, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Chargebee. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "create-subscription",
  payload: {
    customerId: "<value>",
    subscriptionItems: "<value>",
    // id: "<value>",
    // startDate: "<value>",
    // trialEnd: "<value>",
    // billingCycles: "<value>",
    // couponIds: "<value>",
    // poNumber: "<value>",
    // autoCollection: "<value>",
    // paymentSourceId: "<value>",
    // invoiceImmediately: "<value>",
    // invoiceNotes: "<value>",
    // metaData: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action create-subscription --payload '{"customerId":"<value>","subscriptionItems":"<value>"}'

Give an AI agent Chargebee — without giving it Chargebee's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.chargebee#collect-payment",
    "input": {
      "invoiceId": "<invoiceId>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Chargebee connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Chargebee's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Chargebee itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Chargebee declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Chargebee platform status

Atlassian Statuspage rollup for status.chargebee.com, with per-component detail. Unauthenticated and unsigned.

quota

API rate-limit headroom