# 2025-10-30: Cart Service - external discounts on cart level

## Overview

Cart Service now supports applying external discounts directly at the cart level. This enables external systems (such as ERP systems) to apply cart-wide discounts that are calculated outside of Commerce Engine.

New attribute added to cart:

* `externalDiscounts` - an array of external discounts that can be applied to the entire cart, similar to how external discounts can be applied at the item level

Each external discount includes:

* `id` - unique identifier of the external discount
* `discountType` - type of discount: `PERCENT`, `ABSOLUTE`, or `FREE_SHIPPING`
* `value` - the discount value (percentage for PERCENT type, or monetary amount for ABSOLUTE type)
* `discountCalculationType` - determines how the discount is applied:
  * `TOTAL` - discount is spread across products, product fees, and shipping cost
  * `SUBTOTAL` - discount is spread across products only, without fees or shipping
* `sequence` - defines the order in which multiple discounts are applied

{% hint style="warning" %}
Applying external discounts to a cart requires the `cart.cart_manage_external_prices` scope.
{% endhint %}

## Updated endpoints

| Endpoint                                                                                                                                               | Description                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| [Updating a cart](https://developer.emporix.io/api-references/api-guides/checkout/cart/api-reference/carts#put-cart-tenant-carts-cartid)               | The `externalDiscounts` attribute has been added.              |
| [Retrieving cart details by ID](https://developer.emporix.io/api-references/api-guides/checkout/cart/api-reference/carts#get-cart-tenant-carts-cartid) | The `externalDiscounts` attribute is included in the response. |

## Known problems

There are no known problems.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/changelog/archive/changelog-2025/2025-10-30-cart-external-discounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
