Fixed price

How the fixed price action works, what are the required and optional parameters to set it up, and the resources for which it's enabled

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 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):

Key
Type
Required
Notes

type

String

Must be "fixed_price".

selector

String

identifier

String

Can be set only if the selector key value is an attribute.

groups

Array

Required when using bundles.

bundle

Object

aggregation

Object

apply_on

String

limit

Object

Cannot be set when using bundles.

value

Integer

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:

"actions": [
  {
    "type": "fixed_price",
    "selector": "order.line_items.sku",
    "groups": [ "discountable-items" ],
    "value": 2000,  
  }
]

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€).

Restrictions

Resources

As regards the Rule Engine integration with Commerce Layer Core API, the fixed price action type is available both for promotions (order rules) and price lists (price rules).

Last updated