-
Notifications
You must be signed in to change notification settings - Fork 1
4. API Design
Sejeong Kim edited this page May 3, 2024
·
1 revision
API는 현재 계속 구현 중이며, 해당 문서에는 구현이 완료된 API만을 작성하였습니다.
body: application/json
, multipart/form-data
{
key: value
}
-
status code
-
body:
application/json
-
성공
{
status: "",
message: "",
data: {}
}
- 실패
- status: http 상태 코드
- code: 에러 코드
- message: 에러 부연 설명
{
status: "",
code: "",
data: {}
}
- Http Method:
GET
- URI:
display/products
- Query Parameters:
이름 | 타입 | 설명 |
---|---|---|
subcategory | string | 조회할 상품의 하위 분류 |
page | integer | 페이지 번호(입력하지 않을 시 1) |
count | integer | 한 페이지에 보여질 상품 개수 |
- Http Method:
GET
- URI:
display/products/detail/{productId}
- Query Parameters:
이름 | 타입 | 설명 |
---|---|---|
productId | integer | 조회할 상품의 아이디 |
- Http Method:
POST
- URI:
/orders/form
- Header:
Authrization
- Access Token
{
"ordered_product_list": [
{
"product_option_id": 1,
"quantity": 2
},
{
"product_option_id": 13,
"quantity": 1
},
{
"product_option_id": 20,
"quantity": 1
}
]
}
- Http Method:
POST
- URI:
/orders
- Header:
Authrization
- Access Token
{
"receiver_address": "서울시 송파구 ~~~",
"receiver_name": "김00",
"receiver_phone": "010-1234-1234",
"ordered_product_list": [
{
"product_id": 1,
"product_option_id": 1,
"quantity": 2,
"coupon_id": 22,
"points": 100,
"coupon_discount_amount": 10,
"piece_original_price": 10000,
"piece_promotion_price": 8000,
"piece_tier_discount_amount": 200
}
],
"used_points": 1000,
"use_points_in_advance": false
}
- Http Method:
POST
- URI:
/orders/cancel-order/{orderedProductId}
- Header:
Authrization
- Access Token
- Http Method:
PATCH
- URI:
/orders/update-address/{orderedProductId}
- Header:
Authrization
- Access Token
{
"receiverName": "김00",
"receiverPhone": "010-1234-5678",
"receiverAddress": "서울시 강동구 ~~~"
}
- Http Method:
GET
- URI:
/orders/{orderId}
- Header:
Authrization
- Access Token
- Http Method:
GET
- URI:
/orders/ordered-products/{orderedProductId}/history
- Header:
Authrization
- Access Token
- Http Method:
GET
- URI:
/orders/members/{memberId}
- Header:
Authrization
- Access Token
- Http Method:
GET
- URI:
/coupons
- Query Parameters:
이름 | 타입 | 설명 |
---|---|---|
page | integer | 페이지 번호(입력하지 않을 시 1) |
- Http Method:
POST
- URI:
/coupons/{couponId}/issue
- Header:
Authorization
- Access Token
- Http Method:
GET
- URI:
/coupons/products/{productId}
- Http Method:
GET
- URI:
/promotions
- Query Parameters:
이름 | 타입 | 설명 |
---|---|---|
page | integer | 페이지 번호(입력하지 않을 시 1) |
- Http Method:
POST
- URI:
/auth/login
{
"id": "clean01",
"password": "password1234"
}
- Http Method:
POST
- URI:
/auth/sign-up
{
"mewsinsa_id": "clean01",
"password": "password1234",
"name": "김00",
"nickname": "clean",
"email": "clearrworld@gmail.com",
"phone": "010-1234-1234",
"profile_image": null,
"tier_id": 1,
"points": 0,
"admin": false
}
- Http Method:
POST
- URI:
/auth/sign-up
- Header:
RefreshToken
- refresh token 문자열
- Http Method:
POST
- URI:
/products
{
"product_name": "검정색 셔츠",
"brand_id": 1,
"category": "상의",
"subcategory": "셔츠",
"original_price": 30000,
"product_option_list": [
{
"product_option_name": "90",
"stock": 100
},
{
"product_option_name": "95",
"stock": 150
},
{
"product_option_name": "100",
"stock": 150
}
]
}
- Http Method:
DELETE
- URI:
/products/{productId}
- Http Method:
PUT
- URI:
/products/{productId}
{
"product_id": 1,
"product_name": "검은색 반팔티",
"brand_id": 1,
"category": "상의",
"subcategory": "반소매 티셔츠",
"original_price": 20000
}
- Http Method:
DELETE
- URI:
/products/product-options/{productOptionId}
- Http Method:
PUT
- URI:
/products/product-options/{productOptionId}
{
"product_option_id": 1,
"product_option_name": "S",
"stock": 200
}
- Http Method:
POST
- URI:
/coupons
- Header:
Authorization
- Access Token
{
"coupon_name": "후드티 할인 쿠폰",
"coupon_type": true,
"discount_rate": 10,
"discount_amount": 0,
"started_at": "2024-05-03T10:29:45.411Z",
"expired_at": "2024-05-10T22:00:00.411Z",
"coupon_product_list": [
1, 2, 10, 11, 12
],
"remaining": 100
}
- Http Method:
POST
- URI:
/promotions
- Header:
Authorization
- Access Token
{
"promotion_name": "후드티 기획전",
"promotion_type": true,
"discount_rate": 20,
"discount_amount": 0,
"started_at": "2024-05-03T10:32:15.133Z",
"expired_at": "2024-05-10T10:32:15.133Z",
"promotion_product_list": [
1, 2, 10, 11, 12
]
}