apiResult : getProductsList API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ProductsListAPIResult format at the below.
1.4 ProductsListAPIResult
Defines a dictionary for the ProductsListData dictionary apiResult parameter.
apiResult : applyInvoice API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ApplyInvoiceAPIResult format at the below.
1.8 ApplyInvoiceAPIResult
Defines a dictionary for the ApplyInvoiceData dictionary 'apiResult' parameter.
apiResult : verifyInvoice API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in VerifyInvoiceAPIResult format at the below.
1.10 VerifyInvoiceAPIResult
Defines a dictionary for the VerifyInvoiceData dictionary 'apiResult' parameter.
apiResult : getUserPurchaseList API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in GetUserPurchaseListAPIResult format at the below.
1.12 GetUserPurchaseListAPIResult
Defines a dictionary for the UserPurchaseData dictionary 'apiResult' parameter.
apiResult : getServiceCountryAvailability API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in GetUserPurchaseListAPIResult format at the below.
1.16 GetServiceCountryAvailabilityAPIResult
Defines a dictionary for the ServiceCountryAvailabilityData dictionary 'apiResult' parameter.
apiResult : cancelSubscription API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in CancelSubscriptionAPIResult format at the below.
1.19 CancelSubscriptionAPIResult
Defines a dictionary for the CancelSubscriptionData dictionary apiResult parameter.
openDeepLinkResult : It returns "SUCCESS" in success, "FAIL" in failure.
openDeepLinkDetail : It returns the detail information of coupon or gift card. It is a dictionary in JSON format, so you have to parse it to use. For more information, please refer to "PromotionalCodeDetail" at the below.
1.21 PromotionalCodeDetail
This defines data set of PromotionalCodeDetail parameter that contains ShowRegisterPromotionalCodeData dictionary.
openDeepLinkResult : It returns "SUCCESS" in success, "FAIL" in failure.
openDeepLinkDetail : It returns the detail information of refund or cancel. It is a dictionary in JSON format, so you have to parse it to use. For more information, please refer to "PurchaseHistoryDetail" at the below.
1.24 PurchaseHistoryDetail
This defines data set of PurchaseHistoryDetail parameter that contains ShowPurchaseHistoryData dictionary.
apiResult : IsServiceAvailable API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ServiceAvailableAPIResult format at the below.
1.26 ServiceAvailableAPIResult
Defines a dictionary for the ServiceAvailableData dictionary 'apiResult' parameter.
Enables implementing the Samsung Checkout Client module within the application. After authenticating the purchase information through the application, the user can proceed to purchase payment.
onsuccess : Returns "payResult" and "payDetail" if there is no internal error occurs until client to server data communication.
payResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
payDetail, can have additional data when it's returned, such as InvoiceID. Please refer to the development guide of "buyItem" for details
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method
UnknownError, if other error occur, such as internal error or "billing client already running" error
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 2.4
Code Example :
var strAppId = "";
var strUID = webapis.sso.getLoginUid();
var paymentDetails = new Object();
paymentDetails.OrderItemID="PID_2_consum_cupn";
paymentDetails.OrderTitle="hello consum US coupon";
paymentDetails.OrderTotal="2";
paymentDetails.OrderCurrencyID="USD";
paymentDetails.OrderCustomID=strUID;
var stringifyResult = JSON.stringify(paymentDetails);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.buyItem(strAppId, "DEV", stringifyResult, onsuccess, onerror);
getProductsList
Retrieves the list of products registered on the Billing (DPI) server.
pageSize : Number of products retrieved per page (maximum 100)
pageNumber : Requested page number (1 ~ N)
checkValue : Security check value. Required parameters = "appId" + "countryCode"
The check value is used by the DPI service to verify API requests. It is a Base64 hash generated by applying the HMAC SHA256 algorithm on a concatenated string of parameters using the DPI security key.
You can see the example how to generate checkValue from the following Code example.
You can use any open library to generate the HMAC SHA256 hash. The following example uses the CryptoJS library
serverType : Billing server type
onsuccess : Returns the product list if there is no internal error occurs until client to server data communication
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 4.0
Code Example :
var strSecurityKey = ""; // The DPI security key is issued at the DPI portal.
var strAppId = "";
var strCountryCode = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_SERVICE_COUNTRY);
var reqParams = strAppId + strCountryCode;
var hash = CryptoJS.HmacSHA256(reqParams, strSecurityKey);
var strCheckValue = CryptoJS.enc.Base64.stringify(hash);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.getProductsList(strAppId, strCountryCode, "100", "1", strCheckValue, "DEV", onsuccess, onerror);
applyInvoice
Updates the apply status of purchase item to DPI server.
customId : Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID)
invoiceId : Invoice ID of purchased Item that you want to update apply status
countryCode : TV country code
serverType : Billing server type
onsuccess : Returns purchase apply status if there is no internal error occurs until client to server data communication
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 4.0
Code Example :
var strAppId = "";
var strUID = webapis.sso.getLoginUid();
var InvoiceID = ""; // Issued by getProductsList
var strCountryCode = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_SERVICE_COUNTRY);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.applyInvoice(strAppId, strUID, InvoiceID, strCountryCode, "DEV", onsuccess, onerror);
verifyInvoice
Checks whether a purchase, corresponding to a specific "InvoiceID", was successful.
customId : Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID)
invoiceId : Invoice ID that you want to verify whether a purchase was successful
countryCode : TV country code
serverType : Billing server type
onsuccess : Returns the payment status if there is no internal error occurs until client to server data communication.
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 4.0
Code Example :
var strAppId = "";
var strUID = webapis.sso.getLoginUid();
var InvoiceID = ""; // Issued by getProductsList
var strCountryCode = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_SERVICE_COUNTRY);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.verifyInvoice(strAppId, strUID, InvoiceID, strCountryCode, "DEV", onsuccess, onerror);
getServiceCountryAvailability
Get Service Country availability for Samsung Checkout
countryCodes : to check. Multiple countrycodes available. (Add as array, only Uppercase allowed) ex) countrycodes=["DE","US","KR"]
checkValue : Security check value. Required parameters = "appId" + "countryCodes"
The check value is used by the DPI service to verify API requests. It is a Base64 hash generated by applying the HMAC SHA256 algorithm on a concatenated string of parameters using the DPI security key.
You can see the example how to generate checkValue from the following Code example.
You can use any open library to generate the HMAC SHA256 hash. The following example uses the CryptoJS library
serverType : Billing server type
onsuccess : Returns the service availability status of each country if there is no internal error occurs until client to server data communication.
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 5.5
Code Example :
var strSecurityKey = ""; // The DPI security key is issued at the DPI portal.
var strAppId = "";
var countryCodes = ["DE","US","KR"];
var reqParams = strAppId + "DEUSKR";
var hash = CryptoJS.HmacSHA256(reqParams, strSecurityKey);
var strCheckValue = CryptoJS.enc.Base64.stringify(hash);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.getServiceCountryAvailability(strAppId, countryCodes, strCheckValue, "DEV", onsuccess, onerror);
customId : Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID)
countryCode : TV country code
pageNumber : Requested page number (1 ~ N)
checkValue : Security check value. Required parameters = "appId" + "customId" + "countryCode" + "ItemType" + "pageNumber"
ItemType, MUST use 2 as value ("all items")
The check value is used by the DPI service to verify API requests. It is a Base64 hash generated by applying the HMAC SHA256 algorithm on a concatenated string of parameters using the DPI security key.
You can see the example how to generate checkValue from the following Code example.
You can use any open library to generate the HMAC SHA256 hash. The following example uses the CryptoJS library
serverType : Billing server type
onsuccess : Returns the purchase list if there is no internal error occurs until client to server data communication
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 4.0
Code Example :
var strSecurityKey = ""; // The DPI security key is issued at the DPI portal.
var strAppId = "";
var strUID = webapis.sso.getLoginUid();
var strCountryCode = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_SERVICE_COUNTRY);
var strPageNumber = "1";
var reqParams = strAppId + strUID + strCountryCode + "2" + strPageNumber;
var hash = CryptoJS.HmacSHA256(reqParams, strSecurityKey);
var strCheckValue = CryptoJS.enc.Base64.stringify(hash);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.getUserPurchaseList(strAppId, strUID, strCountryCode, strPageNumber, strCheckValue, "DEV", onsuccess, onerror);
invoiceId : Invoice ID of subscription that you want to cancel
customId : Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID)
countryCode : TV country code
serverType : Billing server type
onsuccess : Returns the subscription cancellation status if there is no internal error occurs until client to server data communication.
apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it
when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns
onerror[optional][nullable] : Optional callback method to invoke if an error occurs before the client to server data communication.
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if serverType contains an invalid value
Since : 4.0
Code Example :
var strAppId = "";
var strUID = webapis.sso.getLoginUid();
var InvoiceID = ""; // Issued by getProductsList
var strCountryCode = webapis.productinfo.getSystemConfig(webapis.productinfo.ProductInfoConfigKey.CONFIG_KEY_SERVICE_COUNTRY);
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.cancelSubscription(strAppId, InvoiceID, strUID , strCountryCode , "DEV", onsuccess, onerror);
isServiceAvailable
Checks whether the Billing server is available. However, this api will be replaced by getServiceCountryAvailability after deprecation
onerror[optional][nullable] : Optional callback method to invoke if an internal error occurs before the client to server data communication
SecurityError, if the application does not have the privilege to call this method.
UnknownError, if any other error occurs.
Exceptions :
WebAPIException
with error type TypeMismatchError, if any of input parameter is not compatible with its expected type
with error type InvalidValuesError, if any input parameter contains an invalid value.
Since : 4.0
Deprecated : 5.5
Code Example :
var onsuccess = function(data) {};
var onerror = function(error) {};
webapis.billing.isServiceAvailable("DEV", onsuccess, onerror)
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
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.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
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.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
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.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.