# Issue Virtual Card — Ramp

> Issue a new Ramp virtual card (spend limit) for a user. Run List Users to find the user ID. Works two ways: (1) link to an existing spend program — set Link to Existing Spend Program on and pass a Spend Program ID (run List Spend…

- Key: `ramp-issue-virtual-card`
- Type: Action (Write)
- Version: 0.1.1
- App: Ramp (`ramp`) — https://pipedream.com/apps/ramp.md
- This page (HTML): https://pipedream.com/apps/ramp/actions/issue-virtual-card
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/ramp/actions/issue-virtual-card/issue-virtual-card.mjs

## Description

Issue a new Ramp virtual card (spend limit) for a user. Run **List Users** to find the user ID. Works two ways: (1) **link to an existing spend program** — set **Link to Existing Spend Program** on and pass a **Spend Program ID** (run **List Spend Programs**), and the program governs the card's restrictions; or (2) **set a custom limit** — leave linking off and pass a **Total Limit per Interval** (e.g. `$500`) and an **Interval** (e.g. `MONTHLY`), optionally a per-transaction cap and allowed/blocked categories. Example: issue a $500/month card by passing the user's ID, `$500`, and `MONTHLY`. [See the documentation](https://docs.ramp.com/developer-api/v1/reference/rest/limits#post-developer-v1-limits-deferred)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `displayName` | `string` | Yes | A name for the virtual card, e.g. Marketing SaaS. |
| `userId` | `string` | Yes | The ID of a user — a Ramp UUID, e.g. bcc1e4ca-d38a-4cc9-98fc-e6c2066ad0ae. Run the List Users action to find valid IDs. |
| `linkToSpendProgram` | `boolean` | No | Set to true to link this card to an existing spend program (then provide a Spend Program ID below). Leave off to set a custom limit instead. |
| `spendProgramId` | `string` | No | The spend program to link the card to — a Ramp UUID, e.g. e9d30f12-c73a-463b-bc5f-b200396359d2. Run the List Spend Programs action to find valid IDs. Required when Link to Existing Spend Program is on; leave empty to set a custom limit. |
| `limit` | `string` | No | Total amount allowed per interval, in USD (e.g. $500). Required for a custom limit (when not linking to a spend program); ignored when a Spend Program ID is set. |
| `interval` | `string` | No | Reset interval for the custom limit (e.g. MONTHLY). Required for a custom limit. |
| `transactionAmountLimit` | `string` | No | Maximum amount per single transaction, in USD (e.g. $100). Optional; applies to a custom limit. |
| `allowedCategories` | `integer[]` | No | List of Ramp category codes allowed for the limit |
| `blockedCategories` | `integer[]` | No | List of Ramp category codes blocked for the limit |
| `primaryCardEnabled` | `boolean` | No | Whether the user's physical card can be linked to this limit. Applies to a custom limit. |
| `reimbursementsEnabled` | `boolean` | No | Whether reimbursements can be submitted against this limit. Applies to a custom limit. |
| `isShareable` | `boolean` | No | Whether the spend limit is shareable among multiple users. |

## Run it

**MCP**

```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": "ramp",
      },
    },
  },
)

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: "ramp-issue-virtual-card",
  arguments: {
    displayName: "Virtual Card Name",
    userId: "User ID",
  },
})
```

**TypeScript**

```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: "ramp-issue-virtual-card",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    ramp: { authProvisionId: "apn_xxxxxxx" },
    displayName: "Virtual Card Name",
    userId: "User ID",
  },
})

console.log(result)
```

**cURL**

```bash
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": "ramp-issue-virtual-card",
    "configured_props": {
      "ramp": { "authProvisionId": "apn_xxxxxxx" },
      "displayName": "Virtual Card Name",
      "userId": "User ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/ramp.md · All apps: https://pipedream.com/apps
