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

# Upsell order (/api-reference/merchant/upsell/upsell-order)

`POST https://payments.qliro.com/checkout/merchantapi/Upsell`

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

Adds `OrderItems` to a completed order that is eligible for upsell.

## Body (application/json)

- `MerchantApiKey` (string, required): Will be provided by Qliro Checkout when setting up merchant account. Length: `0 <= x <= 50`
- `RequestId` (string): Unique request id. Format: `guid`
- `OrderId` (integer, required): Qliro Checkout order Id of an already completed order. Format: `int64`
- `UpsellId` (string | null): Unique upsell id for this order. Required for generating upsell links
- `Currency` (string, required): Three uppercase characters, in accordance with ISO 4217. Length: `x >= 1`
- `OrderItems` (object[], required): List of order items to be added to an existing completed order
  - `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, required): An order item type can be 'Product', 'Discount', 'Fee' or 'Shipping'. Length: `x >= 1`
  - `Quantity` (integer, required): The quantity of item(s) and least quantity is 1. 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 or 99.9 or 99.99. Format: `decimal`
  - `PricePerItemExVat` (number, required): The price per item excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99 or 99.9 or 99.99. Format: `decimal`

## Responses

### 200 (application/json)

- `PaymentTransactionId` (integer | null): Newly created payment transaction id. Format: `int64`
- `Status` (string | null): Newly created payment transaction status
- `UpsellLink` (string | null): If upsell requires customer interaction or authorization to be completed, this link needs to be opened. PaymentTransactionId and Status is always null if an UpsellLink is returned

Example:

```json
{
  "PaymentTransactionId": 123,
  "Status": "Created",
  "UpsellLink": "https://checkout.qliro.com/upsell/12345?token=abc123"
}
```

### 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 POST "https://payments.qliro.com/checkout/merchantapi/Upsell" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "MerchantApiKey",
  "OrderId": 12345,
  "Currency": "SEK",
  "OrderItems": [
    {
      "MerchantReference": "BlackHat",
      "Type": "Product",
      "Quantity": 95,
      "PricePerItemIncVat": 143,
      "PricePerItemExVat": 100
    }
  ]
}'
```
