메인 콘텐츠로 건너뛰기
POST /v1/game/session/verify PlayWave 런처에서 발급된 를 검증합니다. 유효한 경우 과금을 시작하고 게임 세션을 생성합니다.

요청

Headers

X-Api-Key
string
필수
게임별 API Key.
Content-Type
string
필수
application/json

Body

ott
string
필수
LaunchData에서 추출한 UUID.
provider_user_id
string
필수
Roblox Player UserId를 문자열로 변환한 값.
{
  "ott": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "provider_user_id": "123456789"
}

응답

성공 — 200

{
  "success": true,
  "request_id": "req_abc123",
  "data": {
    "is_valid": true,
    "game_session_id": "gs_550e8400-e29b-41d4-a716-446655440000",
    "is_pc_cafe": true
  }
}
is_valid
boolean
필수
검증 성공 여부.
game_session_id
string
필수
게임 세션 ID — 하트비트/종료 호출에 사용합니다.
is_pc_cafe
boolean
필수
인증된 PC방 여부.

검증 실패 — 200

비즈니스 로직 실패도 HTTP 200으로 반환됩니다. 반드시 is_valid 값으로 분기하세요.
{
  "success": true,
  "request_id": "req_abc123",
  "data": {
    "is_valid": false,
    "reason": "OTT_EXPIRED"
  }
}
reason설명
OTT_EXPIREDOTT 만료 (발급 후 1분 초과)
OTT_ALREADY_USEDOTT 이미 사용됨
GAME_MISMATCHOTT의 게임과 API Key의 게임 불일치
NOT_CHARGEABLE과금 불가 ( 부족 등)

에러

HTTP코드설명
400BAD_REQUEST필수 필드 누락 또는 형식 오류
401INVALID_API_KEYAPI Key 무효

Luau 예제

local function verifySession(player)
    local joinData = player:GetJoinData()
    local ott = joinData.LaunchData

    if not ott or ott == "" then
        return nil
    end

    local success, response = pcall(function()
        return HttpService:RequestAsync({
            Url = API_URL .. "/game/session/verify",
            Method = "POST",
            Headers = {
                ["X-Api-Key"] = API_KEY,
                ["Content-Type"] = "application/json",
            },
            Body = HttpService:JSONEncode({
                ott = ott,
                provider_user_id = tostring(player.UserId),
            }),
        })
    end)

    if not success or response.StatusCode ~= 200 then
        return nil
    end

    local body = HttpService:JSONDecode(response.Body)
    return body.data
end