View as Markdown
LeadDyno icon

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)

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 Purchase inputs
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