View as Markdown
Recharge icon

Recharge ACTION

Create Subscription

Creates a new subscription allowing a customer to subscribe to a product. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Recharge 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: "recharge-create-subscription",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    recharge: { authProvisionId: "apn_xxxxxxx" },
    addressId: "Address ID",
    chargeIntervalFrequency: 10,
  },
})

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
addressId Address ID string
Select an address or provide a custom address ID.
Required Dynamic
chargeIntervalFrequency Charge Interval Frequency integer
The number of units, specified in Order Interval Unit, between each charge.
Required
nextChargeScheduledAt Next Charge Scheduled At string
This will set the first charge date of a new subscription. Can be a date string such as 2021-12-17.
Required
orderIntervalFrequency Order Interval Frequency integer
The number of units, specified in Order Interval Unit, between each order.
Required
orderIntervalUnit Order Interval Unit string
The frequency unit used to determine when a subscription order is created.
Required
quantity Quantity integer
The quantity of the product.
Required
externalVariantId External Variant ID string
The variant id as it appears in the external e-commerce platform.
Required Dynamic
additionalOptions Additional Options object
Additional parameters to be passed in the request. See the documentation for all available parameters.
Required

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
recharge-create-subscription
Version
0.0.2
App
Recharge
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes