-
Notifications
You must be signed in to change notification settings - Fork 42
Payments API Doc
All Payments API endpoints require authorisation to enable authorisation follow these steps
- Call the user Login endpoint
- retrieve the token from the response of the login
- add
"Bearer <jwt token>"
to the Authorisation Header field - Send the Payment API request
Method: GET
Description: This method is used to get all the Payments that are associated with a user that is currently logged in
example request URL: https://localhost:5001/api/Payments/User/1
STATUS CODE: 200
{
"id": 1,
"amount": 175,
"fixed": false,
"startDate": "2020-03-07T00:00:00",
"endDate": "2020-06-07T00:00:00",
"paymentType": 1,
"frequency": 3,
"description": "electricity"
},
Method: GET
Description: This method is used to get all the Payments that are associated with a flat
example request URL: https://localhost:5001/api/Payments/Flat/1
STATUS CODE: 200 OK
{
"id": 1,
"amount": 175,
"fixed": false,
"startDate": "2020-03-07T00:00:00",
"endDate": "2020-06-07T00:00:00",
"paymentType": 1,
"frequency": 3,
"description": "electricity"
}
Method: POST
Description: This method is used to add a new payment to a flat and add users to that payment
Body Input
Parameters | Format |
---|---|
Payment | Payment Object |
Header Parameters
Parameters | Format |
---|---|
userIds | List of Ids |
Request Body example
{
"id": 0,
"amount": 0,
"fixed": true,
"startDate": "2020-03-16T04:25:50.783Z",
"endDate": "2020-03-16T04:25:50.783Z",
"paymentType": 0,
"frequency": 0,
"description": "string"
}
example request URL: https://localhost:5001/api/Payments/Flat/1
STATUS CODE: 200 OK
{
"id": 0,
"amount": 0,
"fixed": true,
"startDate": "2020-03-16T04:25:50.783Z",
"endDate": "2020-03-16T04:25:50.783Z",
"paymentType": 0,
"frequency": 0,
"description": "string"
},
Method: DELETE
Description: This method is used to delete a payment from a flat
Path Parameters
Parameters | Format |
---|---|
flatId | Integer |
Query Parameters
Parameters | Format |
---|---|
paymentId | Integer |
example request URL: https://localhost:5001/api/Payments/Flat/1?paymentId=2
STATUS CODE: 200 OK
{
"id": 1,
"amount": 175,
"fixed": false,
"startDate": "2020-03-07T00:00:00",
"endDate": "2020-06-07T00:00:00",
"paymentType": 1,
"frequency": 3,
"description": "electricity"
},
Method: PUT
Description: This method is used to add a user to an existing payment
Path Parameters
Parameters | Format |
---|---|
paymentId | Integer |
Query Parameters
Parameters | Format |
---|---|
userId | Integer |
example request URL: https://localhost:5001/api/Payments/User/5?userID=1
STATUS CODE: 204 NO CONTENT
Method: DELETE
Description: This method is used to delete a user from a payment
Path Parameters
Parameters | Format |
---|---|
paymentId | Integer |
Query Parameters
Parameters | Format |
---|---|
userId | Integer |
example request URL: https://localhost:5001/api/Payments/User/4?userId=1
STATUS CODE: 204 NO CONTENT
Method: PUT
Description: This method updates a specific payment
Path Parameters
Parameters | Format |
---|---|
id | Integer |
Request Body Example
{
"id": 0,
"amount": 0,
"fixed": true,
"startDate": "2020-03-16T07:35:31.131Z",
"endDate": "2020-03-16T07:35:31.131Z",
"paymentType": 0,
"frequency": 0,
"description": "string"
}
example request URL: https://localhost:5001/api/Payments/5
STATUS CODE: 204 NO CONTENT
- Home
- Data Model
- Architecture
- API Documentation
- Front End Documentation
- Testing
- Prototyping
- Other
- Contributing Guidelines and Etiquitte
- Labels
- License
- Admin