# Update Order — WICS

> Update an order. See the documentation

- Key: `wics-update-order`
- Type: Action (Write)
- Version: 0.0.3
- App: WICS (`wics`) — https://pipedream.com/apps/wics.md
- This page (HTML): https://pipedream.com/apps/wics/actions/update-order
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/wics/actions/update-order/update-order.mjs

## Description

Update an order. [See the documentation](https://docs.wics.nl/test-environment.html#orders-update-order)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderNumber` | `string` | Yes | Number identifier for the order Options are loaded from the connected account. |
| `deliveryDate` | `string` | No | The date that the order should be delivered. Format: YYYY-MM-DD |
| `webshopId` | `integer` | No | The identifier that corresponds to the webshop account of Transmart or Paazl |
| `warehouseCode` | `string` | No | The warehouse used for this order |
| `note` | `string` | No | A note that will shown alongside the order |
| `tag` | `string` | No | A shippingTag or tag that is linked with a shipment option in WICS. |
| `pickupPoint` | `string` | No | A place for picking up the order |
| `termsOfDelivery` | `string` | No | The delivery condition |
| `type` | `string` | No | The order type of the order |
| `invoiceAddressName` | `string` | No | The name of the invoice address |
| `invoiceAddressStreetNumber` | `string` | No | The street number of the invoice address |
| `invoiceAddressStreet` | `string` | No | The street name of the invoice address |
| `invoiceAddressCity` | `string` | No | The city of the invoice address |
| `invoiceAddressState` | `string` | No | The state of the invoice address |
| `invoiceAddressZipcode` | `string` | No | The zipcode of the invoice address |
| `invoiceAddressCountry` | `string` | No | The country of the invoice address |
| `invoiceEmail` | `string` | No | The email of the invoice address |
| `deliveryAddressName` | `string` | No | The name of the delivery address |
| `deliveryAddressStreetNumber` | `string` | No | The street number of the delivery address |
| `deliveryAddressStreet` | `string` | No | The street name of the delivery address |
| `deliveryAddressCity` | `string` | No | The city of the delivery address |
| `deliveryAddressState` | `string` | No | The state of the delivery address |
| `deliveryAddressZipcode` | `string` | No | The zipcode of the delivery address |
| `deliveryAddressCountry` | `string` | No | The country of the delivery address |
| `deliveryEmail` | `string` | No | The email of the delivery address |
| `lines` | `string[]` | No | The lines of the order as an array of objects including the key lineNumber. Example: [{ "lineNumber": 20002, "itemCode": "16084", "itemDescription": "Speaker kabel", "quantity": 5 }] See the documentation for additional information |

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

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: "wics-update-order",
  arguments: {
    orderNumber: "Order Number",
    deliveryDate: "Delivery Date",
  },
})
```

**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: "wics-update-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    wics: { authProvisionId: "apn_xxxxxxx" },
    orderNumber: "Order Number",
    deliveryDate: "Delivery Date",
  },
})

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": "wics-update-order",
    "configured_props": {
      "wics": { "authProvisionId": "apn_xxxxxxx" },
      "orderNumber": "Order Number",
      "deliveryDate": "Delivery Date"
    }
  }'
```

---

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