# Create Shipment — Trunkrs

> Create a new shipment. See the documentation

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

## Description

Create a new shipment. [See the documentation](https://docs.trunkrs.nl/docs/v2-api-documentation/85ba39933b755-create-shipment)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderReference` | `string` | Yes | Internal order reference provided by customer, this must be unique |
| `senderName` | `string` | Yes | The name of the sender |
| `senderEmailAddress` | `string` | Yes | The email address of the sender |
| `senderStreetAddress` | `string` | Yes | The street address of the sender |
| `senderPostalCode` | `string` | Yes | The postal code of the sender |
| `senderCity` | `string` | Yes | The city of the sender |
| `senderCountry` | `string` | Yes | The country of the sender |
| `recipientName` | `string` | Yes | The name of the recipient |
| `recipientEmailAddress` | `string` | Yes | The email address of the recipient |
| `recipientStreetAddress` | `string` | Yes | The street address of the recipient |
| `recipientPostalCode` | `string` | Yes | The postal code of the recipient |
| `recipientCity` | `string` | Yes | The city of the recipient |
| `recipientCountry` | `string` | Yes | The country of the sender |
| `parcelWeightUnit` | `string` | Yes | The unit of weight for the parcels |
| `parcelWeights` | `string[]` | Yes | An array of weights for the parcels in the unit provided by the parcelWeightUnit prop |
| `timeSlotId` | `string` | No | The ID of the time slot to use for the shipment Options are loaded from the connected account. |
| `service` | `string` | No | Specifies the service level of this parcel. To use the freezer service, set the value to SAME_DAY_FROZEN_FOOD. |

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

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: "trunkrs-create-shipment",
  arguments: {
    orderReference: "Order Reference",
    senderName: "Sender Name",
  },
})
```

**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: "trunkrs-create-shipment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    trunkrs: { authProvisionId: "apn_xxxxxxx" },
    orderReference: "Order Reference",
    senderName: "Sender Name",
  },
})

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": "trunkrs-create-shipment",
    "configured_props": {
      "trunkrs": { "authProvisionId": "apn_xxxxxxx" },
      "orderReference": "Order Reference",
      "senderName": "Sender Name"
    }
  }'
```

---

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