Lumiere API
  • 회원가입
  • 로그인 & 로그아웃
  • 상품
  • 작가
  • 주문
  • 랜딩페이지
  • 마이페이지
  • 관리자 페이지
Powered by GitBook
On this page
  • 장바구니 상품 재고 확인
  • 결제 예정 총 금액 확인
  • 결제 전 주문 생성
  • 아임포트 결제 후 해당 주문서에 imp_uid 추가
  • 해당 주문 취소 | 반품 신청
  • 해당 주문 상세 확인
  • 유저의 최근 주문 정보

주문

장바구니 상품 재고 확인

GET /api/products/cart-items

one or Array

Query Parameters

Name
Type
Description

productId*

ObjectId

Product's

[
    {
        "info": {
            "size": "163x131cm",
            "canvas": 100
        },
        "_id": "61a4debe4f5f6aa036bfec5f",
        "artist": {
            "_id": "61a4debe4f5f6aa036bfec5d",
            "name": "로키산맥"
        },
        "title": "파멸",
        "image": "/images/owner/1.jpg",
        "price": 469000,
        "inStock": true
    },
    {
        "info": {
            "size": "146x112cm",
            "canvas": 80
        },
        "_id": "61a58ed5eebb463c14eca0f9",
        "artist": {
            "_id": "61a4c82a2c1eaad2e0d0084c",
            "name": "안영희"
        },
        "title": "날갯짓",
        "image": "/images/bye/2.jpg",
        "price": 310000,
        "inStock": true
    },
    ...
]

결제 예정 총 금액 확인

GET /api/products/total-price

one or Array

Query Parameters

Name
Type
Description

productId*

ObjectId

Product's

Headers

Name
Type
Description

authorization*

String

Bearer Token

{
    "_id": "결제 예정 총 금액",
    "totalPrice": 898000
}

결제 전 주문 생성

POST /api/orders

Headers

Name
Type
Description

authorization*

String

Bearer Token

Content-type*

String

application/json

Request Body

Name
Type
Description

orderItems*

Array

product, image, title, artist, size, price

result*

Object

id

deliveryInfo*

Object

address, detailedAddress, receiver, contactNum

ordererInfo*

Object

name, phoneNum, email, refundTerms

shippingPrice*

Number

totalPrice*

Number

deliveryDetails

Object

receiveAt, requestedTerms

{
    "message": "주문서 생성 성공",
    "orderId": "61a7adc903b7708e5dbba693"
}
{
    "message": "주문할 상품 목록이 없습니다"
}

아임포트 결제 후 해당 주문서에 imp_uid 추가

PATCH /api/orders/pay

Request Body

Name
Type
Description

imp_uid*

String

{
    "message": "결제 성공"
}
{
    "message": "금액 불일치, 위조된 결제 시도"
}

해당 주문 취소 | 반품 신청

DELETE /api/orders/:id

Path Parameters

Name
Type
Description

id*

ObjectId

Order's

Headers

Name
Type
Description

authorization*

String

Bearer Token

Content-type

String

application/json

Request Body

Name
Type
Description

status

Number

{
    "message": "해당 주문의 결제 취소가 완료되었습니다"
}
{
    "message": "해당 주문의 반품 요청이 완료되었습니다"
}
{
    "message": "해당 주문내역이 존재하지 않습니다"
}
{
    "message": "진행 단계를 알 수 없습니다"
}
{
    "message": "결제 오류로 임시 주문서를 삭제했습니다"
}

해당 주문 상세 확인

GET /api/orders/:id

Path Parameters

Name
Type
Description

id*

ObjectId

Order's

Headers

Name
Type
Description

authorization*

String

Bearer Token

{
    "result": {
        "id": "20211130111111",
        "paidAt": "2021-12-01T17:15:53.146Z",
        "status": 0,
        "updatedAt": "2021-12-01T17:15:53.146Z"
    },
    "deliveryInfo": {
        "address": "[12990] 경기 하남시 감북로 18 (감일동)",
        "detailedAddress": "강남으로 가자 8282",
        "receiver": "김로또",
        "contactNum": "010-7777-7777"
    },
    "deliveryDetails": {
        "receiveAt": "문 앞",
        "requestedTerms": "도착 시 꼭 문자주세요!!"
    },
    "ordererInfo": {
        "name": "남대문",
        "phoneNum": "010-4444-4444",
        "email": "a@test.com",
        "refundTerms": "품절 시 결제수단으로 환불"
    },
    "_id": "61a7adc903b7708e5dbba693",
    "user": "61a4e52b4f5f6aa036bfec61",
    "orderItems": [
        {
            "image": "/images/bye/1.jpg",
            "title": "잠식",
            "artist": "안영희",
            "size": "73x61cm(20호)",
            "price": 99000,
            "product": "61a4c895f59ea1b7a727a658"
        },
        {
            "image": "/images/owner/1.jpg",
            "title": "파멸",
            "artist": "로키산맥",
            "size": "163x131cm(100호)",
            "price": 469000,
            "product": "61a4debe4f5f6aa036bfec5f"
        }
    ],
    "shippingPrice": 10000,
    "totalPrice": 578000
}
{
    "message": "해당 주문 내역이 없습니다"
}

유저의 최근 주문 정보

GET /api/orders/latest

Headers

Name
Type
Description

authorization*

String

Bearer Token

{
    "deliveryInfo": {
        "address": "[18030] 서울특별시 서초구 서초대로 396 ",
        "detailedAddress": "강남빌딩 20층 (스파크플러스 강남2호점)",
        "receiver": "김로또",
        "contactNum": "010-7777-7777"
    },
    "deliveryDetails": {
        "receiveAt": "문 앞에 놓아주세요",
        "requestedTerms": "도착 시 문자주세요"
    },
    "ordererInfo": {
        "name": "남대문",
        "phoneNum": "010-4444-4444",
        "email": "a@test.com",
        "refundTerms": "품절 시 결제수단으로 환불"
    },
    "_id": "61b344023c5af7a153d19a71"
}
{
    "message": "최근 주문 내역이 없습니다"
}
Previous작가Next랜딩페이지

Last updated 3 years ago