# 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://app.gitbook.com/s/G9n5VxMY9T0Ob3D56PSD/rest-api/orders/search-orders)), 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.
