# Guide for Distribution to Countries and Regions Outside of South Korea

## ONE store Service Configuration

* Developers can sell their products in Korea and other countries/regions by registering their products once in the ONE Store Developer Center.
  * Developers who have already registered and are selling products on the existing Korean ONE Store only need to select distribution to additional countries and regions.
  * The ONE Store Developer Center automatically repackages the developer's registered app to create an APK for distribution outside Korea, and distributes it to ONE Store users.
* The ONE Store client and server are separately configured for Korea and other countries/regions.
  * When your app calls the IAP SDK APIs, it automatically connects to the appropriate ONE Store client/server based on the user's service country/region.
  * When calling IAP Server APIs from your developer server, you must include the market identification code (`x-market-code`).

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2Fb9hlVpETqvSrk1uJp9bz%2FOverview2.jpg?alt=media&#x26;token=62c9a501-c7b9-449b-b664-342cfef71c5b" alt=""><figcaption></figcaption></figure>

### ONE store Installer Infomation & Market Classification Code <a href="#id" id="id"></a>

<table><thead><tr><th width="166.33333333333331">Service Country/Region </th><th width="314">Installer Package Name</th><th>Market Classification Code</th></tr></thead><tbody><tr><td>South Korea</td><td><ul><li>com.skt.skaf.A000Z00040</li><li>com.kt.olleh.storefront</li><li>com.lguplus.appstore</li></ul></td><td>MKT_ONE</td></tr><tr><td>Others</td><td><ul><li>com.onestorecorp.gaa.storeapp</li><li>com.dti.folderlauncher</li></ul></td><td>MKT_GLB</td></tr></tbody></table>

## SDK

### SDK Version

* To distribute your app in regions other than Korea, ONE Store In-App Payment SDK V19 (API V6) or higher must be applied.
* If you are using SDK V17, you need to upgrade the SDK.
* If you are using SDK V16, you must register a new app with SDK V21 or higher applied.

{% hint style="warning" %}
Apps with security solutions for integrity checks are required to apply an updated SDK to resolve any conflicts with the security solution.&#x20;

* [SDK V21.02 guides](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/sdk)
  {% endhint %}

### ONE store Client Integration

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FVSQ1kWkE703yDjMqIrBr%2Fclient.jpg?alt=media&#x26;token=ff29d854-e700-4712-893f-b09505fa1ca3" alt=""><figcaption></figcaption></figure>

* The ONE Store in Korea and the ONE Store in regions other than Korea are provided as separate apps.
* Existing apps using ONE Store SDK V19 or higher can be directly distributed to regions other than Korea.

## &#x20;Market Classification Code&#x20;

* To identify the marketplace information (Korea or regions other than Korea) from which the user downloaded the app, you need to retrieve the market identification code.
* The acquired Market Classification Code should be included as a header when using the server API to verify the currently used store.
* How to Obtain Market Classification Code
  * v19 :[ https://onestore-dev.gitbook.io/dev/tools/tools/old-version/v19/undefined-3/classes/purchaseclient#purchaseclient-getstoreinfoasync](https://onestore-dev.gitbook.io/dev/tools/tools/old-version/v19/undefined-3/classes/purchaseclient#purchaseclient-getstoreinfoasync)
  * v21 :[ https://onestore-dev.gitbook.io/dev/tools/tools/v21/references/c-classes/c-purchaseclient#id-c-purchaseclient-getstoreinfoasync](https://onestore-dev.gitbook.io/dev/tools/tools/v21/references/c-classes/c-purchaseclient#id-c-purchaseclient-getstoreinfoasync)

### **Setting Developer Options for Store Selection**

you can designate the store app integrated with the SDK by setting the `android:value` of `onestore:dev_option` as follows:

```xml
<manifest>
    <application>
        <meta-data android:name="onestore:dev_option" android:value="onestore_01" />
    </application>
</manifest>
```

<table><thead><tr><th width="226">android:value</th><th>Target Countries and Regions</th></tr></thead><tbody><tr><td><code>onestore_00</code></td><td>South Korea <em>(default)</em></td></tr><tr><td><code>onestore_01</code></td><td>Singapore, Taiwan</td></tr><tr><td><code>onestore_02</code></td><td>United States</td></tr><tr><td><code>onestore_03</code></td><td>ONE Billing Lab</td></tr></tbody></table>

{% hint style="info" %}
**Version History**

* **v21.04.00** : Added ONE Billing Lab &#x20;
* **v21.02.00** : With `android:value`, you can set South Korea, Singapore/Taiwan, and the United States.&#x20;
* **v21.01.00** : With `android:value`, only global can be set, and only Singapore/Taiwan store apps can be specified.
  {% endhint %}

{% hint style="danger" %}
**Note:** Be sure to remove this option from the binary for distribution versions.
{% endhint %}

### **StoreEnvironment API Feature Addition**

The `StoreEnvironment.getStoreType()` API provides functionality to determine whether an application with the SDK has been installed via ONE Store.

#### **Store Type Definition**

The API returns a `StoreType` and has one of the following four values:

<table><thead><tr><th width="240">StoreType</th><th width="71">value</th><th>description</th></tr></thead><tbody><tr><td><code>StoreType.UNKNOWN</code></td><td>0</td><td>Unable to determine the app installation store (e.g., direct APK installation, unknown source).</td></tr><tr><td><code>StoreType.ONESTORE</code></td><td>1</td><td>Installed from ONE Store (or Developer Option is activated).</td></tr><tr><td><code>StoreType.VENDING</code></td><td>2</td><td>Installed from Google Play Store.</td></tr><tr><td><code>StoreType.ETC</code></td><td>3</td><td>Installed from a store other than ONE Store or Google Play.</td></tr></tbody></table>

#### **How to Use the API**

This API can be utilized by invoking `StoreEnvironment.getStoreType()`.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
import com.gaa.sdk.base.StoreEnvironment

val storeType = StoreEnvironment.getStoreType()

when (storeType) {
    StoreType.ONESTORE -> println("This app was installed from ONE Store.")
    StoreType.VENDING -> println("This app was installed from the Google Play Store.")
    StoreType.ETC -> println("This app was installed from a store other than ONE Store or Google Play.")
    StoreType.UNKNOWN -> println("The store information is unknown.")
}
```

{% endtab %}

{% tab title="Java" %}

```java
import com.gaa.sdk.base.StoreEnvironment;

int storeType = StoreEnvironment.getStoreType();

switch (storeType) {
    case StoreType.ONESTORE:
        System.out.println("ONE Store에서 설치된 앱입니다.");
        break;
    case StoreType.VENDING:
        System.out.println("Google Play Store에서 설치된 앱입니다.");
        break;
    case StoreType.ETC:
        System.out.println("기타 스토어에서 설치된 앱입니다.");
        break;
    case StoreType.UNKNOWN:
    default:
        System.out.println("스토어 정보를 알 수 없습니다.");
        break;
}
```

{% endtab %}
{% endtabs %}

#### **Store Determination Criteria**

This API determines the store through three methods:

* **Distributed via ONE Store market signature**\
  Determines if the app was installed from ONE Store by verifying distribution through ONE Store's market signature.
* **Based on Installer Package Name**\
  If not distributed via ONE Store's market signature, it uses the `PackageManager.getInstallerPackageName()` API to verify the store used during app installation.
* **When Developer Option (`onestore:dev_option`) is activated**\
  If `onestore:dev_option` is set, it always responds with `StoreType.ONESTORE`.

#### **Examples of Use Cases**

* **Applying UI Differentiation by Store**
  * If payment systems provided by ONE Store differ from those of other app markets, you can configure different UIs..

```kotlin
if (StoreEnvironment.getStoreType() == StoreType.ONESTORE) {
    showOneStorePaymentUI()
} else {
    showDefaultPaymentUI()
}
```

* **Restricting Features by Store**
  * You can set specific features to be available only on ONE Store.

```kotlin
if (StoreEnvironment.getStoreType() != StoreType.ONESTORE) {
    println("This feature is available only on ONE Store.")
    return
}
enableOneStoreExclusiveFeature()
```

## Server API&#x20;

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FDCdK5ONPj0EK9d5RfUm4%2FServer.jpg?alt=media&#x26;token=93fb61d3-3c9a-4ebe-b8c3-3b961db1cd6c" alt=""><figcaption></figcaption></figure>

### Domain

If you are servicing only in Korea, domain changes are required.

* **For services limited to Korea:** `https://apis.onestore.co.kr`
* **For services including regions other than Korea:** `https://iap-apis.onestore.net`

### Market Classification&#x20;

* The Market Classification Code (x-market-code) has been added to the request header.
* When servicing regions other than Korea, you must add the market identification code to the header when making requests.
* If the Market Classification Code is absent, it will be treated as an app for Korea.

\<Example>&#x20;

```
curl --location '{global domain}/v7/apps/com.sample/purchases/inapp/products/{productId}/{purchaseToken}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {accessToken}' \
--header 'x-market-code: {marketCode]'\
 

```

| Market Code | Service Country/Region |
| ----------- | ---------------------- |
| MKT\_ONE    | South Korea            |
| MKT\_GLB    | Others                 |

### PNS

* For PNS, the message sending addresses for Korea and regions other than Korea are different.&#x20;
* Hence, if a firewall is in place, two firewall exceptions are necessary for each sending address.

## 3rd Party Payment&#x20;

### Server API

* The 3rd party payment API version has been updated to V6. &#x20;
* If you are servicing regions other than Korea, domain changes are required.
  * **For services limited to Korea:** `https://apis.onestore.co.kr`
  * **For services including regions other than Korea:** `https://iap-apis.onestore.net`
* Country/region information and currency codes have been added to the Request Body of the purchase history transmission API for 3rd-party payments.
* When transmitting the 3rd-party payment transaction history, it should be sent with the amount in the currency in which the transaction was made.
* The 3rd party payment purchase history has been updated. (send3rdPartyPurchase-p1)
* When transmitting 3rd party payment purchase history that occurred in the United States, you must use the send3rdPartyPurchase-p1 specification.
* The existing specification can be used without modification in countries/regions other than the United States, but it is scheduled to be deprecated in June 2025, so please use the new specification.

### Settlement

* Service fees must be wired based on the country/region registered at the time of signing up for the ONE store Developer Center.
  * If the member's country/region is South Korea, the transfer must be made in Korean Won (KRW).\
    (However, for U.S. sales, the settlement must be remitted in USD to a separate account designated by the service provider in that country/region.)
  * If the member's country/region is other than South Korea, the transfer must be made in USD.\
    (However, for U.S. sales, the settlement must be remitted in USD to a separate account designated by the service provider in that country/region.)
* The exchange rate applied for calculating service fees is based on the exchange rate on the 1st day of the month following the sales month, as announced by Seoul Money Brokerage. (If the 1st day falls on a public holiday, the exchange rate of the previous business day will be applied.)

## Products&#x20;

### **Subscription Products**

* Subscription products are not offered in Singapore and Taiwan.
* Even if subscription products were previously registered, the products will not be distributed in Singapore and Taiwan.
* For information on setting distribution countries/regions, local pricing, and multilingual settings, please refer to [App Registration and Mgmt](https://onestore-dev.gitbook.io/dev/eng/docs/apps).&#x20;
