# Membership Authentication

## 1.Overview <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-1" id="id-greater-than-apiv7-greater-than-15.-greater-than-1"></a>

When servicing a Windows app in the EXE format, integration with Purchases on the Web is required.\
Since membership authentication (login) is necessary for Purchases on the Web integration, this specification is provided.

* The Payment Server API uses the OAuth Token (hereinafter referred to as User Access Token) issued during membership authentication (login).
* OAuth authentication is supported to prevent the need for membership authentication (login) for every payment.

## 2.Precautions <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-2" id="id-greater-than-apiv7-greater-than-15.-greater-than-2"></a>

A 403 error will occur if you attempt Google OAuth login in an Embedded Browser (WebView) without applying the Google SDK.\
You can prevent the 403 error using the following methods:

* Attempt login in a new window instead of an Embedded Browser.
* Modify the User-Agent information to make it recognized as a web browser instead of an Embedded Browser.

## 3.Membership Authentication Flow <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-3" id="id-greater-than-apiv7-greater-than-15.-greater-than-3"></a>

### 3.1 Conceptual View <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-3" id="id-greater-than-apiv7-greater-than-15.-greater-than-3"></a>

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FB8odqnT6fwbVmfSNMgXe%2Fimage.png?alt=media&#x26;token=a31d6130-e1fb-49b9-b4c3-1e3e82f61072" alt=""><figcaption></figcaption></figure>

### 3.2 Logical API ↔ Physical API Specification Mapping <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-3.2-api-api" id="id-greater-than-apiv7-greater-than-15.-greater-than-3.2-api-api"></a>

The physical API specifications mapped to the logical APIs listed in the Conceptual View are as follows.

<table><thead><tr><th width="81.4444580078125" valign="top">No</th><th width="150.88897705078125" valign="top">Flow</th><th valign="top">Logical API</th><th valign="top">Physical API (Integration Specifications)</th></tr></thead><tbody><tr><td valign="top">1</td><td valign="top">Membership Authentication</td><td valign="top"><ol><li>Login UI Request</li></ol></td><td valign="top">4.2 ONE store Login Authentication Request</td></tr><tr><td valign="top">2</td><td valign="top">Membership Authentication</td><td valign="top"><ol start="5"><li>Issuance of ONEstore UserAccessToken</li></ol></td><td valign="top">4.3 ONE store User Access Token Issuance Request</td></tr></tbody></table>

## 4. ONE store Membership Authentication <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-4.onestore" id="id-greater-than-apiv7-greater-than-15.-greater-than-4.onestore"></a>

### 4.1 Overview of ONE store Login API <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-4.1onestore-api" id="id-greater-than-apiv7-greater-than-15.-greater-than-4.1onestore-api"></a>

The ONE store Login API consists of the following:

* ONE store Login Authentication Request API
* User Access Token Issuance/Deletion Request API

The ONE store Login Authentication Request API is an API that displays the ONE store login screen on the developer's service web.\
When the user successfully completes ONE store membership authentication, the temporary code (code) received from the API is used to call the User Access Token Issuance Request API.

The User Access Token obtained through the issuance request API is used to call various Server APIs.

The User Access Token has a shorter expiration period compared to the Refresh Token, and when it expires, a new User Access Token must be issued using the Refresh Token.

The detailed token issuance rules are specified in "4.1.4 User Access Token and Refresh Token Issuance Criteria."

#### **4.1.1** Standard Response Codes <a href="#response-code" id="response-code"></a>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Code</td><td valign="top">message_ko</td><td valign="top">message_en</td><td valign="top">HTTP Status Code</td><td valign="top">Target API</td><td valign="top">Remarks</td></tr><tr><td valign="top">Success</td><td valign="top">정상처리 되었습니다.</td><td valign="top">The request has been successfully completed.</td><td valign="top">200 - Success</td><td valign="top">4.4 ONE store User Access Token Deletion Request</td><td valign="top"><br></td></tr><tr><td valign="top">RequiredValueNotExist</td><td valign="top">필수값이 존재하지 않습니다. [ field1, field2, ... ]</td><td valign="top">Request parameters are required. [ field1, field2, ... ]</td><td valign="top">400 - Bad Request</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">NoSuchData</td><td valign="top">조회된 결과값이 존재하지 않습니다.</td><td valign="top">The requested data could not be found.</td><td valign="top">404 - Not Found</td><td valign="top">Single Lookup AP</td><td valign="top"><br></td></tr><tr><td valign="top">ResourceNotFound</td><td valign="top">요청한 자원이 존재하지 않습니다.</td><td valign="top">The requested resource could not be found.</td><td valign="top">404 - Not Found</td><td valign="top">Common</td><td valign="top">When the requested URL resource does not exist</td></tr><tr><td valign="top">InternalError</td><td valign="top">정의되지 않은 오류가 발생하였습니다.</td><td valign="top">An undefined error has occurred.</td><td valign="top">500 - Internal Server Error</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRequest</td><td valign="top">입력값이 유효하지 않습니다. [ field1, field2, ... ]</td><td valign="top">Request parameters are invalid. [ field1, field2, ... ]</td><td valign="top">400 - Bad Request</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">UserAccessTokenExpired</td><td valign="top">Access 토큰이 만료되었습니다.</td><td valign="top">User Access Token has expired.</td><td valign="top">401 - Unauthorized</td><td valign="top">Common</td><td valign="top"><p>Code and UserAccessToken Expiration Processing</p><ul><li>When the expiration period is exceeded</li><li>When the membership status changes (Dormant/Withdrawn/Merged)</li><li>When the TStore ID member password is changed</li><li>When social authentication fails (e.g., changes in social integration information, such as unlinking)</li></ul></td></tr><tr><td valign="top">InvalidRefreshToken</td><td valign="top">잘못된 Refresh Token 입니다.</td><td valign="top">Invalid refresh token</td><td valign="top">400 - Bad Request</td><td valign="top">Common</td><td valign="top">grant_type: refresh_token case</td></tr><tr><td valign="top">ExpiredRefreshToken</td><td valign="top">만료된 Refresh Token 입니다.</td><td valign="top">Invalid refresh token (expired)</td><td valign="top">401 - Unauthorized</td><td valign="top">Common</td><td valign="top">grant_type: refresh_token case</td></tr><tr><td valign="top">UnauthorizedAccess</td><td valign="top">해당 API에 접근권한이 없습니다.</td><td valign="top">Not authorized to this API.</td><td valign="top">403 - Fobidden<br></td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidUserAccessToken</td><td valign="top">Access 토큰이 유효하지 않습니다.</td><td valign="top">User Access Token is invalid.</td><td valign="top">401 - Unauthorized</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidAuthorizationParam</td><td valign="top">Authorization Param의 값이 유효하지 않습니다.</td><td valign="top">Authorization param is invalid.</td><td valign="top">400 - Bad Request</td><td valign="top">Common</td><td valign="top"><ul><li>code</li><li>Invalid code</li></ul></td></tr><tr><td valign="top">MethodNotAllowed</td><td valign="top">지원하지 않는 HTTP Method 입니다.</td><td valign="top">HTTP method not supported.</td><td valign="top">405 - Method Not Allowed</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidContentType</td><td valign="top">잘못된 Content Type 입니다.</td><td valign="top">The request content-type is invalid.</td><td valign="top">415 - Unsupported Media Type</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">UserNotExist</td><td valign="top">회원 정보가 존재하지 않습니다. </td><td valign="top">User does not exist.</td><td valign="top">404 - Not Found</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidUser</td><td valign="top">회원 정보가 유효하지 않습니다.</td><td valign="top">User information is not valid.</td><td valign="top">409 - Conflict</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">UnsupportedResponseType</td><td valign="top"><br></td><td valign="top">Unsupported response types: [field1]</td><td valign="top">400 - Bad Request</td><td valign="top">Common</td><td valign="top"><br></td></tr><tr><td valign="top">WrongApproach</td><td valign="top"><br></td><td valign="top">The wrong approach.</td><td valign="top">403 - Forbidden</td><td valign="top">Common</td><td valign="top"><br></td></tr></tbody></table>

<br>

#### **4.1.2** Standard Error Response

In the case of an error response, the predefined code and message from the standard response codes are returned.

**Example**

| <p>HTTP/1.1 400 Bad Request<br>Content-type: application/json;charset=UTF-8<br>{<br>    "error" : {<br>        "code" : "NoSuchData",<br>        "message" : "The requested data could not be found."<br>    }<br>}</p> |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

#### **4.1.3 client\_id와 client\_secret**

The client\_id and client\_secret values can be found in "Developer Center > Application > App Detail > Common Info > Settings for Licensing".<br>

#### **4.1.4** User Access Token and Refresh Token Issuance Criteria

The ONE store User Access Token is issued based on the Client ID (Game/App) and the ONE store user’s Membership ID.&#x20;

* grant\_type : authorization\_code
  * Since this involves explicit user login, a new token is issued even if the existing token is still valid.
  * user\_access\_token, refresh\_token
    * If valid (user\_access\_token, refresh\_token) already exist, the existing values are returned.
    * If no valid (user\_access\_token, refresh\_token) exist, new tokens are issued.<br>
* grant\_type : refresh\_token
  * refresh\_token
    * If no valid refresh\_token exists, an error response is returned.
    * If a valid refresh\_token exists, the expiration period is extended (reset to the default 35 days).
  * user\_access\_token
    * If a valid user\_access\_token exists, the existing value is returned.
    * If no valid user\_access\_token exists, a new one is issued.
* When a token is deleted, both refresh\_token and user\_access\_token are deleted together.

<br>

### 4.2 ONE store Login Authentication Request <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-4.2onestore" id="id-greater-than-apiv7-greater-than-15.-greater-than-4.2onestore"></a>

**\[ API Spec. ]**

<table data-header-hidden><thead><tr><th width="229.5555419921875"></th><th></th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Protocol</strong></td><td>HTTPS</td><td></td><td></td></tr><tr><td><strong>Content-Type</strong></td><td>application/x-www-form-urlencoded</td><td></td><td></td></tr><tr><td><strong>Method</strong></td><td>GET/POST</td><td></td><td></td></tr><tr><td><strong>Response Format</strong></td><td>URL Redirect</td><td></td><td></td></tr><tr><td><strong>Path</strong></td><td><p>Production</p><p> - <a href="https://accounts.onestore.net/oauth2.0/authorize">https://accounts.onestore.net/oauth2.0/authorize</a></p><p>Development</p><p> - <a href="https://qa-accounts.onestore.co.net/oauth2.0/authorize">https://qa-accounts.onestore.co.net/oauth2.0/authorize</a></p></td><td></td><td></td></tr><tr><td><strong>Description</strong></td><td><p>Login Page When Using ONE store OAuth</p><p>Error Codes Reference: <a href="#response-code">Standard Response Codes</a></p></td><td></td><td></td></tr></tbody></table>

**\[ Request ]**

**Parameter**

<table data-header-hidden><thead><tr><th valign="top"></th><th width="100.3333740234375" valign="top"></th><th valign="top"></th><th width="109" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Parameter Name</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Description</strong></td><td valign="top"><strong>Required</strong></td><td valign="top"><strong>Remarks</strong></td></tr><tr><td valign="top">response_type</td><td valign="top">String</td><td valign="top">The internal identifier for the authentication process must be sent as <strong>'code'</strong>.</td><td valign="top">Y</td><td valign="top"><ul><li>code</li></ul></td></tr><tr><td valign="top">client_id</td><td valign="top">String</td><td valign="top">OAuth Client Id</td><td valign="top">Y</td><td valign="top">Use the Package Name of the Android OS Application.</td></tr><tr><td valign="top">redirect_uri</td><td valign="top">String</td><td valign="top">The value is URL-encoded and sent to the Callback URL registered during registration.</td><td valign="top">Y</td><td valign="top">UURL Encoding</td></tr><tr><td valign="top">state</td><td valign="top">String</td><td valign="top">To prevent cross-site request forgery  attacks, the URL-encoded value is used as a state token generated by the developer.</td><td valign="top">Y</td><td valign="top"><ul><li>URL Encoding</li><li>Generated and passed by the developer. ONE store returns the received value as is.</li></ul></td></tr><tr><td valign="top">scope</td><td valign="top">String</td><td valign="top">It serves as an internal identifier to handle the scope of access permissions.</td><td valign="top">Y</td><td valign="top"><ul><li>user_payment</li></ul></td></tr></tbody></table>

**Header**

<table data-header-hidden><thead><tr><th width="170.4444580078125" valign="top"></th><th width="114.7777099609375" valign="top"></th><th width="307.888916015625" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Parameter Name</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Description</strong></td><td valign="top"><strong>Required</strong></td></tr><tr><td valign="top">x-market-code</td><td valign="top">String</td><td valign="top"><p>Market Classification Code</p><ul><li>MKT_ONE: ONE store (South Korea)</li><li>MKT_GLB: ONE store (other than South Korea)</li></ul></td><td valign="top">Y</td></tr></tbody></table>

**Example**

| <https://accounts.onestore.net/oauth2.0/authorize?response_type=code&client_id=client_id_example&redirect_uri=http%3A%2F%2Fservice.redirect.url%2Fsubpath&state=hLiDdL2uhPtsftcU&scope=user_payment> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**\[ Response ]**

* When the ONE store Login Authentication Request API is called and the user is not logged in, they will be redirected to the login screen.
* After the user completes the login, if agreement to terms and information provision is required, they will be redirected to the corresponding screen.
* Once the login and consent process are completed, the code value and state value are sent as URL parameters to the callback URL.
* The code value is used for the User Access Token issuance request.\ <br>

<table data-header-hidden><thead><tr><th width="167.4444580078125" valign="top"></th><th width="108.111083984375" valign="top"></th><th></th><th></th></tr></thead><tbody><tr><td valign="top"><strong>Element Name</strong></td><td valign="top"><strong>Type</strong></td><td><strong>Description</strong></td><td>Remarks</td></tr><tr><td valign="top">code</td><td valign="top">String</td><td><p> - Authentication code returned upon successful login authentication</p><p> - Used for User Access Token issuance</p></td><td><ul><li>length : 50</li><li>Consists of uppercase and lowercase English letters and numbers</li><li>Expiration period: 5 minutes</li></ul></td></tr><tr><td valign="top">state<br></td><td valign="top">String</td><td>State token generated by the developer to prevent cross-site request forgery (CSRF) attacks</td><td><ul><li>URL encoding</li><li>Returns the exact value passed in the request</li></ul></td></tr><tr><td valign="top">error_code</td><td valign="top">String</td><td>Error code returned upon login authentication failure</td><td>Error codes reference: <a href="#response-code">Standard Response Codes</a></td></tr><tr><td valign="top">error_message</td><td valign="top">String</td><td>Error message returned upon login authentication failure</td><td><br></td></tr></tbody></table>

**Example**

| <p>After completing the authentication process:</p><ul><li><p><strong>If the API request is successful</strong>:</p><ul><li><http://CallbackURL?code={code_value}&#x26;state={state_value}></li></ul></li><li><p><strong>If the API request fails</strong>:</p><ul><li><http://CallbackURL?state={state_value}&#x26;error_code={error_code_value}&#x26;error_message={error_message}></li></ul></li></ul> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

Error Type Summary

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Code</strong></td><td valign="top"><strong>Response Method</strong></td><td valign="top"><strong>Occurrence Conditions</strong></td><td valign="top"><strong>Details (Message and Screen Content)</strong></td><td valign="top"><strong>Additional Explanation</strong></td></tr><tr><td valign="top">RequiredValueNotExist</td><td valign="top">PAGE</td><td valign="top">Missing Required Values<br>- response_type<br>- client_id<br>- state<br>- scope<br>- redirect_uri</td><td valign="top">Request parameters are required. [ {Missing Parameter} ]</td><td valign="top"><br></td></tr><tr><td valign="top">UnsupportedResponseType</td><td valign="top">REDIRECTION</td><td valign="top">Parameter Validity<br>- response_type ≠ code</td><td valign="top">{redirect_uri}?error_code=UnsupportedResponseType&#x26;error_message=Unsupported response types: [{response_type}]</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRequest</td><td valign="top">PAGE</td><td valign="top">Parameter Validity<br>- Unissued client_id</td><td valign="top">Request parameters are invalid. [ client_id ]</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRedirect</td><td valign="top">PAGE</td><td valign="top">Parameter Validity<br>- Unregistered redirect_uri</td><td valign="top">Invalid redirect</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidScope</td><td valign="top">REDIRECTION</td><td valign="top">Parameter Validity<br>- scope ≠ user_payment</td><td valign="top">{redirect_uri}?error_code=InvalidScope&#x26;error_message=Invalid scope</td><td valign="top">Occurs when an authentication request is made after access</td></tr><tr><td valign="top">WrongApproach</td><td valign="top">PAGE</td><td valign="top">Direct Access to Login URI</td><td valign="top">The wrong approach.</td><td valign="top">Direct access to /oauth2.0/login</td></tr></tbody></table>

<br>

### 4.3 ONE store User Access Token Issuance Request <a href="#id-greater-than-apiv7-greater-than-15.-greater-than-4.3onestoreuseraccesstoken" id="id-greater-than-apiv7-greater-than-15.-greater-than-4.3onestoreuseraccesstoken"></a>

**\[ API Spec. ]**

<table data-header-hidden><thead><tr><th width="217.33331298828125" valign="top"></th><th valign="top"></th><th data-hidden valign="top"></th><th data-hidden valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Protocol</strong></td><td valign="top">HTTPS</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top"><strong>Content-Type</strong></td><td valign="top">application/x-www-form-urlencoded</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top"><strong>Method</strong></td><td valign="top">POST</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top"><strong>Response Format</strong></td><td valign="top">application/json</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top"><strong>Path</strong></td><td valign="top"><p>Production</p><p> - <a href="https://accounts.onestore.net/oauth2.0/token">https://accounts.onestore.net/oauth2.0/token</a></p><p>Development</p><p> - <a href="https://accounts.onestore.net/oauth2.0/token">https://qa-accounts.onestore.net/oauth2.0/token</a></p></td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top"><strong>Description</strong></td><td valign="top"><ul><li>ONE store User Access Token Issuance</li><li>Error Codes Reference: <a href="#response-code">Standard Response Codes</a></li></ul></td><td valign="top"></td><td valign="top"></td></tr></tbody></table>

**\[ Request ]**

**Parameter**

<table data-header-hidden><thead><tr><th width="161" valign="top"></th><th width="113.77783203125" valign="top"></th><th valign="top"></th><th width="111.22216796875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Parameter Name</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Description</strong></td><td valign="top"><strong>Required</strong></td><td valign="top"><strong>Remarks</strong></td></tr><tr><td valign="top">grant_type</td><td valign="top">String</td><td valign="top">Classification value for the access token issuance method</td><td valign="top">Y</td><td valign="top"><ul><li>'authorization_code'</li><li>'refresh_token'</li><li>Other issuance methods are currently undecided</li></ul></td></tr><tr><td valign="top">client_id</td><td valign="top">String</td><td valign="top">OAuth Client Id</td><td valign="top">Y</td><td valign="top">Uses the Package Name of the Android OS Application</td></tr><tr><td valign="top">client_secret<br></td><td valign="top">String</td><td valign="top">OAuth Client Secret</td><td valign="top">Y</td><td valign="top">Uses the Client secret value issued by the ONE store Developer Center</td></tr><tr><td valign="top">code<br></td><td valign="top">String</td><td valign="top">Authentication code (code) received in response after successfully calling the login authentication request API<br></td><td valign="top">N</td><td valign="top">grant_type : Required value for authorization_code<br></td></tr><tr><td valign="top">refresh_token</td><td valign="top">String</td><td valign="top">Urefresh_token value issued together when obtaining the User Access Token</td><td valign="top">N</td><td valign="top">grant_type : Required value for refresh_token</td></tr><tr><td valign="top">state<br></td><td valign="top">String</td><td valign="top">To prevent cross-site request forgery  attacks, the URL-encoded value is used as a state token generated by the developer.<br></td><td valign="top">Y</td><td valign="top"><ul><li>URL encoding</li><li>Generated and passed by the developer. ONE store returns the received value as is.</li></ul></td></tr></tbody></table>

**Header**

<table data-header-hidden><thead><tr><th width="192.33331298828125" valign="top"></th><th width="138.111083984375" valign="top"></th><th valign="top"></th><th width="151.666748046875" valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Parameter Name</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Description</strong></td><td valign="top"><strong>Required</strong></td></tr><tr><td valign="top">x-market-code</td><td valign="top">String</td><td valign="top"><p>Market Classification Code</p><ul><li>MKT_ONE: ONE store (South Korea)</li><li>MKT_GLB: ONE store (other than South Korea)</li></ul></td><td valign="top">Y</td></tr></tbody></table>

**Example**

| <p>POST /oauth2.0/token HTTP/1.1 Host: <a href="http://accounts.onestore.net/">accounts.onestore.net</a> Content-Type: application/x-www-form-urlencoded x-market-code:MKT\_ONE</p><p>grant\_type : In the case of authorization\_code<br>grant\_type=authorization\_code&<br>code=EIc5bFrl4RibFls1&<br>client\_id=client\_id\_example&<br>client\_secret=hDBmMRhz7eJRsM9Z2q1oFBSe&<br>state=9kgsGTfH4j7IyAkg</p><p>grant\_type : In the case of refresh\_token<br>grant\_type=refresh\_token&<br>refresh\_token=EIc5bFrl4RibFls1&<br>client\_id=client\_id\_example&<br>client\_secret=hDBmMRhz7eJRsM9Z2q1oFBSe&<br>state=9kgsGTfH4j7IyAkg</p> |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**\[ Response ]**

<table data-header-hidden><thead><tr><th width="180.5555419921875" valign="top"></th><th width="101.4444580078125" valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Element Name</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Description</strong></td><td valign="top">Remarks</td></tr><tr><td valign="top">user_access_token<br></td><td valign="top">String</td><td valign="top">ONE store Access Token (User Access Token)</td><td valign="top"><ul><li>max length : 255</li><li>만료기한 10분</li></ul></td></tr><tr><td valign="top">refresh_token</td><td valign="top">String</td><td valign="top">Refresh Token for the User Access Token</td><td valign="top"><ul><li>max length : 255</li><li>기본 만료기한 35일, 사용 시 만료기한 연장(초기화)</li></ul></td></tr><tr><td valign="top">token_type</td><td valign="top">String</td><td valign="top">Bearer</td><td valign="top"><br></td></tr><tr><td valign="top">expires_in</td><td valign="top">integer</td><td valign="top">Expiration time of the Access Token (in seconds)</td><td valign="top"><br></td></tr><tr><td valign="top">state</td><td valign="top">String</td><td valign="top">State token generated by the developer to prevent cross-site request forgery attacks</td><td valign="top"><ul><li>URL Encoding</li><li>Returns the exact value passed in the request</li><li>Included only on success</li></ul></td></tr><tr><td valign="top">error {<br></td><td valign="top">Object</td><td valign="top">Included only when an error occurs</td><td valign="top">Error Codes Reference: <a href="#response-code">Standard Response Codes</a></td></tr><tr><td valign="top">code</td><td valign="top">String</td><td valign="top">Error Code</td><td valign="top"><br></td></tr><tr><td valign="top">message</td><td valign="top">String</td><td valign="top">Error Message</td><td valign="top"><br></td></tr><tr><td valign="top">}</td><td valign="top"><br></td><td valign="top"><br></td><td valign="top"><br></td></tr></tbody></table>

**Example**

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><p>// On Success</p><p>{</p><pre><code>  "user_access_token" : "f27d2c49-231d-4848-9e8c-ec9a1fef9c35",
  "refresh_token" : "1fe54c5f-60d1-4fbb-a412-929c84adab43",
  "token_type" : "Bearer",
  "expires_in" : 603389,
  "state" : "hLiDdL2uhPtsftcU"
}
</code></pre><p><br></p><p>// On Failure</p><p><code>{</code><br>    <code>"error" : {</code><br>        <code>"code" : "InvalidAuthorizationParam",</code><br>        <code>"message" : "Authorization param is invalid."</code><br>    <code>}</code><br><code>}</code></p></td></tr></tbody></table>

Error Type Summary

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Code</strong></td><td valign="top"><strong>Occurrence Conditions</strong></td><td valign="top"><strong>Details (JSON)</strong></td><td valign="top"><strong>Additional Explanation</strong></td></tr><tr><td valign="top">RequiredValueNotExist</td><td valign="top">Missing Required Values<br>- grant_type<br>- client_id<br>- client_secret<br>- code (Optional Required Values)<br>- refresh_token (Optional Required Values)<br>- state</td><td valign="top">{<br>    "error": {<br>        "code": "RequiredValueNotExist",<br>        "message": "Request parameters are required. ({Missing Parameter})"<br>    }<br>}</td><td valign="top"><p> - code: Required value when grant_type is authorization_code</p><p> - refresh_token: Required value when grant_type is refresh_token</p></td></tr><tr><td valign="top">InvalidRequest</td><td valign="top">Parameter Validity<br>- grant_type ≠ (authorization_code or refresh_token)</td><td valign="top">{<br>    "error": {<br>        "code": "InvalidRequest",<br>        "message": "Request parameters are invalid. [ grant_type ]"<br>    }<br>}</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidAuthorizationParam</td><td valign="top">Parameter Validity<br>- Unissued code</td><td valign="top">{<br>    "error": {<br>        "code": "InvalidAuthorizationParam",<br>        "message": "Authorization param is invalid."<br>    }<br>}</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRequest</td><td valign="top">Parameter Validity<br>- Unissued client_id</td><td valign="top">{<br>    "error": {<br>        "code": "InvalidRequest",<br>        "message": "Request parameters are invalid. [ client_id or client_secret ]"<br>    }<br>}</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRequest</td><td valign="top">Parameter Validity<br>- Unissued client_secret</td><td valign="top">{<br>    "error": {<br>        "code": "InvalidRequest",<br>        "message": "Request parameters are invalid. [ client_id or client_secret ]"<br>    }<br>}</td><td valign="top"><br></td></tr><tr><td valign="top">InvalidRefreshToken</td><td valign="top">Parameter Validity<br>- Unissued refresh_token</td><td valign="top">{<br>    "error": {<br>        "code": "InvalidRefreshToken",<br>        "message": "Invalid refresh token"<br>    }<br>}</td><td valign="top">grant_type : In the case of refresh_token</td></tr><tr><td valign="top">ExpiredRefreshToken</td><td valign="top">Parameter Validity<br>- Expired refresh_token</td><td valign="top">{<br>    "error": {<br>        "code": "ExpiredRefreshToken",<br>        "message": "Invalid refresh token (expired)"<br>    }<br>}</td><td valign="top">grant_type : In the case of refresh_token</td></tr></tbody></table>


---

# 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/eng/tools/billing/v21/web-payment/member.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.
