Filters for Membership Protocols
Filter Programs
You can filter programs with fields below.
id
(program id) - string valuename
(name of program) - string valuestatus
(program status) - PROJECT_ACTIVE_FOR_OBJECT_CREATION, PROJECT_DISABLED_FOR_OBJECT_CREATION, PROJECT_DRAFT, PROJECT_PUBLISHED, PROJECT_PRIVATE, or PROJECT_OVER_QUOTAcreated
(created date of program) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400updated
(last updated date of program) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400profileImageSettings
(profile image settings) - PROFILE_IMAGE_NONE, PROFILE_IMAGE_OPTIONAL, or PROFILE_IMAGE_REQUIRED
Operators:
eq
- equalgt
- greater thanlt
- less thangte
- greater than or equal tolte
- less than or equal tolike
- 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 valueid
(tier id) - string valueprogramId
(id of program tier belongs to) - string valuecreated
(created date of tier) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400updated
(last updated dated of tier) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400
Operators:
eq
- equalgt
- greater thanlt
- less thangte
- greater than or equal tolte
- less than or equal tolike
- 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 valuelastName
(surname of members) - string valuegender
(gender of members) - NOT_KNOWN, FEMALE or MALEdataOfBirth
(DOB of coupon holders) - ISO8601 date e.g. 2020-01-21email
(email of coupon holders) - string valuemobileNumber
(mobile of coupon holders) - string value e.g. +85298001243displayName
(display name of coupon holders) - string valuebirthMonth
(birthday month of coupon holders) - month e.g. january, decembermemberId
(external id of member) - string valuegroupingIdentifier
(group id of members) - string valuetierName
(tier which members belong to) - string value e.g. bronze, silveroptOut
(marketing promotion options) - true or falsepoints
(point balance of members) - string value e.g. 10, 500secondaryPoints
(secondary point balance of members) - string value e.g. 10, 500tierPoints
(tier point balance of members) - string value e.g. 10, 500expiryDate
(expiry date of member pass) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400status
(membership status) - ENROLLED, ACTIVE, SUSPENDED, EXPIRED or CANCELLEDpassStatus
(status of member pass) - PASS_ISSUED, PASS_INSTALLED, PASS_UNINSTALLED or PASS_INVALIDATEDcreated
(joined date) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400updated
(the last update date) - RFC3339 or timestamp e.g. 2020-05-19T00:00:00Z, 1589846400 Operators:
Operators:
eq
- equalgt
- greater thanlt
- less thangte
- greater than or equal tolte
- less than or equal tolike
- 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.