Programming Guide


Samsung In-App Purchase

Samsung In-App Purchase (IAP) allows third-party applications to sell in-app items and internally manages communication with supporting IAP services and the Samsung ecosystem (such as Samsung Account, Samsung Checkout, Samsung Rewards).
You can concentrate on integrating Helper API calls and IAP Server API calls into your app.

IAP offers a SDK and Server APIs :

  • IAP Helper class, IapHelper and Helper APIs enable you to easily integrate IAP functionality into your app, such as configuring IAP, getting item details, offering and selling items, and managing purchased items.

  • IAP Server APIs enable you to communicate with IAP server to verify item purchases, create a service token, and check subscription status.


By integrating IAP features, your apps can sell three types of in-app items:
 
Type Description
Item Consumable App users can use items only one time (e.g., coins, special powers, gems).
Items can be repurchased, but only after the app reports them as consumed by calling consumePurchaseItems().

Note: Items can be reported as consumed before or after the app user uses the items.
Non-Consumable App users can use items any number of times (e.g., e-books, game boards).
Items cannot be repurchased.

Note: During IAP integration testing:
If your application sets to OPERATION_MODE_TEST mode, the purchase record is initialized every 10 minutes to allow repurchase.
Subscription App users can access items (such as magazines, e-zines, newspapers) any number of times during a free trial or while their paid subscriptions are active.

Item purchase is either free (optional free trial), at a discount price (optional lower-tier price), or at a regular price (required regular-tier price).
Free trial periods are optional and occur before paid subscription periods from 7 to 999 days.

For paid subscription periods:
  • Can be weekly, monthly, every 3 months, every 6 months , or annually.
  • App users are billed at the start of each period.
  • After one period ends, the next period starts automatically, until the app user cancels their subscription (at any time during free trials or paid subscriptions).
  • Pricing can be non-tiered (all subscriptions are at the same regular price).
  • For IAP 6.0 and higher, pricing can be two-tiered:
    Lower-tier pricing is optional and can recur up to 100 periods before regular periods start.
    Regular-tier pricing is required and recurs indefinitely until the app user cancels their subscription.
App users can cancel at any time after purchase during a free-trial period, or a lower-tier or regular-tier subscription period.
App user can repurchase items after cancellation.

Note: During IAP integration testing:
If your application sets to OPERATION_MODE_TEST mode, the subscription cycle is automatically renewed every 10 minutes and the subscription is automatically canceled after 12 renewals.

Integrate IAP Helper into Your App

To prepare for integrating IAP features and testing the integration, perform the following.

1. Create a project with unique package name

Create a project in Android Studio with a package name that is different from the app registered in other app stores.

Caution

If package names are not different, app update malfunctions and problems with marketing and promotional support may occur.

2. Add Permissions to AndroidManifest.xml

Add these permissions to AndroidManifest.xml:

  • com.samsung.android.iap.permission.BILLING to connect to IAP and enable in-app item registration in Seller Portal.
  • android.permission.INTERNET because IAP uses the internet.
    <uses-permission android:name="com.samsung.android.iap.permission.BILLING"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    

3. Register an app and in-app items in Seller Portal

During IAP integration, you may need to test IAP features.
Samsung IAP needs information about your app and in-app items registered in Seller Portal.

With the com.samsung.android.iap.permission.BILLING permission added to your app’s AndroidManifest.xml file, you can register an incomplete app and one or more in-app items.

Note

Your app does not need to have IAP features integrated in order to register the app and its in-app items.
As IAP integration proceeds, you can upload new versions of your app and new in-app items as needed.

To register an app and its in-app items

  1. 1.

    Sign in to Seller Portal (https://seller.samsungapps.com) using your Samsung account.

  2. 2.

    Click Add New Application

  3. 3.

    Click Android, select the default language, and click Next.

    Note

    After entering information in each tab, click Save.

  4. 4.

    In the Binary tab, upload your app APK.

  5. 5.

    In the App Information tab, enter fundamental app details.

  6. 6.

    In the Country / Region & Price tab,
    specify a free or paid app, a paid app price, and countries to sell your items.

  7. 7.

    In the In App Purchase tab, register one or more in-app items:

  • Click Add Item

  • Enter in-app item information.

  • Click Save.

  • Verify the item is listed

Note

Don't click Submit Beta Test or Submit in this step.

For more app registration details, see the App Registration Guide.

For more in-app item registration details, see the Item Registration Guide.

4. Download IAP 6.0 Helper and Sample Apps

Download the IAP SDK from the Samsung Developer site (https://developer.samsung.com/iap)

The zipped file contains the SDK and sample projects that uses the IapHelper:

Location Module Description
./Libs IAP6Helper IAP v6.0 SDK
./Samples IAP6Sample Sample java app using IAP v6.0 SDK
./Samples IAP6SampleKotlin Sample kotlin app using IAP v6.0 SDK
Note

IAP v6.0 is supported since Android API 18 or higher. It does not work properly in lower versions.

5. Add the IAP Helper to your app
  1. 1.

    Click File → New → Import module.

  2. 2.

    Select the IAP6Helper folder from the Source Directory, and click Finish.

  3. 3.

    From Project Explorer, click Open Module Settings or press F4 → Dependencies tab.

  4. 4.

    Select your app module, and click + → Module Dependency from Declared Dependencies.

  5. 5.

    Select the IAP6Helper module, and click OK.


IAP Configuration and In-App Item Processing

Your app code can follow the logic flow below to support your in-app items.

The scope of each IAP Helper API is straightforward and most integrations follow a similar logic flow, which is linear with a few branches.

After item purchases, IAP Server APIs are typically called to verify purchases.

 
Note

Purchased consumable items not reported as consumed cannot be repurchased.

 
Caution

Even if the user has completed payment for the item purchase, the item might not be available to user because of a battery or network problem. Make sure you call getOwnedList() whenever launching the application to check if there are consumable items that are not reported as consumed, and if so, consume them immediately by calling consumePurchaseItems(). Then, the user can repurchase the items.


IAP Helper Programming

1. Instantiate Samsung In-App Purchase

Before your app can make IAP requests, it must call getInstance() to create a singleton instance of IapHelper.

  • Request

        public static IapHelper getInstance( Context _context )
        
    • Parameters

      Parameter Type Description
      _context Context Required Android Context
    • Return Value

      IapHelper
       

  • Code snippet

    • JAVA

          private IapHelper iapHelper = IapHelper.getInstance(context);
          
    • KOTLIN

          private val iapHelper: IapHelper = IapHelper.getInstance(context)
          

2. Set the IAP Operation Mode

IAP supports three operational modes.

One is for enabling billing for item purchases, and the other two is for testing IAP functions without billing app users for item purchases.

If setOperationMode() is not called, OPERATION_MODE_PRODUCTION is set by default (testing is not supported, but beta release and normal publication are supported).  

 
Caution

Caution: Ensure the operation mode is set to OPERATION_MODE_PRODUCTION before submitting for Beta test or normal publication.
In other words, OPERATION_MODE_TEST or OPERATION_MODE_TEST_FAILURE must be set only if the app status in Seller Portal is Registering or Updating.

Mode

Description

OPERATION_MODE_PRODUCTION startPayment() requests are processed as specified, financial transactions do occur for successful requests, and actual results are returned (successful or failed).

Note: All other IAP Helper requests work like :
  • The app gets in-app items information of the app whose status in Seller Portal is For sale.
  • Only items purchased in OPERATION_MODE_PRODUCTION mode are considered owned items.
OPERATION_MODE_TEST startPayment() requests are processed as specified, except financial transactions do not occur (app users are not billed for item purchases), and successful results are always returned.
For details of the payment window shown in OPERATION_MODE_TEST mode, see below.

Note: All other IAP Helper requests work like :
  • The app gets in-app items information of the app whose status in Seller Portal is Registering or Updating.
  • Only items purchased in OPERATION_MODE_TEST mode are considered owned items.
OPERATION_MODE_TEST_FAILURE All IAP Helper requests fail.
It is meant to be a negative testing to ensure that your app can handle errors such as improper input and user actions.

You can review the status of your app in Seller Portal Applications page.

 
Note

Depending on the operational mode of the app and the status in Seller Portal, the database referenced by IAP Helper requests differs as follows:



 
Note

If OPERATION_MODE_TEST is set, the pop-up below is displayed and Sandbox is shown at the top right of the payment window to indicate that the app user will not be billed for item purchases.

  • Request

        public void setOperationMode( OperationMode _mode )
        
    • Parameters

      Parameter Type

      Description

      _mode OperationMode Required The IAP operating mode that controls the processing of IAP Helper API requests:
      OPERATION_MODE_PRODUCTION
      OPERATION_MODE_TEST
      OPERATION_MODE_TEST_FAILURE
  • Code snippet

    • JAVA

          iapHelper.setOperationMode(HelperDefine.OperationMode.OPERATION_MODE_TEST);
          
    • KOTLIN

          iapHelper.setOperationMode(HelperDefine.OperationMode.OPERATION_MODE_TEST)
          

3. Get User-Owned items

getOwnedList() returns a list of in-app items that the app user currently has from previous purchases:

  • Consumable items that have not yet been used and not yet reported as consumed
  • Non-consumable items
  • Subscription items currently in a free trial or an active subscription period

getOwnedList() also returns item data and processing results specified by the OnGetOwnedListListener interface.

 
Note

Purchased consumable items must be reported as consumed by calling consumePurchaseItems() to be purchased again, which can be done before or after the app user uses the item in the app.
We recommend reporting all listed consumable items that have not been reported as consumed in one consumePurchasedItem() method call in order to avoid system overload or malfunction.

 
Caution

Even if the user has completed payment for the item purchase, the item might not be available to user because of a battery or network problem. Make sure you call getOwnedList() whenever launching the application to check if there are consumable items that are not reported as consumed, and if so, consume them immediately by calling consumePurchaseItems().

  • Request

        public boolean getOwnedList
        (   
            String                        _productType,
            OnGetOwnedListListener        _onGetOwnedListListener
        )
        
    • Parameters

      Parameter Type

      Description

      _productType String Required Type of in-app items to be returned:
      "item" Both consumable and non-consumable items
      "subscription" Auto-recurring subscription items
      "all" Consumable, non-consumable and auto-recurring subscription
      _onGetOwnedListListener OnGetOwnedListListener Required Name of the OnGetOwnedListListener interface that specifies the item data and processing results to be returned
    • Return Value

      true The request was sent to server successfully and the result will be sent to OnGetOwnedListListener interface listener.

      false The request was not sent to server and was not processed.
       

  • Response

        void onGetOwnedProducts 
        ( 
            ErrorVo                      _errorVO, 
            ArrayList<OwnedProductVo>    _ownedList
        )
        
    • Parameters

      Parameter Type

      Description

      _errorVO ErrorVo Processed request result
      _ownedList ArrayList<OwnedProductVo> Object that contains in-app items owned by the app user
      • ErrorVo

        Getter Return Type

        Description

        getErrorCode() int Response code
        For details, see Response Code
        getErrorString() String Error message
        getExtraString() String Additional information about the result
        isShowDialog() boolean true The error message dialog is displayed after a failed process.
        false The error message dialog is not displayed after a failed process.
      • OwnedProductVo

        Getter Return Type

        Description

        getItemId() String Unique ID of the in-app item
        getItemName() String Title of the in-app item
        getItemPrice() Double Current local price in the local currency of the in-app item (e.g., 7.99)
        getItemPriceString() String Local currency symbol and price (in the local currency format):
        • Currency symbol + price (e.g., £7.99)
        • Price + currency symbol (e.g., 66815₫)
        getCurrencyUnit() String Symbol of the local currency (e.g., €, £, or $)
        getCurrencyCode() String Currency code (3 characters) of the local currency (e.g., EUR, GBP, USD)
        getItemDesc() String Description of the in-app item
        getType() String Type of in-app item:
        "item" Consumable or Non-consumable
        "subscription" Auto-recurring subscription
        getIsConsumable() boolean Whether or not the in-app item is consumable:
        true Consumable in-app item
        false Not a consumable in-app item (Non-consumable item or auto-recurring subscription)

        Caution: If true, the consumable item has not been reported as consumed. Before it can be repurchased, it must be reported, by calling consumePurchaseItems()
        getPaymentId() String Unique identifier assigned by Samsung IAP to the confirmed payment of the in-app item
        getPurchaseId() String Unique identifier assigned by Samsung IAP to the purchase transaction of the in-app item
        getPurchaseDate() String Date and time of the item purchase and payment transaction
        (YYYY-MM-DD HH:mm:ss)
        getSubscriptionEndDate() String For subscription in-app items only, the date and time that the item's current subscription period expires
        (YYYY-MM-DD HH:mm:ss)
        getPassThroughParam() String Unique identifier that your app assigned to the item purchase and payment transaction
        If a pass-through parameter was not assigned, empty string ("") is returned.
        getJsonString() String Full JSON payload
  • Code snippet

    • JAVA

          public class OwnedList implements OnGetOwnedListListener {
              IapHelper.getOwnedList(IapHelper.PRODUCT_TYPE_ALL, this);
          
              @Override
              public void onGetOwnedProducts(ErrorVo _errorVo, ArrayList<OwnedProductVo> _ownedList) {
                  if (_errorVo != null) {
                      if (_errorVo.getErrorCode() == IapHelper.IAP_ERROR_NONE) {
                          if (_ownedList != null) {
                              for (OwnedProductVo item : _ownedList) {
                                  if (item.getIsConsumable()) {
                                      // TODO: Consume the consumable item not yet consumed
                                  }
                              }
                          }
                      } else {
                          // TODO: Handle the error
                      }
                  }
              }
          }
          
    • KOTLIN

          iapHelper.getOwnedList(IapHelper.PRODUCT_TYPE_ALL)
          { _errorVo: ErrorVo?, _ownedList: ArrayList<OwnedProductVo>? ->
              if (_errorVo != null) {
                  if (_errorVo.errorCode == IapHelper.IAP_ERROR_NONE) {
                      if (_ownedList != null) {
                          for (item in _ownedList) {
                              if (item.isConsumable) {
                                  // TODO: Consume the consumable item not yet consumed
                              }
                          }
                      }
                  } else {
                      // TODO: Handle the error
                  }
              }
          }
          

4. Get In-App Item Details

getProductsDetails() returns information for one, more, or all in-app items registered to the app.
Returns item data and processing results specified by the OnGetProductsDetailsListener interface.

  • Request

        public void getProductsDetails
        (   
            String                           _productIds,
            OnGetProductsDetailsListener     _onGetProductsDetailsListener
        )
        
        
    • Parameters

      Parameter Type

      Description

      _productIds String Required One or more in-app item IDs specified by either:
      • Empty string ("") that designates all in-app items or
      • One or more unique in-app item ID values, comma delimited (for example, "coins,blocks,lives")

      You can get the IDs from Seller Portal (Applications page > Click status of the app > In App Purchase tab > Item ID).
      _onGetProductsDetailsListener OnGetProductsDetailsListener Required Name of the OnGetProductDetailsListener interface that specifies the item data and processing results to be returned
  • Response

        void onGetProducts( ErrorVo _errorVo, ArrayList<ProductVo> _productList )
        
    • Parameters

      Parameter Type

      Description

      _errorVO ErrorVo Processed request result
      _productList ArrayList<ProductVo> Object that contains details of in-app items
      • ErrorVo

        Getter Return Type

        Description

        getErrorCode() int Response code
        For details, see Response Code
        getErrorString() String Error message
        getExtraString() String Additional information about the result
        isShowDialog() boolean true The error message dialog is displayed after a failed process.
        false The error message dialog is not displayed after a failed process.
      • ProductVo

        Getter Return Type

        Description

        getItemId() String Unique ID of the in-app item
        getItemName() String Title of the in-app item
        getItemPrice() Double Current local price in the local currency of the in-app item (e.g., 7.99)
        getItemPriceString() String Local currency symbol and price (in the local currency format):
        • Currency symbol + price (e.g., £7.99)
        • Price + currency symbol (e.g., 66815₫)
        getCurrencyUnit() String Symbol of the local currency (e.g., €, £, or $)
        getCurrencyCode() String Currency code (3 characters) of the local currency (e.g., EUR, GBP, USD)
        getItemDesc() String Description of the in-app item
        getType() String Type of in-app item:
        "item" Consumable or Non-consumable
        "subscription" Auto-recurring subscription
        getIsConsumable() boolean Whether or not the in-app item is consumable:
        true Consumable in-app item
        false Not a consumable in-app item (Non-consumable item or auto-recurring subscription)
        getSubscriptionDurationUnit() String For subscription in-app items only, the time basis unit of each subscription period ("YEAR", "MONTH", "WEEK").

        Note: The units must be uppercase.
        getSubscriptionDurationMultiplier() String For subscription items only, the numeric multiple of the time basis unit that determines the item's subscription time period (for example, 1YEAR, 2MONTH, 4WEEK)

        The multiplier is combined with the value returned by getSubscriptionDurationUnit().
        getTieredSubscriptionYN() String For subscription items only, whether or not the item has two-tiered pricing:
        "Y" The item has one or more lower-price subscription periods followed by regular-price periods
        "N" The item only has regular-price subscription periods
        getTieredPrice() String For two-tiered subscription items only, the lower-tier price in local currency (e.g., 7.99)
        getTieredPriceString() String For two-tiered subscription items only, the local currency symbol and price (in the local currency format):
        • Currency symbol + price (e.g., £7.99)
        • Price + currency symbol (e.g., 66815₫)
        getTieredSubscriptionDurationUnit() String For two-tiered subscription items only, the time basis unit of each subscription period ("YEAR", "MONTH", "WEEK").

        Note: The units must be uppercase.
        getTieredSubscriptionDurationMultiplier() String For two-tiered subscription items only, the numeric multiple of the time basis unit that determines the item's subscription time period (for example, 1YEAR, 2MONTH, 4WEEK)

        The multiplier is combined with the value returned by getTieredSubscriptionDurationUnit().
        getTieredSubscriptionCount() String If the item has both lower and regular tier subscription prices, the number of lower-tier subscription periods.
        getShowStartDate() String Start date and time that the item will be available for purchase (YYYY-MM-DD HH:mm:ss)
        getShowEndDate() String End date and time after which the item will not be available for purchase (YYYY-MM-DD HH:mm:ss)
        getItemImageUrl() String URL of the item's image and thumbnail
        getItemDownloadUrl() String URL to download the item
        getFreeTrialPeriod() String Duration of the item's pre-subscription free trial period (in days) : 7 to 999 days
        getJsonString() String Full JSON payload
  • Code snippet

    • JAVA

          public class ProductsDetails implements OnGetProductsDetailsListener {
              IapHelper.getProductsDetails("Nuclear, Claymore, SpeedUp", this);
          
              @Override
              public void onGetProducts(ErrorVo _errorVo, ArrayList<ProductVo> _productList) {
                  if (_errorVo != null) {
                      if (_errorVo.getErrorCode() == IapHelper.IAP_ERROR_NONE) {
                          if (_productList != null) {
                              for (ProductVo item : _productList) {
                          // TODO: Get details of the item
                              }
                          }
                      } else {
                          // TODO: Handle the error
                      }
                  }
              }
          }
          
    • KOTLIN

          iapHelper.getProductsDetails("Nuclear, Claymore, SpeedUp")
          { _errorVo: ErrorVo?, _productList: ArrayList<ProductVo>? ->
              if (_errorVo != null) {
                  if (_errorVo.errorCode == IapHelper.IAP_ERROR_NONE) {
                      if (_productList != null) {
                          for (item in _productList) {
                              // TODO: Get details of the item
                          }
                      }
                  } else {
                      // TODO: Handle the error
                  }
              }
          }
          
          

5. Purchase an In-App Item

startPayment() initiates the purchase and payment transaction of the specified in-app item and can notify the end user whether the purchase succeeded or failed.

Returns the item data and transaction results and data specified in the OnPaymentListener interface.

You can specify a passThroughParam parameter value to enhance purchase security. During purchases with passThroughParam values created and passed by an IAP-integrated application are returned in the responses.  

 
Caution

When the IAP operating mode is OPERATION_MODE_PRODUCTION and the app is being distributed in the Galaxy Store, successful processing results in financial transactions (the app user will be billed for item purchases).

  • Request

        public boolean startPayment
        (
            String                  _itemId,
            String                  _passThroughParam,
            boolean                 _showSuccessDialog,
            OnPaymentListener       _onPaymentListener
        )
        
    • Parameters

      Parameter Type

      Description

      _itemId String Required Unique identifier value of the in-app item to be purchased
      _passThroughParam String Optional Unique identifier (maximum: 255 bytes) assigned by your Android app to the purchase and payment transaction.

      When specified, the value will be returned by OnPaymentListener interface and the IAP Server API call getPurchaseReceipt().
      When not specified, "" or null will be returned.
      _showSuccessDialog boolean Required After successful purchase and payment transactions, whether or not to display a dialog box that notifies the end user:
      true Display the dialog box.
      false Do not display the dialog box.
      _onPaymentListener OnPaymentListener Required Name of the OnPaymentListener interface that specifies the purchase and payment transaction data, item data, and processing results to be returned
    • Return Value

      true The request was sent to server successfully and the result will be sent to OnPaymentListener interface listener.
      false The request was not sent to server and was not processed.

 
  • Response

        void onPayment( ErrorVo _errorVO, PurchaseVo _purchaseVO )
        
    • Parameters

      Parameter Type

      Description

      _errorVO ErrorVo Processed request result
      _purchaseVO PurchaseVo Object that contains the purchase results
      • ErrorVo

        Getter Return Type

        Description

        getErrorCode() int Response code
        For details, see Response Code
        getErrorString() String Error message
        getExtraString() String Additional information about the result
        isShowDialog() boolean true The error message dialog is displayed after a failed process.
        false The error message dialog is not displayed after a failed process.
      • PurchaseVo

        Getter Return Type

        Description

        getItemId() String Unique ID of the in-app item
        getItemName() String Title of the in-app item
        getItemPrice() Double Current local price in the local currency of the in-app item (e.g., 7.99)
        getItemPriceString() String Local currency symbol and price (in the local currency format):
        • Currency symbol + price (e.g., £7.99)
        • Price + currency symbol (e.g., 66815₫)
        getCurrencyUnit() String Symbol of the local currency (e.g., €, £, or $)
        getCurrencyCode() String Currency code (3 characters) of the local currency (e.g., EUR, GBP, USD)
        getItemDesc() String Description of the in-app item
        getType() String Type of in-app item:
        "item" Consumable or Non-consumable
        "subscription" Auto-recurring subscription
        getIsConsumable() boolean Whether or not the in-app item is consumable:
        true Consumable in-app item
        false Not a consumable in-app item (Non-consumable item or auto-recurring subscription)

        Note: We recommend that after verifying the purchase of a consumable in-app item be reported as consumed by calling consumePurchaseItems().
        getPaymentId() String Unique identifier assigned by Samsung IAP to the payment transaction of the in-app item
        getPurchaseId() String Unique identifier assigned by Samsung IAP to the purchase transaction of the in-app item
        getPurchaseDate() String Date and time of the item purchase
        (YYYY-MM-DD HH:mm:ss)
        getVerifyUrl() String Deprecated since IAP 6.0
        See Verify a purchase to get the IAP server URL to verify the purchase using the purchase ID returned by getPurchaseId()
        getPassThroughParam() String Unique identifier that your app assigned to the item purchase and payment transaction
        If a pass-through parameter was not assigned, empty string ("") is returned.
        getItemImageUrl() String URL of the item’s image and thumbnail
        getItemDownloadUrl() String URL to download the item
        getOrderId() String Unique identifier of the order
        getJsonString() String Full JSON payload
  • Code snippet

    • JAVA

          public class PurchaseItem implements OnPaymentListener {    
              IapHelper.startPayment("Nuclear", "pLKjLKjLJL87=76df56rf+4f5", true, this);
            
              @Override
              public void onPayment(ErrorVo _errorVo, PurchaseVo _purchaseVO) {
                    if (_errorVo != null) {
                      if (_errorVo.getErrorCode() == IapHelper.IAP_ERROR_NONE) {
                          if (_purchaseVO != null) {
                              String passThroughParam = _purchaseVo.getPassThroughParam();
                              // TODO: If you have set a PassThroughParameter in the request,  
                              //       you can verify the PassThroughParameter here.
          
                              if (_purchaseVo.getIsConsumable()) {
                                  String purchaseId = _purchaseVo.getPurchaseId();
                                  // TODO: Consume the consumable item by calling `consumePurchasedItems()`
                              }
                          }
                      } else {
                          // TODO: Handle the error
                      }
                  }
              }
          }
          
    • KOTLIN

          iapHelper.startPayment("Nuclear", "pLKjLKjLJL87=76df56rf+4f5", true)
          { _errorVo: ErrorVo?, _purchaseVO: PurchaseVo? ->
              if (_errorVo != null) {
                  if (_errorVo.errorCode == IapHelper.IAP_ERROR_NONE) {
                      if (_purchaseVO != null) {
                          val passThroughParam: String = _purchaseVO.passThroughParam
                          // TODO: If you have set a PassThroughParameter in the request,  
                          //       you can verify the PassThroughParameter here.
          
                          if (_purchaseVO.isConsumable) {
                              val purchaseId: String = _purchaseVO.purchaseId
                              // TODO: Consume the consumable item by calling `consumePurchasedItems()`
                          }
                      }
                  } else {
                      // TODO: Handle the error
                  }
              }
          }
          
Note

When you try to purchase an item in your app, below windows will be shown.

If your Samsung account is not signed in, sign in is required first.

6. Acknowledge a Purchased Consumable Item

consumePurchasedItems() reports one or more purchased consumable items as consumed, which makes the items available for another purchase. The app user may or may not have used the items.
Returns item data and processing results specified by the OnConsumePurchasedItemsListener interface.

Note

We recommend reporting purchased consumable items immediately after verifying their purchase, and reporting all unreported items in one consumePurchasedItem() method call in order to avoid system overload or malfuction.

  • Request

        public boolean consumePurchasedItems
        (
            String                             _purchaseIds,
            OnConsumePurchasedItemsListener    _onConsumePurchasedItemsListener
        )
        
    • Parameters

      Parameter Type

      Description

      _purchaseIds String Required One or more unique identifier values (comma delimited) of the purchase and payment transactions of consumable in-app items that are to be reported as consumed
      _onConsumePurchasedItemsListener OnConsumePurchasedItemsListener Required Name of the OnConsumePurchasedItemsListener interface that specifies the item data and processing results to be returned
    • Return Value

      true The request was sent to server successfully and the result will be sent to OnConsumePurchasedItemsListener interface listener.

      false The request was not sent to server and was not processed.

 
  • Response

        void onConsumePurchasedItems ( ErrorVo _errorVo, ArrayList<ConsumeVo> _consumeList );
        
    • Parameters

      Parameter Type

      Description

      _errorVO ErrorVo Processed request result
      _consumeList ArrayList<ConsumeVo> List of consumed items

      Note: Even if some items fail to consume due to unexpected errors,
      they are included in the _consumeList,
      and the result of each item can be checked
      with ConsumeVo.getStatusCode().
      • ErrorVo

        Getter Return Type

        Description

        getErrorCode() int Response code
        For details, see Response Code
        getErrorString() String Error message
        getExtraString() String Additional information about the result
        isShowDialog() boolean true The error message dialog is displayed after a failed process.
        false The error message dialog is not displayed after a failed process.
      • ConsumeVo

        Getter Return Type

        Description

        getPurchaseId() String Unique identifier assigned by Samsung IAP to the purchase transaction of the in-app item
        getStatusCode() int Status code
        0 : Success
        1 : Invalid purchaseID
        2 : Failed order
        3 : Non-consumable item
        4 : Already consumed
        5 : Unauthorized user
        9 : Unexpected service error
        getStatusString() String Status message
        0 : "success"
        1 : "Can't find order with this purchaseID."
        2 : "Can't consume this purchase because it's not successful order."
        3 : "This type of item is not consumable."
        4 : "This purchase has been consumed already."
        5 : "Can't consume this purchase because the user is not authorized to consume this order."
        9 : "service error"
        getJsonString() String Full JSON payload
  • Code snippet

    • JAVA

          public class ConsumeItems implements OnConsumePurchasedItemsListener {
              final String PURCHASEID = "d215d9abcd17b12578a21c0ea7d8821747b64939732a3243b538d8bcae245590";
              IapHelper.consumePurchasedItems(PURCHASEID, this);
          
              @Override
              public void onConsumePurchasedItems(ErrorVo _errorVo, ArrayList<ConsumeVo> _consumeList) {
                  if (_errorVo != null) {
                      if (_errorVo.getErrorCode() == IapHelper.IAP_ERROR_NONE) {
                          if (_consumeList != null) {
                              for (ConsumeVo item : _consumeList) {
                                  // TODO: Get details of the consumption
                              }
                          }
                      } else {
                          // TODO: Handle the error
                      }
                  }
              }
          }
          
    • KOTLIN

          val PURCHASEID: String = "d215d9abcd17b12578a21c0ea7d8821747b64939732a3243b538d8bcae245590"
          iapHelper.consumePurchasedItems(PURCHASEID)
          { _errorVo: ErrorVo?, _consumeList: ArrayList<ConsumeVo>? ->
              if (_errorVo != null) {
                  if (_errorVo.errorCode == IapHelper.IAP_ERROR_NONE) {
                      if (_consumeList != null) {
                          for (item in _consumeList) {
                              // TODO: Get details of the consumption
                          }
                      }
                  } else {
                      // TODO: Handle the error
                  }
              }
          }
          

7. Response Code
Reponse Code Value

Description

IAP_ERROR_NONE 0 Success
IAP_PAYMENT_IS_CANCELED 1 Payment canceled
IAP_ERROR_INITIALIZATION -1000 Failure during IAP initialization
IAP_ERROR_NEED_APP_UPGRADE -1001 IAP upgrade is required
IAP_ERROR_COMMON -1002 Error while running IAP

Note: Details of possible errors :
  • 9000 : Occured when OPERATION_MODE_TEST_FAILURE is set
  • 9006 : PassThroughParam is not Base64-encoded
  • 9007 : PassThroughParam exceeded max length
  • 9010 : The item is not consumed yet
  • 9122 : Invalid MCC
  • 9132: Invalid token or User ID
  • 9200 : Service Error(Invalid MCC, MNC, or CSC)
  • 9440 : Device under honeycomb is not available
  • 9441 : Service is temporarily unavailable
  • 100001 : Request result does not return normally due to unexpected error
  • 100008 : Disagree Runtime Permission
  • 407002 : Blocked by security system
IAP_ERROR_ALREADY_PURCHASED -1003 Error when a non-consumable item is re-purchased or a subscription is re-purchased before its expiration date.
IAP_ERROR_WHILE_RUNNING -1004 Error when a payment request is made without any information.
IAP_ERROR_PRODUCT_DOES_NOT_EXIST -1005 Error when the requested item is not available

Note: Details of possible errors :
  • 9202 : Product does not exist.
IAP_ERROR_CONFIRM_INBOX -1006 Error when the app does not receive the purchase result after making a purchase request to the server.
In this case, confirmation the item that requested for purchase is needed because the purchase may have been completed successfully.
IAP_ERROR_ITEM_GROUP_DOES_NOT_EXIST -1007 Error when the item group ID does not exist.
IAP_ERROR_NETWORK_NOT_AVAILABLE -1008 Error when network is not available.
IAP_ERROR_IOEXCEPTION_ERROR -1009 IOException
IAP_ERROR_SOCKET_TIMEOUT -1010 SocketTimeoutException
IAP_ERROR_CONNECT_TIMEOUT -1011 ConnectTimeoutException
IAP_ERROR_NOT_EXIST_LOCAL_PRICE -1012 The item is not for sale in the country.

Note: Details of possible errors :
  • 9134 : Local price doesn't exist(Unsupported MCC)
IAP_ERROR_NOT_AVAILABLE_SHOP -1013 IAP is not serviced in the country.

Note: Details of possible errors :
  • 9259 : MCC is valid, but Galaxy Store is not supported
IAP_ERROR_NEED_SA_LOGIN -1014 Samsung account is not signed in.

Samsung IAP Server API

1. Verify a purchase

iap/v6/receipt enables your server and client app to verify that a specified in-app item purchase and payment transaction was successfully completed.

The API returns a JSON object with a successful status and details about a successful transaction
and the item or with a failure status.

This API can help to prevent malicious purchases and ensure that purchase and payment transactions were successful when the client app experiences network interruptions after an item purchase and payment transaction.

  • Request

        GET
        https://iap.samsungapps.com/iap/v6/receipt?purchaseID={purchaseID value}
        
    • Query Parameters

      Parameter Type Required

      Description

      purchaseID String Yes Required Unique identifier of the in-app item purchase transaction
      Note: The purchase ID is assigned by Samsung IAP. Your app receives it in the PurchaseVo object of the OnPaymentListener interface.
      Your app must send the ID to your server independently of Samsung IAP.
    • Example

          GET
          http://iap.samsungapps.com/iap/v6/receipt?purchaseID=7efef23271b0a48746a9d7c391e367c7a802980d391d7f9b75010e8138c66c36
          
  • Response

    Note

    Response parameters may be added, changed, and deleted.

    • Parameters

      Parameter Type

      Description

      itemId String Unique identifier of the in-app item registered in Seller Portal
      paymentId String Unique identifier assigned to the in-app item payment transaction when it was successful
      orderId String Unique identifier assigned to the purchase receipt
      itemName String Title of the in-app item registered in Seller Portal
      itemDesc String Brief explanation of the in-app item registered in Seller Portal
      purchaseDate String Date and time of the item purchase and payment transaction
      (YYYY-MM-DD HH:mm:ss GMT)
      paymentAmount String Total amount, including the in-app item price and all applicable taxes, billed to the user
      status String Processing result of the request for the receipt:
      "success" Success
      "fail" Failed
      "cancel" The purchase transaction was canceled
      paymentMethod String Type of payment option used to purchase the item
      "Credit Card", "Mobile Micro Purchase", "Prepaid Card", "PSMS", "Carrier Billing" and others.
      mode String IAP operating mode in effect at the time of purchase:
      "TEST" Developer Test Mode which always returns Success or Fail result
      "PRODUCTION" Production Mode
      consumeYN String For consumable in-app items only, whether or not the item has been reported as consumed and is available for purchase again:
      "Y" Consumed
      "N" Not yet Consumed
      comsumeDate String Date and time the consumable item was reported as consumed
      (YYYY-MM-DD HH:mm:ss GMT)
      consumeDeviceModel String Model name of device that reported the item as consumed
      passThroughParam String Transaction ID created by your app for security
      Returned only if the pass-through parameter was set.
      currencyCode String Currency code (3 characters) of the purchaser's local currency. (e.g., EUR, GBP, USD)
      currencyUnit String Symbol of the purchaser's local currency (e.g., €, £, or $)
      cancelDate String For canceled transcation only, Date and time the purchase transaction was canceled
      (YYYY-MM-DD HH:mm:ss GMT)
      errorCode String For failed request only, error code
      errorMessage String For failed request only, detailed error message
    • Example

      • Success

            {
                  "itemId": "57515",
                  "paymentId": "20191129013006730832TRAN",
                  "orderId": "S20191129KRA1908197",
                  "itemName": "Test Pack",
                  "itemDesc": "IAP Test Item. Best value!",
                  "purchaseDate": "2019-11-29 01:32:41",
                  "paymentAmount": "100.000",
                  "status": "success",
                  "paymentMethod": "Credit Card",
                  "mode": "PRODUCTION",
                  "consumeYN": "Y",
                  "consumeDate": "2019-11-29 01:33:28",
                  "consumeDeviceModel": "SM-N960N",
                  "passThroughParam": "TEST_PASS_THROUGH",
                  "currencyCode": "KRW",
                  "currencyUnit": "₩"
            }
            
      • Fail

        errorCode

        errorMessage

        1 "fail"
        1000 Detailed message about an unexpected system error
        (e.g., "parsing error")
        9135 "not exist order"
        9153 "wrong param(invalid purchaseID)"
            {
                  "status": "fail",
                  "errorCode": 9135,
                  "errorMessage": "not exist order"
            }
            
      • Canceled purchase transcation

            {
                  "itemId": "57515",
                  "paymentId": "ZPMTID20191128KRA1908196",
                  "orderId": "S20191128KRA1908196",
                  "itemName": "Test Pack",
                  "itemDesc": "IAP Test Item. Best value!",
                  "purchaseDate": "2019-11-28 10:18:09",
                  "paymentAmount": "0.000",
                  "paymentMethod": "Free",
                  "mode": "PRODUCTION",
                  "consumeYN": "Y",
                  "consumeDate": "2019-11-28 10:18:11",
                  "consumeDeviceModel": "SM-G965F",
                  "passThroughParam": "TEST_PASS_THROUGH",
                  "currencyCode": "KRW",
                  "currencyUnit": "₩",
                  "status": "cancel",
                  "cancelDate": "2019-11-29 00:01:52"
            }
            

2. Create a service token

createServiceToken generates and returns access token value that your server must use to authenticate getSubscriptionStatus SOAP requests. Each token is valid for 30 days.

Note

If a token expires during the processing of a SOAP API request, your server must get a new token and resubmit the SOAP API reqeust.

  • Request

        POST
        https://iap.samsungapps.com/iap/ws/RTCService?wsdl 
        
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.iap.samsung.com/"> 
            <soapenv:Header/> 
            <soapenv:Body> 
                <ws:createServiceToken>
                    <secret>{SECRET}</secret>
                </ws:createServiceToken>
            </soapenv:Body>
        </soapenv:Envelope>
        
    • Parameters

      Parameter Type Required

      Description

      secret String Yes Required Unique ID (up to 12 numerical digits) assigned by Samsung to each seller
      You can get your secret in Seller Portal (Profile page > Information for Seller Page table > Seller DeepLink)
    • Example

          POST /iap/ws/RTCService?ws HTTP/1.1 
          Host: iap.samsung.com  
          
          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
          xmlns:ws="http://ws.iap.samsung.com/">
              <soapenv:Header/>
              <soapenv:Body> 
                  <ws:createServiceToken> 
                      <secret>123456789012</secret> 
                  </ws:createServiceToken> 
              </soapenv:Body> 
          </soapenv:Envelope> 
          
  • Response

    Note

    Response parameters may be added, changed, and deleted.

        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            <soap:Body>
                <ns2:createServiceTokenResponse xmlns:ns2="http://ws.iap.samsung.com/">
                   <output>{OUTPUT}</output>
                </ns2:createServiceTokenResponse>
            </soap:Body>
        </soap:Envelope>
        
    • Parameters

      Parameter Type

      Description

      output String Value of your service token ID (96 alphanumeric characters)
    • Example

          <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
              <soap:Body>
                  <ns2:createServiceTokenResponse xmlns:ns2="http://ws.iap.samsung.com/">
                     <output>de4d8cd4843eb59388a8834ac833c4bfbaf...</output>
                  </ns2:createServiceTokenResponse>
              </soap:Body>
          </soap:Envelope>
          

3. Check subscription status

getSubscriptionStatus gets subscription status, item information, and purchase information of a specified Auto Recurring Subscription (ARS) item that was purchased previously.

  • Request

        POST
        https://iap.samsungapps.com/iap/ws/RTCService?wsdl
        
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
        xmlns:ws="http://ws.iap.samsung.com/">
            <soapenv:Header/> 
            <soapenv:Body> 
                <ws:getSubscriptionStatus> 
                    <purchaseID>{PURCHASE_ID}</purchaseID> 
                    <serviceToken>{SERVICE_TOKEN}</serviceToken> 
                </ws:getSubscriptionStatus> 
            </soapenv:Body> 
        </soapenv:Envelope> 
        
    • Parameters

      Parameter Type Required

      Description

      purchaseID String Yes Required Unique identifier assigned by Samsung IAP to the in-app item purchase of the subscription item
      serviceToken String Yes Required Value of your service token ID (96 alphanumeric characters) obtained by calling createServiceToken
    • Example

          POST /iap/ws/RTCService?ws HTTP/1.1 
          Host: iap.samsung.com 
          
          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
          xmlns:ws="http://ws.iap.samsung.com/"> 
              <soapenv:Header/> 
              <soapenv:Body> 
                  <ws:getSubscriptionStatus> 
                      <purchaseID>asd040f7c36e98d5ca3edf377a40fb...</purchaseID>
                      <serviceToken>22afdc3cd60279fad4cf59b17ed85833b9...</serviceToken>
                  </ws:getSubscriptionStatus>
              </soapenv:Body> 
          </soapenv:Envelope> 
          
  • Response

    Note

    Response parameters may be added, changed, and deleted.

        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
            <soap:Body> 
                <ns2:getSubscriptionStatusResponse xmlns:ns2="http://ws.iap.samsung.com/">
                    <output> 
                        <subscriptionPurchaseDate>{SUBSCRIPTION_PURCHASE_DATE}</subscriptionPurchaseDate> 
                        <subscriptionEndDate>{SUBSCRIPTION_END_DATE}</subscriptionEndDate>
                        <subscriptionType>{SUBSCRIPTION_TYPE}</subscriptionType>
                        <subscriptionStatus>{SUBSCRIPTION_STATUS}</subscriptionStatus>
                        <subscriptionFirstPurchaseID>{SUBSCRIPTION_FIRST_PURCHASE_ID|</subscriptionFirstPurchaseID>
                        <countryCode>{COUNTRY_CODE}</countryCode>
                        <localCurrencyCode>{LOCAL_CURRENCY_CODE}</localCurrencyCode>
                        <localPrice>{LOCAL_PRICE}</localPrice>
                        <supplyPrice>{SUPPLY_PRICE}</supplyPrice>
                        <itemID>{ITEM_ID}</itemID>
                        <freeTrial>{FREE_TRIAL}</freeTrial>
                        <realMode>{REAL_MODE</realMode>
                        <latestOrderId>{LATEST_ORDER_ID}</latestOrderId>
                        <totalNumberOfTieredPayment>{TOTAL_NUMBER_OF_PAYMENT}
        </totalNumberOfTieredPayment>
                        <currentPaymentPlan>{CURRENT_PAYMENT_PLAN}</currentPaymentPlan>
                        <totalNumberOfRenewalPayment>{TOTAL_NUMBER_OF_RENEWAL_PAYMENT}</totalNumberOfRenewalPayment>
                        <subscriptionFirstPaymentDate>{SUBSCRIPTION_FIRST_PAYMENT_DATE}
        </subscriptionFirstPurchaseDate>
                        <cancelSubscriptionDate>{CANCEL_SUBSCRIPTION_DATE}
        </cancelSubscriptionDate>
                        <cancelSubscriptionReason>{CANCEL_SUBSCRIPTION_REASON}
        </cancelSubscriptionReason>
                    </output>
                </ns2:getSubscriptionStatusResponse>
            </soap:Body>
        </soap:Envelope>
        
    • Parameters

      Parameter Type

      Description

      output nested
      object
      Container for the elements
      subscriptionPurchaseDate String Date and time of the item's initial purchase and payment transaction
      (YYYY-MM-DD HH:mm:ss GMT)
      subscriptionEndDate String Date and time of the subscription expiration
      (YYYY-MM-DD HH:mm:ss GMT)
      subscriptionType String Type of subscription item
      Below value is always returned:
      Item_Type_Auto_Recurring_Subscription
      subscriptionStatus String Current status of the item subscription
      "ACTIVE" The subscription is current and in effect.
      "CANCEL" The subscription has expired because the user canceled the subscription.
      subscriptionFirstPurchaseID String Unique identifier of the initial purchase of the item
      countryCode String Country code (3 alphabetic characters) of the purchaser's location (e.g., KOR, USA)
      localCurrencyCode String Currency code (3 alphabetic characters) of the purchaser's local currency paid for the item (e.g., EUR, GBP, USD)
      localPrice double Cost (in the user's local currency) that the user paid the in-app item price
      supplyPrice double Total amount of the item price plus the applied tax
      itemID String Unique identifier of the in-app item registered in Seller Portal
      freeTrial String Whether or not the in-app item's subscription is currently in a free trial period:
      "Y" Free trial period
      "N" Regular price period
      realMode String For regular purchases, whether the actual payment was made when the user purchased the item.
      "Y" Samsung IAP was set to production mode. The actual payment was made.
      "N" Samsung IAP was set to Test Mode. The actual payment was NOT made.
      latestOrderId String Identifier (19 alphanumeric characters) of the most recent payment. it can be an initial payment or a renewal payment.
      Order IDs are displayed in the user's renewal receipt.
      totalNumberOfTieredPayment String Total number of tiered price payments
      currentPaymentPlan String Current period the subscription is in:
      - "F" : Free trial period
      - "R" : Regular price period
      - "T" : Tiered (lower) price period
      totalNumberOfRenewalPayment String Total number of payments made for initial and renewal subscriptions
      subscriptionFirstPaymentDate String Date and time the initial subscription started
      (YYYY-MM-DD HH:mm:ss GMT)
      cancelSubscriptionDate String Date and time the subscription was stopped
      (YYYY-MM-DD HH:mm:ss GMT)
      cancelSubscriptionReason String Cause of the subscription stoppage:
      "1" User canceled the subscripton.
      "2" System canceled the subscription
      (for example, renewal test was finished).
      "3" Billing error (e.g., user payment information was no longer valid).
      "4" Item is not available for purchase at the time of renewal.
      "5" Unknown errors
    • Example

          <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
              <soap:Body> 
                  <ns2:getSubscriptionStatusResponse xmlns:ns2="http://ws.iap.samsung.com/"> 
                      <output> 
                          <subscriptionPurchaseDate>2019-07-14 04:28:52</subscriptionPurchaseDate>
                          <subscriptionEndDate>2020-09-21 04:28:52</subscriptionEndDate>
                          <subscriptionType>Item_Type_Auto_Recurring_Subscription</subscriptionType>
                          <subscriptionStatus>ACTIVE</subscriptionStatus>
                          <subscriptionFirstPurchaseID>0cc3325d051cd83981abe6c33eb3a5b41404</subscriptionFirstPurchaseID>
                          <countryCode>USA</countryCode>
                          <localCurrencyCode>USD</localCurrencyCode>
                          <localPrice>1.000</localPrice>
                          <supplyPrice>1.010</supplyPrice>
                          <itemID>SubscriptionItem104</itemID>
                          <freeTrial>Y</freeTrial>
                          <realMode>Y</realMode>
                          <latestOrderId>P20190814US15845453</latestOrderId>
                          <totalNumberOfTieredPayment>0</totalNumberOfTieredPayment>
                          <currentPaymentPlan>R</currentPaymentPlan>
                          <totalNumberOfRenewalPayment>1</totalNumberOfRenewalPayment>
                          <subscriptionFirstPaymentDate>2019-07-21 04:28:52</subscriptionFirstPaymentDate>
                      </output>
                  </ns2:getSubscriptionStatusResponse>
              </soap:Body>
          </soap:Envelope>
          

Submit the app to Galaxy Store

1. Check the operation mode

After IAP integration, you must check the operation mode before submitting the app.
If you submit the app with OPERATION_MODE_TEST, the users will get all the items for free.
So, before beta release or normal publication, confirm if the operation mode is OPERATION_MODE_PRODUCTION.

2. Beta Test

Before your app and its in-app items for review testing and normal publication in the Galaxy Store, you can beta release a test version of the app and one or more of its items to test IAP integration.
All beta testers download the beta app from the beta test URL for free (including paid apps).
Beta testers can be non-licensed (must be billed for in-app item purchases) or licensed (get in-app items for free).


For successful beta testing, you need to uninstall the existing app and install the app via the beta test URL.
To make modifications during a beta test, you must uninstall the existing app, make changes, register the app in Seller Portal, install the app via the beta test URL again. and then conduct another beta test.

Note

For more information about the behavior for IAP Helper requests in beta deployed apps, see here.

To set up a beta test of IAP integration:

  • In the app APK, the IAP operating mode must be OPERATION_MODE_PRODUCTION.
  • The app and at least one in-app item must be registered in Seller Portal.
  1. 1.

    In the Binary tab, click the Closed Beta Test > Settings.

    Note

    Open Beta Test is not supported for In-App Purchase.

  2. 2.

    Register all beta testers (non-licensed and licensed) and setup the beta tester feedback channel.

  3. 3.

    Click Save and Submit Beta Test.
    The Beta Testing URL is sent to the beta testers to download the beta version app.

  4. 4.

    Register License Testers in Seller Portal (Profile page).

3. Submit the app

When you have created an app version that is ready for review testing and normal publication, register the app and its in-app item, and then click Submit.

For more details, see the App Registration Guide.


FAQ

Q. What kind of payment methods are supported by the Samsung IAP?

Samsung IAP supports Credit Card by default in countries where Galaxy Store becomes a paid service.

Phone bill, PayPal, Samsung Pay and local payment methods (such as Shetab , Wechat , Alipay , Paytm) are available in some countries, except several Middle Eastern countries.

For more details, see the Galaxy Store Seller Portal.

Q. Can I use Samsung IAP on non-Samsung devices?

No, not for mobile phones.
However, non-Samsung devices paired with Galaxy Watch wearable devices via the Galaxy Wearable app can use Samsung IAP.

For details, see Galaxy Watch In-App Purchase

Q. What is the role of Samsung IAP?

Samsung IAP manages setting up an IAP instance, getting current in-app item details, and item purchase and payment processing.

Your app is responsible for followings:

  • The logic to display items for purchase.
  • Initiating item purchase.
  • Managing all prerequisites and errors.

Q. What is required of me and the countries that I want to sell in-app items?

Whether Galaxy Store users can download you app for free or after paying an app purchase price:

  • You must have a commercial Samsung Seller Portal account because all in-app items must be paid for by app users.
  • In-app items can only be sold is countries where paid services are available (currently over 120).

Q. In which countries can I sell in-app items?

In-app items can only be sold in countries where paid services are available (currently over 120).

Q. What do users need to complete in-app purchases?

Galaxy Store must be installed on their device.
They must be signed into their Samsung Account, which must have an acceptable payment method registered to it (such as a credit card).

Q. Why is the Galaxy Store necessary?

Galaxy Store publishes free and paid apps that offer in-app items.
However in Galaxy Store Seller Portal, you register your apps and in-app items, submit them for review testing, and manage them after they pass and are published.

Q. Is there a way for seller to enable or disable the auto-renew option?

No, Samsung IAP has only offered auto-recurring subscription since IAP 5.0 version.
After one period ends, the next period starts automatically, until the app user cancels their subscription (at any time during free trials or paid subscriptions).

Q. What kind of process is there to communicate with the server for item purchase transaction?

Server to server verification is supported.
For details, see Verify a purchase.

Q. Why is it important to set the passThroughParam?

It provides a way to identify each in-app item, and ensure returned purchase details are for a specific item.
If your app specifies a passThroughParam string value when initiating an in-app item purchase, IAP returns the string along with the purchase response details.

Q. Are the list returned by the getProductsDetails() sorted?

No, the returned list of product details is not guaranteed to be sorted.
However, your app can sort the list.

Q. If I do not want to use the IapHelper class, what should I do?

We strongly recommend that you use the provided IapHelper to prevent unexpected issues.
Otherwise, you must implement the complex logics that Samsung IAP offers such as the flow for Samsung Account authentication, the logic to communicate with Samsung Checkout and all processing.

Q. What if a purchase transaction is interrupted before the purchase is completed?

If an item purchase is interrupted (for example, due to a battery or network problem), call getOwnedList() and check if the item is listed, which means the purchase was successfully completed.

Q. How can I test Auto-Recurring Subscriptions during app development?

If your application sets to OPERATION_MODE_TEST mode, the subscription cycle is automatically renewed every 10 minutes and the subscription is automatically canceled after 12 renewals.