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. 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 application called book spot, which offers users the option to subscribe to their favorite books and consumable items, such as text fonts, for purchase. after purchase, users can consume the item. finally, developers can view all their payment and refund history on specific dates by calling the samsung iap orders api from the back-end server. prerequisites before implementing in-app purchases in your app, do the following to enable a smooth and effective execution of the process while developing your own application: integrate the samsung iap sdk into your application. for more information about the iap sdk integration, you can follow the integration of samsung iap services in android apps article. upload the application for beta testing on samsung 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” on the test guide. finally, create items on the seller portal so that users can purchase or subscribe to them while using the application. for more details about the available items that the seller portal supports, see the programming guide. for the sample application, we have already completed these steps. some example items were already created in seller portal, such as books and fonts so that you can consume and subscribe to them while using this sample application. implementation of item purchase now that the application and items are ready, you can implement the purchase functionality in your application like in the sample below: when clicking "buy," the startpayment() method is called, specifying parameters for item id and the onpaymentlistener interface, which handles the results of the payment transaction. the onpayment() callback returns whether the purchase has succeeded or failed. the purchasevo object is instantiated and in case it is not null, it holds the purchase results. if the purchase is successful, then it validates the purchase showing its id. if the purchase is not successful, a purchaseerror message is shown. for more information, check the purchase an in-app item section. iaphelper.startpayment(itemid, string.valueof(1), new onpaymentlistener() { @override public void onpayment(@nonnull errorvo errorvo, @nullable purchasevo purchasevo) { if (purchasevo != null) { // purchase successful log.d("purchaseid" , purchasevo.getpurchaseid().tostring()); toast.maketext(getapplicationcontext() ,"purchase successfully", toast.length_short).show(); } else { log.d("purchaseerror" , errorvo.tostring()); toast.maketext(getapplicationcontext() ,"purchase failed", toast.length_short).show(); } } }); implementation of item consumption after successfully purchasing an item, the user can then consume it. in the sample code below, when "consumed" is selected, the consumepurchaseitems() triggers the consume functionality. this is necessary as items must be marked as consumed so they can be purchased again: the consumepurchaseitems() method is called specifying the parameters for purchaseid and the onconsumepurchaseditemslistener() interface, which handles the item data and results. this code also checks if consuming the purchased items succeeded or failed: if the errorvo parameter is not null and there is no error with the purchase, which can be verified with the iap_error_none response code, then the “purchase acknowledged” message is displayed. however, if there is an error, the errorvo parameter returns an error description with the geterrorstring() getter, along with the “acknowledgment failed” message. iaphelper.consumepurchaseditems(purchaseid, new onconsumepurchaseditemslistener() { @override public void onconsumepurchaseditems(@nonnull errorvo errorvo, @nonnull arraylist<consumevo>arraylist) { if (errorvo != null && errorvo.geterrorcode() == iaphelper.iap_error_none) { toast.maketext(getapplicationcontext() ,"purchase acknowledged", toast.length_short).show(); } else { toast.maketext(getapplicationcontext(), "acknowledgment failed: " + errorvo.geterrorstring(), toast.length_short).show(); } } }); implementation of item subscription besides purchasing and consuming items, you can also subscribe to them in your applications. similar to the validation done for the consumable item purchase, you validate the subscription with a purchase id if the purchase is successful. use the same code snippet specified for “item purchase.” for more information, check the implementation of item purchase section. 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 notifications. through server-to-server communication, the api returns all orders data for the application. 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 on 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. get payment and refund history 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 for 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 helps 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. 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' a detailed description of the request items can be found in the request section of the samsung iap orders api documentation. for more information on the server communication, see samsung iap server api. here is a brief summary of the code below: a post request is mapped to the /orders url, which logs the request. the previously described parameters containing the data you specified are formatted in a json body using the string.format() method. the outgoing request is logged in a json body format. a requestbody is instantiated containing the json data, formatted for an http request to be sent to the server with the specified token and service account id. this code also handles multiple results your request can return: the onfailure() method is called when the network request fails for some reason, providing any error details using the ioexception exception. if the request succeeds, the onresponse() method returns the response body or any response exception found. @restcontroller @requestmapping(value = "/iap", method = requestmethod.post) public class orderscontroller { private final okhttpclient client = new okhttpclient(); @getmapping("/orders") public void sendtoserver() { system.out.println("post request received"); // log the request // define parameters values, use according to your requirement // string packagename = "com.example.app_name "; // string requestdate = "20240615"; // string continuationtoken = "xxxxxxxxxxx…….xxxxxx"; string sellerseq = "0000000xxxxx"; // create the json body, use packagename, requestdate, continuationtoken according to your requirement string jsonbody = string.format( "{\"sellerseq\":\"%s\"}", sellerseq ); // create the request body requestbody body = requestbody.create(jsonbody, mediatype.parse("application/json; charset=utf-8")); // access token string token = "0djt9yzryukdogbvulxxxxxx"; // build the request request request = new request.builder() .url("https://devapi.samsungapps.com/iap/seller/orders") .post(body) .addheader("authorization","bearer " + token) .addheader("service-account-id", "85412253-21b2-4d84-8ff5-xxxxxxxxxxxx") .addheader("content-type", "application/json") .build(); 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 { if (response.issuccessful()) { string responsebody = response.body().string(); system.out.println("response: " + responsebody); } else { system.err.println("unexpected response code: " + response.code()); system.err.println("response body: " + response.body().string()); } response.close(); // close the response body } }); } } 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 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. in this case, 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 item 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 item 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: download the android sample 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
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 items 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 item 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 items 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 item information orderid string unique identifier assigned to the purchase receipt purchaseid string unique identifier of the in-app item 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 item is sold packagename string package name of the application registered in seller portal itemid string unique identifier of the in-app item registered in seller portal itemtitle string title of the in-app item 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 item was purchased for example, $ localcurrencycode string three-character currency code iso 4217 of the country's currency where the item was purchased for example, eur, gbp, usd localprice string price of the item in the country where the item 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 item is a subscription, the origin order id of the subscription freetrialyn string if the item is purchased during a free trial period y the item was purchased during a free trial period n the item was not purchased during a free trial period tieredsubscriptionyn string if the item is purchased as a lower-tier/introductory or regular-tier/regular subscription y the item was purchased as a lower-tier or introductory subscription n the item 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 items subscription - cancel, refund, revoke or check the status of iap subscription items 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 items 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 item 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 item purchase transaction the following example shows the url path for creating an item 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 item purchased item refunded subscription started subscription ended subscription refunded subscription renewed 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 item item_refunded the purchased item is refunded to the customer ars_subscribed the subscription has started ars_unsubscribed the subscription has ended or is cancelled 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_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 item purchased item refunded subscription started subscription ended subscription refunded subscription renewed subscription price change accepted subscription in grace period subscription not in grace period order history deleted test item purchased the user successfully purchased the item example "data" { "itemid" "one_gallon_gas", "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37", "testpayyn" "n", "betatestyn" "n", "passthroughparam" null } properties name value description itemid string id of item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item refunded the purchased item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information 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 item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item 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 item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item 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 item contentname string the name of the item 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
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 items, 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 items if you want to manage paid apps or paid in-app items, 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 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 items for apps that have been registered in seller portal name request description view item list get /iap/v6/applications/ packagename/items request a list of item information within a scope appropriate for the page and size view individual item get /iap/v6/applications/ packagename/items/ id request detailed information on one item create item post /iap/v6/applications/ packagename/items register an in-app item modify item put /iap/v6/applications/ packagename/items modify an in-app item partial item modification patch /iap/v6/applications/ packagename/items modify the specified parameters of an in-app item remove item delete /iap/v6/applications/ packagename/items/ id remove an in-app item iap subscription these apis are used to cancel, refund, revoke, and check the status of iap subscription items 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 item processing your app code can follow the logic flow below to support your in-app items 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 item 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
docsamsung iap isn requirements in order to use the the samsung in-app purchase iap instant server notification isn , you must do the following configure a server to receive the notifications create an iap key in seller portal to verify and aunthenticate the notifications configure your iap items in seller portal configure a server you must set up your own server to which samsung's isn system sends real-time notifications for user activities such as in-app item purchases, refunds, and subscriptions the notifications are in json web token format jwt and sent using http post create a url on your server to receive and process these notifications for example, http //your docmain com/notireceiver or https //api games com/subscription/noti/galaxy for security reasons, only ports 80 or 443 can be used you can test the isn service to your server when you register your iap items in seller portal see test the isn service for more information create an iap key in seller portal the iap public key is used to verify and authenticate that the notifications you receive are from the samsung isn system and that the notification has not been modified to create your iap public key log in to seller portal click assistance > api service click create an iap key click yes click [confirm] to display your public key copy the public that has been created and use it to verify the notifications you receive see notification verification examples for examples of how to use the public key to verify the notifications you receive configure your iap items in seller portal you must configure the url of your server for each iap item for which you want to receive notifications see configure in-app items for isn for information on how to set up isn for each of your iap items
Develop Samsung IAP
websamsung in-app purchase seamless integration with galaxy store for your in-app purchase items what is samsung in-app purchase? samsung in-app purchase (iap) is a payment service that makes it possible to sell a variety of items in applications for samsung galaxy store and internally manages communication with supporting iap services in the samsung ecosystem, such as samsung account, samsung checkout, and samsung rewards. learn more four basic steps to selling in-app items start selling in-app items by integrating with samsung iap. 1. develop your app using our sdk download the samsung in-app purchase sdk and integrate it into your app. 2. request commercial seller status you must be a commercial seller in order to sell your in-app items. 3. register your app upload your binary file to samsung galaxy store seller portal. 4. add in-app items to your app add in-app items and register item-related information. technical documents programming guide how to integrate and configure iap, the iap sdk and iap server apis, and what to do before submitting your app to galaxy store. subscription guide how to manage subscriptions and an explanation of the pricing options configured in samsung galaxy store seller portal. test guide how to test in-app item purchase and payment. iap api guides how to view, register, modify, and remove samsung iap items and view all payments and refunds on a specific date. sdk and plugins sdk samsung iap libraries and sample app. unity plugin samsung iap-related scripts and libraries used to integrate with the unity engine. unreal plugin samsung iap-related scripts and libraries used to integrate with the unreal engine. videos samsung developers youtube nov 6, 2019 maximize your revenue with samsung in-app purchase learn about the new features and improvements released in samsung iap 6.0. review the steps to register your app in seller portal, test samsung iap integration, and how to publish your app in galaxy store. nov 6, 2019 nov 11, 2018 monetize your games with samsung in-app purchase introduction to samsung iap plug-in functionality for unity and unreal game engines. learn how to integrate, register and publish your game with samsung iap. nov 11, 2018 have questions? samsung answers your frequently asked questions and provides a forum to communicate with other developers. faq forum
Develop Samsung IAP
docsamsung iap server api 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 description purchaseid string required unique identifier of the in-app item purchase transactionnote 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 noteresponse 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 packagename string package name of the app with a completed transaction 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 cancelednote for canceled transactions, the old iap/getpurchasereceipt only passed "fail", but the iap/v6/receipt passes "cancel" and transaction information together 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 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 securityreturned only if the pass-through parameter was set note the old iap/getpurchasereceipt passed the base64 encoded value, but the iap/v6/receipt passes the value as it is set in the game currencycode string currency code 3 characters of the purchaser's local currency for example, eur, gbp, usd currencyunit string symbol of the purchaser's local currency for example, €, £, or $ canceldate string for canceled transaction only, date and time the purchase transaction was canceled yyyy-mm-dd hh mm ss gmt note added since iap/v6/receipt errorcode integer for failed request only, error code errormessage string for failed request only, detailed error message example success { "itemid" "57515", "paymentid" "20191129013006730832tran", "orderid" "s20191129kra1908197", "packagename" "com samsung android test", "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 for example, "parsing error" 9135 "not exist order" 9153 "wrong param invalid purchaseid " { "status" "fail", "errorcode" 9135, "errormessage" "not exist order" } canceled purchase transaction { "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" } create a service token this soap api will be deprecated at the end of 2024createservicetoken, along with getsubscriptionstatus, will be deprecated at the end of 2024 use the iap subscription api, check status of subscription, instead 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 this soap api will be deprecated at the end of 2024use the iap subscription api, check status of subscription, instead gets the subscription status, including item information and purchase information, which can be used to verify the purchase of an item this call requires the purchase id of the subscription item and a service token for authentication and checks the user’s subscription information on the server information is returned in a rest response this api only provides meaningful information after a subscription is purchased subscription-related content includes the purchase date, current subscription status, current price, current subscription pricing option, number of renewals, paid subscription start date, subscription end date, and reason for cancellation before you can start using the iap subscription 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 see check status of subscription for more information about this iap subscription api check subscription status soap deprecated, end of 2024 warningthis version of the api, which returns information in a soap response, will be deprecated by the end of 2024 use the latest api, shown above, which returns information in a rest response 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 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.