# Create Order — Shopware

> Create a new order. See the documentation

- Key: `shopware-create-order`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Shopware (`shopware`) — https://pipedream.com/apps/shopware.md
- This page (HTML): https://pipedream.com/apps/shopware/actions/create-order
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/shopware/actions/create-order/create-order.mjs

## Description

Create a new order. [See the documentation](https://shopware.stoplight.io/docs/admin-api/52ce9936f6ea4-create-a-new-order-resources)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `billingAddressId` | `string` | Yes | The ID of the billing address to use for the order Options are loaded from the connected account. |
| `currencyId` | `string` | Yes | The ID of the currency to use for the order Options are loaded from the connected account. |
| `salesChannelId` | `string` | Yes | The ID of the sales channel to use for the order Options are loaded from the connected account. |
| `stateId` | `string` | Yes | The ID of the state to use for the order Options are loaded from the connected account. |
| `orderDateTime` | `string` | Yes | The date and time the order was created |
| `priceObject` | `object` | Yes | Price object to use for the order. Example: { "netPrice": 1.00, "totalPrice": 1.00, "positionPrice": 1.00, "rawTotal": 1.00, "taxStatus": "Free", "calculatedTaxes": {}, "taxRules": {} } See the documentation for more information. |
| `shippingCostsObject` | `object` | Yes | Shipping costs object to use for the order. Example: { "unitPrice": 1.00, "totalPrice": 1.00, "quantity": 1, "calculatedTaxes": {}, "taxRules": {} } See the documentation for more information. |
| `currencyObject` | `object` | Yes | Currency object to use for the order. Example: { "factor": 1.0, "symbol": "€", "isoCode": "EUR", "itemRounding": { "decimals": 2, "interval": 1.0, "roundForNet": true }, "totalRounding": { "decimals": 2, "interval": 1.0, "roundForNet": true } } See the documentation for more information. |
| `currencyFactor` | `string` | Yes | Rate at which currency is exchanged |
| `itemRounding` | `object` | Yes | The rounding method to use for the order items. Example: {"extensions":[],"decimals":2,"interval":0.01,"roundForNet":true} |
| `totalRounding` | `object` | Yes | The rounding method to use for the order total. Example: {"extensions":[],"decimals":2,"interval":0.01,"roundForNet":true} |

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

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: "shopware-create-order",
  arguments: {
    billingAddressId: "Billing Address ID",
    currencyId: "Currency ID",
  },
})
```

**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: "shopware-create-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shopware: { authProvisionId: "apn_xxxxxxx" },
    billingAddressId: "Billing Address ID",
    currencyId: "Currency ID",
  },
})

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": "shopware-create-order",
    "configured_props": {
      "shopware": { "authProvisionId": "apn_xxxxxxx" },
      "billingAddressId": "Billing Address ID",
      "currencyId": "Currency ID"
    }
  }'
```

---

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