View as Markdown
Megaventory icon

Megaventory ACTION

Insert Or Update Purchase Order

Insert or update a purchase order in the database. See the docs.
  • Action
  • Writes data
  • Destructive
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Megaventory account once, then configure and run Insert Or Update 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: "megaventory-insert-or-update-purchase-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    megaventory: { authProvisionId: "apn_xxxxxxx" },
    purchaseOrderTypeId: 10,
    supplier: 10,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Insert Or Update Purchase Order inputs
Property Type Description
purchaseOrderTypeId Purchase Order Type ID integer
The ID of the purchase order type.
Required Dynamic
supplier Supplier ID integer
The ID of the supplier.
Required Dynamic
purchaseOrderInventoryLocationId Inventory Location ID integer
The ID of the inventory location.
Required Dynamic
purchaseOrderStatus Purchase Order Status string
The status of the purchase order.
Required
productSKU Product SKU string
The SKU of the product.
Required Dynamic
purchaseOrderRowQuantity Purchase Order Row Quantity integer
The quantity of the product.
Required
purchaseOrderId Purchase Order ID integer
The ID of the purchase order to update. If the purchase order does not exist, it will be created.
Optional Dynamic
purchaseOrderNo Purchase Order No string
The purchase order number.
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
megaventory-insert-or-update-purchase-order
Version
0.0.2
App
Megaventory
Authentication
API key
Read-only
No
Destructive
Yes
Open world
Yes