EN CN
iap/v6/receipt enables your server and client app to verify that a specified in-app item purchase and payment transaction was successfully completed.
iap/v6/receipt
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.
GET https://iap.samsungapps.com/iap/v6/receipt?purchaseID={purchaseID value}
OnPaymentListener
GET http://iap.samsungapps.com/iap/v6/receipt?purchaseID=7efef23271b0a48746a9d7c391e367c7a802980d391d7f9b75010e8138c66c36
"success"
"fail"
"cancel"
iap/getPurchaseReceipt
"Credit Card"
"Mobile Micro Purchase"
"Prepaid Card"
"PSMS"
"Carrier Billing"
"TEST"
"PRODUCTION"
"Y"
"N"
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
{ "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" }
createServiceToken generates and returns access token value that your server must use to authenticate getSubscriptionStatus SOAP requests. Each token is valid for 30 days.
createServiceToken
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>
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>
<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>
<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>
getSubscriptionStatus gets subscription status, item information, and purchase information of a specified Auto Recurring Subscription (ARS) item that was purchased previously.
getSubscriptionStatus
<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>
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>
<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>
Item_Type_Auto_Recurring_Subscription
"ACTIVE"
"CANCEL"
"F"
"R"
"T"
"1"
"2"
"3"
"4"
"5"
<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>
<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>