기능 | 메소드 | url |
---|---|---|
주문하기 | POST | ~/orders |
주문 목록 조회 | GET | ~/orders |
주문 상세 보기 | GET | ~/orders/{id} |
주문 확정 | PATCH | ~/orders/{id}/confirm |
주문 취소 | DELETE | ~/orders/{id} |
유저 쿠폰 발급 | POST | ~/users/coupons |
모든 쿠폰 조회 | GET | ~/coupons |
유저 쿠폰 조회 | GET | ~/users/coupons |
- header
Authorization: Basic ...
- body
{
"selectCartIds" : [1, 2, 3],
"couponId" : 1
}
- status: 201(Created)
- header
Location: /orders/{id}
- header
Authorization: Basic ...
- status: 200(Ok)
- body
[
{
"id" : 1,
"orderProducts" : [
{
"product": {
"id" : 1,
"name" : "치킨",
"imageUrl" : "url",
"price" : 20000,
},
"quantity" : 3
},
{
"product" : {
"id" : 2,
"name" : "피자",
"imageUrl" : "url",
"price" : 30000
},
"quantity" : 2
}
],
"confirmState" : true
},
{
"id" : 2,
"orderProducts" : [
{
"product": {
"id" : 2,
"name" : "피자",
"imageUrl" : "url",
"price" : 30000
},
"quantity" : 2
}
],
"confirmState" : false
}
]
- header
Authorization: Basic ...
- status: 200(Ok)
- body
{
"id" : 2,
"orderProducts" : [
{
"product" : {
"id" : 1,
"name" : "치킨",
"imageUrl" : "url",
"price" : 20000
},
"quantity" : 1
}
],
"originalPrice" : 15000,
"discountPrice" : 12000,
"confirmState" : false,
"coupon" : {
"id" : 1,
"name" : "5월의 달 20% 할인 쿠폰",
"discountType" : "percentage",
"discountRate" : 0.2,
"discountAmount" : 0,
"minimumPrice" : 50000
}
}
- header
Authorization: Basic ...
- status : 200 (Ok)
- header
{
"coupon" :{
"id" : 1,
"name" : "5월의 달 20% 할인 쿠폰",
"discountType" : "percentage",
"discountRate" : 0.2,
"discountAmount" : 0
}
}
- header
Authorization: Basic ...
- status: 204(No Content)
- header
Authorization: Basic ...
- body
{
"id" : 1
}
- status: 201(Created)
-
header
Authorization: Basic ...
- status: 200(Ok)
- Body
[
{
"id" : 1,
"name" : "5월의 달 20% 할인 쿠폰",
"discountType" : "percentage",
"discountRate" : 0.2,
"discountAmount" : 0,
"minimumPrice" : 0,
"issuable" : true
},
{
"id" : 2,
"name" : "5월의 달 1000원 할인 쿠폰",
"discountType" : "deduction",
"discountRate" : 0.0,
"discountAmount" : 1000,
"minimumPrice" : 0,
"issuable" : false
},
{
"id" : 3,
"name" : "50000원 이상 구매시 20% 할인 쿠폰",
"discountType" : "percentage",
"discountRate" : 0.2,
"discountAmount" : 0,
"minimumPrice" : 50000,
"issuable" : true
}
]
- header
Authorization: Basic ...
- status: 200(Ok)
- Body
[
{
"id" : 1,
"name" : "50000원 이상 구매시 20% 할인 쿠폰",
"discountType" : "percentage",
"discountRate" : 0.2,
"discountAmount" : 0,
"minimumPrice" : 50000
},
{
"id" : 2,
"name" : "5월의 달 1000원 할인 쿠폰"
"discountType" : "deduction",
"discountRate" : 0.0,
"discountAmount" : 1000,
"minimumPrice" : 0
}
]
- 쿠폰을 적용한 할인값 구하기
-
주문 신청
- 주문한 상품들의 총 가격 구하기
- 주문한 상품들의 할인 가격 구하기
- 주문한 상품들을 장바구니에서 제거
-
주문 확정
- 주문 확정시 사용 가능한 쿠폰을 유저에게 발급
-
주문 리스트 조회
-
주문 상세 조회
-
주문 취소
- 주문시 사용했던 쿠폰 재발급
-
모든 쿠폰 조회
-
유저 쿠폰 발급
- 유저가 발급 가능한 쿠폰인지 검증(이미 소유중인 쿠폰이면 발급 불가능)
-
유저 쿠폰 조회