# Create Price — SureCart

> Create a new price for a product. See the documentation

- Key: `surecart-create-price`
- Type: Action (Write)
- Version: 0.0.2
- App: SureCart (`surecart`) — https://pipedream.com/apps/surecart.md
- This page (HTML): https://pipedream.com/apps/surecart/actions/create-price
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/surecart/actions/create-price/create-price.mjs

## Description

Create a new price for a product. [See the documentation](https://developer.surecart.com/api-reference/prices/create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `product` | `string` | Yes | The unique identifier of the product. Use List Products to retrieve a list of available products. |
| `name` | `string` | No | Display name for the price shown to customers. Example: Monthly Plan |
| `amount` | `integer` | No | Price in cents for fixed-price plans. Leave empty when Ad Hoc is true to allow custom amounts. Example: 9900 for $99.00 |
| `currency` | `string` | No | Three-letter ISO 4217 currency code. Defaults to the account currency. Example: usd |
| `adHoc` | `boolean` | No | Set to true to allow customers to enter a custom amount instead of a fixed price. |
| `adHocMinAmount` | `integer` | No | Minimum custom amount in cents when Ad Hoc is enabled. Example: 500 for $5.00 |
| `adHocMaxAmount` | `integer` | No | Maximum custom amount in cents when Ad Hoc is enabled. Example: 100000 for $1,000.00 |
| `scratchAmount` | `integer` | No | Original pre-discount price in cents, shown as a strikethrough. Example: 19900 for $199.00 |
| `recurringInterval` | `string` | No | Billing frequency for a subscription price. |
| `recurringIntervalCount` | `integer` | No | Number of intervals between billings. Example: 3 with Recurring Interval month bills every 3 months. |
| `recurringPeriodCount` | `integer` | No | Total number of billing periods before the subscription completes (installment plans). Example: 12 for a 12-month plan. |
| `trialDurationDays` | `integer` | No | Number of free trial days before billing begins. Example: 14 |
| `setupFeeEnabled` | `boolean` | No | Set to true to charge a one-time setup fee alongside the recurring price. |
| `setupFeeAmount` | `integer` | No | One-time setup fee in cents. Example: 2500 for $25.00 |
| `setupFeeName` | `string` | No | Display label for the setup fee. Example: Onboarding Fee |
| `setupFeeTrialEnabled` | `boolean` | No | Set to true to defer the setup fee until the trial period ends. |
| `licenseActivationLimit` | `integer` | No | Maximum number of license activations allowed. Defaults to the product setting if not set. Example: 5 |
| `revokeAfterDays` | `integer` | No | Number of days after which access is automatically revoked. Example: 365 |
| `revokePurchasesOnCompleted` | `boolean` | No | Set to true to revoke access when an installment subscription completes. |
| `restartSubscriptionOnCompleted` | `boolean` | No | Set to true to automatically restart the subscription after an installment plan completes. |
| `portalSubscriptionUpdateEnabled` | `boolean` | No | Set to false to prevent customers from switching to this price in the customer portal. |
| `renewalPrice` | `string` | No | UUID of the price to transition to upon renewal. Example: price_abc123 |
| `position` | `integer` | No | Display ordering position among prices. Example: 1 |
| `archived` | `boolean` | No | Set to true to create the price in an archived state. |
| `metadata` | `object` | No | Additional key-value metadata. Example: { "sku": "PLAN-001" } |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "surecart",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "surecart-create-price",
  arguments: {
    product: "Product ID",
    name: "Name",
  },
})
```

**TypeScript**

```ts
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-price",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    surecart: { authProvisionId: "apn_xxxxxxx" },
    product: "Product ID",
    name: "Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "surecart-create-price",
    "configured_props": {
      "surecart": { "authProvisionId": "apn_xxxxxxx" },
      "product": "Product ID",
      "name": "Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/surecart.md · All apps: https://pipedream.com/apps
