Skip to main content
Retrieves a paginated list of coupons with optional filtering.

Query

query ListCoupons(
  $filter: CouponFilter
  $paging: CursorPaging
  $sorting: [CouponSort!]
) {
  coupons(filter: $filter, paging: $paging, sorting: $sorting) {
    edges {
      node {
        id
        code
        status
        type
        discountValue
        duration
        durationInMonths
        maxRedemptions
        timesRedeemed
        createdAt
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}
{
  "filter": {
    "status": { "eq": "ACTIVE" }
  },
  "paging": {
    "first": 25
  }
}
{
  "data": {
    "coupons": {
      "edges": [
        {
          "node": {
            "id": "coupon-123",
            "code": "SAVE20",
            "status": "ACTIVE",
            "type": "PERCENTAGE",
            "discountValue": 20,
            "duration": "FOREVER",
            "durationInMonths": null,
            "maxRedemptions": 100,
            "timesRedeemed": 45,
            "createdAt": "2024-01-01T00:00:00Z"
          },
          "cursor": "abc123"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "abc123"
      },
      "totalCount": 5
    }
  }
}

Parameters

filter
CouponFilter
Filter criteria for coupons
paging
CursorPaging
Pagination options
sorting
[CouponSort]
Sorting options

Return Type

Returns a CouponConnection with coupon objects.

Common Use Cases

List and manage coupons in admin interfaces.
Check if a coupon exists and is active before applying.
Monitor coupon usage and remaining redemptions.