> For the complete documentation index, see [llms.txt](https://docs.ecwid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecwid.com/guides/orders/get-order-details/discounts-in-order-details.md).

# Discounts in order details

Get the following data about the discount coupons and promotions applied to the order with Ecwid API:

* Sum of promotions applied to the order
* Details on the applied discount coupon
* Total discount from promotions and coupons
* Detailed information about discounts applied to each product in the order

### Configured order API call

You can filter out everything in the order details except for the discount data with the `responseFields` query param.

#### Request example:

{% code overflow="wrap" %}

```http
GET /api/v3/STOREID/orders/ORDERID?responseFields=volumeDiscount,membershipBasedDiscount,totalAndMembershipBasedDiscount,couponDiscount,customDiscount,discount,discountInfo,discountCoupon,items(discounts,discountsAllowed) HTTP/1.1
Host: app.ecwid.com
Authorization: Bearer secret_token
```

{% endcode %}

Change `STOREID` with your store ID, `ORDERID` with the order ID ([find order ID](https://docs.ecwid.com/api-reference/rest-api/orders/search-orders.md)), and the `secret_token` with the secret access token of your app.

#### Response examples:

{% tabs %}
{% tab title="Promotion + coupon" %}

```json
{
    "volumeDiscount": 9,
    "membershipBasedDiscount": 0,
    "totalAndMembershipBasedDiscount": 0,
    "couponDiscount": 10,
    "customDiscount": [],
    "discount": 9,
    "discountInfo": [
        {
            "value": 10,
            "type": "PERCENT",
            "base": "ON_TOTAL",
            "orderTotal": 50,
            "description": "10% off on cart total above €50,00",
            "appliesToItems": [],
            "appliesToOrderItems": [],
            "triggeredByOrderItems": []
        }
    ],
    "discountCoupon": {
        "id": 224223294,
        "name": "Test Coupon #2",
        "code": "DISC2",
        "discountType": "PERCENT",
        "status": "ACTIVE",
        "discount": 10,
        "launchDate": "2024-09-01 23:00:00 +0000",
        "usesLimit": "UNLIMITED",
        "repeatCustomerOnly": false,
        "applicationLimit": "UNLIMITED",
        "creationDate": "2024-09-02 08:32:37 +0000",
        "updateDate": "2024-09-02 08:26:35 +0000",
        "orderCount": 0
    },
    "items": 
}
```

{% endtab %}

{% tab title="No promotion + no coupon" %}

```json
{
    "volumeDiscount": 0,
    "membershipBasedDiscount": 0,
    "totalAndMembershipBasedDiscount": 0,
    "couponDiscount": 0,
    "discount": 0,
    "discountInfo": []
}
```

{% endtab %}
{% endtabs %}

where:

* `volumeDiscount` - Sum of promotions applied to the order subtotal.
* `membershipBasedDiscount` - Sum of promotions applied to customer groups.
* `totalAndMembershipBasedDiscount` - Sum of promotions applied to the order.<br>
* `couponDiscount` - Discount from applied coupon.
* `customDiscount` - List of discounts applied by a custom app. If empty, no custom discounts are applied.<br>
* `discount` - Total sum of **all discounts** applied to the order.<br>
* `discountInfo` - List with details on all promotions applied to the order.
* `discountCoupon` - Details on applied discount coupon.<br>
* `items.discounts.discountInfo` - List with details on all promotions applied to the specific product in the order.
* `items.discounts.total` - Total sum of promotions applied to the specific product in the order. If `total` is less than the sum of `items.discounts[].value`, the discount is taxed.
* `items.discountsAllowed` - If `true`, discounts are applied to the product. If `false`, the product is not affected by any of the order's discounts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecwid.com/guides/orders/get-order-details/discounts-in-order-details.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
