| Previous Topic | Next Topic |
|---|---|
| POS Module 2: Create User - Concepts | POS Module 3: User Look-up |
POS API Certification Tutorial - Module 2: Create User - Example Scenarios
Prerequisites
- You must have read the scenario assumptions.
- Review Module 2: Create User - Concepts.
- Review Module 1: Location Configuration and Program Meta - Example Scenarios.
General Tasks for Creating a User
1. The guest visits the POS store and wants to become a loyalty member.
2. The POS operator requests the guest to provide a phone number, an email address, or a loyalty card number and then enters the user identifier on the POS system.
3. The POS sends a create user request to the Punchh server using the Create New User API with the guest identifier.
4. The POS shows the user creation successful message when it receives a success message from the Punchh server.
Possible Scenario
The following scenario is based on the assumptions here.
Story Line
Ross, who purchases his morning coffee from Central Punchh Coffee every day, finally decides it is time to set up a loyalty account. Before ordering his usual iced latte, he inquires about the perks of having a loyalty account. Rachel explains that Central Punchh uses a banked rewards program, wherein guests accumulate points that convert into dollar amounts for future redemption when point-conversion milestones are reached. Rachel further explains that for every dollar Ross spends he will earn one point, and when he reaches the 50-point threshold a $2 reward will be automatically credited to his loyalty account. Rachel tells Ross if he reached 100 points, he would have $4 to spend; 150 points would provide $6, 200 points would provide $8, and so on. She also tells Ross that he can accumulate currency over time and can choose when and how much of his banked currency to spend during any given transaction.
Ross is impressed with the benefits of Central Punchh Coffee’s banked rewards program and decides to open a loyalty account. Rachel asks him to provide either his phone number or email address. Ross decides to use his phone number for account creation. Rachel enters it into the POS system, and the POS system creates a loyalty account for Ross. Rachel reminds Ross to complete his profile and registration process using the link that will be sent to his registered mobile number. Now Ross's phone number will be active in the system, and he can provide it anytime he goes to a Central Punchh Coffee location to earn rewards points.
Code Sample (Direct API Integration)
The following code sample contains the API request and response for the transactions between the POS and Punchh based on this story line. When Rachel creates Ross's loyalty account using his phone number (212-555-4626), first name, and last name, the Create New User API call returns information that includes Ross's personal information such as:
- First name: Ross
- Last name: Geller
- Phone number: 212-555-4626
- Address: null
- Banked rewards: 0
When Ross signs up from the mobile app or website and completes his profile, Punchh will be able to show Ross's personal information such as his address, state, city, etc. in the response body for API requests that return Ross's personal information (e.g., the User Look-up and Fetch Balance API).
| Request Body | Response Body |
| API endpoint name: Create New User POST {server-name}/api/pos/users { "first_name": "Ross", "last_name": "Geller", "phone": "2125554626" } For examples of how to make this call using various programming languages, see Module 2: Example Code. |
{ "address_line1": null, "anniversary": null, "avatar_remote_url": null, "birthday": null, "city": null, "created_at": "2022-10-06T08:59:18Z", "email": "2125554626-619@phone.punchh.com", "email_verified": false, "fb_uid": null, "first_name": "Ross", "age_verified": false, "privacy_policy": false, "gender": null, "id": 61949936, "last_name": "Geller", "state": null, "updated_at": "2022-11-06T08:59:18Z", "zip_code": null, "test_user": false, "user_joined_at": "2022-10-06T08:59:18Z", "balance": { "banked_rewards": 0, "membership_level": null, "membership_level_id": null, "net_balance": 0.0, "net_debits": 0.0, "pending_points": 0.0, "points_balance": 0.0, "signup_anniversary_day": "10/06", "total_credits": 0.0, "total_debits": "0.0", "total_point_credits": 0.0, "total_redeemable_visits": 0, "expired_membership_level": null, "total_visits": 0, "initial_visits": 0, "unredeemed_cards": 0 }, "user_digest": "USER_DIGEST_GOES_HERE", "selected_card_number": null, "selected_reward_id": null, "selected_discount_amount": null, "rewards": [], "discount_type": null, "phone": "2125554626" } |