View as Markdown
SureCart icon

SureCart ACTION

Create Subscription

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

IMPLEMENTATION

Call this tool

Connect a user's SureCart 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: "surecart-create-subscription",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    surecart: { authProvisionId: "apn_xxxxxxx" },
    customer: "Customer ID",
    price: "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
customer Customer ID string
The unique identifier of the customer. Use List Customers to retrieve a list of available customers.
Required
price Price ID string
UUID of the recurring price to subscribe to. Example: price_abc123
Required
paymentMethod Payment Method ID string
UUID of the payment method to charge. Example: pm_abc123
Optional
manualPaymentMethod Manual Payment Method ID string
UUID of a manual payment method (e.g. bank transfer). Example: mpm_abc123
Optional
currency Currency string
ISO 4217 currency code. Example: usd
Optional
discount Discount object
Coupon or promotion code to apply. Example: { "coupon": "coup_abc123" } or { "promotion_code": "SAVE10" }
Optional
variant Variant ID string
UUID of the product variant. Example: var_abc123
Optional
shippingMethod Shipping Method ID string
UUID of the shipping method. Example: sm_abc123
Optional
affiliation Affiliation ID string
UUID of the affiliate to associate with this subscription. Example: aff_abc123
Optional
imported Imported boolean
Set to true when migrating a subscription from another platform.
Optional
firstScPeriodStartAt First Period Start At (Unix timestamp) integer
Unix timestamp for when the next billing period starts (use with imported). Example: 1700000000
Optional
metadata Metadata object
Additional key-value metadata. Example: { "source": "migration" }
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
surecart-create-subscription
Version
0.0.3
App
SureCart
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes