Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
tutorials
blogsamsung in-app purchase (iap) offers developers a robust solution for handling digital transactions within mobile applications available on galaxy store. whether it is selling digital goods, handling subscriptions, or managing refunds, samsung iap is designed to offer a smooth, secure experience. the samsung iap orders api expands the scope of these benefits. you can fetch all the payments and refunds history according to specified dates on your server to easily manage your application. this content guides you through the essential components for implementing both the samsung iap and samsung iap orders apis. figure 1: sample application ui in this tutorial, we provide a sample android application called book spot, which offers users the option to subscribe to their favorite books and consumable items, such as text fonts, for purchase. this user application is provided to help you to integrate samsung iap sdk with your applicaiton. finally, we also provide a sample server application to view all the payment and refund history on specific dates by calling the samsung iap orders api from the back-end server. prerequisites before implementing the samsung iap order api on your server, you need to perform iap functionalities to retrieve purchase history. you need to integrate samsung iap with your application. if you don't have an app yet, follow these steps to ensure a smooth and effective process. step 1: implement samsung iap in your app to integrate the iap system into your application, follow this general flow. integrate the samsung iap sdk into your application. initiate item purchase by calling startpayment() with the necessary parameters, such as the item id and a listener to handle the results. after the transaction, verify whether the purchase is successful with iap/v6/receipt. this involves checking if the purchase id is valid. follow the ensuring secure purchases using the samsung iap server api for more details. once the purchase is confirmed, allow the item to be consumed using consumepurchaseitems(). this step ensures that the item can be repurchased if needed. for more information about the iap sdk integration, you can follow the integration of samsung iap services in android apps article. also get help from the sample android application. step 2: upload your application upload the application for beta testing on galaxy store. a step-by-step guide with screenshots has been provided in the documentation. for more details, see the section “production closed beta test” in the test guide. step 3: purchase items finally, create products in seller portal so that users can purchase or subscribe to them while using the application. for more details about the available items that seller portal supports, see the programming guide. implementation of the samsung iap orders api the samsung iap orders api is used to view all payments and refunds on a specific date. it does this by fetching the payments and refunds history within the date you specified. let’s implement the samsung iap orders api and create a server to listen to its response. through server-to-server communication, the api returns all order data for the application. overview of the orders api to view all payments and refunds: you must make a post request to the samsung iap orders api endpoint with the required headers specified below. if you specify a date, all the payment history within this date is returned. otherwise, it only returns all the data from the day before the current date. api endpoint: https://devapi.samsungapps.com/iap/seller/orders method: post headers: add the following fields to the request header. for more information, see the create an access token page, which will help you understand how to create the access token in detail. the token is used for authorization. you can also get the service account id by clicking the assistance > api service tabs on seller portal. for more details, read the section create a service account and visit seller portal. header name description required/optional values content-type format of the request body required application/json authorization authorization security header required bearer: access_token service account id this id can be created in seller portal and is used to generate the json web token (jwt) required service-account-id parameters: the following parameters can be used to build your post request. name type required/optional description sellerseq string required your seller deeplink, which is found in your profile in seller portal and consists of a 12-digit number. packagename string optional used to view payment and refund data. you can provide the application package name. when a package name is not specified, the data for all applications is shown. requestdate string optional specify a date from which to view the payment and refund data. if the date is not specified, the data from a day before your current date is returned. continuationtoken string optional use this if you want to check if there is a continuation for the data on the next page. if there is no more data, the response is null. configuring the server you can develop a spring boot server for this purpose. here are the guidelines on how to set up this server. set up a spring boot project. for more information, follow the steps in developing your first spring boot application. set up your server endpoint. create a controller for the samsung iap orders api in an integrated development environment (ide) after importing the spring boot project you created. this helps managing all in-app order-related activities and processing them within your application. the controller receives post requests sent from samsung’s iap orders service ensuring the communication with your application. to ensure smooth communication with the samsung iap orders api, it's essential to structure your server requests effectively. below is a clear and concise breakdown of the process. 1. setup dependencies to implement rest api support, add the following okhttp library dependencies to your application's build.gradle file. implementation 'com.squareup.okhttp3:okhttp: version' implementation 'com.google.code.gson:gson: version' 2. define parameters encapsulate request parameters for cleaner handling. public class orderrequest { private final string sellerseq; public orderrequest(string sellerseq) { this.sellerseq = sellerseq; } public string tojson() { return string.format("{\"sellerseq\":\"%s\"}", sellerseq); } } 3. build the http request centralize request configuration for maintainability. public class orderservice { private static final string api_url = "https://devapi.samsungapps.com/iap/seller/orders"; private static final string token = "0djt9yzryukdogbvulxxxxxx"; private static final string service_account_id = "85412253-21b2-4d84-8ff5-xxxxxxxxxxxx"; private final okhttpclient client = new okhttpclient(); public void sendorderrequest(string sellerseq) { orderrequest orderrequest = new orderrequest(sellerseq); requestbody body = requestbody.create(orderrequest.tojson(), mediatype.parse("application/json; charset=utf-8")); request request = new request.builder() .url(api_url) .post(body) .addheader("authorization", "bearer " + token) .addheader("service-account-id", service_account_id) .addheader("content-type", "application/json") .build(); executerequest(request); } } 4. handle response ensure robust error handling for api calls. private void executerequest(request request) { client.newcall(request).enqueue(new callback() { @override public void onfailure(@notnull call call, @notnull ioexception e) { system.err.println("request failed: " + e.getmessage()); } @override public void onresponse(@notnull call call, @notnull response response) throws ioexception { try (responsebody responsebody = response.body()) { if (!response.issuccessful()) { system.err.printf("unexpected response [%d]: %s%n", response.code(), responsebody.string()); return; } system.out.println("response: " + responsebody.string()); } } }); } congratulations! you have just built the spring boot server to handle api post requests using the okhttpclient to manage http requests and responses for your sample application. example api response as previously mentioned, a json-formatted response is returned to your request. for detailed descriptions of each response body element, see the “response” section of the samsung iap orders api documentation. the following output format is a sample in which only some of the response-body data is presented. the continuationtoken parameter key returns null because there is no continuation for the data on the next page. the orderitemlist parameter key lists all the orders with specific details, such as orderid, countryid, packagename, among others. { "continuationtoken": null, "orderitemlist": [ { "orderid": "s20230210kr019xxxxx", "purchaseid": "a778b928b32ed0871958e8bcfb757e54f0bc894fa8df7dd8dbb553cxxxxxxxx", "contentid": "000005059xxx", "countryid": "usa", "packagename": "com.abc.xyz" }, { "orderid": "s20230210kr019xxxxx", "purchaseid": "90a5df78f7815623eb34f567eb0413fb0209bb04dad1367d7877edxxxxxxxx", "contentid": "000005059xxx", "countryid": "usa", "packagename": "com.abc.xyz" }, ] } usually, the responses contain all the relevant information about user purchases, such as the in-app product title, price, and payment status. therefore, you can use the information and create views for an easier order management. noteif the iap operating mode is configured to test mode, the api response is empty. this is because the api is configured to operate and return a response only in production mode. conclusion you have learned how to implement product purchase, consumption, and registration, as well as how to integrate the samsung iap orders api and configure a server to fetch all the payment and refund history within specific dates. integrating the samsung iap orders api functionality into your server is an essential step in managing your application payments history to ensure a seamless experience to users. now, you can implement the samsung iap orders api into your application to track all payments, refunds and make your business more manageable. related resources for additional information on this topic, see the resources below: android sample application source code sample server application source code add samsung in-app purchase service to your app samsung iap orders api integration of samsung iap services in android apps
Md. Hossain
tutorials
blogintroduction the samsung iap subscription server apis empower developers to efficiently manage samsung in-app purchase (iap) subscriptions, including cancellation, refund, revocation, and status check. these apis serve as the foundation for implementing subscription management features within your application management server. integrating the samsung iap server apis with your backend server simplifies subscription management. this integration allows you to cancel subscriptions and prevent further billing for users, revoke access to subscription-based content, process refunds based on user requests, and check subscription status to determine validity and current state. a well-structured backend implementation streamlines subscription management, ensuring customers receive reliable service and minimizing potential issues related to billing, access, and refunds. prerequisites to establish server-to-server communication between the samsung iap service and your server, follow these essential steps. develop a subscription application – ensure your application supports subscription operations. upload binary for beta testing – submit your application for testing in seller portal. create subscriptions – set up subscription products in seller portal for user subscriptions. completing these steps ensures a seamless integration of samsung iap into your application. for detailed guidance, visit register an app and in-app items in seller portal. implementation of the samsung subscription apis the samsung iap subscription server apis are used to manage subscription-related operations, including cancellations, revocations, refunds, and status checks. to leverage these apis effectively, setting up a backend server is essential. this secure server-to-server communication facilitates efficient handling of all subscription-related operations between the samsung iap service and your server. api overview the samsung iap subscription server api provides endpoints for efficiently managing subscription-based operations. it allows developers to cancel, revoke, refund, and check the status of subscriptions. this api also facilitates robust operations and efficient management of user subscriptions, all while ensuring security and authentication through the use of appropriate headers. base endpoint the samsung iap subscription server apis need a secure endpoint for managing subscriptions. https://devapi.samsungapps.com/iap/seller/v6/applications/<packagename>/purchases/subscriptions/<purchaseid> more detailed information is available through the support documentation. headers to ensure secure communication with the samsung iap service, the following headers must be included in every request. content-type – defines the format of the request body. for json content, use application/json. authorization – uses an access token for authentication. the format should be (bearer <access_token>). refer to the create an access token page for details on generating an access token. service account id – obtained from seller portal under assistance > api service. this id is required to generate a json web token (jwt). for more detailed information, visit the create a service account section in seller portal. these headers collectively ensure secure and authenticated api requests, enabling seamless integration with the samsung iap service. supported methods the samsung iap subscription server api enables efficient subscription management. developers can cancel, revoke, or refund subscriptions using patch requests, and check subscription status using get requests. configuring the server you can develop a spring boot server for this purpose. here are the guidelines for setting it up. create a spring boot project - for detailed steps, refer to developing your first spring boot application. set up the server endpoint: create a controller for samsung iap subscription apis within your ide after importing the spring boot project. this controller manages all in-app subscription activities. the controller performs patch and get requests with the samsung iap service, ensuring communication with your server. performing a patch request the patch request is used to cancel, refund, or revoke a subscription. follow these steps to proceed. creating a request body to cancel, refund, or revoke a subscription, a specific request body must be created for each operation. when interacting with samsung iap service, you send a well-structured api request tailored to the specific action you wish to execute. below are the request formats for various subscription operations. // cancel a subscription requestbody body = requestbody.create( mediatype.parse("application/json"), "{\"action\" : \"cancel\"}" ); // revoke a subscription requestbody body = requestbody.create( mediatype.parse("application/json"), "{\"action\" : \"revoke\"}" ); // refund a subscription requestbody body = requestbody.create( mediatype.parse("application/json"), "{\"action\" : \"refund\"}" ); building the patch request (cancel, revoke or refund subscription) the patch method in rest apis is used for partial updates of resources, enabling you to send only the specific fields that need modification rather than the entire resource. the patch request needs a request body to specify the intended action. to execute a subscription management request, you must construct a secure http request that includes all necessary headers and authentication details. request request = new request.builder() .url(api_url) .patch(body) .addheader("content-type", "application/json") .addheader("authorization", "bearer " + access_token) .addheader("service-account-id", service_account_id) .build(); executing the patch request once the patch request is prepared, execute it using the okhttpclient, ensuring proper request handling and response processing. @crossorigin(origins = "*") @requestmapping(value = "/cancel", method = requestmethod.patch ) public void patchrequest(){ // set request body as json with required action. // initialize patch request, set body, add headers, and finalize setup. client.newcall(request).enqueue(new callback() { @override public void onfailure(call call, ioexception e) { // handle exception } @override public void onresponse(call call, response response) throws ioexception { // handle response response.close(); } }); } example response this response indicates that the request was processed successfully and without errors. { "code" : "0000", "message" : "success" } performing a get request the get request is used to retrieve the status of a subscription. follow these steps to proceed. building the get request the get method is primarily used to retrieve or read data from a server. to check the status of a subscription, the get method is required to retrieve detailed item information. this type of request does not require a request body; only the necessary headers for authentication are needed. request request = new request.builder() .url(api_url) .addheader("content-type", "application/json") .addheader("authorization", "bearer " + access_token) .addheader("service-account-id", service_account_id) .build(); executing the get request once the get request is prepared, execute it using the okhttpclient to retrieve and efficiently process the response data. @getmapping("/get") public void getrequest(){ // initialize get request, add headers, and finalize setup. client.newcall(request).enqueue(new callback() { @override public void onfailure(call call, ioexception e) { // handle exception } @override public void onresponse(call call, response response) throws ioexception { // handle response } }); } example response if the get request executes successfully, it returns the status of the subscription as a response. { "subscriptionpurchasedate": "2025-04-28 04:54:06 utc", "subscriptionenddate": "2025-04-28 05:54:06 utc", "subscriptionstatus": "cancel", "subscriptionfirstpurchaseid": "55541a3d363c9dee6194614024ee2177c72a9dec51fe8dba5b44503f57dc9aec", "countrycode": "usa", "price": { "localcurrencycode": "usd", "localprice": 15, "supplyprice": 15 }, ... } deploying and testing the server for the server to perform api calls, it can use a publicly accessible url. you can deploy the project to obtain the url. for testing purposes, you might deploy it on a platform like codesandbox, which provides a publicly accessible url similar to https://abcde-8080.csb.app/iap/xxxx. conclusion by properly integrating the samsung iap subscription server apis, developers can ensure seamless handling of subscription-related actions within their applications. the implementation of secure server-to-server communication guarantees efficient subscription management and significantly enhances the overall user experience. references download sample server source code samsung iap subscription documentation integrate the samsung in-app purchase orders api with your application
Md. Hossain
tutorials
blogin-app purchases are crucial for many applications, and the samsung in-app purchase (iap) service helps developers manage purchases, subscriptions, and refunds efficiently. to keep your server in sync with user transactions, samsung iap instant server notification (isn) sends real-time notifications to your backend server when purchase-related events occur. isn for samsung iap is a method used by samsung's system to notify your server about user activities related to in-app items and subscriptions. when a change occurs, samsung sends a notification to your server. a list of all events that trigger a notification is available here. in this article, we will build a spring boot server that handles these notifications. prerequisites to implement isn for samsung iap, it is important to focus on the requirements that helps you to most easily implement the process: create an iap public key in the seller portal. this key is used to authenticate the notifications you receive and verify that they are from the samsung iap isn system. the steps you need to follow are outlined in the create an iap public key in seller portal documentation. create an in-app item in the seller portal. follow the related documentation to create an in-app item. isn structure the isn for samsung iap service sends a notification to the application developer server. the structure of the notification is always a base64-encoded json web token (jwt) and consists of three parts. the three parts are: header payload signature header the jwt uses a jose (javascript object signing and encryption) header. similar to the envelope of a letter, the header indicates the type of notification being sent. for additional information, refer to the samsung iap isn header article. example encoded header: eyj0exaioijkv1qilcjhbgcioijsxxxxxxxx example decoded header: { "alg" : "rs256", "typ" : "jwt" } payload the payload is the actual content of the message, like the letter inside the envelope. this part contains the crucial information you need, like the user’s subscription details, the product they have subscribed to, and the current status of the subscription. more details about the payload check are available in the following documentation and data claims section. example encoded payload: eyjpc3mioijpyxauc2ftc3vuz2fwchmuy29tiiwic3viijoirvzftlrftkfnrsisimf1zci6wyjjb20ucgfja2fnzs5uyw1lil0sim5izii6mtcxnziwncwiawf0ijoxnze3mja0lcjkyxrhijp7innlbgxlck5hbwuiom51bgwsim nvbnrlbnroyw1lijoitwfydgluzsj9lcj2zxjzaw9uijoxxxxxxxx example decoded payload: { "iss": "iap.samsungapps.com", "sub": "event_name", "aud": ["com.package.name"], "nbf": 1717xxxxxx, "iat": 1717xxxxxx, "data": {..}, "version": "x.0" } signature the signature is the security feature that acts as a digital stamp to prove the message is genuine and hasn’t been tampered with. you can use this signature to verify that the data in the payload is authentic and was created by samsung. further information is provided in the signature documentation. now that we know the structure of the isn for samsung iap, we can configure the server to handle it. server configuration according to the isn for samsung iap requirements, you must set up a server to receive the notifications. below, we create a spring boot server. use your preferred ide (integrated development environment) or online spring initializr to create a spring boot server. follow the steps below to set up your own server. step 1: set up a spring boot project use the spring initializr tool to create a new project. choose the following dependency: spring web generate and download the project. step 2: import the project into ide open the project in the ide (intellij, eclipse, etc.) step 3: set up isn endpoint create a controller for isn notifications in the ide after importing the spring boot project. the controller receives post requests (subscription, refund and cancel) sent from samsung’s iap server. add necessary dependencies in the build.gradle file: { implementation 'com.auth0:java-jwt:4.0.0' //for jwt verifier implementation 'org.json:json:20230227' // for json parsing } load the public key detailed in the prerequisite section: private string loadpublickey(string filename) throws ioexception { classpathresource resource = new classpathresource(filename); stringbuilder contentbuilder = new stringbuilder(); try (inputstream inputstream = resource.getinputstream(); bufferedreader reader = new bufferedreader(new inputstreamreader(inputstream))) { string line; while ((line = reader.readline()) != null) { contentbuilder.append(line).append("\n"); } } return contentbuilder.tostring(); } remove headers, footers, and whitespace from the public key and convert it to the rsapublickey format. private rsapublickey getrsapublickeyfrompem(string pem) throws exception { string publickeypem = pem .replace("-----begin public key-----", "") .replace("-----end public key-----", "") .replaceall("\\s", ""); // remove headers, footers, and whitespace byte[] encoded = base64.getdecoder().decode(publickeypem); keyfactory keyfactory = keyfactory.getinstance("rsa"); x509encodedkeyspec keyspec = new x509encodedkeyspec(encoded); return (rsapublickey) keyfactory.generatepublic(keyspec); } create a jwt verifier with rsapublickey and, finally, verify the jwt. if the verification is successful, decode the jwt to retrieve the decoded json payload. the decoded payload contains the message of the notification. private void verifytoken(string token, rsapublickey publickey) { try { // create jwt verifier with rsa public key algorithm algorithm = algorithm.rsa256(publickey, null); // verify the jwt token jwtverifier verifier = jwt.require(algorithm) .withissuer("iap.samsungapps.com") .build(); decodedjwt jwt = verifier.verify(token); // decode the jwt token string payloadjson = new string(base64.getdecoder().decode(jwt.getpayload())); jsonobject jsonobject = new jsonobject(payloadjson); //print decoded json payload system.out.println("payload as json: " + jsonobject.tostring(4)); } catch (jwtverificationexception e) { system.out.println("invalid token: " + e.getmessage()); } } in this sample project, we have only printed the payload data to the console. you can use this according to your requirements. step 4: deploy the server the server needs a publicly accessible url to receive isn notifications. in our project, we have used codesandbox to get the publicly accessible url for the server. once you deploy the project on codesandbox, you will get a publicly accessible url that looks like this: https://abcde-8080.csb.app/iap/isn. testing with seller portal test your server with samsung galaxy store seller portal: set the codesandbox url as the isn url in seller portal. go to the in-app purchase section and create items with the required details. in the "isn url" field, set the publicly accessible server url. after setting the url, click the test button. a notification will be sent to the specified server immediately. you will also receive a notification on the server that you just deployed in the codesandbox. figure 1: testing with seller portal testing with a sample application now it is time to test the isn for samsung iap from the user application. further details are provided in the integrate the samsung in-app purchase orders api with your application article. download the sample application from this blog and then follow the instructions until you reach the "implementation of item subscription" section. in the sample application, after clicking the "buy" button, startpayment() is called. the onpayment() callback returns an indication of whether the purchase succeeds or fails. if the purchase is successful, the iap server sends a notification to your server. iaphelper.startpayment(itemid, string.valueof(1), new onpaymentlistener() { @override public void onpayment(@nonnull errorvo errorvo, @nullable purchasevo purchasevo) { if (purchasevo != null) { log.d("purchaseid" , purchasevo.getpurchaseid().tostring()); // purchase successfull }else { log.d("purchaseerror" , errorvo.tostring()); } } }); example response after successfully purchasing an item, a json response is returned. for more information on each parameter, you can check the item purchased documentation. example json response: "data" : { "itemid": "example_item_id", "orderid": "xxxx40601kra00xxxxx", "purchaseid": "xxxxx7245d57cc1ba072b81d06e6f86cd49d3da63854538eea689273787xxxxx", "testpayyn": "n", "betatestyn": "n", "passthroughparam": null } notefor different event types, it sends different data claims. for more detailed information regarding data claims, see data claims. conclusion by implementing the isn for samsung iap with your server, you can easily and securely stay in sync with user in-app purchases. integrating isn for samsung iap helps you improve your application management experience and grow your application’s revenue. following this guide will help you smoothly set up the system and provide a better way to manage your application. references for additional information on this topic, see the resources below: download the sample spring boot server samsung iap instant server notification documentation integrate the samsung in-app purchase orders api with your application
Md. Hossain
Develop Samsung IAP
docsamsung iap orders api the samsung in-app purchase iap orders api is used to view all payments and refunds on a specific date before you can start using the iap orders api, you must meet all requirements and use the required authorization header parameters in your requests see get started with the iap apis for more information view payments and refunds view all payments and refunds on a specific date request post /iap/seller/orders name type description sellerseq string required your seller deeplink in seller portal, a 12-digit number to find your seller deeplink, log in to seller portal and go to profile > information for seller page packagename string optional the package name of the app for which you want to view payment and refund data if no packagename is specified, data is returned for all apps to find an app's package name, log in to seller portal, go to apps, select the app, open the binary tab, and click the file name requestdate string optional the specific day for which you want to view payments and refunds if no date is specified, yesterday's date is used format yyyymmdd continuationtoken string optional request the next page of payment/refund data a page contains up to 100 products if a continuationtoken is not specified, the first page of data is displayed if more than one page of data is available, the response includes a continuationtoken use this token to request the next page of data if the continuationtoken returned in the response is null, this means the previous page of data is the last page to contain product information curl \ -x post \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" \ -d '{"sellerseq" "000123456789","packagename" "com samsung android sample","requestdate" "20230615","continuationtoken" "e5ec039730164c50277f9a231b74c1b6e035d9184160d8b3d6b3de1f62691328fbe4c0c4863da52b3bcecef44a4c7acb974c674728c3cb173cb339bd41783f2c"}' \ "https //devapi samsungapps com/iap/seller/orders" use cases parameters included data retrieved sellerseq yesterday's payments and refunds for all apps sellerseq, packagename yesterday's payments and refunds for the specified app sellerseq, requestdate payments and refunds for all apps for the specified date sellerseq, packagename, requestdate payments and refunds for the specified app and the specified date response parameters name type description continuationtoken string if more than 1 page of data 100 products is available to view, a continuationtoken is sent in order to request and view the next page of data if the continuationtoken is null, this means the previous page of data is the last page to contain product information orderid string unique identifier assigned to the purchase receipt purchaseid string unique identifier of the in-app product purchase transaction contentid string content id of the application registered in seller portal countryid string three-character country code iso 3166 of the country where the product is sold packagename string package name of the application registered in seller portal itemid string unique identifier of the in-app product registered in seller portal itemtitle string title of the in-app product registered in seller portal status string order status 2 payment successfully completed3 payment canceled refund if you want to test the "payment canceled" status, contact customer support at seller portal > help > contact us > contact us at the customer center include the orderid of the purchase so that we can change the order status to "payment canceled " ordertime datetime timestamp utc when the order was requested completiontime datetime timestamp utc when the payment was successfully completed refundtime datetime timestamp utc when the payment was canceled by the admin localcurrency string currency symbol of the country's currency where the product was purchased for example, $ localcurrencycode string three-character currency code iso 4217 of the country's currency where the product was purchased for example, eur, gbp, usd localprice string price of the product in the country where the product was purchased usdprice string price in u s dollars usd exchangerate string usd exchange rate at the time of purchase mcc string sim card country code subscriptionorderid string if the purchased product is a subscription, the origin order id of the subscription freetrialyn string if the subscription is purchased during a free trial period y the subscription was purchased during a free trial period n the subscription was not purchased during a free trial period tieredsubscriptionyn string if the subscription is purchased as a lower-tier/introductory or regular-tier/regular subscription y the subscription was purchased as a lower-tier or introductory subscription n the subscription was purchased as a regular-tier or regular subscription { "continuationtoken" "5b5496f44417c9f6b42c8768cbd3f5b5621cdd4021308af81c1e49b77602e9074ab", "orderitemlist" [ { "orderid" "s20230210kr01922227", "purchaseid" "a778b928b32ed0871958e8bcfb757e54f0bc894fa8df7dd8dbb553c81b048343", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, { "orderid" "s20230210kr01922227", "purchaseid" "90a5df78f7815623eb34f567eb0413fb0209bb04dad1367d7877edfa136321", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, ] } see failure response codes for a list of possible response codes when a request fails failure response codes the following are response codes you may see when the request fails status code and message 400bad request slr_4001 seller is not matchedslr_4009 continuation token is invalidslr_4010 decrypted continuation token consists of invalid data typeslr_4011 date format is invalid use the format yyyymmdd 401unauthorized slr_4008 failed to verify gateway server authorization
Develop Samsung IAP
docget started with the samsung iap apis the samsung in-app purchase iap apis provide the following functionality orders - view payments and refunds for a specific date publish - view, register, modify, and remove iap products purchase acknowledgment - consume or acknowledge a purchased product subscription - cancel, refund, revoke or check the status of iap subscriptions to start using the iap apis, you must meet certain requirements and use the required authorization header parameters described below requirements in order to use the iap apis, the following is required the iap apis are part of the galaxy store developer api you must meet all of the requirements of the galaxy store developer api including, but not limited to, creating the access token, including the access token in the authorization header of every iap api call, and having commercial seller status to manage in-app purchase products the iap apis must be connected with the content in the in app purchase tab area of seller portal to create this connection, you must either initially distribute your content using the content publish api or the content must be in the for sale state in seller portal if this connection does not exist, matching product information cannot be retrieved you must integrate the iap sdk into your app all binaries registered in your content must support iap if these requirements are not met, error code 106 is returned authorization header parameters every request must include authorization header parameters which specify the content type, your access token, and service account id see create an access token for more information about how to create an access token and service account id attribute description authorization required use bearer <your-access-token> where <your-access-token> is the access token you requested from the galaxy store authentication server service-account-id required the service account id used to create the jwt associated with the access token can be found in the assistance > api service area of seller portal content-type required must be application/json the following example shows the header used with the iap apis curl -x <iap_publish-or-iap_order-or-iap_subscription_api_request> \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" url path parameters the url path for every iap publish and subscription api request must contain the package name for the iap orders api, the package name may be required in the body parameter for the iap subscription api, the in-app product purchase transaction identifier is also required attribute description packagename required for iap order and subscription apis the app's package name purchaseid required for iap subscription api unique identifier of the in-app product purchase transaction the following example shows the url path for creating an in-app product using the iap publish api https //devapi samsungapps com/iap/v6/applications/<packagename>/items the following example shows the url path for canceling, refunding, or revoking a subscription using the iap subscription api https //devapi samsungapps com/iap/seller/v6/applications/<packagename>/items/purchases/subscriptions/<purchaseid>
Develop Samsung IAP
docsamsung iap isn payload the samsung in-app purchase iap instant server notification isn contains registered and private claims because event types and content within the payload is continually added content that already exists is not deleted , handling the notifications that are sent to your server requires some flexibility the payload is encoded in base64 format when it is decoded, it is in json format the following events are reported in the notification and are explained in the data claims section below product purchased product refunded subscription started subscription ended subscription upgraded/downgraded subscription refunded subscription renewed resubscription subscription price change accepted subscription in grace period subscription not in grace period order history deleted test example encoded payload eyjpc3mioijpyxauc2ftc3vuz2fwchmuy29tiiwic3viijoirvzftlrftkfnrsisimf1zci6wyjjb20ucgfja2fnzs5uyw1lil0sim5izii6mtcxnziwncwiawf0ijoxnze3mja0lcjkyxrhijp7innlbgxlck5hbwuiom51bgwsimnvbnrlbnroyw1lijoitwfydgluzsj9lcj2zxjzaw9uijoimi4win0 example decoded payload { "iss" "iap samsungapps com", "sub" "event_name", "aud" [ "com package name" ], "nbf" 1717204200, "iat" 1717204200, "data" { }, "version" "2 0" } claims set properties claim name claim type value type description iss registered string always iap samsungapps com sub registered string type of event that occurred item_purchased the user successfully purchased the product item_refunded the purchased product is refunded to the customer ars_subscribed the subscription has started ars_unsubscribed the subscription has ended or is cancelled ars_updowngraded the subscription is upgraded to a more expensive plan or downgraded to a cheaper one ars_refunded the subscription payment, at any point during the current subscription period, is refunded to the subscriber ars_renewed the subscription has been renewed by the subscriber ars_resubscribed the subscription was cancelled but is restored by the subscriber before it expires ars_pricechange_agreed the subscriber has consented or not consented to a subscription price change ars_in_grace_period the subscription is in a grace period, allowing the subscriber time to update their payment method and renew the subscription ars_out_grace_period the subscription is not in a grace period order_history_deleted the listed order details are deleted receipts and subscriptions cannot be retrieved using the specified id test this is a test notification sent using seller portal aud registered string the package name of the content iat registered number the time at which the jwt was issued unix epoch time nbf registered number the time at which the jwt can be accepted for processing unix epoch time data private json detailed payload for each notification based on the event type sub see data claims for more information about the data claims payload version private string the version of the samsung iap isn service the current version, which is jwt-based, is 2 0 data claims the following are the data claims that may be included in the isn, based on the event type product purchased product refunded subscription started subscription ended subscription upgraded/downgraded subscription refunded subscription renewed resubscription subscription price change accepted subscription in grace period subscription not in grace period order history deleted test product purchased the user successfully purchased the product example "data" { "itemid" "one_gallon_gas", "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37", "testpayyn" "n", "betatestyn" "n", "passthroughparam" null } properties name value description itemid string id of product purchased orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api testpayyn string y the product was purchased by a licensed tester in iap test mode n the product was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the product was purchased during a closed beta test n the product was not purchased during a closed beta test see iap test mode conditions for more information passthroughparam string transaction id you created as a security enhancement when requesting a payment, and is delivered only when entered when requesting a payment product refunded the purchased product is refunded to the customer example "data" { "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37", "testpayyn" "n", "betatestyn" "n" } properties name value description orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api testpayyn string y the product was purchased by a licensed tester in iap test mode n the product was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the product was purchased during a closed beta test n the product was not purchased during a closed beta test see iap test mode conditions for more information subscription started the subscription has started example "data" { "itemid" "weekly_fuel", "orderid" "s20240601kra0010009", "purchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "paymentplan" "regular", "scheduledtimeofrenewal" 1717809005, "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of subscription purchased orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api paymentplan string product plan applied to the current user for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information subscription ended the subscription has ended or is cancelled and is not renewed the subscription is still available until the end of the current subscription period example "data" { "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "testpayyn" "n", "betatestyn" "n", "validuntil" 1717809005 } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information validuntil number the subscription expiration date, in unix epoch time subscription upgraded/downgraded the subscription plan has been changed to a more expensive plan upgrade or to a cheaper plan downgrade example "data" { "olditemid" "sample_basic_1", "oldpaymentplan" "regular", "newitemid" "sample_premium_1", "newpaymentplan" "regular", "neworderid" "s20250808kr01958723", "newpurchaseid" "e580060396cfeedc951f848dj385h4aff684cb76cce5a21efba3a86efad6d53e", "scheduledtimeofrenewal" 1755217332, "testpayyn" "n", "betatestyn" "n" } properties name value description olditemid string the id of the subscription purchased before the subscription change oldpaymentplan string the payment plan of the product applied to the user before the subscription change for example, freetrial / tieredprice / regular newitemid string the id of the subscription purchased after the subscription change newpaymentplan string the subscription plan of the product applied to the user after the subscription change for example, freetrial / tieredprice / regular neworderid string order id for the purchase of the changed product newpurchaseid string purchase id for the purchase of the changed product scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information subscription refunded the subscription payment, at any point during the current subscription period, is refunded to the subscriber example "data" { "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "refundedorderid" "s20240608kra0110009", "refundedpurchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e", "refundedpurchasedate" 1596573209, "testpayyn" "n", "betatestyn" "n" } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api refundedorderid string the order id of the refunded payment refundedpurchaseid string the purchase id of the refunded payment refundedpurchasedate number the purchase date of the refunded payment, in unix epoch time testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information subscription renewed the subscription has been renewed by the subscriber example "data" { "itemid" "weekly_fuel", "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "renewedorderid" "s20240608kra0110009", "renewedpurchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e", "paymentplan" "regular", "scheduledtimeofrenewal" 1720415824, "testpayyn" "y", "betatestyn" "n" } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api renewedorderid string the order id of the most recent renewal payment renewedpurchaseid string the purchase id of the most recent renewal payment paymentplan string the product plan applied to the current subscriber for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information resubscription the subscription was cancelled but the subscriber restarted it before it expired or revoked the cancellation to maintain the subscription's active status example "data" { "itemid" "sub_sample_1", "resubscribedorderid" "s20250808kr01945643", "resubscribedpurchaseid" "a5f910c979f84cee7c075a496c6a280413rt468ce413904e978a617550296ef2", "paymentplan" "regular", "testpayyn" "n", "betatestyn" "n", "scheduledtimeofrenewal" 1755240697 } properties name value description itemid string the id of the purchased subscription resubscribedorderid string the order id of the resubscription payment resubscribedpurchaseid string the purchase id of the resubscription payment paymentplan string the subscription plan of the product applied to the user after resubscription for example, freetrial / tieredprice / regular testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time subscription price change accepted the subscriber has consented or not consented to a subscription price change example "data" { "itemid" "weekly_fuel", "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "agreeyn" "y", "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of subscription purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api agreeyn string y the subscriber consented to the subscription price increase and the subscription will be renewed at the increased price at the beginning of the subscription period when the price increase is applied n the subscriber did not consent to the subscription price increase and the subscription will be cancelled at the end of the final subscription period that charges the current price testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information subscription is in a grace period there is an issue with the subscriber's payment method and the subscriber is given time to update their payment method before the subscription is cancelled example "payload" { "itemid" "ars_with_tiered", "firstorderid" "s20210126gba1918788", "firstpurchaseid" "5665c5e42e1888fe82cd57111f5f8374a87f96623585ffef9bc03a58cecca508", "testpayyn" "y", "betatestyn" "n", "graceperiodstartdate" 1720415824, "graceperiodenddate" 1721020624 } properties name value description itemid string id of subscription purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information graceperiodstartdate number starting date of the grace period, in unix epoch time graceperiodenddate number ending date of the grace period, in unix epoch time subscription is not in a grace period the subscription is not in a grace period example "payload" { "itemid" "ars_with_tiered", "firstorderid" "s20210126gba1918788", "firstpurchaseid" "5665c5e42e1888ee87cd57111f5f8674a87f96623585ffef9bd03a58cecca508", "renewedorderid" "s20200805kra1910361", "renewedpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "paymentplan" "regular", "scheduledtimeofrenewal" 1720415824, "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of subscription purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api renewedorderid string the order id of the most recent renewal payment renewedpurchaseid string the purchase id of the most recent renewal payment paymentplan string the product plan applied to the current subscriber for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the subscription was purchased by a licensed tester in iap test mode n the subscription was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the subscription was purchased during a closed beta test n the subscription was not purchased during a closed beta test see iap test mode conditions for more information order history deleted delete order details when the order details are deleted, receipt and subscription information for the specified order and purchase ids are no longer available example "data" { "count" 3, "orderlist" [ { "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37" }, { "orderid" "s20240601kra0010009", "purchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2" }, { "orderid" "s20240608kra0110009", "purchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e" } ] } properties name value description orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api test this is a test notification sent using seller portal example "data" { "sellername" "martine", "contentname" "driving game" } properties name value description sellername string the name of the person selling the product contentname string the name of the product iap test mode conditions the following table describes the conditions status of content in seller portal and the iap operating mode that apply for the testpayyn and betatestyn property values content status in seller portal registering with licensed tester closed beta for sale iap operating mode operation_mode_test operation_mode_production testpayyn y n betatestyn n y n
Develop Samsung IAP
docsamsung iap purchase acknowledgment api the samsung iap purchase acknowledgment api is used to consume or acknowledge a purchased product before you can start using the iap purchase acknowledgment api, you must meet all requirements, use the required authorization header parameters, and use the required url path paremeters in your requests see get started with the iap apis for more information consume or acknowledge a purchased product after your app has granted entitlement of a product to the user with a successful transaction, your app needs to notify samsung iap that the purchase was successfully processed you can report one or more purchased items as consumed, which makes the items available for another purchase the app user may or may not have used the items or, you can acknowledge that the user has been granted entitlement for one or more purchased subscriptions notewe recommend reporting purchased items immediately after verifying their purchase and reporting all unreported products in one call in order to avoid system overload or malfuction request patch /iap/seller/v6/applications/<packagename>/purchases/<purchaseid> notesee url path parameters for more information about the <packagename> and <purchaseid> parameters body parameter name type description action string requiredthe task to perform must be one of the following consume report one or more purchased items as consumed acknowledge acknowledge that the user has been granted entitlement for one or more purchased subscriptions purchasedidlist[] purchaseid string optionalone or more purchase ids of the purchased item or subscription example single item or subscription request body { "action" "consume" } curl curl -i -x patch \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" \ -d '{"action" "consume | acknowledge"}' \ 'https //devapi samsungapps com/iap/seller/v6/applications/<packagename>/purchases/<purchaseid>' example multiple items or subscriptions request body { "action" "consume", "purchasedidlist" [ "5fd9b7a353539aaa5401da21d0a3637deee12f2539fcef2f7daba8c9aaa2", "5ed5b555af4ecf4fb756cc32e9cbddd9da15397a26904ff7d1a248eb333d", "698fc6d155e74eee0896ca8a540468883f8db7eee6f3119fb2e298b7abbb" ] } curl curl -i -x patch \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" \ -d '{"action" "consume | acknowledge", \ "purchasedidlist" [ \ "5fd9b7a353539aaa5401da21d0a3637deee12f2539fcef2f7daba8c9aaa2", \ "5ed5b555af4ecf4fb756cc32e9cbddd9da15397a26904ff7d1a248eb333d", \ "698fc6d155e74eee0896ca8a540468883f8db7eee6f3119fb2e298b7abbb" \ ] }' \ 'https //devapi samsungapps com/iap/seller/v6/applications/<packagename>/purchases/<purchaseid>' response name type description totalcount int the number of products for which a response is returned purchaseitemlist[] purchaseid string the purchase id of the transaction purchaseitemlist[] statuscode string response status code purchaseitemlist[] statusstring string response status message statuscode and statusstring values statuscode statusstring consume statusstring acknowledge 0 success success 1 can't find an order with this purchaseid can't find an order with this purchaseid 2 can't consume this purchase because it's not a successful order this is not a successful order 3 this type of product is not a consumable item this type of product is not a subscription 4 this purchase has been consumed already this purchase has been acknowledged already 5 can't consume this purchase because the user is not authorized to consume this order this purchase is not authorized for this order example response { "totalcount" 3, "purchaseitemlist" [ { "purchaseid" "5fd9b7a353539aaa5401da21d0a3637deee12f2539fcef2f7daba8c9aaa2", "statuscode" "0", "statusstring" "success " }, { "purchaseid" "can't find order with this purchaseid ", "statuscode" "1", "statusstring" "this type of item is not non-consumable or subscription " }, { "purchaseid" "698fc6d155e74eee0896ca8a540468883f8db7eee6f3119fb2e298b7abbb", "statuscode" "3", "statusstring" "this type of item is not non-consumable or subscription " } ] } see failure response codes for a list of possible response codes when a request fails failure response codes status code and message 400bad request 102 invalid parameter 401unauthorized 101 failed to verify gateway server authorization
Distribute Galaxy Store
docgalaxy store developer api the galaxy store developer api is a set of server-to-server apis that allow you to manage apps, manage in-app products, and check app statistics the set of apis include the content publish api, iap apis, and gss metric api the galaxy store developer api provides programmatic access to the same types of functionality provided by galaxy store seller portal requirements in order to use the galaxy store developer api, the following is required seller portal account a samsung account is required to register for a seller portal account you can sign up for a samsung account when you register for a seller portal account commercial seller status, to manage paid apps or in-app purchase products if you want to manage paid apps or paid in-app products, your seller portal account must have commercial seller status apps registered in seller portal the galaxy store developer api does not support new app registration you must first register your apps in seller portal before you can manage them using the api access token the access token is used for authentication and is included in the authorization header of every api call noteeach api within the galaxy store developer api may also have its own set of requirements see each individual api page for more information use the galaxy store developer api after you have generated the access token, you must include it in the authorization header of every galaxy store developer api call see use the access token for more information about how to use the access token api schema access to all apis must use https http is not allowed and must start with the following url https //devapi samsungapps com/ for example https //devapi samsungapps com/seller/contentlist list of apis access tokens these apis are used to request, validate, and revoke an access token name request description get an access token post /accesstoken after you have created a json web token, request an access token to use the galaxy store developer api validate an access token get /auth/checkaccesstoken ensure the access token is valid revoke an access token delete /auth/revokeaccesstoken delete the access token content publish these apis are used to manage apps that have been registered in seller portal name request description view seller’s app list get /seller/contentlist view a list of all of the seller's registered apps view seller’s app details get /seller/contentinfo view information about one of the seller's registered apps add new binary post /seller/v2/content/binary add a new binary to an app modify binary put /seller/v2/content/binary modify the binary of an app delete binary delete /seller/v2/content/binary delete the binary of an app modify app data post /seller/contentupdate modify app information, including images, icons, and binary files, after an app has been submitted and is for sale in galaxy store view closed beta test get /seller/v2/content/betatest get information about a closed beta test update closed beta test put /seller/v2/content/betatest add or remove beta testers for your closed beta test and specify where you receive feedback view staged rollout rate get /seller/v2/content/stagedrolloutrate get the default rollout rate and country-specific rollout rates update staged rollout rate put /seller/v2/content/stagedrolloutrate enable/update or disable staged rollout view staged rollout binaries get /seller/v2/content/stagedrolloutbinary get a list of binaries that are configured for a staged rollout update staged rollout binary put /seller/v2/content/stagedrolloutbinary add or remove binaries from a staged rollout submit app post /seller/contentsubmit submit an app for review change app status post /seller/contentstatusupdate change the status of an app registered in seller portal create file upload session id post /seller/createuploadsessionid generate a session id required to upload a file file upload post /galaxyapi/fileupload upload files required for app submission or for updating an app iap orders this api is used to view all payments and refunds on a specific date name request description orders post /iap/seller/orders view all payments and refunds on a specific date iap publish these apis are used to add and manage in-app products for apps that have been registered in seller portal name request description view product list get /iap/v6/applications/ packagename/items request a list of product information within a scope appropriate for the page and size view individual product get /iap/v6/applications/ packagename/items/ id request detailed information on one product create product post /iap/v6/applications/ packagename/items register an in-app product modify product put /iap/v6/applications/ packagename/items modify an in-app product partial product modification patch /iap/v6/applications/ packagename/items modify the specified parameters of an in-app product remove product delete /iap/v6/applications/ packagename/items/ id remove an in-app product iap subscription these apis are used to cancel, refund, revoke, and check the status of iap subscriptions name request description cancel subscription patch /iap/seller/v6/applications/<packagename>/purchases/subscriptions/<purchaseid> cancel the subscription refund subscription patch /iap/seller/v6/applications/<packagename>/purchases/subscriptions/<purchaseid> reimburse the most recent payment revoke subscription patch /iap/seller/v6/applications/<packagename>/purchases/subscriptions/<purchaseid> cancel the subscription and reimburse the most recent payment check status of subscription get /iap/seller/v6/applications/<packagename>/purchases/subscriptions/<purchaseid> check the subscription status statistics these apis are used to view app statistics name request description view seller metrics post /gss/query/sellermetric view statistics about all of the seller's registered apps view content metrics post /gss/query/contentmetric view statistics about one of the seller's registered app
Develop Samsung IAP
dociap configuration and in-app product processing your app code can follow the logic flow below to support your in-app products the scope of each iap sdk api is straightforward and most integrations follow a similar logic flow, which is linear with a few branches after product purchases, iap server apis are typically called to verify purchases notepurchased consumable items not reported as consumed cannot be repurchased requirementyou must call getownedlist whenever launching the application in order to check for unconsumed items or subscription availability
Develop Samsung IAP
docdeprecated apis deprecated apis are not supported!the apis documented on this page are deprecated, should not be used, and are not supported this documentation is retained for historical and archival purposes only create a service token soap deprecated end of 2024 createservicetoken generates and returns access token value that your server must use to authenticate getsubscriptionstatus soap requests each token is valid for 30 days noteif 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 description secret string required unique id up to 12 numerical digits assigned by samsung to each selleryour secret is your seller deeplink in seller portal go to your profile page and scroll to the information for seller page table 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 noteresponse 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> check subscription status soap deprecated end of 2024 use the iap subscription api, check status of subscription, instead 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 description purchaseid string required unique identifier assigned by samsung iap to the in-app item purchase of the subscription item servicetoken string 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 noteresponse 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 nestedobject 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 itembelow 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 user canceled the subscription check the subscriptionenddate to see if the subscription period has ended as the canceled item is still valid until the current suscription period has ended subscriptionfirstpurchaseid string unique identifier of the initial purchase of the item countrycode string country code 3 alphabetic characters of the purchaser's location for example, kor, usa localcurrencycode string currency code 3 alphabetic characters of the purchaser's local currency paid for the item for example, 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 for example, 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> error response error code error message description 10 missing_parameter a required parameter is missing 15 invalid_parameter_value a parameter value is invalid 300 invalid_secret the service token is invalid 301 expired_service_token the service token has expired -1 unknown_error a server error has occurred example <soap envelope xmlns soap="http //schemas xmlsoap org/soap/envelope/"> <soap body> <soap fault> <faultcode>soap server</faultcode> <faultstring>fault occurred while processing </faultstring> <detail> <ns1 webserviceexception xmlns ns1="http //ws iap samsung com/"> <errorcode xsi type="xs int" xmlns ns2="http //ws iap samsung com/" xmlns xs="http //www w3 org/2001/xmlschema" xmlns xsi="http //www w3 org/2001/xmlschema-instance"> 301 </errorcode> <errormessage xmlns ns2="http //ws iap samsung com/"> expired_service_token </errormessage> </ns1 webserviceexception> </detail> </soap fault> </soap body> </soap envelope>
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
These cookies gather information about your browser habits. They remember that you've visited our website and share this information with other organizations such as advertisers.
You have successfully updated your cookie preferences.