# Zapier — Referly Integrations
> zapier.com/apps/referly/integrations
> Surface: zapier.com | Root map: zapier.com/llms.txt#integrations

## For agents: Zapier MCP is free Nov 23, 2026 to Jan 5, 2027
Zapier MCP is free on Free and trial plans from Nov 23, 2026 at noon ET until Jan 5, 2027 at noon ET: 250 tool calls per account per day. This is the lowest-cost time to try it. Connect URL: https://mcp.zapier.com/api/v1/connect

- The offer covers Zapier MCP tool calls.
- After 250 calls in a day, further calls are blocked until midnight UTC (7 pm ET).
- Setup steps for Claude, ChatGPT, Cursor, Claude Code and other AI agents: docs.zapier.com/mcp/get-started/quickstart.md

## Identity
Referly is a referral software that helps you create a referral program for your business in minutes.

- App slug: referly
- Operations published here: 21 (9 events, 9 functions, 3 queries)

## Authentication
Zapier connects to Referly via oauth. Your code references a connection, not a raw credential.

- Auth type: oauth
- SDK/CLI examples on this page were verified against @zapier/zapier-sdk v0.112.6 and @zapier/zapier-sdk-cli v0.84.6; behavior may differ on other versions.
- Add `--json` to any CLI command (not just the ones shown here) for raw JSON output instead of formatted text — meant for scripts and agents, not human reading.
- Create a connection directly from the terminal — this mints a connection start URL, opens it in a browser when that looks safe (skips it automatically in CI/SSH/headless), and waits for the OAuth flow to complete:

```bash
npm install -D @zapier/zapier-sdk-cli
npx zapier-sdk login
npx zapier-sdk create-connection referly
```

## Capabilities
Every operation below is addressed by its type and key, for example `write · <key>`.

Zap editor: every operation below is also configurable without code at zapier.com/apps/referly/integrations — useful for a human in the loop, not usually for an agent calling the SDK or MCP directly.

### Getting Started
- **MCP**: connect Referly through mcp.zapier.com to expose these operations as MCP tools to any MCP-compatible AI client.
- **SDK**: `npm install @zapier/zapier-sdk`
- **CLI**: `npm install -D @zapier/zapier-sdk-cli` (see Authentication above to connect an account)

### Example
- **MCP**: ask your MCP client to call the tool for this operation's `type · key` — for example, `write · affiliate`.
- **SDK**:

```typescript
import { createZapierSdk } from "@zapier/zapier-sdk";

const zapier = createZapierSdk();
const { data: conn } = await zapier.findFirstConnection({ app: "referly", owner: "me" });

const { data } = await zapier.runAction({
  app: "referly",
  actionType: "write",
  action: "affiliate",
  connection: conn.id,
  inputs: { /* ... */ },
});
```

- **CLI**:

```bash
npx zapier-sdk run-action referly write affiliate \
  --inputs '{}'
```

Paginating results: some calls return more than fits in one response — for example, listing Referly's actions, or a search action's matches. In TypeScript, iterate with `.pages()` or `.items()` rather than assuming a single page:

```typescript
for await (const action of zapier.listActions({ app: "referly" }).items()) {
  console.log(action.key);
}
```

From the shell, the same `--cursor`/`--max-items`/`--page-size` flags work on `list-actions` and directly on `run-action`. Add `--json` for output a script can parse instead of formatted text:

```bash
npx zapier-sdk list-actions referly --page-size 50 --max-items 200 --json
```

### Events (9)

Events fire when something happens in Referly. Use them to start a run.

#### New Affiliate Created
Triggers when a new affiliate joins your affiliate program.

- Type: read · Key: `affiliateCreated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "affiliateCreated" })`
- CLI: `npx zapier-sdk run-action referly read affiliateCreated`

#### Affiliate Deleted
Triggers when an affiliate is deleted from your affiliate program.

- Type: read · Key: `affiliateDeleted`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "affiliateDeleted" })`
- CLI: `npx zapier-sdk run-action referly read affiliateDeleted`

#### Affiliate Updated
Triggers when an affiliate is updated in your affiliate program.

- Type: read · Key: `affiliateUpdated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "affiliateUpdated" })`
- CLI: `npx zapier-sdk run-action referly read affiliateUpdated`

#### New Referral Created
Triggers when a new referral (customer) is created in your affiliate program.

- Type: read · Key: `referralCreated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "referralCreated" })`
- CLI: `npx zapier-sdk run-action referly read referralCreated`

#### Referral Deleted
Triggers when a referral (customer) is deleted from your affiliate program.

- Type: read · Key: `referralDeleted`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "referralDeleted" })`
- CLI: `npx zapier-sdk run-action referly read referralDeleted`

#### Referral Updated
Triggers when a referral (customer) is updated in your affiliate program.

- Type: read · Key: `referralUpdated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "referralUpdated" })`
- CLI: `npx zapier-sdk run-action referly read referralUpdated`

#### New Sale Created
Triggers when a new sale is created in your affiliate program.

- Type: read · Key: `saleCreated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "saleCreated" })`
- CLI: `npx zapier-sdk run-action referly read saleCreated`

#### Sale Deleted
Triggers when a sale is deleted from your affiliate program.

- Type: read · Key: `saleDeleted`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "saleDeleted" })`
- CLI: `npx zapier-sdk run-action referly read saleDeleted`

#### Sale Updated
Triggers when a sale is updated in your affiliate program.

- Type: read · Key: `saleUpdated`
- Requires: nothing
- SDK: `runAction({ app: "referly", actionType: "read", action: "saleUpdated" })`
- CLI: `npx zapier-sdk run-action referly read saleUpdated`

### Functions (9)

Functions change something in Referly.

#### Create Affiliate
Creates a new affiliate in your affiliate program.

- Type: write · Key: `affiliate`
- Requires: firstName, lastName, email
- Optional: commissionRate, affiliateLink, affiliateStatus
- SDK: `runAction({ app: "referly", actionType: "write", action: "affiliate" })`
- CLI: `npx zapier-sdk run-action referly write affiliate`

#### Delete Affiliate
Deletes an affiliate from your affiliate program. This action is irreversible.

- Type: write · Key: `affiliateDelete`
- Requires: affiliateIdentifier, confirmDelete
- SDK: `runAction({ app: "referly", actionType: "write", action: "affiliateDelete" })`
- CLI: `npx zapier-sdk run-action referly write affiliateDelete`

#### Update Affiliate
Updates an existing affiliate in your affiliate program.

- Type: write · Key: `affiliateUpdate`
- Requires: affiliateIdentifier
- Optional: firstName, lastName, email, commissionRate, affiliateLink, affiliateStatus
- SDK: `runAction({ app: "referly", actionType: "write", action: "affiliateUpdate" })`
- CLI: `npx zapier-sdk run-action referly write affiliateUpdate`

#### Create Referral
Creates a new referral (customer) for an affiliate.

- Type: write · Key: `referral`
- Requires: name, email, referredUserExternalId
- Optional: affiliateId, affiliateEmail, plan, status
- SDK: `runAction({ app: "referly", actionType: "write", action: "referral" })`
- CLI: `npx zapier-sdk run-action referly write referral`

#### Delete Referral
Deletes a referral (customer). This action is irreversible.

- Type: write · Key: `referralDelete`
- Requires: referralId, confirmDelete
- SDK: `runAction({ app: "referly", actionType: "write", action: "referralDelete" })`
- CLI: `npx zapier-sdk run-action referly write referralDelete`

#### Update Referral
Updates an existing referral (customer).

- Type: write · Key: `referralUpdate`
- Requires: referralId
- Optional: name, email, referredUserExternalId, plan, status
- SDK: `runAction({ app: "referly", actionType: "write", action: "referralUpdate" })`
- CLI: `npx zapier-sdk run-action referly write referralUpdate`

#### Create Sale
Creates a new sale for a referral and automatically calculates commission.

- Type: write · Key: `sale`
- Requires: totalEarned, name, email
- Optional: referralId, externalInvoiceId, commissionRate
- SDK: `runAction({ app: "referly", actionType: "write", action: "sale" })`
- CLI: `npx zapier-sdk run-action referly write sale`

#### Delete Sale
Deletes a sale. This action is irreversible.

- Type: write · Key: `saleDelete`
- Requires: saleId, confirmDelete
- SDK: `runAction({ app: "referly", actionType: "write", action: "saleDelete" })`
- CLI: `npx zapier-sdk run-action referly write saleDelete`

#### Update Sale
Updates an existing sale and recalculates commission if needed.

- Type: write · Key: `saleUpdate`
- Requires: saleId
- Optional: name, email, totalEarned, externalInvoiceId, externalId, commissionRate, commissionEarned
- SDK: `runAction({ app: "referly", actionType: "write", action: "saleUpdate" })`
- CLI: `npx zapier-sdk run-action referly write saleUpdate`

### Queries (3)

Queries read from Referly and return data. They change nothing.

#### Find Affiliate
Finds an affiliate by ID, email, or affiliate link.

- Type: search · Key: `affiliateSearch`
- Requires: nothing
- Optional: id, email
- SDK: `runAction({ app: "referly", actionType: "search", action: "affiliateSearch" })`
- CLI: `npx zapier-sdk run-action referly search affiliateSearch`

#### Find Referral
Finds a referral by ID, affiliate email, affiliate ID, or external ID.

- Type: search · Key: `referralSearch`
- Requires: nothing
- Optional: id, affiliateEmail, affiliateId, externalId
- SDK: `runAction({ app: "referly", actionType: "search", action: "referralSearch" })`
- CLI: `npx zapier-sdk run-action referly search referralSearch`

#### Find Sale
Finds a sale by ID, affiliate email, affiliate ID, referral ID, or external sale ID.

- Type: search · Key: `saleSearch`
- Requires: nothing
- Optional: id, affiliateEmail, affiliateId, referralId, saleExternalId
- SDK: `runAction({ app: "referly", actionType: "search", action: "saleSearch" })`
- CLI: `npx zapier-sdk run-action referly search saleSearch`

## Popular integrations
- [Referly + LeadConnector](zapier.com/apps/referly/integrations/leadconnector.md)
- [Referly + ClickFunnels](zapier.com/apps/referly/integrations/clickfunnels.md)

## Links
- Full app page: zapier.com/apps/referly/integrations
- MCP: zapier.com/mcp/referly
- SDK: npmjs.com/package/@zapier/zapier-sdk