# Create Shipment — shipcloud

> Create a shipment See docs here

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

## Description

Create a shipment [See docs here](https://developers.shipcloud.io/reference/#creating-a-shipment)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `carrier` | `string` | Yes | The carrier you want to use |
| `service` | `string` | Yes | The service that should be used for the shipment |
| `toAddress` | `string` | Yes | Select an Address from the list. Alternatively, you can provide a custom JSON-stringified Address object. Example address object: {"company":"MusterCompany","first_name":"Max","last_name":"Mustermann","street":"Musterstraße","street_no":"42","zip_code":"54321","city":"Musterstadt"} Options are loaded from the connected account. |
| `fromAddress` | `string` | Yes | Select an Address from the list. Alternatively, you can provide a custom JSON-stringified Address object. Example address object: {"company":"MusterCompany","first_name":"Max","last_name":"Mustermann","street":"Musterstraße","street_no":"42","zip_code":"54321","city":"Musterstadt"} Options are loaded from the connected account. |
| `package` | `object` | Yes | Object describing the package. Required fields are height, length, weight and width. (See more info on the Shipcloud Docs) |
| `additionalOptions` | `object` | No | Optional parameters to pass, such as description or notification_email (more info on the Shipcloud Docs) |

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

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: "shipcloud-create-shipment",
  arguments: {
    carrier: "Carrier",
    service: "Service",
  },
})
```

**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: "shipcloud-create-shipment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shipcloud: { authProvisionId: "apn_xxxxxxx" },
    carrier: "Carrier",
    service: "Service",
  },
})

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": "shipcloud-create-shipment",
    "configured_props": {
      "shipcloud": { "authProvisionId": "apn_xxxxxxx" },
      "carrier": "Carrier",
      "service": "Service"
    }
  }'
```

---

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