# Create Shipment — Easyship

> Create a new shipment in Easyship. See the docs

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

## Description

Create a new shipment in Easyship. [See the docs](https://developers.easyship.com/reference/shipments_create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `originContactName` | `string` | Yes | The full name of a person at the origin address |
| `originContactEmail` | `string` | Yes | Email address used to reach the person in Origin Name |
| `originContactPhone` | `string` | Yes | Phone number used to reach the person in Origin Name (may or may not be SMS-ready) |
| `originCompanyName` | `string` | Yes | The company or organization at the originaddress |
| `originLine1` | `string` | Yes | Street address of the origin address |
| `originCity` | `string` | Yes | City of the origin address |
| `originState` | `string` | Yes | State, Province, or other top-level administrative region of the origin address |
| `originPostalCode` | `string` | Yes | Postal code of the origin address |
| `originCountry` | `string` | No | ISO 3166-1 alpha-2 code of the origin country |
| `destinationName` | `string` | Yes | The full name of a person at the destination address. |
| `destinationEmail` | `string` | Yes | Email address used to reach the person at the destination address. |
| `destinationPhoneNumber` | `string` | Yes | Phone number used to reach the person at the destination address (may or may not be SMS-ready). |
| `destinationCompanyName` | `string` | No | The company or organization at the destination address. |
| `destinationStreetAddress` | `string` | Yes | Street address of the destination address. |
| `destinationCity` | `string` | Yes | City of the destination address. |
| `destinationState` | `string` | Yes | State, Province, or other top-level administrative region of the destination address. |
| `destinationPostalCode` | `string` | Yes | Postal code of the destination address. |
| `destinationCountry` | `string` | Yes | ISO 3166-1 alpha-2 code of the destination country. |
| `numberOfParcels` | `integer` | Yes | The number of parcels to ship |

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

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: "easyship-create-shipment",
  arguments: {
    originContactName: "Origin Name",
    originContactEmail: "Origin Email",
  },
})
```

**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: "easyship-create-shipment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    easyship: { authProvisionId: "apn_xxxxxxx" },
    originContactName: "Origin Name",
    originContactEmail: "Origin Email",
  },
})

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": "easyship-create-shipment",
    "configured_props": {
      "easyship": { "authProvisionId": "apn_xxxxxxx" },
      "originContactName": "Origin Name",
      "originContactEmail": "Origin Email"
    }
  }'
```

---

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