Skip to content

List Cart Rules

Lists every cart rule in the store — the data behind the admin Marketing → Promotions → Cart Rules datagrid.

TIP

New here? Read the Cart Rules overview for what a cart rule does and how its fields behave.

Operation

OperationTypePurpose
adminMarketingCartRulesQueryCursor-paginated list of all cart rules

Details

  • Requires an admin Bearer token in the Authorization header.
  • Cursor pagination — pass first for the page size and after (the endCursor from the previous page) to advance. totalCount is the grand total.
  • Each node carries the flat rule fields shown in the example, including couponCode (the rule's primary coupon code). The heavier conditions, channels, and customerGroups resolve only on the detail query — they are null on list rows.

Filtering

Pass any of these arguments alongside first / after (they mirror the admin datagrid filters, combined with logical AND):

ArgumentDescription
idSingle id or comma-separated list (e.g. 1,4,9)
nameName — partial match
coupon_codePrimary coupon code — partial match
status0 (inactive) / 1 (active)
coupon_type0 (no coupon) / 1 (specific coupon)
sort_orderPriority — exact match
starts_from_from, starts_from_toStart-date range (ISO 8601)
ends_till_from, ends_till_toEnd-date range (ISO 8601)
sort, orderSort field (id, name, sort_order) + asc / desc (default id desc)

Released under the MIT License.