younifyd
Menu

Get salesRules/search

Get salesRules/search

GET/V1/salesRules/search

Use it in a workflow

  1. Add a step and choose the Adobe Commerce connector.
  2. Pick the Get salesRules/search action (under Promotions).
  3. Fill in the fields below, then reference the result from later steps as {{getSalesrulesSearch.response.data}}.

Request

Query parameters

searchCriteria[filterGroups][0][filters][0][field]string

Field

searchCriteria[filterGroups][0][filters][0][value]string

Value

searchCriteria[filterGroups][0][filters][0][conditionType]string

Condition type

searchCriteria[sortOrders][0][field]string

Sorting field.

searchCriteria[sortOrders][0][direction]string

Sorting direction.

searchCriteria[pageSize]integer

Page size.

searchCriteria[currentPage]integer

Current page.

Response

Returns 200 with an object. Read it in later steps with {{getSalesrulesSearch.response.data.<field>}}.

itemsarray<object>

Rules.

rule_idinteger

Rule id

namestring

Rule name

store_labelsarray<object>3 fields

Display label

descriptionstring

Description

website_idsarray<integer>required

A list of websites the rule applies to

customer_group_idsarray<integer>required

Ids of customer groups that the rule applies to

from_datestring

The start date when the coupon is active

to_datestring

The end date when the coupon is active

uses_per_customerintegerrequired

Number of uses per customer

is_activebooleanrequired

The coupon is active

conditionobject7 fields

Interface ConditionInterface

action_conditionobject7 fields

Interface ConditionInterface

stop_rules_processingbooleanrequired

To stop rule processing

is_advancedbooleanrequired

Is this field needed

product_idsarray<integer>

Product ids

sort_orderintegerrequired

Sort order

simple_actionstring

Simple action of the rule

discount_amountnumberrequired

Discount amount

discount_qtynumber

Maximum qty discount is applied

discount_stepintegerrequired

Discount step

apply_to_shippingbooleanrequired

The rule applies to shipping

times_usedintegerrequired

How many times the rule has been used

is_rssbooleanrequired

Whether the rule is in RSS

coupon_typestringrequired

Coupon type

use_auto_generationbooleanrequired

To auto generate coupon

uses_per_couponintegerrequired

Limit of uses per coupon

simple_free_shippingstring

To grant free shipping

extension_attributesobject1 fields

ExtensionInterface class for @see \Magento\SalesRule\Api\Data\RuleInterface

search_criteriaobject

Search criteria interface.

filter_groupsarray<object>required1 fields

A list of filter groups.

sort_ordersarray<object>2 fields

Sort order.

page_sizeinteger

Page size.

current_pageinteger

Current page.

total_countinteger

Total count.

json
{
  "items": [
    {
      "website_ids": [
        0
      ],
      "customer_group_ids": [
        0
      ],
      "uses_per_customer": 0,
      "is_active": false,
      "stop_rules_processing": false,
      "is_advanced": false,
      "sort_order": 0,
      "discount_amount": 0,
      "discount_step": 0,
      "apply_to_shipping": false,
      "times_used": 0,
      "is_rss": false
    }
  ],
  "search_criteria": {
    "filter_groups": [
      {
        "filters": [
          {
            "field": "string",
            "value": "string",
            "condition_type": "string"
          }
        ]
      }
    ],
    "sort_orders": [
      {
        "field": "string",
        "direction": "string"
      }
    ],
    "page_size": 0,
    "current_page": 0
  },
  "total_count": 0
}

Need more? See the Adobe Commerce guide for connection setup and behaviour shared by every action.