LeadDyno ACTION
Create Purchase
Creates a new purchase in LeadDyno. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's LeadDyno account once, then configure and run Create Purchase 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: "leaddyno-create-purchase",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
leaddyno: { authProvisionId: "apn_xxxxxxx" },
email: "Lead Email",
purchaseCode: "Purchase Code",
},
})
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": "leaddyno-create-purchase",
"configured_props": {
"leaddyno": { "authProvisionId": "apn_xxxxxxx" },
"email": "Lead Email",
"purchaseCode": "Purchase Code"
}
}'// 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": "leaddyno",
},
},
},
)
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: "leaddyno-create-purchase",
arguments: {
email: "Lead Email",
purchaseCode: "Purchase Code",
},
})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 |
|---|---|---|
email Lead Email | string | The email of the customer Required Dynamic |
purchaseCode Purchase Code | string | A unique identifier for this purchase. If not provided, a unique ID will be generated Optional |
purchaseAmount Purchase Amount | string | The total amount of the purchase, used for percentage commission calculations Optional |
planCode Plan Code | string | The code of the reward structure used for calculating affiliate commissions Optional |
affiliateCode Affiliate Code | string | The affiliate code to which the purchase should be assigned. Its usage depends on the 'first source wins' or 'first affiliate wins' settings Optional Dynamic |
commissionAmount Commission Amount Override | string | An overriding commission amount that will replace any predefined plan and provide an immediate fixed-amount commission. This value should be a decimal Optional |
description Description | string | Text description of the purchase Optional |
reassignAffiliate Reassign Affiliate | boolean | If set to false, the original affiliate of the lead will be retained. Optional |
lineItems Line Items | string[] | A list of JSON object containing the line items associated with the purchase. Format: [{"sku": "string", "description": "string", "quantity": "string", "amount": "string"}] 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
- leaddyno-create-purchase
- Version
- 0.0.2
- App
- LeadDyno
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗