# Fixed price

Actions of type `fixed_price` enable you to overwrite the unit amount of a specific field with a desired value.

When setting up a fixed price action, in addition to the action `type`, you need to specify at least the attribute or resource on which to apply the action as the `selector` key value and fill the `value` key with the [integer number](#value) corresponding to the new price in cents that you want to set (for more information on the parameters listed in the table below and how they work please refer to the main [actions page](https://docs.commercelayer.io/rules-engine/actions)):

<table><thead><tr><th>Key</th><th>Type<select multiple><option value="YGgpISUGMdPQ" label="Boolean" color="blue"></option><option value="QePOb3JPIkBd" label="Integer" color="blue"></option><option value="rSmUinI3meTE" label="Float" color="blue"></option><option value="ytg3YoHxHpB2" label="String" color="blue"></option><option value="rlTqes6yAIME" label="Array" color="blue"></option><option value="qhQqnuEfMsvz" label="Object" color="blue"></option></select></th><th data-type="checkbox">Required</th><th>Notes</th></tr></thead><tbody><tr><td><strong><code>type</code></strong></td><td><span data-option="ytg3YoHxHpB2">String</span></td><td>true</td><td>Must be <code>"fixed_price"</code>.</td></tr><tr><td><strong><code>selector</code></strong></td><td><span data-option="ytg3YoHxHpB2">String</span></td><td>true</td><td></td></tr><tr><td><strong><code>identifier</code></strong></td><td><span data-option="ytg3YoHxHpB2">String</span></td><td>false</td><td>Can be set only if the <code>selector</code> key value is an attribute.</td></tr><tr><td><strong><code>groups</code></strong></td><td><span data-option="rlTqes6yAIME">Array</span></td><td>false</td><td>Required when using <a href="../bundle">bundles</a>.</td></tr><tr><td><strong><code>bundle</code></strong></td><td><span data-option="qhQqnuEfMsvz">Object</span></td><td>false</td><td></td></tr><tr><td><strong><code>aggregation</code></strong></td><td><span data-option="qhQqnuEfMsvz">Object</span></td><td>false</td><td></td></tr><tr><td><strong><code>apply_on</code></strong></td><td><span data-option="ytg3YoHxHpB2">String</span></td><td>false</td><td></td></tr><tr><td><strong><code>quantity</code></strong></td><td><span data-option="QePOb3JPIkBd">Integer</span></td><td>false</td><td>Learn more <a href="#quantity">here</a>.</td></tr><tr><td><strong><code>limit</code></strong></td><td><span data-option="qhQqnuEfMsvz">Object</span></td><td>false</td><td>Cannot be set when using <a href="../bundle">bundles</a>.</td></tr><tr><td><strong><code>value</code></strong></td><td><span data-option="QePOb3JPIkBd">Integer</span></td><td>true</td><td></td></tr></tbody></table>

### Example

The following action set to 2000 cents the unit amount of all the line items associated with an SKU among the ones grouped as `discountable-items` within the related condition matchers:

<pre class="language-json"><code class="lang-json">"actions": [
  {
<strong>    "type": "fixed_price",
</strong><strong>    "selector": "order.line_items.sku",
</strong>    "groups": [ "discountable-items" ],
<strong>    "value": 2000,  
</strong>  }
]
</code></pre>

## Value

The new amount that you want to set is defined by the `value` key which must be provided in **cents** (e.g. `1500` applied to a order with currency code `EUR` corresponds to 15€).

## Quantity

The `quantity` parameter allows you to override the actual quantity of the resource when applying the fixed price action. When specified, the action will be applied to the minimum between the specified quantity value and the actual resource quantity.

This parameter is particularly useful when you need to limit the number of items that receive a discount, regardless of how many units are actually in the cart. The action applies to the specified number of items, while any remaining items beyond that quantity will not receive the discount.&#x20;

{% hint style="info" %}
This parameter affects how many items receive the discount only, not the price value itself. For example, if you set it to 2 on a line item with 5 units, only 2 units will be set to the specified price, while the remaining 3 units will be charged at their original price.
{% endhint %}

{% hint style="success" icon="gift" %}
To implement a free gift promotion, use the [free gift](https://docs.commercelayer.io/rules-engine/actions/types/free-gift) action type, which applies a 100% discount to targeted line items without requiring you to know or hardcode item prices.
{% endhint %}

## Restrictions

{% hint style="success" %}
Fixed price actions support [bundles](https://docs.commercelayer.io/rules-engine/actions/bundle), provided that one or more groups among the ones defined when grouping the matches of the related conditions are specified.
{% endhint %}

{% hint style="warning" %}
You can set a [limit](https://docs.commercelayer.io/rules-engine/actions/limit) on fixed price actions only if you're **not** using bundles.&#x20;
{% endhint %}

## Resources

{% hint style="info" %}
As regards the Rule Engine [integration with Commerce Layer Core API](https://docs.commercelayer.io/rules-engine/readme#core-api-integration), the fixed price action type is available both for [promotions](https://docs.commercelayer.io/rules-engine/resources/promotions) ([order rules](https://docs.commercelayer.io/rules-engine/core-api-integration/order-rules)) and [price lists](https://docs.commercelayer.io/rules-engine/resources/price-lists) ([price rules](https://docs.commercelayer.io/rules-engine/core-api-integration/price-rules)).
{% endhint %}
