View as Markdown
Chargebee icon

Chargebee ACTION

Create Subscription

Create a new subscription for an existing customer. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Chargebee account once, then configure and run Create Subscription from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "chargebee-create-subscription",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    chargebee: { authProvisionId: "apn_xxxxxxx" },
    customerId: "Customer ID",
    itemPriceId: "Plan Item Price ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Subscription inputs
Property Type Description
customerId Customer ID string
The ID of the customer to create the subscription for.
Required Dynamic
itemPriceId Plan Item Price ID string
The unique identifier of the plan item price.
Required Dynamic
unitPrice Unit Price integer
The unit price of the plan item.
Required
quantity Quantity integer
The quantity of the plan item.
Required
id ID string
A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
Optional
netTermDays Net Term Days integer
Defines Net D for the subscription. Net D is the number of days within which any invoice raised for the subscription must be paid.
Optional
startDate Start Date string
The date/time at which the subscription is to start, e.g. 2024-08-15T09:30:00Z. If not provided, the subscription starts immediately.
Optional
additionalFields Additional Fields object
Additional fields and values to set for the subscription. See the documentation for all available fields.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
chargebee-create-subscription
Version
0.0.2
App
Chargebee
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes