Create User
ℹ️
Automatic User Creation
There is no need to explicitly create users. When sending the first event for a user, our system automatically creates the user account.
How User Creation Works
The Lynes Loyalty platform uses a streamlined approach to user management. Instead of requiring a separate API call to create users, we automatically create user profiles the first time an event is submitted for a new user ID.
Process Overview
- You send an event to our API with a unique
userId
that doesn't exist in our system yet - Our platform detects this is a new user and creates a user profile automatically
- The event is processed and associated with the newly created user
- Any subsequent events for the same
userId
will be associated with this user
Example: First Event for a New User
curl -X POST "https://api.lynesloyalty.com/v1/events" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"event_type": "purchase",
"user_id": "new_user_123",
"metadata": {
"purchase_amount": 49.99,
"product_id": "prod_abc123"
}
}'
ℹ️
More information about sending an event
To get detailled information how to send events to our api, please visit this page.
Sending events to lynes loyalty APIIn this example, if new_user_123
doesn't exist in our system yet, a new user profile will be automatically created and the purchase event will be associated with this new user.
User Profile Details
When a user is automatically created, we initialize their profile with:
- User ID (from your request)
- Starting point balance of 0
- Timestamp of creation
- Empty history of events