View as Markdown
Mews icon

Mews ACTION

Create Order

Create an order in Mews. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Mews account once, then configure and run Create Order from your backend or agent.

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: "mews-create-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mews: { authProvisionId: "apn_xxxxxxx" },
    accountType: "Account Type",
    accountId: "Account ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Order inputs
Property Type Description
accountType Account Type string
Type of account to be charged
Required
accountId Account ID string
Identifier of the Customer or Company to be charged. Company billing may not be enabled for your integration.
Required Dynamic
serviceId Service ID string
Identifier of the Service to be ordered.
Required Dynamic
billId Bill ID string
Identifier of the Bill to which the created order will be assigned. The bill needs to be issued to the same account as the order.
Optional Dynamic
linkedReservationId Linked Reservation ID string
Identifier of the Reservation to which the created order will be linked.
Optional Dynamic
consumptionUtc Consumption (UTC) string
Date and time of the order consumption in UTC timezone in ISO 8601 format. If not specified, current date and time is used.
Optional
notes Notes string
Additional notes of the order.
Optional
productOrders Product Orders string[]

Array of product orders in JSON format. Each order must include:

Required:

  • ProductId (string) - Unique identifier of the Product to be ordered

Optional:

  • Count (number) - Count of products to be ordered (e.g. 10 in case of 10 beers)
  • UnitAmount (object) - Unit amount of the product that overrides the amount defined in Mews:
    • Currency (string) - ISO-4217 currency code
    • GrossValue (number) - Gross value including all taxes
    • NetValue (number) - Net value excluding taxes
    • TaxCodes (string[]) - Tax codes applied to the amount
  • StartUtc (string) - Product start in UTC timezone in ISO 8601 format (for Add order operation this can be omitted)
  • EndUtc (string) - Product end in UTC timezone in ISO 8601 format (for Add order operation this can be omitted)

Note: Either GrossValue or NetValue must be specified in amount objects, but not both. For products with charging Once and PerPerson, StartUtc and EndUtc must be set to the same value.

Example:

[
  {
    "ProductId": "12345678-1234-1234-1234-123456789012",
    "Count": 2,
    "UnitAmount": {
      "Currency": "USD",
      "GrossValue": 15.50,
      "TaxCodes": ["VAT"]
    },
    "StartUtc": "2025-01-01T00:00:00Z",
    "EndUtc": "2025-01-01T00:00:00Z"
  }
]
Optional
items Items string[]

Array of custom items in JSON format. Each item must include:

Required:

  • Name (string) - Name of the item
  • UnitCount (integer) - Count of units to be ordered (must be positive)
  • UnitAmount (object) - Amount per unit of the item:
    • Currency (string) - ISO-4217 currency code
    • GrossValue (number) - Gross value including all taxes
    • NetValue (number) - Net value excluding taxes
    • TaxCodes (string[]) - Tax codes applied to the amount

Optional:

  • AccountingCategoryId (string) - Identifier of the Accounting Category

Note: Either GrossValue or NetValue must be specified in UnitAmount, but not both.

Example:

[
  {
    "Name": "Room Service",
    "UnitCount": 1,
    "UnitAmount": {
      "Currency": "USD",
      "GrossValue": 25.00,
      "TaxCodes": ["VAT"]
    },
    "AccountingCategoryId": "87654321-4321-4321-4321-210987654321"
  }
]
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
mews-create-order
Version
0.0.3
App
Mews
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes