> The index of all pages is at [llms.txt](https://developers.qliro.com/llms.txt). Add `.md` to any page URL for its Markdown.

# Update order (/api-reference/merchant/orders/update-order)

`PUT https://payments.qliro.com/checkout/merchantapi/Orders/{id}`

Production: `https://payments.qliro.com/checkout/merchantapi`. Staging: `https://pago.qit.nu/checkout/merchantapi`

Updates the `OrderItems` list of an order you have created.

## Path parameters

- `id` (integer, required): Id of order to update. Format: `int64`

## Body (application/json)

- `MerchantApiKey` (string, required): Will be provided by Qliro Checkout when setting up merchant account. Length: `0 <= x <= 50`
- `OrderItems` (object[], required)
  - `MerchantReference` (string, required): A string generated by the merchant to identify the order item. The combination of MerchantReference and Price Per Item Including Vat is used to uniquely identify the order item. Maximum length is 200 characters. Length: `x >= 1`. Pattern: `^[\p{L}\s(.)'\-_&,\/–+0-9:|]{1,200}$`
  - `Description` (string | null): A name or description of the order item. Length: `x <= 4000`
  - `Type` (string | null): Can be 'Product', 'Discount', 'Fee' or 'Shipping'
  - `Quantity` (integer, required): The number of these items in the cart. Format: `int32`. Range: `1 <= x <= 2147483647`
  - `PricePerItemIncVat` (number, required): The price per item including Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `PricePerItemExVat` (number): The price per item excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `VatRate` (number): The VAT rate for the item. Always specified with 2 decimals, e.g. 25.00 = 2500. Format: `decimal`
  - `Metadata` (object | null): Only available in create order and update order requests. Can be used to indicate if an item includes some kind of risk. If an item has been flagged with the property HasRisk, then depending on the merchant setup in Qliro Checkout, some payment methods will be disabled. This behavior is customizable in the merchant preferences. It can also be used to indicate that an order item is a subscription. If it is indicated as a subscription Qliro Checkout will show some additional terms for Qliro invoice if Qliro invoice is enabled for the merchant
    - `HasRisk` (boolean | null): If true, order item considered as risk item. Default is false
    - `Subscription` (object | null): It indicates that order item is a subscription if Enabled is true
      - `Enabled` (boolean)
    - `TravelInformation` (object | null)
      - `DepartureCountry` (string | null)
      - `DepartureCity` (string | null)
      - `DepartureIATACode` (string | null)
      - `ArrivalCountry` (string | null)
      - `ArrivalCity` (string | null)
      - `ArrivalIATACode` (string | null)
      - `StopOverCountry` (string | null)
      - `StopOverCity` (string | null)
      - `StopOverIATACode` (string | null)
      - `TravelType` (string | null)
      - `BookingDate` (string): Format: `date-time`
      - `DepartureDate` (string): Format: `date-time`
      - `ReturnDate` (string): Format: `date-time`
      - `DaysToDeparture` (integer): Format: `int32`
      - `NoOfPassengers` (integer): Format: `int32`
      - `Travelers` (object[] | null)
      - `Class` (string | null)
      - `Airline` (string | null)
      - `NoOfLuggage` (integer): Format: `int32`
    - `Ingrid` (object | null)
      - `Weight` (integer | null): Format: `int32`
      - `Sku` (string | null)
      - `ShippingDate` (object | null)
      - `Attributes` (string[] | null)
      - `Dimensions` (object | null)
      - `OutOfStock` (boolean | null)
      - `Discount` (number | null): Format: `decimal`
    - `MerchantData` (string | null): Length: `x <= 250`
- `AvailableShippingMethods` (object[] | null)
  - `MerchantReference` (string, required): A string generated by the merchant to identify the shipping method uniquely. Maximum length is 450 characters. Length: `0 <= x <= 450`
  - `ShippingFeeMerchantReference` (string | null): When the customer chooses a shipping method in Qliro Checkout, an order item will be added to the cart, including the shipping fee for that particular shipping method. By default, the merchantReference of this fee item will be copied from the selected shipping option. If the ShippingFeeMerchantReference parameter is provided, the merchantReference will be overridden. Maximum length is 450 characters. Length: `0 <= x <= 450`
  - `DisplayName` (string, required): The name of the shipping method, presented to the customer. Length: `0 <= x <= 100`
  - `Descriptions` (string[] | null): An array of (String) descriptions, presented as extra lines of information to the customer. Maximum length is 200 characters per line and up to 3 lines
  - `Brand` (string | null): A brand connected to the shipping method. If supported by Qliro Checkout, a logotype will be shown in the shipping methods list. Length: `0 <= x <= 50`
  - `PriceIncVat` (number): The price including Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `PriceExVat` (number): The price excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `OriginalPrice` (number | null): Use when updating the price of a shippingOption if the old price should be displayed, e.g. to point out shipping was made free because of total price over a certain value. Format: `decimal`
  - `SupportsAccessCode` (boolean): If provided and true, a field will be presented so that the customer can enter an access code. The access code will be optional and have maximum 50 characters. Suitable for home delivery methods
  - `SupportsDynamicSecondaryOptions` (boolean): If provided and true, a request to MerchantOrderAvailableShippingMethodsUrl will be sent every time the customer clicks on this shipping option. If MerchantOrderAvailableShippingMethodsUrl is not provided, selected shipping option will not be updated with secondary options list
  - `SecondaryOptions` (object[] | null): An array of additional options of the shipping method. See details below
    - `MerchantReference` (string, required): A string generated by the merchant to identify the Shipping option. Length: `0 <= x <= 450`
    - `DisplayName` (string, required): User friendly title of the Shipping option. Length: `0 <= x <= 100`
    - `City` (string | null): Use to provide city of delivery. Length: `0 <= x <= 450`
    - `Address` (string | null): Use to provide address of delivery. Length: `0 <= x <= 450`
    - `PostalCode` (string | null): Use to provide postal code of delivery. Length: `0 <= x <= 100`
    - `Descriptions` (string[] | null): User friendly description of the Shipping option
    - `Coordinates` (object | null): Use to provide Geographical location of delivery
      - `Lat` (number | null): Latitude expressed as decimal. Format: `double`
      - `Lng` (number | null): Longitude expressed as decimal. Format: `double`
    - `DeliveryDateInfo` (object | null): Use to provide information about delivery date
      - `DateStart` (string | null): This field represent the estimated delivery start date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
      - `DateEnd` (string | null): This field represent the estimated delivery end date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
      - `Unit` (DeliveryDateUnit | null): This field represent the display type for the delivery date. If no unit is provided a default of date will be used. Values: `0`, `1`, `2`
  - `AdditionalShippingServices` (object[] | null): Use when additional shipping services are available for the shipping option
    - `MerchantReference` (string, required): A string generated by the merchant to identify the additional shipping service uniquely. Maximum length is 200 characters. Length: `0 <= x <= 450`
    - `DisplayName` (string, required): The name of the additional shipping service, presented to the customer. Length: `0 <= x <= 100`
    - `Descriptions` (string[] | null): An array of (String) descriptions, presented as extra lines of information to the customer. Maximum length is 100 characters per line and up to 3 lines
    - `PriceExVat` (number): The price excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
    - `PriceIncVat` (number): The price including Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
    - `DeliveryDate` (string | null): This field represent the estimated delivery date of the order, with this selected. Will override the delivery date on Shipping Option. Format: `date-time`
    - `DeliveryDateInfo` (object | null): Use to provide information about delivery date
      - `DateStart` (string | null): This field represent the estimated delivery start date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
      - `DateEnd` (string | null): This field represent the estimated delivery end date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
      - `Unit` (DeliveryDateUnit | null): This field represent the display type for the delivery date. If no unit is provided a default of date will be used. Values: `0`, `1`, `2`
  - `DeliveryDate` (string | null): This field represent the estimated delivery date of the order. If the date provided is older than today the value will be ignored. Format: `date-time`
  - `CategoryDisplayName` (string | null): Can be used to group shipping methods. If used it must be set on all included shipping methods. Only 2 category values can be used for a list of shipping methods. Recommended values to use are "HOME_DELIVERY" and "PICKUP" so Qliro Checkout can handle the localizations. Other values will be used as is. Maximum length is 50 characters
  - `LabelDisplayName` (string | null): To be used with categories. Only use 3 or less different labels for all shipping options. Recommended values: "Express", "Free" and "Economy". Maximum length is 50 characters
  - `DeliveryDateInfo` (object | null): Use to provide information about delivery date
    - `DateStart` (string | null): This field represent the estimated delivery start date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
    - `DateEnd` (string | null): This field represent the estimated delivery end date of the order. If the date provided is older than today the value will be ignored. If no time offset is sent on the date, date will assume UTC If time offset different than UTC is sent on the date, date be converted to UTC. Format: `date-time`
    - `Unit` (DeliveryDateUnit | null): This field represent the display type for the delivery date. If no unit is provided a default of date will be used. Values: `0`, `1`, `2`
  - `IsEcoFriendly` (boolean): Use to mark a shipping method as eco friendly
  - `OptionLabels` (object[] | null): Use to mark a shipping method with labels
    - `Name` (string, required): The name of the shipping option label, presented to the customer. Length: `0 <= x <= 50`
    - `DisplayType` (string | null): The Display Type of the shipping option label, presented to the customer. Length: `0 <= x <= 50`
- `RequireIdentityVerification` (boolean | null)
- `ShippingAdditionalHeader` (string | null): Length: `x <= 300`
- `ApplicableFees` (object | null)
  - `Fees` (Record<string, object[]> | null): A Dictionary of string and Array of Fees, the key should be the name of a PaymentMethod for which the Array of Fees is applicable
    - `Type` (string, required): The type of Fee. Length: `x >= 1`
    - `MerchantReference` (string, required): A string generated by the merchant to identify the Fee. Length: `x >= 1`. Pattern: `^[\p{L}\s(.)'\-_&,\/–+0-9:|]{1,200}$`
    - `AmountIncludingVat` (number, required): The price per item excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
    - `AmountExcludingVat` (number, required): The price per item including Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
    - `Description` (string | null): User friendly description of the fee. Length: `x <= 4000`
- `ShippingConfiguration` (object | null): If you send shipping configs in update call checkoutId and tags that was sent in create order call will be overwritten So make sure to send the checkoutId and all the tags you need or just skip this if Shipping configurations has not changed
  - `Unifaun` (object | null): If you already have integration with unifaun fill in the Unifaun section and contact merchant onboarding to enable the feature
    - `CheckoutId` (string | null): Checkout id of the unifaun checkout that was created with qliro's template
    - `Tags` (Record<string, string> | null): Upto 20 tags are allowed. Max length for tag key is 20 letters and for tag value it is 30 letters Note we already send tocountry, tozipcode, language, currency parameters to unifaun. So merchant doesn't need to send them in tags
  - `Ingrid` (object | null): Optionally configure Delivery Grouping, Vouchers and Attributes for Ingrid
    - `Vouchers` (string[] | null): Vouchers that can be used in price/filter rules
    - `CartAttributes` (string[] | null): Attributes of the Cart. Cart level attributes are specific to the cart or for the full cart contents. Ingrid Delivery Checkout can set varied delivery scenarios based on such attributes. Ex. [“PRIO”, “AB-testID”]
    - `Groups` (object[] | null): Optional specification of group to which the cart items should be assigned
      - `GroupId` (string, required): Unique identifier of group passed when doing split of shipments. Length: `x >= 1`
      - `Header` (string | null): Header text containing arbitrary information related to the group
      - `Attributes` (string[] | null): Attributes list of a single delivery group. Used to control the behaviour of the `cart_attributes()` filter rule for each group individually
      - `Contents` (object[], required): List of cart item splits by each group. For example: Different sku quantities can be split between groups(orders)
    - `ExternalId` (string | null): Optional external identifier used when completing the Ingrid session. If not provided, the order's MerchantReference will be used
- `MerchantProvidedMetadata` (object[] | null): Merchant can send promotion and other information which can be retrieved later using GetOrder call if required. Maximum 30 elements allowed in list
  - `Key` (string | null): Merchant provided metadata element key. Max string length is 50. Length: `0 <= x <= 50`
  - `Value` (string | null): Merchant provided metadata element value. Max string length is 250. Length: `0 <= x <= 250`
- `PickupPersonDetails` (object | null): If you send a non empty object, PickupPersonDetails that was sent in create order call will be overwritten. You can skip this if 3rd party pickup person has not changed
  - `FirstName` (string | null): Pickup person's first name. Length: `0 <= x <= 100`
  - `LastName` (string | null): Pickup person's last name. Length: `0 <= x <= 100`
  - `Mobile` (string | null): Pickup person's phone number in international format. Length: `0 <= x <= 50`
  - `Email` (string | null): Pickup person's email. Length: `0 <= x <= 255`
- `MerchantConstraintName` (string | null): Enables dynamic filtering of payment channels available in specific orders
- `MerchantUpdateVersion` (string | null): Merchants cart version. Will be returned by front end api callback onOrderUpdated when data saved is shown in the checkout. Length: `1 <= x <= 36`
- `PaymentId` (string | null)
- `CustomerInformation` (object | null): Customer information used to try to identify the customer without user interaction
  - `Email` (string | null): The customer's email address. Length: `0 <= x <= 255`
  - `Address` (object | null): The customer's address. If provided and complete, the address will be presented as an alternative to the address fetched by Qliro Checkout. For B2B customer treat this address as billing address
    - `PostalCode` (string | null): The postal code of the address. Length: `0 <= x <= 15`

## Responses

### 200

Order updated. The response has no body.

### 400 (application/json)

- `ErrorCode` (string | null): Unique error code
- `DetailedErrorMessage` (string | null): Detailed error message
- `ErrorReference` (string): A tracking ID from Qliro Checkout. Format: `guid`

Example:

```json
{
  "ErrorCode": "ORDER_NOT_FOUND",
  "DetailedErrorMessage": "Order not found",
  "ErrorReference": "d7da92f4-1ad9-48c3-9cd3-26559c98e64c"
}
```

### 500 (application/json)

- `ErrorCode` (string | null): Unique error code
- `DetailedErrorMessage` (string | null): Detailed error message
- `ErrorReference` (string): A tracking ID from Qliro Checkout. Format: `guid`

Example:

```json
{
  "ErrorCode": "ORDER_NOT_FOUND",
  "DetailedErrorMessage": "Order not found",
  "ErrorReference": "d7da92f4-1ad9-48c3-9cd3-26559c98e64c"
}
```

## Example request

```bash
curl -X PUT "https://payments.qliro.com/checkout/merchantapi/Orders/0" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "MerchantApiKey",
  "OrderItems": [
    {
      "MerchantReference": "RedHat",
      "Quantity": 3,
      "PricePerItemIncVat": 375.55
    }
  ]
}'
```
