응답 코드
Code | Message | Description |
---|---|---|
200 |
SUCCESS |
성공 |
400 |
BAD_REQUEST |
잘못된 요청 |
잔액 API
잔액 조회
HTTP Request
GET /api/v1/users/1/balance HTTP/1.1
Host: localhost:8080
Parameter | Description |
---|---|
|
사용자 ID |
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 76
{
"code" : 200,
"message" : "OK",
"data" : {
"amount" : 1000
}
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
|
|
|
응답 데이터 |
|
|
|
잔액 |
잔액 충전
HTTP Request
POST /api/v1/users/1/balance HTTP/1.1
Content-Type: application/json
Content-Length: 22
Host: localhost:8080
{
"amount" : 10000
}
Parameter | Description |
---|---|
|
사용자 ID |
Request Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
충전 금액 |
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 38
{
"code" : 200,
"message" : "OK"
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
쿠폰 API
보유 쿠폰 목록 조회
HTTP Request
GET /api/v1/users/1/coupons HTTP/1.1
Host: localhost:8080
Parameter | Description |
---|---|
|
사용자 ID |
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 198
{
"code" : 200,
"message" : "OK",
"data" : {
"coupons" : [ {
"id" : 1,
"name" : "쿠폰명",
"discountRate" : 0.1,
"expiredAt" : "2025-04-01 12:00:00"
} ]
}
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
|
|
|
응답 데이터 |
|
|
|
쿠폰 목록 |
|
|
|
쿠폰 ID |
|
|
|
쿠폰 이름 |
|
|
|
쿠폰 할인율 |
|
|
|
쿠폰 만료일 |
쿠폰 발급
HTTP Request
POST /api/v1/users/1/coupons HTTP/1.1
Content-Type: application/json
Content-Length: 20
Host: localhost:8080
{
"couponId" : 1
}
Parameter | Description |
---|---|
|
사용자 ID |
Request Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
쿠폰 ID |
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 38
{
"code" : 200,
"message" : "OK"
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
주문/결제 API
주문 결제 완료
HTTP Request
POST /api/v1/orders HTTP/1.1
Content-Type: application/json
Content-Length: 95
Host: localhost:8080
{
"userId" : 1,
"couponId" : 1,
"products" : [ {
"id" : 1,
"quantity" : 2
} ]
}
Request Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
사용자 ID |
|
|
|
O |
쿠푠 ID |
|
|
상품 ID |
|
|
|
상품 수량 |
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 38
{
"code" : 200,
"message" : "OK"
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
상품 API
상품 목록 조회
HTTP Request
GET /api/v1/products HTTP/1.1
Host: localhost:8080
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 171
{
"code" : 200,
"message" : "OK",
"data" : {
"products" : [ {
"id" : 1,
"name" : "상품명",
"price" : 300000,
"stock" : 3
} ]
}
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
|
|
|
응답 데이터 |
|
|
|
상품 목록 |
|
|
|
상품 ID |
|
|
|
상품 이름 |
|
|
|
가격 |
|
|
|
재고 수 |
랭킹 API
상위 상품 Top5 목록 조회
HTTP Request
GET /api/v1/products/ranks HTTP/1.1
Host: localhost:8080
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 171
{
"code" : 200,
"message" : "OK",
"data" : {
"products" : [ {
"id" : 1,
"name" : "상품명",
"price" : 300000,
"stock" : 3
} ]
}
}
Response Fields
Path | Type | Optional | Description |
---|---|---|---|
|
|
응답 코드 |
|
|
|
응답 메세지 |
|
|
|
응답 데이터 |
|
|
|
상품 목록 |
|
|
|
상품 ID |
|
|
|
상품 이름 |
|
|
|
가격 |
|
|
|
재고 수 |