Refersion ACTION
Create Affiliate
Create a new affiliate. See the docs here
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Refersion account once, then configure and run Create Affiliate 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: "refersion-create-affiliate",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
refersion: { authProvisionId: "apn_xxxxxxx" },
firstName: "First Name",
lastName: "Last Name",
},
})
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": "refersion-create-affiliate",
"configured_props": {
"refersion": { "authProvisionId": "apn_xxxxxxx" },
"firstName": "First Name",
"lastName": "Last Name"
}
}'// 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": "refersion",
},
},
},
)
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: "refersion-create-affiliate",
arguments: {
firstName: "First Name",
lastName: "Last Name",
},
})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 |
|---|---|---|
firstName First Name | string | First name of the affiliate Required |
lastName Last Name | string | Last name of the affiliate Required |
email Email | string | Email of the affiliate Required |
password Password | string | Has at least 9 characters. The password is NOT more than 72 characters. Has at least 1 upper case character. Has at least 1 lower case character. Has at least 1 numerical character. Has at least 1 special character. Does NOT have the same character repeated more than 3 times in a row. Password does NOT match the email of the user. Required |
status Status | string | Status of the affiliate Required |
offer Offer | string | Specific Offer ID to opt affiliate into, otherwise your default offer is used. Optional |
company Company | string | Company of the affiliate Optional |
paypalEmail Paypal Email | string | Paypal email of the affiliate Optional |
address1 Address 1 | string | Address 1 of the affiliate Optional |
address2 Address 2 | string | Address 2 of the affiliate Optional |
city City | string | City of the affiliate Optional |
state State | string | State of the affiliate Optional |
zip Zip | string | Zip of the affiliate Optional |
country Country | string | Country of the affiliate Optional |
phone Phone | string | Phone of the affiliate Optional |
sendWelcome Send Welcome | boolean | Send welcome email to affiliate Optional |
conversionTriggerCoupon Conversion Trigger Coupon | string | A unique coupon code to assign to this affiliate as a conversion trigger. Optional |
uniqueMerchantId Unique Merchant ID | string | An optional alphanumeric identifier for the affiliate for your team's internal use. 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
- refersion-create-affiliate
- Version
- 0.0.2
- App
- Refersion
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗