케케_ 2024. 9. 30. 18:48

결제(주문) API

1. 결제하기 = 주문하기 = 주문 등록 = 데이터베이스 주문 insert

  • method : post
  • url : /orders
  • http status code : 성공 200
  • request body
    • items : [{cartItemId : 장바구나 도서 id, bookId : 도서 id, count : 수량}, {cartItemId : 장바구나 도서 id, bookId : 도서 id, count : 수량}, {cartItemId : 장바구나 도서 id, bookId : 도서 id, count : 수량}...]
    • delivery 
      • address : 주소
      • receiver : 이름
      • contact : 전화번호
    • totalPrice : 총금액
  • response body

2. 주문 목록 조회

  • method : get
  • url : /orders
  • http status code : 성공 200
  • request body
  • response body
    • [{order_id: 주문 id,created_at : '주문일자',delivery : {address : 주소, receiver : 이름, contact : 전화번호}, bookTitle : 대표 책 제목, totalPrice : 결제금액, totalCount : 총 수량}]

3. 상세 주문 상품 조회

  • method : get
  • url : /orders/:orderid
  • http status code : 성공 200
  • request body
  • response body
[
	{	
    	book_id: 도서 id,
        bookTitle: 도서 제목
        author: 작가명
        price: 가격
        count: 수량
    }
    {	
    	book_id: 도서 id,
        bookTitle: 도서 제목
        author: 작가명
        price: 가격
        count: 수량
    }
    ...
]