Membershiup API endpoints 1. Linking card ================================================= POST /membership/fidel/card Parameters: $_REQUEST['card_id'] - card id taken from the fidel api Requires logged user Response: json Linking fidel card api. so we know which card belong to the user. You could see how it's working on that page: http://licklist.co.uk/iframe.fidel.php Use the cards like "44440000000040XX" to link a card to your user Then login into my fidel dashboard using: email: nik@licklist.co.uk pass: licklisttestaccount To see transactions. You could create transactions and then they should appear in the system 2. Referral reward ================================================= POST /membership/members/referral Parameters: $_REQUEST['code'] - valid code $_REQUEST['venue_id'] - valid venue_id Response: json On providing valid code certain points will be added to user's account 3. Redeeming reward ================================================= POST /membership/members/redeem $_REQUEST['reward_id'] - valid reward_id Action which will allow user to redeem the reward. Probably is not bad to show somewhere the resulting id of the redeem. It's returned in the response like: Redeeming id: 0000123, so the users could request it somehow when they get the rewards 4. Redeem History of the user ================================================= GET /membership/members/history.json Parameters: $_REQUEST['start'] - integer, default 0 $_REQUEST['limit'] - integer, default 12, how many rows per page Show history of previous redeems for the logged user. 5. "My rewards" venues. ================================================= GET /membership/members/venues.json Parameters: $_REQUEST['start'] - integer, default 0 $_REQUEST['limit'] - integer, default 12, how many rows per page List of venues where the user spent money 6. The list of "near by venues" ================================================= should be constructed from the search.json call with lng,lat point 7. List of user's cards ================================================= GET /membership/members/cards.json $_REQUEST['start'] - integer, default 0 $_REQUEST['limit'] - integer, default 12, how many rows per page Usually start and limit shouldn't be needed but they are there. Probably it's good to have the first card, as the main one and the rest as history log. 8. Removing card ================================================= POST /membership/fidel/unlink Parameters: $_REQUEST['card_id'] - licklist card id (taken from cards.json) Requires logged user Response: json 9. Venue rewards ================================================= GET /membership/members/rewards.json Parameters: $_REQUEST['venue_id'] - Id of the venue Requires logged user Response: json 10. Unlinking fidel card if licklist couldn't store the record ================================================= POST /membership/fidel/fidel_unlink Parameters: $_REQUEST['card_id'] - licklist card id (taken from cards.json) Requires logged user 11. Listing user invitations ================================================= Display the list of invited emails which the user invited to join the app GET /membership/invitations/index.json Parameters: $_REQUEST['start'] - integer, default 0 $_REQUEST['limit'] - integer, default 12, how many rows per page Requires logged user 12. Adding emails to invitations ================================================= POST /membership/invitations/add.json $_REQUEST['data[email]'] - for single entry $_REQUEST['data[phone]'] - for single entry or $_REQUEST['data[email]'][] - for multiple entries $_REQUEST['data[phone]'][] - for multiple entries example: $_REQUEST['data[email]'] = 'user@server.com'; $_REQUEST['data[phone]'] = '0757575757575'; or $_REQUEST['data[email]'][] = 'user1@server.com'; $_REQUEST['data[email]'][] = '0757575757575'; $_REQUEST['data[email]'][] = 'user2@server.com'; $_REQUEST['data[email]'][] = '0747474747474'; The response will return array with the status of each email invitation. If a duplicate entry is added it will return error, or success if it's ok. This could be used to display errors to corresponding emails. 13. Activating invitations ================================================= once the invitation is send with a link, the user will click on that link and he need to open the following url in order to obtain the session_id which will be used to match the newly registered users. TBD how to make the link to be handled in the app GET /membership/invitations/activate.json $_REQUEST['referral_id'] - id of the referral user $_REQUEST['id'] - optional - id of the activation If successfull, the response will contain a variable session_id which should be stored and passed when the user registers (via the app or the site) Once visited, the user should be redirected to registration process while keeping the session_id in the app. From the app, that session_id, need to be passed along the other data in the user's form with the name data[User][session_id] 14. Amount of referral rewards which could be redeemed ================================================= It show how many referral rewards could be converted to specific venue points GET /membership/invitations/rewards.json The node "rewards" could give indication how many rewards were earned and could be redeemed 15. Redeem referral reward ================================================= At this call the user with positive rewards (from point 14) will be able to select a venue and load his account with the lowest amount of points available as reward for the venue of his choice. The interface on the app should have a field where the user should be able to select (autocomplete probably) the venue which the reward will be applied to. POST /membership/invitations/redeem.json $_REQUEST[venue_id] - id of the venue from membership programme return json 16. Venue with rewards autocomplete ================================================= GET /membership/members/autocomplete.json $_REQUEST[q] - string to search in venue names. it should have 3 or more characters to return any data. Please use offloaded approach e.g. set timeout so when the user pauses to type then send the request to the server, rather than on every keypress.