---
title: "Add order"
method: POST
path: "/api/connector/v1/orders/add"
tags: ["Orders"]
---

# Add order

`POST /api/connector/v1/orders/add`

Creates a new order, with the specified products and items. If the product being posted already exists in Mews, then use `ProductOrders`. If the product does *not* exist in Mews, then use `Items`. If the time of consumption is specified, this must be either in the future or within the Editable History Interval for the enterprise. Compared to a stay service order (i.e. a reservation), which is consumed over certain span of time, a product service order is consumed at a single point in time.
Note this operation supports [Portfolio Access Tokens](https://mews-systems.gitbook.io/connector-api/concepts/multi-property/).

> ### Linking orders to reservations
> Specify parameter `LinkedReservationId` in order to link the order to a guest reservation. This will greatly assist the property when using billing automation.
> This parameter is also a prerequisite for the Allowances flow; without linking the order to the correct reservation, Allowances will not apply to those items. If this parameter is not set, Mews will attempt to predict the linked reservation, but accuracy cannot be guaranteed.

## Request body

- OrderAdditionParameters
  - `ClientToken` string, required — Token identifying the client application.
  - `AccessToken` string, required — Access token of the client application.
  - `Client` string, required — Name and version of the client application.
  - `EnterpriseId` string, uuid, nullable — Unique identifier of the `Enterprise`. Required when using Portfolio Access Tokens, ignored otherwise.
  - `ServiceId` string, uuid, required — Identifier of the `Service` to be ordered.
  - `AccountId` string, uuid, required — Identifier of the `Customer` or `Company` to be charged. Company billing may not be enabled for your integration.
  - `CustomerId` string, uuid, nullable — Identifier of the [Customer](https://mews-systems.gitbook.io/connector-api/operations/customers/#customer) to be charged. **Deprecated!**
  - `Options` OrderAdditionOptions
    - `DisableItemGrouping` boolean, nullable — Whether to disable item grouping. Defaults to `false` (item grouping is enabled by default).
  - `ProductOrders` ProductOrderAdditionData[], nullable — Parameters of the ordered products.
    - `ProductId` string, uuid, required — Unique identifier of the `Product` to be ordered.
    - `Count` integer, nullable — Count of products to be ordered, e.g. 10 in case of 10 beers.
    - `UnitAmount` AmountParameters — Price of the product that overrides the price defined in Mews.
      - `Currency` string, currency, required
      - `TaxCodes` string[], required
      - `NetValue` number, double, nullable
      - `GrossValue` number, double, nullable
    - `StartUtc` string, date-time, nullable — Product start in UTC timezone in ISO 8601 format. For products with charging `Once` and `PerPerson` must be set to same value as `EndUtc`. Use only with operation [Add reservations](https://mews-systems.gitbook.io/connector-api/operations/reservations#add-reservations) or [Add reservation product](https://mews-systems.gitbook.io/connector-api/operations/reservations#add-reservation-product), can be omitted for [Add order](https://mews-systems.gitbook.io/connector-api/operations/orders#add-order) operation.
    - `EndUtc` string, date-time, nullable — Product end in UTC timezone in ISO 8601 format. For products with charging `Once` and `PerPerson` must be set to same value as `StartUtc`. Use only with operation [Add reservations](https://mews-systems.gitbook.io/connector-api/operations/reservations#add-reservations) or [Add reservation product](https://mews-systems.gitbook.io/connector-api/operations/reservations#add-reservation-product), can be omitted for [Add order](https://mews-systems.gitbook.io/connector-api/operations/orders#add-order) operation.
    - `ExternalIdentifier` string, nullable — External identifier of the product order.
  - `Items` OrderItemAdditionData[], nullable — Parameters of the ordered custom items.
    - `Name` string, required — Name of the item.
    - `UnitCount` integer, required — Count of units to be ordered, e.g. 10 in case of 10 beers.
    - `UnitAmount` AmountParameters, required — Price of the product that overrides the price defined in Mews.
      - `Currency` string, currency, required
      - `TaxCodes` string[], required
      - `NetValue` number, double, nullable
      - `GrossValue` number, double, nullable
    - `AccountingCategoryId` string, uuid, nullable — Unique identifier of an `AccountingCategory` to be assigned to the item.
    - `ExternalIdentifier` string, nullable — External identifier of the order item.
  - `ConsumptionUtc` string, date-time, nullable — Date and time of the order consumption in UTC timezone in ISO 8601 format. If not specified, current date and time is used. Please note, as order consumption is one-time event, the optional parameters `StartUtc` and `EndUtc` in `ProductOrders` should not be used.
  - `Notes` string, nullable — Additional notes of the order.
  - `BusinessSegmentId` string, uuid, nullable — Unique identifier of the business segment.
  - `BillId` string, uuid, nullable — 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.
  - `LinkedReservationId` string, uuid, nullable — Identifier of the `Reservation` to which the created order will be linked.

## Response `200`

OK

- OrderAdditionResult
  - `OrderId` string, uuid — Unique identifier of the created order.

## Other responses

- `204` — Server has successfully fulfilled the request and there is no additional information to send back.
- `400` — Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).
- `401` — Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
- `403` — Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.
- `408` — Error caused by heavy request that takes too long to process (typically tens of seconds). To get around this, request data in smaller batches. For more information, see [Request timeouts](https://mews-systems.gitbook.io/connector-api/guidelines/requests#request-timeouts)
- `429` — Error caused by too many requests sent in a given amount of time. Response contains `Retry-After` header indicating how long the user agent should wait before making a follow-up request. For more information, see [Request limits](https://mews-systems.gitbook.io/connector-api/guidelines/requests#request-limits).
- `500` — Unexpected error on the Mews side. This may be due to a software fault. If such a situation occurs, the error will be logged and the development team notified, however you can raise an issue through GitHub on our [documentation repository](https://github.com/MewsSystems/gitbook-connector-api).

---

[API](https://skmtc.net/mews/apis/connector-api.md) · [All operations](https://skmtc.net/mews/apis/connector-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mews/connector-api/versions/81933a8ff730/schema)
