Skip to main content
All CollectionsDevelopPassKit API
Membership Protocol: Filtering, Listing and Counting by API
Membership Protocol: Filtering, Listing and Counting by API

Filter programs, tiers and members by API.

Danny Allen avatar
Written by Danny Allen
Updated over 4 years ago

Filters for Membership Protocols

Filter Programs

You can filter programs with fields below.

  • id (program id) - string value

  • name (name of program) - string value

  • status (program status) - PROJECT_ACTIVE_FOR_OBJECT_CREATION, PROJECT_DISABLED_FOR_OBJECT_CREATION, PROJECT_DRAFT, PROJECT_PUBLISHED, PROJECT_PRIVATE, or PROJECT_OVER_QUOTA

  • created (created date of program) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

  • updated (last updated date of program) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

  • profileImageSettings (profile image settings) - PROFILE_IMAGE_NONE, PROFILE_IMAGE_OPTIONAL, or PROFILE_IMAGE_REQUIRED

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List programs endpoint

POST https://api.pub1.passkit.io/members/programs/list

Examples: POST payload for program filtering

Filter programs with name containing a word 'Loyalty'.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "name",
"filterValue": "Loyalty",
"filterOperator": "like"
}]
}]
}

Filter programs with status Published.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "status",
"filterValue": "PROJECT_PUBLISHED",
"filterOperator": "eq"
}]
}]
}

Filter programs with status Published AND created in year 2020.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "status",
"filterValue": "PROJECT_PUBLISHED",
"filterOperator": "eq"
},{
"filterField": "created",
"filterValue": "2020-01-01T00:00:00Z",
"filterOperator": "gte"
}]
}]
}

Filter programs with status Published OR created after 2020-01-01.

{
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "status",
"filterValue": "PROJECT_PUBLISHED",
"filterOperator": "eq"
},{
"filterField": "created",
"filterValue": "2020-01-01T00:00:00Z",
"filterOperator": "gte"
}]
}]
}

Filter Tiers

You can filter tiers with following fields.

  • name (name of tier) - string value

  • id (tier id) - string value

  • programId (id of program tier belongs to) - string value

  • created (created date of tier) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

  • updated (last updated dated of tier) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

List tiers endpoint

POST https://api.pub1.passkit.io/members/tiers/list

Examples: POST payload for tier filtering

Filter tiers with name bronze.

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "name",
"filterValue": "bronze",
"filterOperator": "eq"
}]
}]
}
}

Filter tiers with name bronze AND created in May 2020.

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "name",
"filterValue": "bronze",
"filterOperator": "eq"
},{
"filterField": "created",
"filterValue": "2020-05-01T00:00:00Z",
"filterOperator": "gte"
},{
"filterField": "created",
"filterValue": "2020-06-01T00:00:00Z",
"filterOperator": "lt"
}]
}]
}
}

Filter tiers in program A OR program B.

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "programId",
"filterValue": "1psDme9oMjUkyCL2uY1O45",
"filterOperator": "eq"
},{
"filterField": "programId",
"filterValue": "12CVkm7cpnilaPpfW74mLz",
"filterOperator": "eq"
}]
}]
}
}

Filter Members

  • Step 1: Get a Program ID

  • Step 2: Set a filter condition

  • Step 3: Make an API call

Step 1 : Get a Program ID

You can grab you Program ID from the Settings Page.

Step 2: Set a filter condition for members.

You can filter members with following fields and values:

  • firstName (forename of members) - string value

  • lastName (surname of members) - string value

  • gender (gender of members) - NOT_KNOWN, FEMALE or MALE

  • dataOfBirth (DOB of coupon holders) - ISO8601 date e.g. 2020-01-21

  • email (email of coupon holders) - string value

  • mobileNumber (mobile of coupon holders) - string value e.g. +85298001243

  • displayName (display name of coupon holders) - string value

  • birthMonth (birthday month of coupon holders) - month e.g. january, december

  • memberId (external id of member) - string value

  • groupingIdentifier (group id of members) - string value

  • tierName (tier which members belong to) - string value e.g. bronze, silver

  • optOut (marketing promotion options) - true or false

  • points (point balance of members) - string value e.g. 10, 500

  • secondaryPoints (secondary point balance of members) - string value e.g. 10, 500

  • tierPoints (tier point balance of members) - string value e.g. 10, 500

  • expiryDate (expiry date of member pass) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

  • status (membership status) - ENROLLED, ACTIVE, SUSPENDED, EXPIRED or CANCELLED

  • passStatus (status of member pass) - PASS_ISSUED, PASS_INSTALLED, PASS_UNINSTALLED or PASS_INVALIDATED

  • created (joined date) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400

  • updated (the last update date) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400 Operators:

Operators:

  • eq - equal

  • gt - greater than

  • lt - less than

  • gte - greater than or equal to

  • lte - less than or equal to

  • like - contain a value

Step 3: Make an API call

LIST members endpoint

POST https://api.pub1.passkit.io/members/member/list/your_program_id

COUNT members endpoint

POST https://api.pub1.passkit.io/members/count/your_program_id

Examples: POST Payload for filter coupons

Filter members who installed their member pass

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "passStatus",
"filterValue": "PASS_INSTALLED",
"filterOperator": "eq"
}]
}]
}
}


Filter members who joined between 2020-05-01 AND 2020-05-31

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "AND",
"fieldFilters": [{
"filterField": "created",
"filterValue": "2020-05-01",
"filterOperator": "gte"
},{
"filterField": "created",
"filterValue": "2020-05-31",
"filterOperator": "lte"
}]
}]
}
}

Filter members who are in tier bronze OR tier silver

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "tierId",
"filterValue": "bronze",
"filterOperator": "eq"
},{
"filterField": "tierId",
"filterValue": "silver",
"filterOperator": "eq"
}]
}]
}
}

Filter members who are in ( tier bronze OR tier silver ) AND member is is null

{
"filters": {
"limit": 100,
"offset": 0,
"orderBy": "created",
"orderAsc": true,
"filterGroups": [{
"condition": "OR",
"fieldFilters": [{
"filterField": "tierId",
"filterValue": "bronze",
"filterOperator": "eq"
},{
"filterField": "tierId",
"filterValue": "silver",
"filterOperator": "eq"
}]
},{
"condition": "AND",
"fieldFilters": [{
"filterField": "memberId",
"filterValue": "NULL",
"filterOperator": "eq"
}]
}]
}
}

Note: Limit has maximum limit of 1000 for REST API call. Unlimited Limit is available for gRPC request.

Did this answer your question?