# Update Donation — NationBuilder

> Update a specific donation with the provided data. See the documentation

- Key: `nationbuilder-update-donation`
- Type: Action (Write)
- Version: 0.0.2
- App: NationBuilder (`nationbuilder`) — https://pipedream.com/apps/nationbuilder.md
- This page (HTML): https://pipedream.com/apps/nationbuilder/actions/update-donation
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/nationbuilder/actions/update-donation/update-donation.mjs

## Description

Update a specific donation with the provided data. [See the documentation](https://nationbuilder.com/donations_api)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `donationId` | `string` | Yes | Donation id that will be used. Options are loaded from the connected account. |
| `amountInCents` | `integer` | Yes | Amount of donation in cents. |
| `authorId` | `string` | No | Id of the person who created the donation. Options are loaded from the connected account. |
| `billingAddress1` | `string` | No | First Address Line. |
| `billingAddress2` | `string` | No | Second Address Line. |
| `billingAddress3` | `string` | No | Third Address Line. |
| `billingAddressCity` | `string` | No | The city of the billing address. |
| `billingAddressState` | `string` | No | The state of the billing address. |
| `billingAddressZip` | `string` | No | The zip code of the billing address. |
| `billingAddressCountryCode` | `string` | No | The country code of the billing address (using ISO-3166-1 alpha-2). |
| `billingAddressLat` | `string` | No | The latitude of the billing address (using WGS-84). |
| `billingAddressLng` | `string` | No | The longitude of the billing address (using WGS-84). |
| `checkNumber` | `string` | No | Check/wire/MO number. |
| `corporateContribution` | `boolean` | No | True if the donation is a corporate contribution. |
| `donorId` | `string` | No | The person id of the donor. Options are loaded from the connected account. |
| `isPrivate` | `boolean` | No | False if the donation should be posted publicly on the site. |
| `note` | `string` | No | a note for this donation. |
| `paymentTypeName` | `string` | No | The name of the payment type. |
| `recruiterNameOrEmail` | `string` | No | Recruiter's name or email address (will also be credited as the fundraiser for this donation). |
| `trackingCodeSlug` | `string` | No | Tracking code for this donation. |
| `workAddress1` | `string` | No | First Address Line. |
| `workAddress2` | `string` | No | Second Address Line. |
| `workAddress3` | `string` | No | Third Address Line. |
| `workAddressCity` | `string` | No | The city of the work address. |
| `workAddressState` | `string` | No | The state of the work address. |
| `workAddressZip` | `string` | No | The zip code of the work address. |
| `workAddressCountryCode` | `string` | No | The country code of the work address (using ISO-3166-1 alpha-2). |
| `workAddressLat` | `string` | No | The latitude of the work address (using WGS-84). |
| `workAddressLng` | `string` | No | The longitude of the work address (using WGS-84). |
| `actblueOrderNumber` | `integer` | No | ActBlue order number. |
| `fecType` | `string` | No | FEC code name. |
| `cycle` | `integer` | No | Election cycle. |
| `period` | `string` | No | Election period. |

## 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": "nationbuilder",
      },
    },
  },
)

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: "nationbuilder-update-donation",
  arguments: {
    donationId: "Donation Id",
    amountInCents: 10,
  },
})
```

**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: "nationbuilder-update-donation",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    nationbuilder: { authProvisionId: "apn_xxxxxxx" },
    donationId: "Donation Id",
    amountInCents: 10,
  },
})

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": "nationbuilder-update-donation",
    "configured_props": {
      "nationbuilder": { "authProvisionId": "apn_xxxxxxx" },
      "donationId": "Donation Id",
      "amountInCents": 10
    }
  }'
```

---

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