# SalesRules
Retrieve sales rules that match te specified criteria. This call returns an array of objects, but detailed information about each object’s attributes might not be included. See https://developer.adobe.com/commerce/webapi/rest/attributes#RuleRepositoryInterface to determine which call to use to get detailed information about all attributes for an object.
## Documentation
Retrieve sales rules that match te specified criteria. This call returns an array of objects, but detailed information about each object’s attributes might not be included. See https://developer.adobe.com/commerce/webapi/rest/attributes#RuleRepositoryInterface to determine which call to use to get detailed information about all attributes for an object.
- Catalog: `Magento`
- Schema: `Marketing`
- Primary Keys: `rule_id`
Can retrieve data and change data using insert, update and delete.
## Parameters of Table Function
The following parameters can be used to control the behaviour of the table function `SalesRules`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values.
Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three.
Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third.
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `searchCriteria[currentPage]` | `` | ☐ | | Current page. |
| `searchCriteria[filterGroups][0][filters][0][conditionType]` | `` | ☐ | | Condition type |
| `searchCriteria[filterGroups][0][filters][0][field]` | `` | ☐ | | Field |
| `searchCriteria[filterGroups][0][filters][0][value]` | `` | ☐ | | Value |
| `searchCriteria[pageSize]` | `` | ☐ | | Page size. |
| `searchCriteria[sortOrders][0][direction]` | `` | ☐ | | Sorting direction. |
| `searchCriteria[sortOrders][0][field]` | `` | ☐ | | Sorting field. |
## Columns of Table Function
The columns of the table function `SalesRules` are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `action_condition_aggregator_type` | `varchar2` | | ☐ | The aggregator type |
| `action_condition_attribute_name` | `varchar2` | | ☐ | The attribute name of the condition |
| `action_condition_condition_type` | `varchar2` | | ☐ | Condition type |
| `action_condition_extension_attributes` | `varchar2` | | ☐ | The JSON text of the nested object. |
| `action_condition_operator` | `varchar2` | | ☐ | The operator of the condition |
| `action_condition_value` | `varchar2` | | ☐ | The value of the condition |
| `apply_to_shipping` | `char` | | ☐ | The rule applies to shipping |
| `condition_aggregator_type` | `varchar2` | | ☐ | The aggregator type |
| `condition_attribute_name` | `varchar2` | | ☐ | The attribute name of the condition |
| `condition_condition_type` | `varchar2` | | ☐ | Condition type |
| `condition_extension_attributes` | `varchar2` | | ☐ | The JSON text of the nested object. |
| `condition_operator` | `varchar2` | | ☐ | The operator of the condition |
| `condition_value` | `varchar2` | | ☐ | The value of the condition |
| `coupon_type` | `varchar2` | | ☐ | Coupon type |
| `customer_group_ids` | `varchar2` | | ☐ | Ids of customer groups that the rule applies to The identifiers, separated by commas. |
| `description` | `varchar2` | | ☐ | Description |
| `discount_amount` | `decimal` | | ☐ | Discount amount |
| `discount_qty` | `decimal` | | ☐ | Maximum qty discount is applied |
| `discount_step` | `int64` | | ☐ | Discount step |
| `extension_attributes` | `varchar2` | | ☐ | The JSON text of the nested object. |
| `from_date` | `varchar2` | | ☐ | The start date when the coupon is active |
| `is_active` | `char` | | ☐ | The coupon is active |
| `is_advanced` | `char` | | ☐ | Is this field needed |
| `is_rss` | `char` | | ☐ | Whether the rule is in RSS |
| `name` | `varchar2` | | ☐ | Rule name |
| `product_ids` | `varchar2` | | ☐ | Product ids The identifiers, separated by commas. |
| `rule_id` | `int64` | | ☐ | Rule id |
| `simple_action` | `varchar2` | | ☐ | Simple action of the rule |
| `simple_free_shipping` | `varchar2` | | ☐ | To grant free shipping |
| `sort_order` | `int64` | | ☐ | Sort order |
| `stop_rules_processing` | `char` | | ☐ | To stop rule processing |
| `times_used` | `int64` | | ☐ | How many times the rule has been used |
| `to_date` | `varchar2` | | ☐ | The end date when the coupon is active |
| `use_auto_generation` | `char` | | ☐ | To auto generate coupon |
| `uses_per_coupon` | `int64` | | ☐ | Limit of uses per coupon |
| `uses_per_customer` | `int64` | | ☐ | Number of uses per customer |
| `website_ids` | `varchar2` | | ☐ | A list of websites the rule applies to The identifiers, separated by commas. |