Description
Returns a list of customers with information tied to a brand
Note: Customer must have prior collection with brand to appear.
Parameters
| Parameter | Type | Value | Required |
| operation_name | String | customersInfo | true |
| variables | JSON | $JSON_OBJECT | true |
$JSON_OBJECT Structure
| Key | Type | Value | Required |
| brandId | String | $SHARED_BRAND_ID | true |
| phoneNumbers | Array[String] | $PHONE_NUMBERS | true |
| extension | String | $EXTENSION | true |
Important: Append country code to phone number string
Important: Only MY extension numbers are supported at this current time
Warning: Do not mix numbers with different extensions in the same request
Tip: $SHARED_BRAND_ID can be obtained via Accessible Brands
Example
Request
curl \
-X POST \
-H "Content-Type: application/json" \
-H "Token: $TOKEN" \
-d '{
"operation_name": "customersInfo",
"variables": {
"phoneNumbers": ["60123123123"],
"extension": "MY",
"brandId": $SHARED_BRAND_ID
}
}' \
https://simpleloyalty.com/third_party
Response
{
"data": {
"thirdParty": {
"customers": [
{
"phoneNumber": "0123123123",
"name": "customerName",
"birthdate": "YYYY-MM-DD",
"email": "example@email.com",
"registered": true,
"totalVisits": $TEST_TOTAL_VISIT,
"totalPointRedemptions": $TEST_TOTAL_POINT_REDEMPTIONS,
"totalSmsRedemptions": $TEST_TOTAL_SMS_REDEMPTIONS,
"collectedPoints": $TEST_COLLECTED_POINTS,
"availablePoints": $TEST_AVAILABLE_POINTS,
"totalSpending": $TEST_TOTAL_SPENDING,
"privilegeCards": [
{
"id": "1",
"privilegeName": "VIP Privilege",
"rewardName": "10% off",
"active": true,
"expiryDays": 30,
"expiryDate": "YYYY-MM-DD",
"referralId": "ABC123",
"privilegeImageUrl": "https://example.com/image.png",
"barcodeType": "QR_CODE",
"barcodeAlternateText": "ABC123"
}
]
}
]
}
},
"errors": []
}
Note: An empty array is returned if brand has no customers
Privilege Card Fields
| Field | Type | Description |
| id | String | Privilege card ID |
| privilegeName | String | Privilege card name |
| rewardName | String | Reward offered by the privilege card |
| active | Boolean | Whether the privilege card campaign is currently active |
| expiryDays | Integer | Days the card stays valid after it is obtained, null if not set |
| expiryDate | String | Fixed expiry date (YYYY-MM-DD), null if not set |
| referralId | String | Referral ID of the privilege card campaign |
| privilegeImageUrl | String | Privilege card image URL |
| barcodeType | String | One of NONE, CODE_128, EAN_13, UPC_A, QR_CODE, PDF_417, CODE_39, TEXT_ONLY |
| barcodeAlternateText | String | Text shown with the barcode, null if not set |
Note: privilegeCards only lists privilege cards the customer currently holds with the brand. An empty array is returned if the customer has none.