Members API - Loyalty
Endpoints to validate members, create new accounts, and manage member profiles for the Loyalty API.
/api/v1/loyalty/
Validate Member
/api/v1/loyalty/members/validate
Check if a phone number is a member of a specific loyalty card (points or stamps).
Step by Step
Collect Phone Number
Get the customer's phone number in E.164 format (e.g., +21612345678).
Send Validation Request
Send POST request to members/validate endpoint with card_id and phone_number.
Check Response
The is_member field tells you if they're signed up.
Request Body
{
"card_id": 5,
"phone_number": "+21612345678",
"include_member_data": false
}
card_id (integer, required) - The loyalty card ID
phone_number (string, required) - Phone number to validate
include_member_data (boolean, optional) - Include full member details
Response
{
"success": true,
"data": {
"card_id": 5,
"phone_number": "+21612345678",
"is_member": true,
"validated_at": "2025-01-15T10:30:00Z"
}
}
Create Member
/api/v1/loyalty/members
Create a new member account and automatically associate them with the card.
Step by Step
Request OTP
Send POST request to /api/v1/auth/member/request-otp with member's email.
Verify OTP
Send POST request to /api/v1/auth/member/verify-otp to get X-Member-Token.
Create Member
Send POST request to members/ with token in X-Member-Token header.
Headers
X-App-Id: app_abc123...
X-Api-Key: test_xyz789...
X-Member-Token: eyJ0eXAiOiJKV1QiLCJhbGc...
Content-Type: application/json
Request Body
{
"card_id": 5,
"name": "John Doe",
"email": "john@example.com",
"phone_number": "+21612345678",
"verification_code": "123456"
}
Get Member Profile
/api/v1/loyalty/members/{id}
Retrieve member profile and balance for a specific card.
Response
{
"success": true,
"data": {
"member": {
"id": 123,
"name": "John Doe",
"email": "john@example.com",
"phone": "+21612345678",
"created_at": "2025-01-15T10:30:00Z"
},
"card": {
"id": 5,
"name": "Premium Coffee Card",
"reward_system": "points",
"points_balance": 150,
"joined_at": "2025-01-15T10:30:00Z"
}
}
}
Update Member Profile
/api/v1/loyalty/members/{id}
Update member name and communication preferences.
Request Body
{
"name": "John Doe",
"accepts_emails": true,
"accepts_text_messages": false
}