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

# Return items (/api-reference/admin/orders/return-with-items)

`POST https://payments.qliro.com/checkout/adminapi/v2/ReturnItems`

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

Returns items of an order and starts a refund.

The response only confirms that Qliro received the request. Qliro sends the result in a notification with the `PaymentTransactionId`.

## Body (application/json)

- `RequestId` (string): A GUID formatted string used to avoid the same request being executed multiple times. The GUID will be stored for 7 days, and during that time, any requests sent with the same GUID will be denied. https://guidgenerator.com/online-guid-generator.aspx. Format: `guid`
- `MerchantApiKey` (string, required): Will be provided by Qliro Checkout when setting up merchant account. Length: `0 <= x <= 50`
- `OrderId` (integer): The Qliro Checkout order ID. Format: `int64`
- `Currency` (string, required): Three uppercase characters, in accordance with ISO 4217. Length: `x >= 1`
- `Returns` (object[], required): An array of objects containing the order items, fees, discounts and PaymentTransactionId
  - `PaymentTransactionId` (integer, required): A reference to the payment transaction. This reference was communicated in the notification message after a MarkItemsAsShipped call was processed. Format: `int64`
  - `OrderItems` (object[], required): Order items to return
    - `MerchantReference` (string, required): A string generated by the merchant to identify the order item. The combination of MerchantReference and PricePerItemIncVat is used to uniquely identify the order item. Maximum length is 200 characters. Length: `x >= 1`
    - `Type` (string, required): Can be 'Product', 'Discount', 'Fee' or 'Shipping'. Length: `x >= 1`
    - `Quantity` (integer, required): The number of these items that should be added to 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`
    - `VatRate` (number): The VAT rate for the item. Always specified with 2 decimals, e.g. 25.00 = 2500. Format: `decimal`
  - `Fees` (object[] | null): Fees that should be applied to the order
    - `MerchantReference` (string, required): A string generated by the merchant to identify the fee item. The combination of MerchantReference and PricePerItemIncVat is used to uniquely identify the fee item. Maximum length is 200 characters. Length: `1 <= x <= 400`
    - `Description` (string | null): A name or description of the fee item. Length: `x <= 4000`
    - `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, 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`
  - `Discounts` (object[] | null): Discounts that should be applied to the order
    - `MerchantReference` (string, required): A string generated by the merchant to identify the discount item. The combination of MerchantReference and PricePerItemIncVat is used to uniquely identify the discount item. Maximum length is 200 characters. Length: `1 <= x <= 400`
    - `Description` (string | null): A name or description of the discount item. Length: `x <= 4000`
    - `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. Note: This value must be below zero. 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, -99.9 or -99.99. Note: This value must be below zero. Format: `decimal`

## Responses

### 200 (application/json)

Request received.

- `PaymentTransactions` (object[] | null)
  - `PaymentTransactionId` (integer): Format: `int64`
  - `Status` (InfrastructureConstantsPaymentTransactionStatus): Values: `0`, `1`, `2`, `3`, `4`, `5`, `6`

Example:

```json
{
  "PaymentTransactions": [
    {
      "PaymentTransactionId": 0,
      "Status": 0
    }
  ]
}
```

### 400 (application/json)

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

Example:

```json
{
  "ErrorCode": "string",
  "ErrorMessage": "string",
  "ErrorReference": "string"
}
```

### 500 (application/json)

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

Example:

```json
{
  "ErrorCode": "string",
  "ErrorMessage": "string",
  "ErrorReference": "string"
}
```

## Example request

```bash
curl -X POST "https://payments.qliro.com/checkout/adminapi/v2/ReturnItems" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "HATS",
  "Currency": "SEK",
  "Returns": [
    {
      "PaymentTransactionId": 5451215,
      "OrderItems": [
        {
          "MerchantReference": "Fancy RedHat from HM",
          "Type": "Product",
          "Quantity": 2,
          "PricePerItemIncVat": 375.55
        }
      ]
    }
  ]
}'
```
