HTTP 동사
+본 REST API에서 사용하는 HTTP 동사(verbs)는 가능한한 표준 HTTP와 REST 규약을 따릅니다.
+| 동사 | +용례 | +
|---|---|
|
+리소스를 가져올 때 사용 |
+
|
+새 리소스를 만들 때 사용 |
+
|
+기존 리소스를 수정할 때 사용 |
+
|
+기존 리소스의 일부를 수정할 때 사용 |
+
|
+기존 리소스를 삭제할 떄 사용 |
+
HTTP 상태 코드
+본 REST API에서 사용하는 HTTP 상태 코드는 가능한 표준 HTTP와 REST 규약을 따릅니다.
+| 상태 코드 | +용례 | +
|---|---|
|
+요청을 성공적으로 처리함 |
+
|
+새 리소스를 성공적으로 생성함. 응답의 |
+
|
+기존 리소스를 성공적으로 수정함. |
+
|
+잘못된 요청을 보낸 경우. 응답 본문에 더 오류에 대한 정보가 담겨있다. |
+
|
+요청한 리소스가 없음. |
+
|
+클라이언트의 요청이 서버의 상태와 충돌이 발생한 경우. |
+
주문
+주문 수정
+Curl request
+$ curl 'http://http://just-pickup.com:8001/order/1' -i -X PATCH \
+ -H 'Content-Type: application/json;charset=UTF-8' \
+ -H 'Accept: application/json' \
+ -d '{
+ "orderStatus" : "PLACED"
+}'
+HTTP request
+PATCH //just-pickup.com:8001/order/1 HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+Accept: application/json
+Content-Length: 30
+Host: http
+
+{
+ "orderStatus" : "PLACED"
+}
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 59
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : null
+}
+Path parameters
+| Parameter | +Description | +
|---|---|
|
+주문 고유번호 |
+
Request fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+주문 상태 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+데이터 |
+
주문 상세보기 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/order-detail/1589' -i -X GET
+HTTP request
+GET //just-pickup.com:8001/api/order-detail/1589 HTTP/1.1
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 991
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "id" : 1589,
+ "orderStatus" : "PLACED",
+ "orderTime" : "2022-03-29 14:05",
+ "orderPrice" : 76600,
+ "storeName" : "매장이름",
+ "user" : {
+ "id" : 6,
+ "name" : "박상범",
+ "phoneNumber" : "010-1234-5678"
+ },
+ "orderItems" : [ {
+ "id" : 11374,
+ "itemId" : 43,
+ "totalPrice" : 0,
+ "count" : 2,
+ "name" : "카페라떼",
+ "options" : [ {
+ "id" : 11372,
+ "itemOptionId" : 41,
+ "name" : "HOT",
+ "optionType" : "REQUIRED"
+ }, {
+ "id" : 11373,
+ "itemOptionId" : 42,
+ "name" : "시럽 추가",
+ "optionType" : "OTHER"
+ } ]
+ }, {
+ "id" : 11375,
+ "itemId" : 44,
+ "totalPrice" : 0,
+ "count" : 2,
+ "name" : "아메리카노",
+ "options" : [ {
+ "id" : 11371,
+ "itemOptionId" : 40,
+ "name" : "ICE",
+ "optionType" : "REQUIRED"
+ } ]
+ } ]
+ }
+}
+Path parameters
+| Parameter | +Description | +
|---|---|
|
+주문 고유번호 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과코드 SUCCESS/ERROR |
+
|
+
|
+메세지 |
+
|
+
|
+주문 고유번호 |
+
|
+
|
+주문 매장이름 |
+
|
+
|
+주문 상태 |
+
|
+
|
+주문 시간 [yyy-MM-dd] |
+
|
+
|
+주문 금액 |
+
|
+
|
+주문한 회원 고유번호 |
+
|
+
|
+주문한 회원 이름 |
+
|
+
|
+주문한 회원 전화번호 |
+
|
+
|
+주문아이템 고유번호 |
+
|
+
|
+아이템 고유번호 |
+
|
+
|
+주문아이템 총합계 |
+
|
+
|
+주문아이템 수량 |
+
|
+
|
+아이템 이름 |
+
|
+
|
+주문아이템옵션 고유번호 |
+
|
+
|
+아이템옵션 고유번호 |
+
|
+
|
+아이템옵션 이름 |
+
|
+
|
+아이템옵션 타입 |
+
주문 (사용자 서비스)
+주문 내역 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/customer/order/history?page=0' -i -X GET \
+ -H 'user-id: 2'
+HTTP request
+GET //just-pickup.com:8001/api/customer/order/history?page=0 HTTP/1.1
+user-id: 2
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 1138
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "orders" : [ {
+ "orderId" : 1,
+ "orderTime" : "2022-03-07 19:00",
+ "orderStatus" : "PLACED",
+ "storeId" : 1001,
+ "storeName" : null,
+ "orderPrice" : 10000,
+ "orderItems" : [ {
+ "orderItemId" : 100,
+ "orderItemName" : null
+ }, {
+ "orderItemId" : 400,
+ "orderItemName" : null
+ } ]
+ }, {
+ "orderId" : 2,
+ "orderTime" : "2022-03-07 19:00",
+ "orderStatus" : "PLACED",
+ "storeId" : 1002,
+ "storeName" : null,
+ "orderPrice" : 20000,
+ "orderItems" : [ {
+ "orderItemId" : 200,
+ "orderItemName" : null
+ }, {
+ "orderItemId" : 600,
+ "orderItemName" : null
+ } ]
+ }, {
+ "orderId" : 3,
+ "orderTime" : "2022-03-07 19:00",
+ "orderStatus" : "PLACED",
+ "storeId" : 1003,
+ "storeName" : null,
+ "orderPrice" : 30000,
+ "orderItems" : [ {
+ "orderItemId" : 300,
+ "orderItemName" : null
+ }, {
+ "orderItemId" : 800,
+ "orderItemName" : null
+ } ]
+ } ],
+ "hasNext" : true
+ }
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request parameters
+| Parameter | +Description | +
|---|---|
|
+검색할 페이지 [Optional, default: 0] |
+
|
+검색할 페이지 사이즈 [Optional, default: 3] |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+주문 고유번호 |
+
|
+
|
+주문 시간 [yyyy-MM-dd HH:mm] |
+
|
+
|
+합계 |
+
|
+
|
+주문 상태 |
+
|
+
|
+매장 고유번호 |
+
|
+
|
+매장 이름 |
+
|
+
|
+주문 아이템 고유번호 |
+
|
+
|
+주문 아이템 이름 |
+
|
+
|
+더보기 버튼 유무 |
+
장바구니 상품 추가
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/customer/order/item' -i -X POST \
+ -H 'Content-Type: application/json;charset=UTF-8' \
+ -H 'user-id: 2' \
+ -H 'Accept: application/json' \
+ -d '{
+ "itemId" : 102,
+ "storeId" : 1,
+ "price" : 3000,
+ "count" : 4,
+ "itemOptionIds" : [ 1, 2, 3, 4, 5 ]
+}'
+HTTP request
+POST //just-pickup.com:8001/api/customer/order/item HTTP/1.1
+Content-Type: application/json;charset=UTF-8
+user-id: 2
+Accept: application/json
+Content-Length: 109
+Host: http
+
+{
+ "itemId" : 102,
+ "storeId" : 1,
+ "price" : 3000,
+ "count" : 4,
+ "itemOptionIds" : [ 1, 2, 3, 4, 5 ]
+}
+HTTP response
+HTTP/1.1 204 No Content
+Content-Type: application/json
+Content-Length: 59
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : null
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request body
+{
+ "itemId" : 102,
+ "storeId" : 1,
+ "price" : 3000,
+ "count" : 4,
+ "itemOptionIds" : [ 1, 2, 3, 4, 5 ]
+}
+Request fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+아이템 고유번호 |
+
|
+
|
+매장 고유번호 |
+
|
+
|
+아이템 가격 |
+
|
+
|
+아이템 갯수 |
+
|
+
|
+아이템 옵션들 |
+
장바구니 내역 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/customer/order/orders' -i -X GET \
+ -H 'user-id: 2'
+HTTP request
+GET //just-pickup.com:8001/api/customer/order/orders HTTP/1.1
+user-id: 2
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 518
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "id" : 2,
+ "userId" : 2,
+ "orderPrice" : 12000,
+ "storeName" : "저스트카페",
+ "orderItemDtoList" : [ {
+ "id" : 1,
+ "itemId" : 1,
+ "itemName" : "카페라테",
+ "orderItemOptionDtoList" : [ {
+ "id" : 2,
+ "optionType" : "REQUIRED",
+ "name" : "Hot"
+ }, {
+ "id" : 2,
+ "optionType" : "OTHER",
+ "name" : "샷추카"
+ } ],
+ "price" : 3000,
+ "count" : 32
+ } ]
+ }
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+주문 고유번호 |
+
|
+
|
+주문한 유저 고유번호 |
+
|
+
|
+매장 명 |
+
|
+
|
+총 합계 |
+
|
+
|
+orderItem 고유번호 |
+
|
+
|
+상품 고유번호 |
+
|
+
|
+상품 명 |
+
|
+
|
+아이템 옵션들 |
+
|
+
|
+아이템 옵션 고유번호 |
+
|
+
|
+아이템 옵션 타입 |
+
|
+
|
+아이템 옵션명 |
+
|
+
|
+상품 가격 |
+
|
+
|
+상품 갯수 |
+
주문 생성
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/customer/order/orders' -i -X POST \
+ -H 'user-id: 2'
+HTTP request
+POST //just-pickup.com:8001/api/customer/order/orders HTTP/1.1
+user-id: 2
+Host: http
+HTTP response
+HTTP/1.1 201 Created
+Content-Type: application/json
+Content-Length: 59
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : null
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
주문 (점주 서비스)
+주문 페이지 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/owner/order/order-main?orderDate=2022-02-03&lastOrderId=7' -i -X GET \
+ -H 'user-id: 1'
+HTTP request
+GET //just-pickup.com:8001/api/owner/order/order-main?orderDate=2022-02-03&lastOrderId=7 HTTP/1.1
+user-id: 1
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 2020
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "hasNext" : true,
+ "orders" : [ {
+ "id" : 1,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명1",
+ "orderItems" : [ {
+ "itemName" : "아이템10"
+ }, {
+ "itemName" : "아이템11"
+ }, {
+ "itemName" : "아이템12"
+ } ]
+ }, {
+ "id" : 2,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명2",
+ "orderItems" : [ {
+ "itemName" : "아이템20"
+ }, {
+ "itemName" : "아이템22"
+ }, {
+ "itemName" : "아이템24"
+ } ]
+ }, {
+ "id" : 3,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명3",
+ "orderItems" : [ {
+ "itemName" : "아이템30"
+ }, {
+ "itemName" : "아이템33"
+ }, {
+ "itemName" : "아이템36"
+ } ]
+ }, {
+ "id" : 4,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명4",
+ "orderItems" : [ {
+ "itemName" : "아이템40"
+ }, {
+ "itemName" : "아이템44"
+ }, {
+ "itemName" : "아이템48"
+ } ]
+ }, {
+ "id" : 5,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명5",
+ "orderItems" : [ {
+ "itemName" : "아이템50"
+ }, {
+ "itemName" : "아이템55"
+ }, {
+ "itemName" : "아이템60"
+ } ]
+ }, {
+ "id" : 6,
+ "orderTime" : "2022-03-29 14:05",
+ "orderStatus" : "ACCEPTED",
+ "userName" : null,
+ "storeName" : "가게명6",
+ "orderItems" : [ {
+ "itemName" : "아이템60"
+ }, {
+ "itemName" : "아이템66"
+ }, {
+ "itemName" : "아이템72"
+ } ]
+ } ]
+ }
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request parameters
+| Parameter | +Description | +
|---|---|
|
+주문 날짜 YYYY-MM-DD |
+
|
+페이지의 마지막 주문 고유 번호 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+다음 게시물 표시 여부 |
+
|
+
|
+주문 고유번호 |
+
|
+
|
+주문 시간 [yyyy-MM-dd HH:mm] |
+
|
+
|
+주문 상태 |
+
|
+
|
+주문한 사용자 이름 |
+
|
+
|
+가게 이름 |
+
|
+
|
+아이템 이름 |
+
주문 페이지 조회 (잘못된 파라미터 형식)
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/owner/order/prev-order?startDate=2023-02-03&endDate=2022-02-04&page=0' -i -X GET \
+ -H 'user-id: 1'
+HTTP request
+GET //just-pickup.com:8001/api/owner/order/prev-order?startDate=2023-02-03&endDate=2022-02-04&page=0 HTTP/1.1
+user-id: 1
+Host: http
+HTTP response
+HTTP/1.1 400 Bad Request
+Content-Type: application/json
+Content-Length: 155
+
+{
+ "code" : "ERROR",
+ "message" : "[startDate](은)는 시작일은 종료일보다 클 수 없습니다. 입력된 값: [2023-02-03]",
+ "data" : null
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request parameters
+| Parameter | +Description | +
|---|---|
|
+시작날짜 YYYY-MM-DD |
+
|
+종료날짜 YYYY-MM-DD |
+
|
+검색 페이지 (0부터 시작) |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+데이터 |
+
지난 주문 페이지 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/owner/order/prev-order?startDate=2022-02-03&endDate=2022-02-04&page=0' -i -X GET \
+ -H 'user-id: 1'
+HTTP request
+GET //just-pickup.com:8001/api/owner/order/prev-order?startDate=2022-02-03&endDate=2022-02-04&page=0 HTTP/1.1
+user-id: 1
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 831
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "orders" : [ {
+ "orderId" : 1,
+ "orderStatus" : "PLACED",
+ "orderTime" : "2022-02-03 14:00:00",
+ "orderPrice" : 0,
+ "userName" : "닉네임",
+ "orderItems" : [ {
+ "orderItemId" : 100,
+ "orderItemName" : "아이템1"
+ }, {
+ "orderItemId" : 101,
+ "orderItemName" : "아이템2"
+ } ]
+ }, {
+ "orderId" : 2,
+ "orderStatus" : "FAILED",
+ "orderTime" : "2022-02-03 15:00:00",
+ "orderPrice" : 0,
+ "userName" : "닉네임",
+ "orderItems" : [ {
+ "orderItemId" : 102,
+ "orderItemName" : "아이템3"
+ }, {
+ "orderItemId" : 103,
+ "orderItemName" : "아이템2"
+ } ]
+ } ],
+ "page" : {
+ "startPage" : 0,
+ "totalPage" : 1
+ }
+ }
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request parameters
+| Parameter | +Description | +
|---|---|
|
+시작날짜 YYYY-MM-DD |
+
|
+종료날짜 YYYY-MM-DD |
+
|
+검색 페이지 (0부터 시작) |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+주문 고유번호 |
+
|
+
|
+주문상태 |
+
|
+
|
+주문시간 |
+
|
+
|
+결제금액 |
+
|
+
|
+닉네임 |
+
|
+
|
+주문상품 고유번호 |
+
|
+
|
+주문상품 이름 |
+
|
+
|
+현재 페이지 (0부터 시작) |
+
|
+
|
+총 페이지 개수 |
+
지난 주문 페이지 조회 (파라미터 오류)
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/owner/order/prev-order?startDate=2023-02-03&endDate=2022-02-04&page=0' -i -X GET \
+ -H 'user-id: 1'
+HTTP request
+GET //just-pickup.com:8001/api/owner/order/prev-order?startDate=2023-02-03&endDate=2022-02-04&page=0 HTTP/1.1
+user-id: 1
+Host: http
+HTTP response
+HTTP/1.1 400 Bad Request
+Content-Type: application/json
+Content-Length: 155
+
+{
+ "code" : "ERROR",
+ "message" : "[startDate](은)는 시작일은 종료일보다 클 수 없습니다. 입력된 값: [2023-02-03]",
+ "data" : null
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Request parameters
+| Parameter | +Description | +
|---|---|
|
+시작날짜 YYYY-MM-DD |
+
|
+종료날짜 YYYY-MM-DD |
+
|
+검색 페이지 (0부터 시작) |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+데이터 |
+
대쉬보드 조회
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/owner/order/dashboard' -i -X GET \
+ -H 'user-id: 1'
+HTTP request
+GET //just-pickup.com:8001/api/owner/order/dashboard HTTP/1.1
+user-id: 1
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 638
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : {
+ "salesAmount" : 1237801239,
+ "bestSellItem" : {
+ "itemId" : 40,
+ "itemName" : "까메리카노",
+ "sumCounts" : 3217
+ },
+ "sellAmountAWeeks" : [ {
+ "sellDate" : "2022-03-22",
+ "sellAmount" : 1235
+ }, {
+ "sellDate" : "2022-03-23",
+ "sellAmount" : 235
+ }, {
+ "sellDate" : "2022-03-24",
+ "sellAmount" : 2235
+ }, {
+ "sellDate" : "2022-03-25",
+ "sellAmount" : 1635
+ }, {
+ "sellDate" : "2022-03-26",
+ "sellAmount" : 35
+ }, {
+ "sellDate" : "2022-03-27",
+ "sellAmount" : 635
+ } ]
+ }
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+데이터 |
+
|
+
|
+총 판매금약 |
+
|
+
|
+7일간 베스트 판매 상품 |
+
|
+
|
+7일간 베스트 판매 상품 고유번호 |
+
|
+
|
+7일간 베스트 판매 상품명 |
+
|
+
|
+7일간 베스트 판매 상품판매량 |
+
|
+
|
+7일간 판매 통계 |
+
|
+
|
+7일간 판매 통계날짜 |
+
|
+
|
+7일간 판매 통계날짜별 판매량 |
+
주문상품 (사용자 서비스)
+장바구니 아이템 삭제
+Curl request
+$ curl 'http://http://just-pickup.com:8001/api/customer/orderItem/2' -i -X DELETE \
+ -H 'user-id: 2'
+HTTP request
+DELETE //just-pickup.com:8001/api/customer/orderItem/2 HTTP/1.1
+user-id: 2
+Host: http
+HTTP response
+HTTP/1.1 200 OK
+Content-Type: application/json
+Content-Length: 56
+
+{
+ "code" : "SUCCESS",
+ "message" : "",
+ "data" : 2
+}
+Request headers
+| Name | +Description | +
|---|---|
|
+유저 고유번호 |
+
Path parameters
+| Parameter | +Description | +
|---|---|
|
+orderItem 고유번호 |
+
Response fields
+| Path | +Type | +Description | +
|---|---|---|
|
+
|
+결과 코드 SUCCESS/ERROR |
+
|
+
|
+메시지 |
+
|
+
|
+orderItem 고유번호 |
+