API 참조

즉석 당첨

즉석 당첨 게임 관리 및 플레이 기록

즉석 당첨

즉석 당첨 게임은 서버 측 경품 추첨 기능을 갖춘 간소화된 콘테스트입니다. 방문자는 먼저 게임을 플레이하고, 당첨된 경품을 수령할 때만 이메일을 입력합니다.

mechanic, layout, entryLimit은 생성 시 설정되며 이후에는 변경할 수 없습니다.


게임 목록 조회

GET/api/v1/instant-win-games
Public or Private API Key

쿼리 매개변수

slugstring optional

프리셋으로 필터링: `spin-to-win`, `scratch-and-win`, `mystery-box`, `advent-calendar`, `plinko`, `slot-machine`, `golden-egg`, `claw-machine` 중 하나. 지원이 종료된 프리셋(`trade-show-prize-wheel`, `daily-login-game`, `coupon-roulette`, `in-store-kiosk`)도 기존 게임을 필터링하는 용도로는 계속 사용할 수 있습니다.

pagenumber optional default: 1

페이지 번호

limitnumber optional default: 20

페이지당 항목 수 (1-100)


게임 조회

GET/api/v1/instant-win-games/:gameId
Public or Private API Key

설정, 티어, 확률, 재고(quantity), 고유 코드 개수를 반환합니다.

공개 키를 사용하면 티어의 redeemCode와 redeemUrl은 응답에서 제외됩니다. 공개 키는 웹 페이지에서 누구나 읽을 수 있기 때문입니다. 이 값을 읽으려면 비공개 키를 사용하세요.


게임 생성

POST/api/v1/instant-win-games
Private API Key Required

요청 본문

slugstring required

프리셋 식별자: `spin-to-win`, `scratch-and-win`, `mystery-box`, `advent-calendar`, `plinko`, `slot-machine`, `golden-egg`, `claw-machine` 중 하나

titlestring required

게임 제목

mechanicstring required

`wheel`, `scratch`, `box`, `advent`, `plinko`, `slots`, `egg`, `claw` 중 하나

layoutstring required

`default` 또는 `fullscreen`

entryLimitstring required

`none`, `daily`, `device` 중 하나

tiersarray required

티어 최소 2개. 확률의 합은 100이어야 합니다. 꽝이 아닌 티어에는 `redeemCode` 또는 `redeemUrl`이 필요합니다.

publishAsstring required

`landing` 또는 `embed`

embedUrlstring optional

위젯으로 게시할 때 필수

요청

bash
curl -X POST https://blitzrocket.com/api/v1/instant-win-games \
  -H "x-api-key: your_private_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "spin-to-win",
    "title": "Summer wheel",
    "mechanic": "wheel",
    "layout": "default",
    "entryLimit": "daily",
    "publishAs": "landing",
    "tiers": [
      { "id": "win", "name": "20% off", "oddsPercent": 20, "deliveryType": "code", "redeemCode": "SUMMER20" },
      { "id": "miss", "name": "Try again", "oddsPercent": 80, "isMiss": true }
    ]
  }'

게임 수정

PUT/api/v1/instant-win-games/:gameId
Private API Key Required

제목, 설명, 티어, 게시 방식, 상태를 변경할 수 있습니다. mechanic, layout, entryLimit을 변경하려는 요청은 무시됩니다.


게임 삭제

DELETE/api/v1/instant-win-games/:gameId
Private API Key Required

게임에 경품이 수령된 참가 내역이 있으면 ?force=true를 전달해야 하며, 그렇지 않으면 API가 409를 반환합니다.


플레이

POST/api/v1/instant-win-games/:gameId/play
Public or Private API Key

가중치 기반 추첨을 실행합니다. 당첨된 경품은 24시간 동안 예약됩니다. 경품 지급 정보는 수령 전까지 공개되지 않습니다.

요청 본문

playCookiestring optional

이전 플레이에서 받은 기기 쿠키. 반환된 `playCookie`를 저장해 다시 사용하세요.

응답

json
{
  "success": true,
  "data": {
    "playId": "play_abc",
    "playCookie": "a1b2c3d4",
    "alreadyPlayed": false,
    "result": {
      "id": "win",
      "name": "20% off",
      "isMiss": false,
      "color": "#F59E0B"
    }
  }
}

entryLimit이 daily 또는 device인 경우, 해당 쿠키나 IP로 이미 플레이했다면 403을 반환합니다.


경품 수령

POST/api/v1/instant-win-games/:gameId/plays/:playId/claim
Public or Private API Key

참가 내역을 생성하고, 해당 플레이를 수령 완료로 표시한 뒤, 경품을 이메일로 발송합니다.

요청 본문

emailstring required

당첨자 이메일 주소

playCookiestring optional

플레이 시 반환된 것과 동일한 쿠키

응답

json
{
  "success": true,
  "data": {
    "alreadyClaimed": false,
    "prizeName": "20% off",
    "couponCode": "SUMMER20",
    "redeemUrl": null
  }
}

플레이 목록 조회

GET/api/v1/instant-win-games/:gameId/plays
Private API Key Required

상태(pending, claimed, miss, expired), 티어, 수령 이메일을 포함한 플레이 기록을 페이지 단위로 반환합니다.