- Create Transaction
- Get Transaction Details
- Finish Transaction
- Cancel Transaction
- List Transactions By Username
- Top Up Balance
URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/rest-auth/registration/
Example Request Body:
{
"username": "compfestx",
"password1": "admin12345",
"password2": "admin12345"
}
Example Response Body:
{
"key": "e4a218f4ea58b269762981694844521889d545c7"
}
URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/
Example Response Body:
{
"id": 2,
"username": "compfest"
}
URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/rest-auth/login/
Example Request Body:
{
"username": "compfest",
"password": "admin12345"
}
Example Response Body:
{
"key": "e4a218f4ea58b269762981694844521889d545c7",
"id": 1,
"username": "compfest"
}
URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/balance/create/
Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/balance/create/
NO REQUEST BODY
Example Response Body:
{
"id": 1,
"go_pay_balance": 0,
"user": "compfest"
}
URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/balance/
Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/balance/
Example Response Body:
{
"id": 1,
"go_pay_balance": 0,
"user": "compfest"
}
URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/transactions/
Example Request Body:
{
"user": "compfest",
"changed_balance": -10000,
"description": "jalan jalan"
}
Example Response Body:
{
"id": 1,
"changed_balance": -10000,
"description": "jalan jalan",
"finished": false,
"user": "compfest"
}
URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/
Example Response Body:
{
"id": 1,
"changed_balance": 100000,
"description": "top up",
"finished": false,
"user": "compfest"
}
URL: PUT - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/
Example Request Body:
{
"finished": true
}
Example Response Body:
{
"id": 1,
"changed_balance": -10000,
"description": "jalan jalan",
"finished": true,
"user": "compfest"
}
URL: DELETE - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/
RETURN HTTP 204 No Content
URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/transactions/all/<username>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/all/compfest/
Example Response Body:
[
{
"id": 2,
"user": "compfest",
"changed_balance": 20000,
"description": "top up"
},
{
"id": 1,
"user": "compfest",
"changed_balance": -10000,
"description": "jalan jalan"
}
]
URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/transactions/top-up/<username>/
Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/top-up/compfest/
Example Request Body:
{
"changed_balance": 10000,
"description": "top up boy"
}
Example Response Body:
{
"id": 3,
"changed_balance": 10000,
"description": "top up boy",
"finished": true,
"user": "compfest"
}