Cart

장바구니 도메인 API 명세

장바구니 등록

장바구니 등록

POST http://localhost:8080/carts/add

회원의 장바구니에 상품을 담을 수 있도록 합니다.

Headers

Name
Type
Description

token*

String

로그인 시 발급받은 JWT

Request Body

Name
Type
Description

idx*

Long

옵션의 고유 아이디

quantity*

Integer

장바구니에 담을 옵션의 수량

shopName*

String

가게 이름(ex: 굽네치킨 부산안락점)

{
    "success": true,
    "response": null,
    "error": null
}

장바구니 조회

장바구니 조회

GET http://localhost:8080/carts

유저의 장바구니를 조회합니다.

Headers

Name
Type
Description

token*

String

로그인 시 발급받은 JWT

{
    "success": true,
    "response": {
        "menus": [
            {
                "idx": 1,
                "menuName": "고추바사삭",
                "carts": [
                    {
                        "idx": 1,
                        "option": {
                            "idx": 1,
                            "optionName": "고추바사삭 뼈치킨",
                            "price": 19000
                        },
                        "quantity": 10,
                        "price": 190000
                    },
                    {
                        "idx": 2,
                        "option": {
                            "idx": 5,
                            "optionName": "콜라 라지 변경",
                            "price": 2000
                        },
                        "quantity": 1,
                        "price": 2000
                    }
                ]
            },
            {
                "idx": 2,
                "menuName": "볼게이노",
                "carts": [
                    {
                        "idx": 3,
                        "option": {
                            "idx": 10,
                            "optionName": "콜라 라지 변경",
                            "price": 2000
                        },
                        "quantity": 7,
                        "price": 14000
                    }
                ]
            }
        ],
        "totalPrice": 206000
    },
    "error": null
}

장바구니 수정

장바구니 수정

PUT http://localhost:8080/carts/update

회원의 장바구니를 수정합니다.

Headers

Name
Type
Description

token*

String

로그인 시 발급받은 JWT

Request Body

Name
Type
Description

idx*

Long

장바구니의 고유 아이디

quantity*

Integer

개수를 수정할 장바구니 고유 아이디에

해당하는 옵션의 수량

{
    "success": true,
    "response": null,
    "error": null
}

장바구니 삭제

장바구니 삭제

DELETE http://localhost:8080/carts/clear

회원의 장바구니를 비웁니다.

Headers

Name
Type
Description

token*

String

로그인 시 발급받은 JWT

{
    "success": true,
    "response": null,
    "error": null
}

Last updated