Zenventory ACTION
Create Purchase Order
Generates a new purchase order. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Zenventory account once, then configure and run Create Purchase 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: "zenventory-create-purchase-order",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
zenventory: { authProvisionId: "apn_xxxxxxx" },
supplierId: 10,
supplierName: "Supplier Name",
},
})
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": "zenventory-create-purchase-order",
"configured_props": {
"zenventory": { "authProvisionId": "apn_xxxxxxx" },
"supplierId": 10,
"supplierName": "Supplier Name"
}
}'// 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": "zenventory",
},
},
},
)
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: "zenventory-create-purchase-order",
arguments: {
supplierId: 10,
supplierName: "Supplier Name",
},
})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 |
|---|---|---|
supplierId Supplier Id | integer | Id of the supplier that is being ordered from. Optional |
supplierName Supplier Name | string | Name of the supplier that is being ordered from. Ignored if supplierId is provided. Optional |
warehouseId Warehouse Id | integer | Id of the warehouse the items will be delivered to. If no warehouse parameters are given, then the user's current warehouse will be used. Optional |
warehouseName Warehouse Name | string | Name of the warehouse the items will be delivered to. Ignored if warehouseId is provided. Optional |
clientId Client Id | integer | Id of the client that the purchase order is for. Defaults to the user's client id. Optional |
clientName Client Name | string | Name of the client that the purchase order is for. Ignored if clientId is provided and is nonzero. Optional |
orderNumber Order Number | string | Order number for the purchase order. If blank, one will automatically be generated. Optional |
draft Draft | boolean | True if the purchase order should be created as a draft to allow future editing. Optional |
requiredByDate Required By. | string | The date of the purchase. Format: YYYY-MM-DD Optional |
projectNumber Project Number | string | The number of the project. Optional |
notes Notes | string | A note of the purchase. Optional |
items Items | string[] | A list of object of ordered items. Example: {"itemId": 123, "sku": "SKU123", "description": "description", "quantity": 1}. See the documentation for further information. Optional |
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
- zenventory-create-purchase-order
- Version
- 0.0.4
- App
- Zenventory
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗