Anggota Kelompok:
- Hafizh Abid Wibowo - 502701011
- Alvian Ghifari - 5027201035
- Axellino Anggoro A - 5027201040
POST
api/register
Tidak menggunakan autentikasi
{number, name, password}
{
"number": "12345",
"name": "user",
"password": "user"
}
{
"status": 201,
"message": "User Created"
}
POST
/api/login
Tidak menggunakan Autentikasi
{number, password}
{
"number": "test",
"password": "test"
}
{
"status": 200,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6......"
}
POST
/api/searchproduct
Tidak menggunakan Autentikasi
{search}
{
"search": "Vanilla"
}
{
"Product": [
{
"product_name": "Piscok Vanilla",
"product_price": 50000,
"product_qty": 497,
"product_seller": "PISCOK LUMER"
},
{
"product_name": "Piscok Vanillaasdasdsa",
"product_price": 10000,
"product_qty": 47,
"product_seller": "Mafia gedhang"
}
]
}
GET
/admin
Menggunakan autentikasi Admin
Tidak ada parameter
{
"users": [
{
"users_number": "085648175777",
"users_name": "admin",
"users_password": "$2b$10$mfkk2dToUjjG.sVK7S8XYuFOKlT1PldI/gintdXLrS2l1klhAbKzC",
"users_role": "admin",
"users_datecreated": "2022-05-28T23:08:58.000Z",
"users_balance": 0
},
{
"users_number": "08312321548",
"users_name": "PISCOK LUMER",
"users_password": "$2b$10$xd86Svwly10ovOlGdv5wMu2606ZPwutpcSrP/jXGp1ioziIZg6LH6",
"users_role": "user",
"users_datecreated": "2022-06-01T00:45:49.000Z",
"users_balance": 0
}
]
}
GET
/user/profile
Menggunakan autentikasi User
Tidak ada parameter
{
"User": {
"users_number": "081234567",
"users_name": "Mafia gedhang",
"users_password": "$2b$10$tvYbb9tUs1jCFqkWvZwYMOiUNs.03NdTomObEoaMWhbxDJLrhfBhq",
"users_role": "user",
"users_datecreated": "2022-06-01T00:44:15.000Z",
"users_balance": 2000
}
}
POST
/user/addproduct
Menggunakan autentikasi User
{product_name, product_qty, product_price}
{
"product_name": "Piscok demo",
"product_qty": "50",
"product_price": "10000"
}
{
"status": 200,
"message": "Product Added"
}
POST
/user/updateproduct
Menggunakan autentikasi User
{product_name, product_qty, product_price}
{
"product_name": "Piscok demo",
//dapat diisi salah satu dan dua2nya
"product_qty": "50",
"product_price": "10000"
}
{
"status": 200,
"message": "Product Updated"
}
GET
/user/getallproduct
Menggunakan autentikasi User
Tidak ada parameter
{
"Product": [
{
"product_id": 1,
"product_name": "Piscok Keju",
"product_price": 10000,
"product_qty": 92,
"product_seller": "PISCOK LUMER"
},
{
"product_id": 2,
"product_name": "Piscok Cappucino",
"product_price": 10000,
"product_qty": 97,
"product_seller": "Boss Gedhang"
}
]
}
POST
/user/buy
Menggunakan autentikasi User
{product_name, product_qty}
{
"product_name": "Piscok Keju",
"product_qty": "5"
}
{
"status": 200,
"message": "Product Ordered, Waiting for Payment"
}
GET
/user/myorder
Menggunakan autentikasi User
Tidak ada parameter
{
"Order": [
{
"orders_id": 1,
"orders_status": "Paid",
"product_id": 9,
"orders_qty": 5,
"orders_price": 35000,
"buyer_name": "afrida",
"seller_name": "Mafia gedhang"
},
{
"orders_id": 4,
"orders_status": "Waiting for Payment",
"product_id": 1,
"orders_qty": 10,
"orders_price": 100000,
"buyer_name": "afrida",
"seller_name": "PISCOK LUMER"
}
]
}
POST
/user/pay
Menggunakan autentikasi User
{orders_id, emoney, username, number, password, email}
{
"orders_id": "2",
"emoney": "Payfresh",
//optional, tergantung dari emoney yang digunakan
"username": "PadPay",
"number": "082169420720",
"password": "PeacePay",
"email": "[email protected]"
}
{
"status": 200,
"message": "Payment Success"
}
POST
/user/sellerconfirm
Menggunakan autentikasi User
{orders_id}
{
"orders_id": "2"
}
{
"status": 200,
"message": "Confirmation successful (product sent)"
}
POST
/user/buyerconfirm
Menggunakan autentikasi User
{orders_id}
{
"orders_id": "2"
}
{
"status": 200,
"message": "Confirmation successful (product received)"
}
POST
/user/withdraw
Menggunakan autentikasi User
{amount, emoney, tujuan}
{
"amount": "1000",
"emoney": "PeacePay",
"tujuan": "123"
}
{
"status": 200,
"message": "Withdraw Success"
}