쿠폰 생성

요청

POST /admin/coupon HTTP/1.1
Content-Type: application/json
Content-Length: 189
Host: localhost:8080

{
  "couponName" : "할인 쿠폰",
  "totalQuantity" : 1000,
  "expirationDate" : "2025-03-20",
  "issueStartTime" : "2025-03-13 02:59:56",
  "issueEndTime" : "2025-03-20 02:59:56"
}
Path Type Description

couponName

String

쿠폰 이름

totalQuantity

Number

쿠폰 총 수량

expirationDate

String

쿠폰 만료 날짜

issueStartTime

String

쿠폰 시작 시간

issueEndTime

String

쿠폰 종료 시간

응답

HTTP/1.1 200 OK

쿠폰 목록 조회

요청

GET /admin/coupons HTTP/1.1
Host: localhost:8080

응답

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 532

[ {
  "code" : "CIRN-KEIQ-5D4K",
  "couponName" : "할인 쿠폰1",
  "totalQuantity" : 100,
  "remainingQuantity" : 100,
  "expirationDate" : "2025-03-20",
  "issueStartTime" : "2025-03-13T02:59:56.480604",
  "issueEndTime" : "2025-03-20T02:59:56.480604"
}, {
  "code" : "A8WJ-FY3C-BNIO",
  "couponName" : "할인 쿠폰2",
  "totalQuantity" : 100,
  "remainingQuantity" : 100,
  "expirationDate" : "2025-03-20",
  "issueStartTime" : "2025-03-13T02:59:56.480604",
  "issueEndTime" : "2025-03-20T02:59:56.480604"
} ]
Path Type Description

[].code

String

랜덤 생성된 쿠폰 코드

[].couponName

String

쿠폰 이름

[].totalQuantity

Number

쿠폰 총 수량

[].remainingQuantity

Number

쿠폰 남은 수량

[].expirationDate

String

쿠폰 만료 날짜

[].issueStartTime

String

쿠폰 발급 시작 시간

[].issueEndTime

String

쿠폰 발급 종료 시간

쿠폰 발급

요청

POST /coupon/issue HTTP/1.1
Content-Type: application/json
Content-Length: 63
Host: localhost:8080

{
  "code" : "MG9S-TPRN-WOND",
  "email" : "test@test.com"
}
Path Type Description

code

String

쿠폰 코드

email

String

사용자 이메일

응답

HTTP/1.1 200 OK

쿠폰 사용

요청

POST /coupon/use?email=test@test.com HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: localhost:8080

응답

HTTP/1.1 200 OK

쿠폰 재사용

요청

POST /coupon/use?email=test@test.com HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: localhost:8080

응답

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 90

{
  "code" : "COUPON_ALREADY_USED",
  "message" : "이미 사용한 쿠폰입니다."
}
Path Type Description

code

String

응답 코드

message

String

오류 메시지

쿠폰 만료

요청

POST /coupon/use?email=test@test.com HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: localhost:8080

응답

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 84

{
  "code" : "COUPON_EXPIRED",
  "message" : "쿠폰이 만료되었습니다."
}
Path Type Description

code

String

응답 코드

message

String

오류 메시지