SureCart ACTION
Update Variant
Update an existing variant. 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 Update Variant 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-update-variant",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
surecart: { authProvisionId: "apn_xxxxxxx" },
variantId: "Variant ID",
product: "Product ID",
},
})
console.log(result)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-update-variant",
"configured_props": {
"surecart": { "authProvisionId": "apn_xxxxxxx" },
"variantId": "Variant ID",
"product": "Product ID"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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-update-variant",
arguments: {
variantId: "Variant ID",
product: "Product ID",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
variantId Variant ID | string | The unique identifier of the variant. Use List Variants to retrieve a list of available variants. Required |
product Product ID | string | The UUID of the product this variant belongs to. Use List Products to find product IDs. Optional |
option1 Option 1 | string | The value for the first variant option. Example: Red Optional |
option2 Option 2 | string | The value for the second variant option. Optional |
option3 Option 3 | string | The value for the third variant option. Optional |
amount Amount | integer | Amount in cents to charge for this variant. If empty, the regular price amount is used. Example: 1999 Optional |
sku SKU | string | Stock keeping unit for this variant. Optional |
position Position | integer | Ordering position when displayed to customers. Optional |
purchaseLimit Purchase Limit | integer | Max times this variant can be purchased by a customer. Optional |
stockEnabled Stock Enabled | boolean | Set to true to track stock for this variant. Optional |
stockAdjustment Stock Adjustment | integer | Amount to adjust the stock by (positive or negative). Optional |
shippingEnabled Shipping Enabled | boolean | Set to true to require a shipping address at checkout. Optional |
taxEnabled Tax Enabled | boolean | Set to true to make this variant taxable. Optional |
taxCategory Tax Category | string | The tax category for this variant. Optional |
allowOutOfStockPurchases Allow Out Of Stock Purchases | boolean | Set to true to allow purchases when stock runs out. Optional |
autoFulfillEnabled Auto Fulfill Enabled | boolean | Set to true to auto-fulfill this variant on purchase. Optional |
downloadsEnabled Downloads Enabled | boolean | Set to true to enable downloads for this variant. Optional |
licenseActivationLimit License Activation Limit | integer | Max activations allowed per license. Optional |
image Image ID | string | The UUID of the media image for this variant. Use List Media to find media IDs. 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-update-variant
- Version
- 0.0.1
- App
- SureCart
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗