# Facility discounts

Facility discounts determine the value by which the [sales price](https://app.gitbook.com/o/5V8sCGBtfls4Jp7FwH20/s/2u56u6iixikInznwlzwk/api/core-concepts/customization-via-attributes#category-salesprice) of the facility's listings is reduced for a specific group. It is configured on the facility that supplies the listing to other facilities. The amount of the discount can be defined as a relative or absolute value. Discounts can be defined for a facility, a [group of facilities](https://app.gitbook.com/o/5V8sCGBtfls4Jp7FwH20/s/wxw7CUWGaTQdU5nY8tU0/core/facilities/facility-groups) or a group of articles ([category](https://app.gitbook.com/o/5V8sCGBtfls4Jp7FwH20/s/wxw7CUWGaTQdU5nY8tU0/inventory-management/article-categories)).The scope of application can be extended or reduced with the help of `AND` and `NOT` operators. The contexts set in the discount (e.g., facility groups) are matched with the corresponding context of the [listing attributes](https://docs.fulfillmenttools.com/documentation/developer-docs/api/core-concepts/customization-via-attributes#category-salesprice). If all contexts are matching, the discount is applied to the [sales price](https://app.gitbook.com/o/5V8sCGBtfls4Jp7FwH20/s/2u56u6iixikInznwlzwk/api/core-concepts/customization-via-attributes#category-salesprice) of the item. The priority defines the order in which the discounts should be applied.Facility discounts can be viewed, created and edited via the REST API: [REST API documentation – Facility discounts](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/facilities/-facilityRef-/discounts). More information can be found under [Developer Docs – Facility discounts](https://app.gitbook.com/o/5V8sCGBtfls4Jp7FwH20/s/2u56u6iixikInznwlzwk/integration-guides/more-integration-guides/facility-discounts).

#### **Example** <a href="#example" id="example"></a>

**Discounts supplier facility "CGN-02"**

| Discount | Scope of application                   | Priority |
| -------- | -------------------------------------- | -------- |
| 10%      | Facility "CGN-01" \| Facility "DUS-01" | 10       |
| 10%      | Article category "school books"        | 50       |
| 50€      | Facility group "NRW"                   | 100      |

Facility discounts determine the value by which the [sales price](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/articles/article-attributes#category-salesprice) of the facility's listings is reduced for a specific group. Discounts can be defined for a facility, a [group of facilities](https://docs.fulfillmenttools.com/documentation/getting-started/facilities/facility-groups) or a group of articles ([category](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/categories)). The scope of application can be extended or reduced with the help of `AND`, `OR`, `NOT` operators. The contexts set in the discount (for example, facility groups) are matched with the corresponding context of the [listing attributes](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/articles/article-attributes#category-salesprice). If all contexts were matching, the discount would be applied to the sales price of the item.

## Create facility discounts

To add a discount to an existing facility, perform the following `POST` request with a JSON body similar to the example provided. This example applies a discount of 5 EUR to articles that do NOT belong to the category `pet food` and that belong to either the `CGN` or `DUS` facility groups.

```http
POST https://{projectId}.api.fulfillmenttools.com/api/facilities/{facilityRef}/discounts
```

```json
{
  "context": [
    {
      "operator": "NOT",
      "type": "CATEGORY",
      "values": [
        "pet food"
      ]
    },
    {
      "operator": "AND",
      "type": "FACILITY_GROUP",
      "values": [
        "CGN",
        "DUS"
      ]
    }
  ],
  "discount": {
    "type": "ABSOLUTE",
    "value": 500,
    "currency": "EUR",
    "decimalPlaces": 2
  },
  "priority": 20,
  "type": "SALES_PRICE"
}

```
