# Create Mail Check — OnlineCheckWriter

> Creates a mail check. See the documentation.

- Key: `onlinecheckwriter-create-mail-check`
- Type: Action (Write)
- Version: 0.0.2
- App: OnlineCheckWriter (`onlinecheckwriter`) — https://pipedream.com/apps/onlinecheckwriter.md
- This page (HTML): https://pipedream.com/apps/onlinecheckwriter/actions/create-mail-check
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/onlinecheckwriter/actions/create-mail-check/create-mail-check.mjs

## Description

Creates a mail check. [See the documentation](https://apiv3.onlinecheckwriter.com/#f4562b65-70e8-4c4d-8444-8898e61ab7f0).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `isShippingToCustomAddress` | `boolean` | No | Value is true if sending mail to custom address. Default false |
| `customFromAddressId` | `string` | No | Must be a custom from address ID. Required if Shipping To Custom Address? is true. Options are loaded from the connected account. |
| `customToAddressId` | `string` | No | Must be a custom to address ID. Required if Shipping To Custom Address? is true. Options are loaded from the connected account. |
| `customShippingTypeId` | `string` | No | Must be a valid custom shipping type ID. Required if Shipping To Custom Address? is true. |
| `checkId` | `string` | Yes | Must be a check ID. Options are loaded from the connected account. |
| `shippingTypeId` | `string` | Yes | The shipping type ID of the check. |
| `paperTypeId` | `string` | Yes | Must be a valid paper type ID. |
| `informTypeId` | `string` | No | Must be a valid inform type ID. |
| `enableSmsInform` | `boolean` | No | Value is true if SMS inform is enabled. Default false |
| `enableEmailInform` | `boolean` | No | Value is true if email inform is enabled. Default false. |
| `payeeEmail` | `string` | No | Required if Enable Email Inform is true and there is no email on the associated payee. |
| `payeePhone` | `string` | No | Required if Enable SMS Inform is true and there is no phone on the associated payee. |

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

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: "onlinecheckwriter-create-mail-check",
  arguments: {
    isShippingToCustomAddress: true,
    customFromAddressId: "Custom From Address 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: "onlinecheckwriter-create-mail-check",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    onlinecheckwriter: { authProvisionId: "apn_xxxxxxx" },
    isShippingToCustomAddress: true,
    customFromAddressId: "Custom From Address 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": "onlinecheckwriter-create-mail-check",
    "configured_props": {
      "onlinecheckwriter": { "authProvisionId": "apn_xxxxxxx" },
      "isShippingToCustomAddress": true,
      "customFromAddressId": "Custom From Address ID"
    }
  }'
```

---

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