# Order Upload — Business Edge

> Upload an order to Business Edge via POST /documents/orderupload/export.json. ImpOrder is required and validated before the request (OrdDate, ImpDtlLine with product id + OrdQty; ShipTo/BillTo/ThirdPartyBillTo require Name when set). See…

- Key: `business_edge-order-upload`
- Type: Action (Write)
- Version: 0.0.3
- App: Business Edge (`business_edge`) — https://pipedream.com/apps/business-edge.md
- This page (HTML): https://pipedream.com/apps/business-edge/actions/order-upload
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/business_edge/actions/order-upload/order-upload.mjs

## Description

Upload an order to Business Edge via `POST /documents/orderupload/export.json`. ImpOrder is required and validated before the request (OrdDate, ImpDtlLine with product id + OrdQty; ShipTo/BillTo/ThirdPartyBillTo require Name when set). [See the documentation](https://hangerbolt.ci-inc.com/apilist/export)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `entity` | `string` | Yes | Entity for this request. Options load from customer V3 args.json when available; otherwise numeric codes 1–20 are shown (configurable fallback). Options are loaded from the connected account. |
| `dateFormatOpt` | `string` | No | A=mm-dd-yy; B=yy-mm-dd; C=yyyy-mm-dd; D=mmddyy; E=yymmdd; F=yyyymmdd; G=dd-mm-yy; H=ddmmyy |
| `dateDelim` | `string` | No | Separator for delimited date formats. Ignored (not sent) when DateFormatOpt is D, E, F, or H (compact formats without delimiters). Default "-" for other formats. |
| `savedSchemaId` | `string` | No | Optional saved API schema ID for returned data (use with or instead of schema code) |
| `savedSchemaCode` | `string` | No | Optional saved API schema code for returned data (use with or instead of schema ID) |
| `impOrder` | `object` | Yes | Order header and lines (ImpDtlLine). OrdDate required; each line needs OrdQty plus one of ProdCode, ProdID, BinBarcode, AnyScan; optional ShipTo/BillTo/ThirdPartyBillTo require Name when included |

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

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: "business_edge-order-upload",
  arguments: {
    entity: "Entity",
    dateFormatOpt: "Date Format (DateFormatOpt)",
  },
})
```

**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: "business_edge-order-upload",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    business_edge: { authProvisionId: "apn_xxxxxxx" },
    entity: "Entity",
    dateFormatOpt: "Date Format (DateFormatOpt)",
  },
})

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": "business_edge-order-upload",
    "configured_props": {
      "business_edge": { "authProvisionId": "apn_xxxxxxx" },
      "entity": "Entity",
      "dateFormatOpt": "Date Format (DateFormatOpt)"
    }
  }'
```

---

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