/splitwise-backend

Primary LanguageJavaScriptApache License 2.0Apache-2.0

splitwise-backend

API Endpoints

Users

1. /register - register a new user

body:

{
  "name": "test",
  "email": "test",
  "UpiID": "test"
}

2. /login - login a user

body:

{
  "token": "test"
}

3. /logout - logout a user

4. /me - get details of logged in user

5. /all - get details of all users

6. /addFriends - add friends to logged in user

body:

{
  "members": ["12345", "123456"]
}

Groups

1. /create - create a new group

body:

{
  "name": "test",
  "members": ["12345", "123456"]
}

2. /all - get details of all groups

3. /addMembers - add members to a group

body:

{
  "groupId": "12345",
  "members": ["12345", "123456"]
}

4. /:id - get details of a group by id

Transactions

1. /create - create a new transaction

body:

{
  "groupId": "12345",
  "amount": 100,
  "description": "test",
  "paidBy": "12345",
  "date": "2020-01-01",
  "distributionType": "PERCENT",
  "distribution": {
    "12345": 50,
    "123456": 50
  }
}