SmartRoutes ACTION
Create Order
Creates a new order in the smartroutes. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's SmartRoutes account once, then configure and run Create Order from your backend or agent.
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: "smartroutes-create-order",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
smartroutes: { authProvisionId: "apn_xxxxxxx" },
orderNumber: "Order Number",
customerAccount: "Customer Account Number",
},
})
console.log(result)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": "smartroutes-create-order",
"configured_props": {
"smartroutes": { "authProvisionId": "apn_xxxxxxx" },
"orderNumber": "Order Number",
"customerAccount": "Customer Account Number"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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": "smartroutes",
},
},
},
)
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: "smartroutes-create-order",
arguments: {
orderNumber: "Order Number",
customerAccount: "Customer Account Number",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
orderNumber Order Number | string | The order number Required |
customerAccount Customer Account Number | string | Account number of a customer Required Dynamic |
type Type | string | Type of the order (delivery, pickup, or shipment). Required |
deliveryContactName Delivery Contact Name | string | Name of the contact person. Optional |
deliveryContactNumber Delivery Contact Number | string | Contact number of the person. Optional |
deliveryContactEmail Delivery Contact Email | string | Email of the contact person. Optional |
deliveryAddress Delivery Address | string | Delivery address. Optional |
deliveryPostcode Delivery Postcode | string | Postcode for delivery address. Optional |
deliveryLat Delivery Latitude | string | Latitude of the delivery location. Optional |
deliveryLng Delivery Longitude | string | Longitude of the delivery location. Optional |
deliveryDuration Delivery Duration | integer | Duration for order delivery in minutes. Optional |
deliveryNotes Delivery Notes | string | Notes for delivery instructions. Optional |
deliveryDate Delivery Date | string | Date for order delivery. Optional |
pickupAddress Pickup Address | string | Address for order pickup. Optional |
pickupPostcode Pickup Postcode | string | Postcode for pickup address. Optional |
pickupDuration Pickup Duration | integer | Duration for order pickup in minutes. Optional |
pickupLat Pickup Latitude | string | Latitude of the pickup location. Optional |
pickupLng Pickup Longitude | string | Longitude of the pickup location. Optional |
pickupNotes Pickup Notes | string | Notes for pickup instructions. Optional |
pickupContactName Pickup Contact Name | string | Name of the contact person for pickup. Optional |
pickupContactNumber Pickup Contact Number | string | Contact number of the person for pickup. Optional |
pickupContactEmail Pickup Contact Email | string | Email of the contact person for pickup. Optional |
parts Parts | integer | Number of parts in the order. Optional |
lineItems Line Items | string[] | Array of line items in the order. Each line item object must contain product_code, product_name, and product_quantity. Optional |
timeWindows Time Windows | string[] | Array of time windows for order delivery or pickup. Each time window object must contain from (Start time of the time window. Ex: "08:00") and to (End time of the time window. Ex: "12:00"). Optional |
skills Skills | string[] | List of required skills for the order. Skills listed must exist within your Vehicle Settings. Optional |
customFields Custom Fields | string[] | Custom fields for the order Optional Dynamic |
capacities Capacities | string[] | Capacities for the order Optional Dynamic |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- smartroutes-create-order
- Version
- 0.0.2
- App
- SmartRoutes
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗