# Megaventory — Pipedream Connect

> Web-based software for online inventory management, order fulfillment and manufacturing using bills of materials.

- API slug: `megaventory` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Commerce
- Website: https://www.megaventory.com/
- This page (HTML): https://pipedream.com/apps/megaventory
- Tools: 6 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: megaventory`

```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": "megaventory",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Insert Or Update Product:
const result = await mcp.callTool({
  name: "megaventory-insert-or-update-product",
  arguments: {
    productSKU: "Product SKU",
    productDescription: "Product Description",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Megaventory endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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: "megaventory-insert-or-update-product",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    megaventory: { authProvisionId: "apn_xxxxxxx" },
    productSKU: "Product SKU",
    productDescription: "Product Description",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (6)

### `megaventory-insert-or-update-product` — Insert Or Update Product (Write)

Insert or update a product in the database. See the docs.

Full schema: https://pipedream.com/apps/megaventory/actions/insert-or-update-product.md

### `megaventory-insert-or-update-purchase-order` — Insert Or Update Purchase Order (Write)

Insert or update a purchase order in the database. See the docs.

Full schema: https://pipedream.com/apps/megaventory/actions/insert-or-update-purchase-order.md

### `megaventory-insert-or-update-sales-order` — Insert Or Update Sales Order (Write)

Insert or update a sales order in the database. See the docs.

Full schema: https://pipedream.com/apps/megaventory/actions/insert-or-update-sales-order.md

### `megaventory-list-inventory-location-id-options` — List Inventory Location ID Options (Read-only)

Retrieves available options for the Inventory Location ID field.

Full schema: https://pipedream.com/apps/megaventory/actions/list-inventory-location-id-options.md

### `megaventory-list-purchase-order-id-options` — List Purchase Order ID Options (Read-only)

Retrieves available options for the Purchase Order ID field.

Full schema: https://pipedream.com/apps/megaventory/actions/list-purchase-order-id-options.md

### `megaventory-list-sales-order-id-options` — List Sales Order ID Options (Read-only)

Retrieves available options for the Sales Order ID field.

Full schema: https://pipedream.com/apps/megaventory/actions/list-sales-order-id-options.md

## Triggers (3)

### `megaventory-new-product-created` — New Product Created (Polling)

Emit new event when a new product is created. See the docs.

Full schema: https://pipedream.com/apps/megaventory/triggers/new-product-created.md

### `megaventory-new-purchase-order-created` — New Purchase Order Created (Polling)

Emit new event when a new purchase order is created. See the docs.

Full schema: https://pipedream.com/apps/megaventory/triggers/new-purchase-order-created.md

### `megaventory-new-sales-order-created` — New Sales Order Created (Polling)

Emit new event when a new sales order is created. See the docs.

Full schema: https://pipedream.com/apps/megaventory/triggers/new-sales-order-created.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
