# Using In-App Purchases on the Web

## Overview

This document explains the integration method for using ONE store in-app purchases in a web environment.

## **Prerequisites**

### **Membership Authentication Integration**

To implement ONE store in-app purchases for Windows-based games/apps or PC/Mobile Web, membership authentication (login integration) is required.\
For detailed information, refer to the "[Membership Authentication](broken://pages/LuQpX9GXzuzkvrJagwvX)"

### **Firewall Policy Registration**

To enable `CallBackUrl` calls, it is mandatory to register firewall policies between ONE store's payment server and the developer's server. Developers intending to use `CallBackUrl` must provide their server's IP information in advance.

* Integration with port 80 or 443 of the developer's server is standard.
* Firewall policy registration requires at least one business day to complete.

## **Integration Architecture**

ONE store provides member-based services. Even in a web environment, user login is required for payment requests. After login, payments can be initiated.\
To avoid requiring users to log in repeatedly for each payment request, OAuth authentication is supported. All purchase/payment-related server APIs must use the OAuth Token (referred to as *User Access Token*) obtained during login.

## **Server APIs**

ONE store web server APIs must be called using the issued *User Access Token*. When making HTTP calls, include the access token in the header.

### Standard Response Codes

<table><thead><tr><th width="149">Code</th><th>message_kr</th><th>message_en</th><th>HTTP Status Code</th><th>대상API</th></tr></thead><tbody><tr><td>UserNotExist</td><td>회원 정보가 존재하지 않습니다. </td><td>User does not exist.</td><td>404 - Not Found</td><td>공통</td></tr><tr><td>UserAccessTokenExpired</td><td>User Access Token이 만료되었습니다.</td><td>User Access Token has expired.</td><td>401 - Unauthorized</td><td>공통</td></tr><tr><td>UnsupportedDevice</td><td>상품이 해당 단말을 지원하지 않습니다. </td><td>The product does not support the device.</td><td>400 - Bad Request</td><td>공통</td></tr><tr><td>UnauthorizedUserAccess</td><td>해당 API에 접근권한이 없습니다.</td><td>Not authorized to this API.</td><td>403 - Forbidden<br></td><td>공통</td></tr><tr><td>Success</td><td>정상처리 되었습니다.</td><td>The request has been successfully completed.</td><td>200 - Success</td><td>consume/acknowledge<br></td></tr><tr><td>ServiceMaintenance</td><td>서비스 점검중입니다.</td><td>System maintenance is in progress.</td><td>503 - Service Temporarily Unavailable</td><td>공통</td></tr><tr><td>ResourceNotFound</td><td>요청한 자원이 존재하지 않습니다.</td><td>The requested resource could not be found.</td><td>404 - Not Found</td><td>공통</td></tr><tr><td>RequiredValueNotExist</td><td>필수값이 존재하지 않습니다. [ field1, field2, ... ]</td><td>Request parameters are required. [ field1, field2, ... ]</td><td>400 - Bad Request</td><td>공통</td></tr><tr><td>ProductNotExist</td><td>상품 정보가 존재하지 않습니다.</td><td>The product does not exist.</td><td>404 - Not Found</td><td>공통</td></tr><tr><td>NotSupportMultipleQuantity </td><td>복수 구매 요청은 관리형 상품으로 제한합니다.</td><td>Only Managed products are eligible for repeated purchase requests.</td><td>400 - Bad Request</td><td>requestPurchase</td></tr><tr><td>NoSuchData</td><td>조회된 결과값이 존재하지 않습니다.</td><td>The requested data could not be found.</td><td>404 - Not Found</td><td>단건조회 API</td></tr><tr><td>MethodNotAllowed</td><td>지원하지 않는 HTTP Method 입니다.</td><td>HTTP method not supported.</td><td>405 - Method Not Allowed</td><td>공통</td></tr><tr><td>InvalidUserAccessToken</td><td>User Access Token이 유효하지 않습니다.</td><td>User Access Token is invalid.</td><td>401 - Unauthorized</td><td>공통</td></tr><tr><td>InvalidUser</td><td>회원 정보가 유효하지 않습니다.</td><td>User information is not valid.<br></td><td>409 - Conflict</td><td>공통</td></tr><tr><td>InvalidRequest</td><td>입력값이 유효하지 않습니다. [ field1, field2, ... ]</td><td>Request parameters are invalid. [ field1, field2, ... ]</td><td>400 - Bad Request</td><td>공통</td></tr><tr><td>InvalidPurchaseState</td><td>구매내역이 존재하지 않거나, 구매완료 상태가 아닙니다.</td><td>Purchase history does not exist or is not completed.</td><td>409 - Conflict</td><td>consume/acknowledge<br></td></tr><tr><td>InvalidProduct</td><td>상품 정보가 유효하지 않습니다.</td><td>The product is not valid.</td><td>409 - Conflict</td><td>공통</td></tr><tr><td>InvalidContentType</td><td>잘못된 Content Type 입니다.</td><td>The request content-type is invalid.</td><td>415 - Unsupported Media Type</td><td>공통</td></tr><tr><td>InvalidConsumeState</td><td>소비상태 변경이 불가하거나, 이미 변경완료 되었습니다.</td><td>The purchase consumption status cannot be changed or has already been changed.</td><td>409 - Conflict</td><td>consume</td></tr><tr><td>InvalidAuthorizationHeader</td><td>Authorization 헤더의 값이 유효하지 않습니다.</td><td>Authorization header is invalid.</td><td>400 - Bad Request</td><td>공통</td></tr><tr><td>InternalError</td><td>정의되지 않은 오류가 발생하였습니다.</td><td>An undefined error has occurred.</td><td>500 - Internal Server Error</td><td>공통</td></tr><tr><td>ExceedQuantityMultiplePurchase</td><td>구매 요청이 가능한 개수를 초과하였습니다. (최대 10개)</td><td>Your purchase request has exceeded the quantity available. (Max. 10 items)</td><td>400 - Bad Request</td><td>requestPurchase</td></tr><tr><td>ExceedAmountMultiplePurchase</td><td>구매 요청이 가능한 금액을 초과하였습니다. (최대 50만원)</td><td>Your purchase request has exceeded the amount available. (Max. ₩500,000)</td><td>400 - Bad Request</td><td>requestPurchase</td></tr><tr><td>DeveloperPayloadNotMatch</td><td>구매요청 시 전달된 developerPayload값과 일치하지 않습니다.</td><td>The request developerPayload does not match the value passed in the purchase request.</td><td>400 - Bad Request</td><td>consume/acknowledge</td></tr><tr><td>AlreadyPurchased</td><td>이미 상품을 보유하였거나 함께 구매할 수 없는 상품을 보유중입니다.</td><td>You already have the product or a product that cannot be purchased together.</td><td>409 - Conflict</td><td>requestPurchase</td></tr><tr><td>AccessBlocked</td><td>요청이 차단되었습니다.</td><td>The request was blocked.</td><td>403 - Forbidden</td><td>공통</td></tr></tbody></table>

#### Standard Error Response

In case of error responses, codes and messages defined in the standard response codes are delivered.

**Example**

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

#### Product Type Code

| **Code**     | **Name**                       | **Description**                                                             |
| ------------ | ------------------------------ | --------------------------------------------------------------------------- |
| inapp        | Consumable products            | products that can be consumed                                               |
| auto         | Monthly auto-renewal  products | Monthly automatic payment products                                          |
| subscription | Subscription-based products    | Subscription-based products                                                 |
| all          | All products                   | Consumable products + Monthly auto-renewal products + Subscription products |

### requestPurchase <a href="#id-2.-apiv7-4.2requestpurchase" id="id-2.-apiv7-4.2requestpurchase"></a>

#### **\[API Spec.]**&#x20;

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="121.5859375"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <a href="https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/{type}/products/{productId}/order">https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/{type}/products/{productId}/order</a></p><p>(Development) <a href="https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/{type}/products/{productId}/order">https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/{type}/products/{productId}/order</a></p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>requesting the purchase of a specific in-app product.</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

<table><thead><tr><th>Parameter Name</th><th width="128.93359375">Data Type</th><th width="176.60546875">Required</th><th width="236.91796875">Description</th></tr></thead><tbody><tr><td>clientId</td><td>String</td><td>Y</td><td>The client ID of the app </td></tr><tr><td>type</td><td>String</td><td>Y</td><td><ul><li>The in-app product type code for the purchase request.</li><li>Refer to Product Type Code</li></ul></td></tr><tr><td>productId</td><td>String</td><td>Y</td><td>The in-app product ID for which the purchase is requested.</td></tr></tbody></table>

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

| Element Name     | Data Type | Data Size   | Required | Description                                                                                                                  |
| ---------------- | --------- | ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| prchsClientPocCd | String    | 50          | Y        | <p>Purchase Request Client Classification Code:<br>POC\_PC : PC Payment<br>POC\_MOBILE : Mobile Payment</p>                  |
| returnUrl        | String    | 200         | Y        | Redirect URL for Receiving Payment Results                                                                                   |
| callbackUrl      | String    | 200         | N        | REST API URL for Receiving Payment Results (Only for the Final Payment Result)                                               |
| productName      | String    | 50          | N        | In-App Product Name for Purchase Request (If not provided, the product name registered in the developer center will be used) |
| developerPayload | String    | 200         | N        | An identifier managed by the developer to identify the purchase transaction                                                  |
| quantity         | Integer   | <p><br></p> | N        | Quantity of the product to be purchased (Default: 1)                                                                         |

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/inapp/products/p5000/order
Host: pcapis.onestore.net Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB
 
{
    "prchsClientPocCd": "POC_PC",
    "returnUrl": "https://onestorecorp.com",
    "callbackUrl": "https://onestorecorp.com",
    "productName": "금화100개",
    "developerPayload" : "1jkl2j3lk1lj",
    "quantity": 2
}
```

#### **\[ Response ]**

| Element Name | Data Type | Data Size | Description                           |
| ------------ | --------- | --------- | ------------------------------------- |
| purchaseId   | String    | 20        | Purchase ID                           |
| paymentUrl   | String    | 200       | Payment Request URL Information       |
| paymentParam | String    | -         | Payment Request Parameter Information |

**Example**

```
성공 시

{
   "purchaseId": "200406083435101108801",
   "paymentUrl": "https://onestorecorp.com",
   "paymentParam": "ABCDEDIAGJAFERasdfwerewrlkjasjflsdafj42352ds"
}



// 실패 시

{
    "error" : {
        "code" : "AlreadyPurchased",
        "message" : "You already have the product or a product that cannot be purchased together."
    }
}
```

### getProductDetails <a href="#id-2.-apiv7-4.3getproductdetails" id="id-2.-apiv7-4.3getproductdetails"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="123.046875"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/products/{type}<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/products/{type}</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Returns detailed information about in-app products available for sale.</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                                                                                                        |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API                                                                               |
| type           | String    | Y        | <p></p><ul><li>The in-app product type code for the purchase request.</li><li>Refer to Product Type Code</li></ul> |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

| Element Name     | Data Type   | Data Size   | Required    | Description                                                                          |
| ---------------- | ----------- | ----------- | ----------- | ------------------------------------------------------------------------------------ |
| productIdList \[ | <p><br></p> | <p><br></p> | <p><br></p> | <p><br></p>                                                                          |
| <p><br></p>      | String      | 150         | Y           | The in-app product ID specified during product registration in the developer center. |
| ]                | <p><br></p> | <p><br></p> | <p><br></p> | <p><br></p>                                                                          |

**Example**

<pre><code>POST /pc/v7/apps/com.onestorecorp.com.test/products/inapp
Host: 
pcapis.onestore.net

Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB

{
    "productIdList": ["다이아100_20170818000000", "루비300_20170818000000"]
<strong>}
</strong></code></pre>

#### **\[ Response ]**

| Element Name         | Data Type   | Data Size   | Description                                                       |
| -------------------- | ----------- | ----------- | ----------------------------------------------------------------- |
| productDetailList \[ | <p><br></p> | -           | List of product details                                           |
| {                    | <p><br></p> | <p><br></p> | <p><br></p>                                                       |
| productId            | String      | 150         | In-app product ID for purchasable items                           |
| type                 | String      | 20          | <ul><li>Product Type</li><li>Refer to Product Type Code</li></ul> |
| price                | String      | 30          | Product price                                                     |
| priceCurrencyCode    | String      | 10          | Currency denomination (e.g., KRW, USD)                            |
| title                | String      | -           | Product name                                                      |
| priceAmountMicros    | Long        | -           | Product price \* 1M                                               |
| }                    | <p><br></p> | <p><br></p> | <p><br></p>                                                       |
| ]                    | <p><br></p> | <p><br></p> | <p><br></p>                                                       |

**Example**

```
// 성공 시
{
    "productDetailList": [
        {
            "productId": "다이아100_20170818000000",
            "type": "inapp",
            "price": "1000",
            "priceCurrencyCode": "KRW",
            "title": "Sample Title",
            "priceAmountMicros": 1000000000
        },
        {
            "productId": "루비300_20170818000000",
            "type": "inapp",
            "price": "1000",
            "priceCurrencyCode": "KRW",
            "title": "Sample Title",
            "priceAmountMicros": 1000000000
        }
    ]
}
// 실패 시
{
    "error" : {
        "code" : "InvalidUserAccessToken",
        "message" : "Access token is invalid."
    }
}

```

### getPurchases <a href="#id-2.-apiv7-4.4getpurchases" id="id-2.-apiv7-4.4getpurchases"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="143.14453125"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) </p><p>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/{type}</p><p></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/{type}</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Returns a list of unconsumed purchases (including quantity). (Up to 100 items can be queried)</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                                                                                                        |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API                                                                               |
| type           | String    | Y        | <p></p><ul><li>The in-app product type code for the purchase request.</li><li>Refer to Product Type Code</li></ul> |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

| Parameter Name  | Data Type | Data Size | Required | Description                          |
| --------------- | --------- | --------- | -------- | ------------------------------------ |
| continuationKey | String    | 41        | N        | Next key for purchase history paging |

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/inapp
Host: pcapis.onestore.net Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB
 
{
    "continuationKey" : "a2fajklfsjkl2"
}
```

#### **\[ Response ]**

| Element Name             | Data Type         | Data Size   | Description                                                                                                                                                                   |
| ------------------------ | ----------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| productIdList \[         | <p><br></p>       | -           | XVjKVLbw7TIy                                                                                                                                                                  |
| <p><br></p>              | String            | 150         | In-app product ID specified during product registration in the developer center                                                                                               |
| ]                        | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| purchaseDetailList \[    | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| {                        | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| orderId                  | String            | 40          | Payment ID                                                                                                                                                                    |
| packageName              | String            | 128         | Package name                                                                                                                                                                  |
| productId                | <p>String<br></p> | 150         | In-app product ID specified during product registration in the developer center                                                                                               |
| purchaseTime             | Long              | -           | Purchase time                                                                                                                                                                 |
| acknowledgeState         | Int               | -           | Acknowledge state( 0: Not Acknowledged, 1: Acknowledged)                                                                                                                      |
| purchaseState            | Int               | -           | Purchase state                                                                                                                                                                |
| recurringState           | Int               | -           | <p>Automatic payment status</p><ul><li>0 : Normal subscription status</li><li>1 : Termination reserved status지예약 상태</li><li>-1 : Not a monthly subscription product</li></ul> |
| purchaseId               | String            | 20          | Purchase ID                                                                                                                                                                   |
| purchaseToken            | String            | 20          | Purchase token                                                                                                                                                                |
| developerPayload         | String            | 200         | An identifier managed by the developer to identify the purchase transaction                                                                                                   |
| quantity                 | Int               | <p><br></p> | Purchase quantity                                                                                                                                                             |
| }                        | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| ]                        | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| purchaseSignatureList \[ | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| <p><br></p>              | String            | -           | A signature for verifying each purchaseDetailList.                                                                                                                            |
| ]                        | <p><br></p>       | <p><br></p> | <p><br></p>                                                                                                                                                                   |
| continuationKey          | String            | 41          | Next key for purchase history paging                                                                                                                                          |

**Example**

```
// 성공 시
{
    "productIdList": ["다이아100_20170818000000", "루비300_20170818000000"],
    "purchaseDetailList": [
        {
            "orderId": "01239349082349823489342",
            "packageName": "com.onestore.sample",
            "productId": "다이아100_20170818000000",
            "purchaseTime": 1345678900000,
            "acknowledgeState": 1,
            "purchaseState": 0,
            "recurringState": -1,
            "purchaseId": "17070421461015116878",
            "purchaseToken": "17070421461015116878",
            "developerPayload": "E23DEFB029F84F4383ECB0E53B46B6A2",
            "quantity": 1
        },
        {
            "orderId": "01239349082349823489343",
            "packageName": "com.onestore.sample",
            "productId": "루비300_20170818000000",
            "purchaseTime": 1345678920000,
            "acknowledgeState": 0,
            "purchaseState": 0,
            "recurringState": -1,
            "purchaseId": "17070431461610116878",
            "purchaseToken": "17070421461015116878",
            "developerPayload": "T_RPAY_27_201707120110880",
            "quantity": 2
        }
    ],
    "purchaseSignatureList": ["sign1", "sign2"],
    "continuationKey" : "continuationKey"
}
 
// 실패 시
{
    "error" : {
        "code" : "InvalidUserAccessToken",
        "message" : "Access token is invalid."
    }
}
```

### consumePurchase <a href="#id-2.-apiv7-4.5consumepurchase" id="id-2.-apiv7-4.5consumepurchase"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="129.44921875"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/inapp/{purchaseToken}/consume<br><br>(Development) <br>https://sbpp.onestore.co.kr/pc/v7/apps/{clientId}/purchases/inapp/{purchaseToken}/consume</td></tr><tr><td><strong>Description</strong></td><td><ul><li>Changes the state of the purchased managed in-app product to consumed. (Only applicable to consumable products.)</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

| Parameter Name   | Data Type | Data Size | Required | Description                                                                 |
| ---------------- | --------- | --------- | -------- | --------------------------------------------------------------------------- |
| developerPayload | String    | 200       | N        | An identifier managed by the developer to identify the purchase transaction |

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/inapp/200406083435101108801/consume
Host: http://pcapis.onestore.net
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB

{
"developerPayload" : "1jkl2j3lk1lj"
}
```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing)    |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
/// 성공 시

{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}



// 실패 시

{
    "error" : {
        "code" : "AlreadyPurchased",
        "message" : "You already have the product or a product that cannot be purchased together."
    }
}
```

### acknowledgePurchase

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="125.921875"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/all/{purchaseToken}/acknowledge<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/all/{purchaseToken}/acknowledge</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Changes the purchased in-app product to the purchase confirmation status. (Supported for both consumable and subscription products.)</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter     | Data Type | Required | Description                          |
| ------------- | --------- | -------- | ------------------------------------ |
| clientId      | String    | Y        | Client ID of the App Calling the API |
| purchaseToken | String    | Y        | The purchase token                   |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

| Element Name     | Data Type | Data Size | Required | Description                                                                 |
| ---------------- | --------- | --------- | -------- | --------------------------------------------------------------------------- |
| developerPayload | String    | 200       | N        | An identifier managed by the developer to identify the purchase transaction |

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/inapp/200406083435101108801/acknowledge
Host: pcapis.onestore.net
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB

{
"developerPayload" : "1jkl2j3lk1lj"
}
```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing))   |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
// 성공 시

{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}



// 실패 시

{
    "error" : {
        "code" : "AlreadyPurchased",
        "message" : "You already have the product or a product that cannot be purchased together."
    }
}
```

### cancelRecurringPurchase <a href="#id-2.-apiv7-4.7cancelrecurringpurchase" id="id-2.-apiv7-4.7cancelrecurringpurchase"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="121.58984375"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/auto/{purchaseToken}/cancel<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/auto/{purchaseToken}/cancel</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Reserve cancellation of the next automatic payment for the monthly subscription (automatic payment) product.</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

N/A

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/auto/200406083435101108801/cancel
Host: pcapis.onestore.net
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB

{
}
```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing)    |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
// 성공 시

{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}



// 실패 시

{
    "error" : {
        "code" : "NoSuchData",
        "message" : "The requested data could not be found."
    }
}
```

### reactivateRecurringPurchase <a href="#id-2.-apiv7-4.8reactivaterecurringpurchase" id="id-2.-apiv7-4.8reactivaterecurringpurchase"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="126.37890625"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/auto/{purchaseToken}/reactivate<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/auto/{purchaseToken}/reactivate</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Cancel the existing cancellation reservation (termination reservation) for the monthly subscription (automatic payment) product to ensure that the next automatic payment proceeds normally.</li><li>This API functions correctly only when the status of the requested monthly subscription (automatic payment) product is in the cancellation reservation state.</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

N/A

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/auto/200406083435101108801/reactivate
Host: pcapis.onestore.net
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB

{
}
```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing)    |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
// 성공 시

{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}



// 실패 시

{
    "error" : {
        "code" : "NoSuchData",
        "message" : "The requested data could not be found."
    }
}
```

### cancelSubscription <a href="#id-2.-apiv7-4.9cancelsubscription" id="id-2.-apiv7-4.9cancelsubscription"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="127.9375"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}/cancel<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}/cancel</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Cancel the next automatic payment for the subscription product (cancellation reservation).</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

N/A

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/subscription/200406083435101108801/cancel
Host: pcapis.onestore.net
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB
 
{  
}
```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing)    |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
// 성공 시
{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}
 
 
// 실패 시
{
    "error" : {
        "code" : "NoSuchData",
        "message" : "The requested data could not be found."
    }
}
```

### reactivateSubscription <a href="#id-2.-apiv7-4.10reactivatesubscription" id="id-2.-apiv7-4.10reactivatesubscription"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="129.203125"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}/reactivate<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}/reactivate</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Cancel the next automatic payment for the subscription product (cancellation reservation).</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/subscription/200406083435101108801/reactivate
Host: pcapis.onestore.net 
Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB
 
{
}

```

#### **\[ Response ]**

| Element Name | Data Type   | Data Size   | Description                              |
| ------------ | ----------- | ----------- | ---------------------------------------- |
| result       | Object      | <p><br></p> | <p><br></p>                              |
| {            | <p><br></p> | <p><br></p> | <p><br></p>                              |
| code         | String      | 50          | Response Code (Successful Processing)    |
| message      | String      | 300         | Response Message (Successful Processing) |
| }            | <p><br></p> | <p><br></p> | <p><br></p>                              |

**Example**

```
// 성공 시
{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    }
}
 
 
// 실패 시
{
    "error" : {
        "code" : "NoSuchData",
        "message" : "The requested data could not be found."
    }
}
```

### getSubscriptionDetail <a href="#id-2.-apiv7-4.11getsubscriptiondetail" id="id-2.-apiv7-4.11getsubscriptiondetail"></a>

#### **\[ API Spec. ]**

| **Protocol**     | HTTPS            | **Method**          | POST             |
| ---------------- | ---------------- | ------------------- | ---------------- |
| **Content-Type** | application/json | **Response Format** | application/json |

<table data-header-hidden><thead><tr><th width="128.640625"></th><th></th></tr></thead><tbody><tr><td><strong>Path</strong></td><td><p>(Commercial) <br>https://pcapis.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}<br></p><p>(Development) <br>https://sbpp.onestore.net/pc/v7/apps/{clientId}/purchases/subscription/{purchaseToken}</p></td></tr><tr><td><strong>Description</strong></td><td><ul><li>Search for detailed information about the subscription.</li><li>Error Code: Refer to the standard response codes</li></ul></td></tr></tbody></table>

#### **\[ Request ]**

**Path Parameter**

| Parameter Name | Data Type | Required | Description                          |
| -------------- | --------- | -------- | ------------------------------------ |
| clientId       | String    | Y        | Client ID of the App Calling the API |
| purchaseToken  | String    | Y        | Purchase token                       |

**Header**

| Parameter Name | Data Type | Required | Description                                                                                                         |
| -------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Authorization  | String    | Y        | User Access Token obtained through the User Access Token issuance API                                               |
| x-market-code  | String    | N        | <p>Market classification code</p><ul><li>MKT\_ONE:   South Korea</li><li>MKT\_GLB: other than South Korea</li></ul> |

**Body**

**Example**

```
POST /pc/v7/apps/com.onestorecorp.test/purchases/subscription/200406083435101108801
Host: pcapis.onestore.net Content-Type: application/json
Authorization: Bearer 680b3512-1253-5642-1263-8adjbf651nb
x-market-code: MKT_GLB
 
{
}
```

#### **\[ Response ]**

<table><thead><tr><th width="149">Element Name</th><th></th><th></th><th>Data Type</th><th>Description</th></tr></thead><tbody><tr><td>result {</td><td></td><td></td><td>Object</td><td>API Call Result(Normal) - Response in Case of Normal</td></tr><tr><td></td><td>code</td><td></td><td>String</td><td>Response Code</td></tr><tr><td></td><td>message</td><td></td><td>String</td><td>Response Message</td></tr><tr><td>}</td><td><br></td><td><br></td><td></td><td></td></tr><tr><td>error {</td><td></td><td></td><td>Object</td><td>API Call Result(Error) - Response in Case of Error</td></tr><tr><td></td><td>code</td><td></td><td>String</td><td>Response Code</td></tr><tr><td></td><td>message</td><td></td><td>String</td><td>Response Message</td></tr><tr><td>}</td><td><br></td><td><br></td><td></td><td></td></tr><tr><td>subscription {</td><td></td><td><br></td><td>Object</td><td></td></tr><tr><td><br></td><td>productId</td><td></td><td>String</td><td>Custom product ID</td></tr><tr><td><br></td><td>productName</td><td></td><td>String</td><td>Product name</td></tr><tr><td><br></td><td>parentProductId</td><td></td><td>String</td><td>Parent product ID</td></tr><tr><td><br></td><td>parentProductName</td><td></td><td>String</td><td>Parent product name</td></tr><tr><td><br></td><td>packageName</td><td></td><td>String</td><td>Package name</td></tr><tr><td><br></td><td>productAmount</td><td></td><td>String</td><td>Product amount</td></tr><tr><td><br></td><td>productAmountMicros</td><td></td><td>Long</td><td>Product amount x 1M</td></tr><tr><td><br></td><td>priceCurrencyCode<br></td><td></td><td>String</td><td>Currency denomination (e.g., KRW, USD)</td></tr><tr><td><br></td><td>imagePath</td><td></td><td>String</td><td>Product image path</td></tr><tr><td><br></td><td>periodUnit</td><td></td><td>String</td><td>Usage period unit</td></tr><tr><td><br></td><td>period</td><td></td><td>Integer</td><td>Usage period</td></tr><tr><td><br></td><td>purchaseToken</td><td></td><td>String</td><td>Purchase token</td></tr><tr><td><br></td><td>status</td><td></td><td>String</td><td>Subscription status code Code</td></tr><tr><td><br></td><td>startDate</td><td></td><td>Long</td><td>Subscription start time (millis)</td></tr><tr><td><br></td><td>expiryDate</td><td></td><td>Long</td><td>Subscription expiration time (millis)</td></tr><tr><td><br></td><td>paymentAmount</td><td></td><td>String</td><td>Previous payment amount</td></tr><tr><td><br></td><td>paymentAmountMicros</td><td></td><td>Long</td><td>Previous payment amount x 1M</td></tr><tr><td><br></td><td>nextPaymentAmount</td><td></td><td>String</td><td>Next payment amount</td></tr><tr><td><br></td><td>nextPaymentAmountMicros</td><td></td><td>Long</td><td>Next payment amount x 1M</td></tr><tr><td><br></td><td>nextPaymentDate</td><td></td><td>Long</td><td>Next payment time (millis)</td></tr><tr><td><br></td><td>pauseAllow</td><td></td><td>String</td><td>Pause availability (Y/N - default)</td></tr><tr><td><br></td><td>pauseStartDate</td><td></td><td>Long</td><td>Pause start time (millis) - Only provided if in pause reservation/pause status</td></tr><tr><td><br></td><td>pauseEndDate</td><td></td><td>Long</td><td>Pause end time (millis) - Only provided if in pause reservation/pause status</td></tr><tr><td><br></td><td>promotionAmount</td><td></td><td>String</td><td>Promotion product amount</td></tr><tr><td><br></td><td>promotionAmountMicros</td><td></td><td>Long</td><td>Promotion product amount x 1M</td></tr><tr><td><br></td><td>promotionPeriod</td><td></td><td>Integer</td><td>Promotion usage period</td></tr><tr><td><br></td><td>priceChanges [</td><td></td><td>Array</td><td>Price change information list</td></tr><tr><td><br></td><td>{</td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td>priceChangeSeq</td><td>Integer</td><td>Price change sequence</td></tr><tr><td><br></td><td><br></td><td>priceChangeApplyStartDate</td><td>Long</td><td>Price change effective start time</td></tr><tr><td><br></td><td><br></td><td>priceChangePreviousAmount</td><td>String</td><td>Previous price before price change</td></tr><tr><td><br></td><td><br></td><td>priceChangePreviousAmountMicros</td><td>Long</td><td>Previous price before price change x 1M</td></tr><tr><td><br></td><td><br></td><td>priceChangeAmount</td><td>String</td><td>Price change amount</td></tr><tr><td><br></td><td><br></td><td>priceChangeAmountMicros</td><td>Long</td><td>Price change amount x 1M</td></tr><tr><td><br></td><td><br></td><td>priceChangeAgreement</td><td>String</td><td>Price change agreement</td></tr><tr><td><br></td><td><br></td><td>priceChangeAgreementDueDate</td><td>Long</td><td><p></p><p>Price change agreement expiration time</p><p>(Policy supplementary explanation)</p><ul><li>Value = Price change date + 7 + 30 days</li><li>Users can agree until the first automatic payment point after the agreement expiration date.</li></ul></td></tr><tr><td><br></td><td>}]</td><td><br></td><td><br></td><td><br></td></tr><tr><td>}</td><td><br></td><td><br></td><td></td><td></td></tr></tbody></table>

<br>

**Example**

```
// 성공 시
{
    "result" : {
        "code" : "Success",
        "message" : "Request has been completed successfully."
    },
    "subscription" : {
        "productId" : "다이아100_20170818000000",
        "productName" : "다이아100",
        "productAmount" : "2000",
        "productAmountMicros" : 2000000000,
        "priceCurrencyCode" : "KRW",
        "imagePath" : "https://xxx.png",
        "periodUnit" : "MONTH",
        "period" : 1,
        "purchaseToken" : "17070421461015116878",
        "status" : "SUBSCRIBING"
        "parentProductId" : "03904729375",
        "parentProductName" : "모상품명",
        "packageName" : "com.test.game",
        "startDate" : 1345578920000,
        "expiryDate" : 1345678920000,
        "startPaymentDate" : 1345578920000,
        "paymentAmount" : "1000",
        "paymentAmountMicros" : 1000000000,
        "nextPaymentAmount" : "1500",
        "nextPaymentAmountMicros" : 1500000000,
        "nextPaymentDate" : 1345678920000,
        "pauseAllow": "Y",
        "pauseStartDate" : 1625670000000,
        "pauseEndDate" : 1628840000000,
        "promotionAmount" : "1000",
        "promotionAmountMicros" : 1000000000,
        "promotionPeriod" : 1,
        "priceChanges" : [{
            "priceChangeSeq": 1,
            "priceChangeApplyStartDate": 1345678920000,
            "priceChangePreviousAmount" : "2000",
            "priceChangePreviousAmountMicros" : 2000000000,            
            "priceChangeAmount" : "2500",
            "priceChangeAmountMicros" : 2500000000,
            "priceChangeAgreement" : "N",
            "priceChangeAgreementDueDate": 1345678920000
        }]
    }
}
 
 
// 실패 시
{
    "error" : {
        "code" : "NoSuchData",
        "message" : "The requested data could not be found."
    }
}
```

## Payment <a href="#onestoreglobalwebserviceintegrationspecification-7.payment" id="onestoreglobalwebserviceintegrationspecification-7.payment"></a>

### Payment Request <a href="#onestoreglobalwebserviceintegrationspecification-7.1paymentrequest" id="onestoreglobalwebserviceintegrationspecification-7.1paymentrequest"></a>

Request a ONE Store payment. Pass the paymentParam to the paymentUrl provided in the response of requestPurchase.&#x20;

Upon success, the ONE Store standard payment screen will be displayed.

#### **\[ Call Spec. ]**

| **Protocol**     | HTTPS      | **Method** | POST       |
| ---------------- | ---------- | ---------- | ---------- |
| **Content-Type** | text/plain | **Accept** | text/plain |

<table data-header-hidden><thead><tr><th width="140.15625"></th><th></th></tr></thead><tbody><tr><td>URL Path</td><td>paymentUrl</td></tr><tr><td>Description</td><td>Calling the Standard Payment Screen for PC</td></tr></tbody></table>

**Parameter**

| Parameter Name | Data Size | Required | Description                                                                |
| -------------- | --------- | -------- | -------------------------------------------------------------------------- |
| paymentParam   | 500       | M        | Payment Request Data (Parameters for invoking the standard payment screen) |

#### Browser Size when Requesting Payment <a href="#onestoreglobalwebserviceintegrationspecification-7.1.1browsersizewhenrequestingpayment" id="onestoreglobalwebserviceintegrationspecification-7.1.1browsersizewhenrequestingpayment"></a>

The optimal browser size for the ONE Store standard payment screen is width=400, height=580.&#x20;

If the browser is created with a different size than 400 X 580, ONE Store cannot guarantee the correct display and functionality of the payment screen.

Below is an example of calling the ONE Store payment screen in a new browser window.

{% code overflow="wrap" %}

```
window.open('paymentUrl','pp01','width=400, height=580, left='+((window.screen.width / 2) - (400 / 2))+', top='+((window.screen.height / 2) - (580 / 2))+' status=no, menubar=no, toolbar=no, sizable=no');
```

{% endcode %}

### Payment Response <a href="#onestoreglobalwebserviceintegrationspecification-7.2paymentresponse" id="onestoreglobalwebserviceintegrationspecification-7.2paymentresponse"></a>

This section delivers the payment results from the standard payment screen to the developer.

#### **\[ Call Spec. ]**

| Signature Algorithm | SHA512 with RSA |
| ------------------- | --------------- |

| **Protocol**     | HTTP/HTTPS                                                                                | **Method** | POST                           |
| ---------------- | ----------------------------------------------------------------------------------------- | ---------- | ------------------------------ |
| **Content-Type** | <p>returnUrl : Application/x-www-form-urlencode<br><br>callbackUrl : Application/json</p> | **Accept** | callbackUrl : Application/json |

<table><thead><tr><th width="150.8984375"></th><th>SHA512 with RSA</th></tr></thead><tbody><tr><td>URL Path</td><td>returnUrl, callbackUrl</td></tr><tr><td>Description</td><td><p>The developer provides the returnUrl (Redirect Page) and callbackUrl (REST API) to deliver the payment results. Both methods use identical Parameter Elements, with returnUrl being submitted in the form data format and callbackUrl being delivered in JSON format.</p><p>·   However, callbackUrl data is only sent for the final payment result when actual integration with the payment gateway (PG) occurs.</p></td></tr></tbody></table>

**Parameter**

<table><thead><tr><th width="162.39453125">Element Name</th><th width="86.5">Data Type</th><th width="84.94921875">Data Size</th><th width="72.03515625">Required</th><th>Description</th></tr></thead><tbody><tr><td>responseCode</td><td>String</td><td>20</td><td>Y</td><td>Response Code (Refer to the table below)</td></tr><tr><td>responseMessage</td><td>String</td><td>200</td><td>N</td><td>Empty Value when payment is successful</td></tr><tr><td>orderId</td><td>String</td><td>20</td><td>N</td><td>Payment ID</td></tr><tr><td>purchaseId</td><td>String</td><td>20</td><td>N</td><td>Purchase ID</td></tr><tr><td>purchaseToken</td><td>String</td><td>20</td><td>N</td><td>Purchase token</td></tr><tr><td>purchaseTime</td><td>Long</td><td>13</td><td>N</td><td>Purchase Time (millis)</td></tr><tr><td>developerPayload</td><td>String</td><td>200</td><td>N</td><td>An identifier managed by the developer to identify the purchase transaction</td></tr><tr><td>quantity</td><td>Long</td><td>5</td><td>N</td><td>Quantity for multiple purchases</td></tr><tr><td>purchaseSignature</td><td>String</td><td>2000</td><td>N</td><td><p></p><p>Signature for purchase information verification</p><ul><li><p>For single purchases: </p><ul><li>(orderId+purchaseId+purchaseToken+purchaseTime+developerPayload)</li></ul></li><li><p>For multiple purchases:</p><ul><li>(orderId+purchaseId+purchaseToken+purchaseTime+developerPayload+quantity)</li></ul></li></ul></td></tr><tr><td>billingKey<br></td><td>String</td><td>200</td><td>N</td><td>Billing key for S2S automatic payment approval</td></tr></tbody></table>

**Example(returnUrl)**

```
<form name="paymentResultForm" action="{returnUrl}" method="post">

<input type="hidden" name="responseCode" value="Success">
<input type="hidden" name="responseMessage" value="">
<input type="hidden" name="orderId" value="20200429OS01123456789">
<input type="hidden" name="purchaseId" value="20042912345678901234">
<input type="hidden" name="purchaseToken" value="20042912345678905678">
<input type="hidden" name="purchaseTime" value=5615474165165>
<input type="hidden" name="developerPayload" value="pd2020042912354987321">
<input type="hidden" name="quantity" value=3>
<input type="hidden" name="purchaseSignature" value="DB98B5CB92126B1D52E86FED4C6E4AC9E29ADAF356057DB98B5CB92126B1D5......">
<input type="hidden" name="billingKey" value="36FED4C6E4AC9E29ADAF356057DB98B5CB92126B1D52E87577....">

</form>

```

**Example(callbackUrl)**

```
{
  "responseCode" : "Success",
  "responseMessage" : "",
  "orderId" : "20200429OS01123456789",
  "purchaseId" : "20042912345678901234",
  "purchaseToken" : "20042912345678905678",
  "purchaseTime" : 5615474165165,
  "developerPayload" : "pd2020042912354987321",
  "quantity" : 3
  "purchaseSignature" : "DB98B5CB92126B1D52E86FED4C6E4AC9E29ADAF356057DB98B5CB92126B1D5......",
  "billingKey" : "36FED4C6E4AC9E29ADAF356057DB98B5CB92126B1D52E87577...."
}
```

**Response Code**&#x20;

| Response Code      | Response Message           | Description                                                     |
| ------------------ | -------------------------- | --------------------------------------------------------------- |
| Success            | Empty Value                | Payment Success                                                 |
| Fail               | Refer to Description       | Provides the cause of each PG company and internal system error |
| UserCancel         | Payment has been canceled. | <p><br></p>                                                     |
| PaymentTimeExpired | Payment time has exceeded  | <p><br></p>                                                     |


---

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