# Update Picqer Order — Picqer

> Update an order in Picqer. See the documentation

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

## Description

Update an order in Picqer. [See the documentation](https://picqer.com/en/api/orders#update)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderId` | `string` | Yes | The order id for searching orders. Options are loaded from the connected account. |
| `customerId` | `string` | No | The customer id for creating a new order. Options are loaded from the connected account. |
| `templateId` | `string` | No | The template id for creating a new order. Options are loaded from the connected account. |
| `deliveryName` | `string` | No | Name of delivery address. |
| `deliveryContactName` | `string` | No | Contact name of delivery address. |
| `deliveryAddress` | `string` | No | Address line of delivery address. |
| `deliveryAddress2` | `string` | No | Second address line. Not accepted by all shipping providers. |
| `deliveryZipcode` | `string` | No | ZIP code of delivery address. |
| `deliveryCity` | `string` | No | City of delivery address. |
| `deliveryRegion` | `string` | No | Region, province or state of delivery address. |
| `deliveryCountry` | `string` | No | Country of delivery address (needs to be ISO 3166 2-char code). |
| `invoiceName` | `string` | No | Name of invoice address. |
| `invoiceContactName` | `string` | No | Contact name of invoice address |
| `invoiceAddress` | `string` | No | Address line of invoice address |
| `invoiceAddress2` | `string` | No | Second address line. Not accepted by all shipping providers. |
| `invoiceZipcode` | `string` | No | ZIP code of invoice address |
| `invoiceCity` | `string` | No | City of invoice address |
| `invoiceRegion` | `string` | No | Region, province or state of invoice address |
| `invoiceCountry` | `string` | No | Country of invoice address (needs to be ISO 3166 2-char code). Required if Customer Id is not provided. |
| `telephone` | `string` | No | Telephone number of the customer. |
| `emailAddress` | `string` | No | Email address of the customer |
| `discount` | `string` | No | Discount percentage of order |
| `preferredDeliveryDate` | `string` | No | Customer supplied preferred delivery date, in format yyyy-mm-dd. |
| `customerRemarks` | `string` | No | Remarks from the customer, will be printed on picking and packing list |
| `reference` | `string` | No | Reference for customer, will be printed on invoice and picking list |
| `invoiced` | `boolean` | No | If this order is already invoiced, set this to true. This will make sure Picqer will not invoice this order |
| `shippingProviderId` | `string` | No | The shipping provider id for creating a new order. Options are loaded from the connected account. |
| `partialDelivery` | `boolean` | No | If Picqer AutoSplit is enabled, order can be split over multiple picklists over multiple warehouses. If disabled, it will wait for all products to be available |
| `language` | `string` | No | Language of the order |

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

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: "picqer-update-order",
  arguments: {
    orderId: "Order ID",
    customerId: "Customer 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: "picqer-update-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    picqer: { authProvisionId: "apn_xxxxxxx" },
    orderId: "Order ID",
    customerId: "Customer 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": "picqer-update-order",
    "configured_props": {
      "picqer": { "authProvisionId": "apn_xxxxxxx" },
      "orderId": "Order ID",
      "customerId": "Customer ID"
    }
  }'
```

---

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