# Create Shipping Order — Shipday

> Creates a new shipping order. See the documentation

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

## Description

Creates a new shipping order. [See the documentation](https://docs.shipday.com/reference/insert-delivery-order)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderNumber` | `string` | Yes | Alphanumeric identifier for the order object |
| `customerName` | `string` | Yes | The name of the customer |
| `customerAddress` | `string` | Yes | The address of the customer |
| `customerEmail` | `string` | Yes | The email address of the customer |
| `customerPhoneNumber` | `string` | Yes | Phone number of the customer with country code |
| `restaurantName` | `string` | Yes | The name of the restaurant |
| `restaurantAddress` | `string` | Yes | The address of the restaurant |
| `expectedDeliveryDate` | `string` | No | Expected delivery date in UTC for the particular order ( yyyy-mm-dd format) |
| `expectedPickupTime` | `string` | No | Expected pickup time in UTC for the particular order (format hh:mm:ss) |
| `expectedDeliveryTime` | `string` | No | Expected Delivery Time in UTC for the particular order (format hh:mm:ss) |
| `pickupLatitude` | `string` | No | The latitude of the pickup location |
| `pickupLongitude` | `string` | No | The longitude of the pickup location |
| `deliveryLatitude` | `string` | No | The latitude of the delivery location |
| `deliveryLongitude` | `string` | No | The longitude of the delivery location |
| `tips` | `string` | No | Tips amount for the order |
| `tax` | `string` | No | The tax for the order |
| `discountAmount` | `string` | No | The discount amount for the order |
| `deliveryFee` | `string` | No | The delivery fee for the order |
| `totalOrderCost` | `string` | No | The total cost of the order |
| `pickupInstruction` | `string` | No | The pickup instructions for the order |
| `deliveryInstruction` | `string` | No | The delivery instructions for the order |

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

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: "shipday-create-order",
  arguments: {
    orderNumber: "Order Number",
    customerName: "Customer 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: "shipday-create-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shipday: { authProvisionId: "apn_xxxxxxx" },
    orderNumber: "Order Number",
    customerName: "Customer 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": "shipday-create-order",
    "configured_props": {
      "shipday": { "authProvisionId": "apn_xxxxxxx" },
      "orderNumber": "Order Number",
      "customerName": "Customer Name"
    }
  }'
```

---

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