younifyd
Menu

Get coupons/search

Get coupons/search

GET/V1/coupons/search

Use it in a workflow

  1. Add a step and choose the Adobe Commerce connector.
  2. Pick the Get coupons/search action (under Promotions).
  3. Fill in the fields below, then reference the result from later steps as {{getCouponsSearch.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 {{getCouponsSearch.response.data.<field>}}.

itemsarray<object>

Rules.

coupon_idinteger

Coupon id

rule_idintegerrequired

The id of the rule associated with the coupon

codestring

Coupon code

usage_limitinteger

Usage limit

usage_per_customerinteger

Usage limit per customer

times_usedintegerrequired

The number of times the coupon has been used

expiration_datestring

Expiration date

is_primarybooleanrequired

The coupon is primary coupon for the rule that it's associated with

created_atstring

When the coupon is created

typeinteger

Of coupon

extension_attributesobject

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

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": [
    {
      "rule_id": 0,
      "times_used": 0,
      "is_primary": false,
      "coupon_id": 0,
      "code": "string",
      "usage_limit": 0,
      "usage_per_customer": 0,
      "expiration_date": "string",
      "created_at": "string",
      "type": 0,
      "extension_attributes": {}
    }
  ],
  "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.