Giter VIP home page Giter VIP logo

piscokku-fullstack's Introduction

API Piscokku

Anggota Kelompok:

  • Hafizh Abid Wibowo - 502701011
  • Alvian Ghifari - 5027201035
  • Axellino Anggoro A - 5027201040

Register

Method

POST

Endpoint

api/register

Auth

Tidak menggunakan autentikasi

Parameter

{number, name, password}

Contoh Payload

{
    "number": "12345",
    "name": "user",
    "password": "user"
}

Response

{
    "status": 201,
    "message": "User Created"
}

Login

Method

POST

Endpoint

/api/login

Auth

Tidak menggunakan Autentikasi

Parameter

{number, password}

Contoh Payload

{
    "number": "test",
    "password": "test"
}

Response

{
    "status": 200,
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6......"
}

Search Product

Method

POST

Endpoint

/api/searchproduct

Auth

Tidak menggunakan Autentikasi

Parameter

{search}

Contoh Payload

{
    "search": "Vanilla"
}

Response

{
    "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 All User

Method

GET

Endpoint

/admin

Auth

Menggunakan autentikasi Admin

Parameter

Tidak ada parameter

Response

{
    "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
        }
    ]
}

Profile

Method

GET

Endpoint

/user/profile

Auth

Menggunakan autentikasi User

Parameter

Tidak ada parameter

Response

{
    "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
    }
}

Add Product

Method

POST

Endpoint

/user/addproduct

Auth

Menggunakan autentikasi User

Parameter

{product_name, product_qty, product_price}

Contoh Payload

{
    "product_name": "Piscok demo",
    "product_qty": "50",
    "product_price": "10000"
}

Response

{
    "status": 200,
    "message": "Product Added"
}

Update Product

Method

POST

Endpoint

/user/updateproduct

Auth

Menggunakan autentikasi User

Parameter

{product_name, product_qty, product_price}

Contoh Payload

{
    "product_name": "Piscok demo",
    //dapat diisi salah satu dan dua2nya
    "product_qty": "50", 
    "product_price": "10000"
}

Response

{
    "status": 200,
    "message": "Product Updated"
}

Get All Product

Method

GET

Endpoint

/user/getallproduct

Auth

Menggunakan autentikasi User

Parameter

Tidak ada parameter

Response

{
    "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"
        }
    ]
}

Buy

Method

POST

Endpoint

/user/buy

Auth

Menggunakan autentikasi User

Parameter

{product_name, product_qty}

Contoh Payload

{
    "product_name": "Piscok Keju",
    "product_qty": "5"
}

Response

{
    "status": 200,
    "message": "Product Ordered, Waiting for Payment"
}

My Order

Method

GET

Endpoint

/user/myorder

Auth

Menggunakan autentikasi User

Parameter

Tidak ada parameter

Response

{
    "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"
        }
    ]
}

Pay

Method

POST

Endpoint

/user/pay

Auth

Menggunakan autentikasi User

Parameter

{orders_id, emoney, username, number, password, email}

Contoh Payload

{
    "orders_id": "2",
    "emoney": "Payfresh",
    //optional, tergantung dari emoney yang digunakan
    "username": "PadPay",
    "number": "082169420720",
    "password": "PeacePay",
    "email": "[email protected]"
}

Response

{
    "status": 200,
    "message": "Payment Success"
}

Seller Confirm

Method

POST

Endpoint

/user/sellerconfirm

Auth

Menggunakan autentikasi User

Parameter

{orders_id}

Contoh Payload

{
    "orders_id": "2"
}

Response

{
    "status": 200,
    "message": "Confirmation successful (product sent)"
}

Buyer Confirm

Method

POST

Endpoint

/user/buyerconfirm

Auth

Menggunakan autentikasi User

Parameter

{orders_id}

Contoh Payload

{
    "orders_id": "2"
}

Response

{
    "status": 200,
    "message": "Confirmation successful (product received)"
}

Withdraw Funds

Method

POST

Endpoint

/user/withdraw

Auth

Menggunakan autentikasi User

Parameter

{amount, emoney, tujuan}

Contoh Payload

{
    "amount": "1000",
    "emoney": "PeacePay",
    "tujuan": "123"
}

Response

{
    "status": 200,
    "message": "Withdraw Success"
}

piscokku-fullstack's People

Contributors

alvingxv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.