# Coupontools — Pipedream Connect

> The Coupontools software hands Marketers the promotional tools to interact with their audience.

- API slug: `coupontools` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Marketing
- Website: https://www.coupontools.com/
- This page (HTML): https://pipedream.com/apps/coupontools
- Tools: 5 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: coupontools`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_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": "coupontools",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Create Single Use URL:
const result = await mcp.callTool({
  name: "coupontools-create-single-use-url",
  arguments: {
    couponId: "Coupon ID",
    firstName: "First Name",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Coupontools endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.coupontools.com/v4/subaccount/list

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuY291cG9udG9vbHMuY29tL3Y0L3N1YmFjY291bnQvbGlzdA?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
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: "coupontools-create-single-use-url",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    coupontools: { authProvisionId: "apn_xxxxxxx" },
    couponId: "Coupon ID",
    firstName: "First Name",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (5)

### `coupontools-create-single-use-url` — Create Single Use URL (Write)

Create a single-use URL for a coupon. Prefill data like first name, last name, custom validation code, etc. See the documentation

Full schema: https://pipedream.com/apps/coupontools/actions/create-single-use-url.md

### `coupontools-create-subaccount` — Create Subaccount (Write)

Create a subaccount. See the documentation

Full schema: https://pipedream.com/apps/coupontools/actions/create-subaccount.md

### `coupontools-list-coupon-id-options` — List Coupon ID Options (Read-only)

Retrieves available options for the Coupon ID field.

Full schema: https://pipedream.com/apps/coupontools/actions/list-coupon-id-options.md

### `coupontools-list-directory-id-options` — List Directory ID Options (Read-only)

Retrieves available options for the Directory ID field.

Full schema: https://pipedream.com/apps/coupontools/actions/list-directory-id-options.md

### `coupontools-send-coupon-by-email` — Send Coupon by Email (Write)

Send a coupon by email. See the documentation

Full schema: https://pipedream.com/apps/coupontools/actions/send-coupon-by-email.md

## Triggers (3)

### `coupontools-new-coupon-claim` — New Coupon Claim (Polling)

Emit new event whenever a coupon has a new claim. See the documentation

Full schema: https://pipedream.com/apps/coupontools/triggers/new-coupon-claim.md

### `coupontools-new-coupon-validation` — New Coupon Validation (Polling)

Emit new event when a coupon has been validated. See the documentation

Full schema: https://pipedream.com/apps/coupontools/triggers/new-coupon-validation.md

### `coupontools-new-directory-registration` — New Directory Registration (Polling)

Emit new event when there's a new user registration in the directory. See the documentation

Full schema: https://pipedream.com/apps/coupontools/triggers/new-directory-registration.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
