Skip to content
Đồ án cuối kì
Share
Explore

Private API

Customer
Auth /auth
POST /auth/login → đã test
request
Body
{
username,
password,
}
response
SUCCESS
status: 200
{
info,
accessToken,
refreshToken,
}
ERROR
400 Mật khẩu sai
404 Không tìm thấy username
500 Lỗi server
GET /auth/refresh → đã test
request
header
x-access-token
x-refresh-token
response
SUCCESS 200
data: { accessToken }
ERROR
400 sai accessToken hoặc refreshtoken
500 lỗi server
POST /auth/reset_password - yêu cầu thay đổi password
request body { email }.
POST /auth/new_password - thay đổi password
request body { email, OTP, password }
Customer /customer
Tất cả API bên dưới đều cần gửi
headers
x-access-token
POST /customer/password → đổi mật khẩu
request
{
old_password,
new_password
}
Account
GET /customer/accounts → đã test
200 → trả về thông tin account
image.png
404 → không tìm thấy account
GET /customer/accounts/:account_number → đã test
200 → trả về thông tin account
image.png
POST /customer/accounts → đã test
request
{
“account_name,
account_object
}
image.png
200 → thành công
Trả về
{
success:true,
user_id
account_number:,
account_name
account_object
}
500 → lỗi server :))
400 → thiếu các trường → có kèm theo trong errors

DELETE /customer/accounts/:account_number → đã test
200 → thành công
image.png
Trả về
{ success, deleted_account}
400 → account còn tiền hoặc là tài khoản chính → không xóa được
PUT /customer/accounts/:account_number→ đã test
200 → succes
Trả về
{ success, result}
image.png
400 → Tài khoản không phải là tài khoản tiết kiệm → không xóa được
500 → lỗi server bị cái vẹo gì đó chưa test kĩ
Receiver
GET /customer/receivers → đã test
image.png
200 → success
Trả về danh sách receiver
500 → server error
GET/customer/receivers/:_id → đã test (id là receiver id)
image.png
POST /customer/receivers → test done
→ đã test {nhập tên gợi nhớ, không nhập tên gợi nhớ, thiếu account number hoặc bank }
image.png
request
{
name
account_number
bank
}
response
200 → success
400 → thiếu trường
500 → LỖI SERVER
PUT /customer/receivers/:_id → đã test
image.png
request
{ name}
response → trả về receiver sau khi thay đổi
DELETE /customer/receivers/:_id → đã test
image.png
DEBT LIST
GET /customer/debt_list → đã check 1 tài khoản
200 → success
image.png
Trả về
{
debt : danh sách nhắc nợ mà người khác gửi cho mình, → mảng
own: danh sách nhắc nợ mình gửi người ta → mảng
}
500 → lỗi server

GET /customer/debt_list/:_id → đã test
image.png
POST /customer/debt_list → check, đã test
request
{
src_account_number,
des_account_number,
description,
amount
}
image.png
response
200 → tạo thành công → trả về success và cái nhắc nợ
500 lỗi server
PUT /customer/debt_list/:id → cancel nhắc nợ,
request → body gửi description → nếu có
response
200 → success
500 → server lỗi
DELETE /customer/debt_list/:id → điều kiện là phải cancel
User
GET /customer/customers/:account_number → nhận thông tin user theo account_number → đã test
200 →
{
user_name
email
user_id,
full_name
}
Chỉ có thể tìm thông tin dựa trên tài khoản giao dịch
GET /customer/customers/:account_number?bank=”NKL Bank” → nhận thông tin user theo account_number và bank → đã test
các ngân hàng đã có thể test
mpbank
nklbank
Eight

image.png
Bank
GET /customer/banks → tra cuu danh sach ngan hang
Transaction
GET /transaction/request → yêu cầu lệnh chuyển tiền → đã check
image.png
POST /transaction/transfer → chuyển tiền → đã check
request
{
"user_name":"luffy",
"password":"onepiece",
"OTP":"496494",
"source_account":"1595967024",
"destination_account":"09437776833040",
"source_bank":"S2Q Bank",
"des_name":"Nguyễn Hoàng Sang",
"destination_bank": "Eight",
"isFeePayBySender": true,
"fee": 3000,
"amount":100000,
"description":"abc"
}

POST/transaction/pay_debt/ → thanh toán nợ → đã check
image.png
request
{
OTP,
debtId
}
GET /transaction/histories/:account_number → lịch sử giao dịch của số tài khoản

POST /transaction/save
image.png
POST /transaction/withdraw
image.png
Notification
GET /customer/notification?ts=${ts}
lấy notification
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.