en zh

Deprecated APIs




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.

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 seller
Your 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

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

Parameters

Parameter

Type

Description

output

String

Value of your service token ID (96 alphanumeric characters)


Example

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

Check subscription status (SOAP)

Deprecated: End of 2024

Use the IAP Subscription API, check status of subscription, instead.

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

Request

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

Parameters

Parameter

Type

Description

purchaseID

String

(Required) Unique identifier assigned by Samsung IAP to the in-app item purchase of the subscription item

serviceToken

String

(Required) Value of your service token ID (96 alphanumeric characters) obtained by calling createServiceToken


Example

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

Response

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

Parameters

Parameter

Type

Description

output

nested
object

Container for the elements

subscriptionPurchaseDate

String

Date and time of the item's initial purchase and payment transaction
(YYYY-MM-DD HH:mm:ss GMT)

subscriptionEndDate

String

Date and time of the subscription expiration
(YYYY-MM-DD HH:mm:ss GMT)

subscriptionType

String

Type of subscription item
Below value is always returned:
Item_Type_Auto_Recurring_Subscription

subscriptionStatus

String

Current status of the item subscription
"ACTIVE" The subscription is current and in effect.
"CANCEL" The 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>