# 유효성 검증

사용자가 입력한 게임ID와 서버 정보의 유효성을 확인하고,해당 아이템의 구매 가능 여부를 검증합니다.

* 게임 ID는 아이템을 지급받을 최종 대상(유저/캐릭터)을 식별하는 값이며, 웹샵에서는 serviceUserId로 전달됩니다.\
  \&#xNAN;*<mark style="color:$info;">(게임 구조에 따라 UID 또는 캐릭터 ID 등으로 사용될 수 있습니다.)</mark>*

#### **Request URI**

{% hint style="warning" %}
**유의사항**

원웹샵 보안 정책에 따라 **HTTPS 프로토콜 및 443 Port**만 지원하며, 그 외 규격 사용 시 정상 동작하지 않을 수 있습니다.
{% endhint %}

<table data-header-hidden><thead><tr><th width="184.9678955078125"></th><th></th></tr></thead><tbody><tr><td><strong>HTTP Type</strong></td><td>HTTPS</td></tr><tr><td><strong>HTTP Method</strong></td><td><mark style="color:$primary;"><code>POST</code></mark></td></tr><tr><td><strong>URL</strong></td><td>수신 받을 서버 URL은 <code>개발자센터 > 웹샵 > 연동 관리</code> 메뉴에서 등록할 수 있습니다. 설정 방법은 <a href="/pages/4ej8isEhY9UMZWACKAs8">연동 관리</a> 문서를 참고해주세요.</td></tr><tr><td><strong>Header</strong></td><td><p>Content-Type: application/json; charset=UTF-8</p><p>Accept: application/json</p></td></tr></tbody></table>

#### **Request**

<table><thead><tr><th width="203.33251953125">Name</th><th width="133.9879150390625">Type</th><th width="127.109375">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>param.clientId</code></td><td>String</td><td>M</td><td>원스토어 웹샵 타이틀 ID(상품 ID)</td></tr><tr><td><code>param.prodId</code></td><td>String</td><td>M</td><td>원스토어 웹샵 아이템 ID(인앱 상품 ID)</td></tr><tr><td><code>param.serviceUserId</code></td><td>String</td><td>M</td><td>사용자의 게임 ID</td></tr><tr><td><code>param.serviceServerId</code></td><td>String</td><td>Optional</td><td>사용자의 서버 ID<br><mark style="color:$danger;">※ 구매 입력 정보가 '구매식별자 + 서버'로 설정된 경우 필수입니다.</mark></td></tr><tr><td><code>signature</code></td><td>String</td><td>M</td><td><p>위변조 방지를 위한 서명</p><ul><li>서명키는 <code>개발자센터 > 연동 관리 > 라이선스 관리</code> 메뉴에서 확인할 수 있습니다.</li><li><a href="/pages/oRU887QZeredzPY8ym9m#id-07.pns-pushnotificationservice-signature">Signature 검증 방법</a> 가이드</li></ul></td></tr></tbody></table>

**Example**

```
curl -X POST \
  'https://example.com/gameuser/check' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "param": {
      "clientId": "WS00000001",
      "prodId": "item1000",
      "serviceUserId": "USR1234567890",
      "serviceServerId": "asia01"
    },
    "signature": "ajkfl;askfjkladfjksl"
  }'
```

#### **Response**

<table><thead><tr><th width="203.33251953125">Name</th><th width="133.9879150390625">Type</th><th width="127.109375">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>result.code</code></td><td>String</td><td>M</td><td><p>"0000": 성공</p><p>"1000": 비회원 </p><p>"1001" : 구매불가 </p></td></tr><tr><td><code>result.message</code></td><td>String</td><td>M</td><td><ul><li><code>result.code</code>가 <code>1001</code>인 경우 사용자 화면에 표시되는 안내 메시지입니다.</li><li>대상 사용자에게 적합한 언어로 전달하는 것을 권장합니다.</li><li><p><strong>예시 문구</strong> </p><ul><li>"구매 가능한 횟수를 초과하였습니다."</li><li>"이미 구매한 상품입니다."</li><li>"이벤트 기간이 종료된 상품입니다."</li></ul></li></ul></td></tr><tr><td><code>developerPayload</code></td><td>String</td><td>Optional</td><td><p>유효성 검증 응답 시 개발사가 전달하는 구매건에 대한 식별자입니다.</p><ul><li>결제 완료 후 PNS에도 포함되어 구매 검증에 사용됩니다.</li></ul></td></tr></tbody></table>

**Example**

```
// 성공
{
  "result": {
    "code": "0000",
    "message": "User found"
  },
  "developerPayload": "OS_000211234" //Optional
}

// 비회원
{
  "result": {
    "code": "1000",
    "message": "User not found"
  }
}

//구매 불가
{
  "result": {
    "code": "1001",
    "message": "구매 가능한 횟수를 초과하였습니다."
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/tools/webshop/validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
