Skip to content
Jaah edited this page Aug 30, 2020 · 25 revisions

List of methods:

Methods Params Description
getUserInfo -- Return user information
getOrderHistory -- Get order history of a user
getOrderDetail id:<order_id> Get order detail of an order of a user
setUserInfo name*, email*, birthday, anniversary, gender} Update user information
saveUserAddress tag*, sub_locality*, lat* , lng*, address_1*, address_2, pin} Save address of a user
changePassword oldPassword, newPassword, confirmPassword, phone Change current password
deleteAddress id Delete address from user profile
getWalletTransactions -- get all wallet transactions
getWalletTransactions -- get all wallet transactions
getNotifications -- Get all notifications
getCoupons -- Get all coupons
reorder id, location_id, lat, lng Reorder

Note:

  • (*) required
  • All methods return a promise.
  • This will throw an error if the user is not logged in.

Get user information

.getUserInfo()

Sample response:

{
  success: true,
  data: {
     "addresses": [],
     "balance": 0,
     "email": "",
     "name": "Mukesh Biswas",
     "phone": "+919833010430",
     "points": 0,
     "signup_date": 1542102597000,
     "total_order_value": 0
  }
}

Here, balance is the amount that the user has in their Wallet.

Update user information

setUserInfo(params)

This will update the user information. The following information can be updated:

  1. Name
  2. Email
  3. Birthday
  4. Anniversary,
  5. Gender

Obj structure:

{
   name: <String>,
   email: <String>,
   birthday: <Time in milli sec>,
   anniversary: <Time in milli sec>,
   gender: <String>,
}

Get order history of a user

.getOrderHistory

Change password

.changePassword()  

Params:

{
    oldPassword: <oldPassword>,
    newPassword: <newPassword>,
    confirmPassword: <newPassword>,
    phone: <signed in phoneno>
}

Delete user address

.deleteAddress({id})  
Clone this wiki locally