IAP Sample Specification - ONE-store/inapp-sdk-eng GitHub Wiki
< NOTE >
This documents are for ONE store IAP SDK v16(API v4). If you are looking for the latest version of ONE store IAP SDK v17(API v5), please refer to the url below:
URL for the latest documents and downloads of ONE store IAP SDK v17(API v5) : https://dev.onestore.co.kr/devpoc/reference/view/IAP_v17
Request App ID "OA12345678" checks all the published In-App products.
{
"method" : "request_product_info",
"param" : {
"appid" : "OA12345678",
"product_id" : []
}
}
Success Response
- Product inquiry succeeded
- The number of published product: 1
- Product ID: 0000000020
- Product type: Consumable In-App
- Product price: KRW1,100
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "check_purchasability",
"result" : {
"code" : "0000",
"count" : 1,
"product" : [ {
"id" : "0000000020",
"name": "developer center in-app product name",
"type": "one-time",
"kind": "consumable",
"price": 1100
} ]
}
}
Failure Response
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "request_product_info",
"result" : {
"code" : "3004",
"message" : "request failed."
}
}
Request
Ex: check single product
Request to check the validity of the product whose App ID is "OA12345678" and the purchased product ID is "0000000020"
{
"method" : "request_purchase_history",
"param" : {
"appid" : "OA12345678",
"product_id" : ["0000000020"]
}
}
Ex: check multi product
Request to check the validity of the product whose App ID is "OA12345678" and the purchased product ID is "0000000020" & "0000000021"
{
"method" : "request_purchase_history",
"param" : {
"appid" : "OA12345678",
"product_id" : [
"0000000020",
"0000000021" ]
}
}
Ex: check all products
Request to check all purchase history of the product whose App ID is "OA12345678"
{
"method" : "request_purchase_history",
"param" : {
"appid" : "OA12345678"
}
}
Success Response Response
- Product inquiry succeeded
- The number of published product: 2
- Product ID:0000000020
- Product type: Consumable In-App
- The number of available product: 0
- Purchase date: December 1, 2012 (termination date is meaningless)
- Inquiry status: 0000000020 check purchase product validity – the period expires
- Product : 0000000021
- Product type: auto-renewal-month
- The number of available product: 365 (this is not meaningful for auto-renewal-month)
- Purchase date: December 1, 2015
- Termination date: December 31, 2015
- Inquiry status: 0000000021 check purchase product validity – authentication succeeded
{
"api_version" : "4",
"identifier" : "1234567890",
"result" : {
"code" : "0000",
"message" : "request is successfully processed.",
"count" : 2,
"product" : [ {
"id" : "0000000020",
"name": "2011 professional baseball item KRW1,000",
"type": "one-time",
"kind": "consumable",
"validity": 0,
"price": 1100,
"startDate": "20121201173841",
"endDate": "20121201173841",
"status": {
"code" : "PH02",
"message": "The use period expired. Repurchase is required for contined use"
}
},{
"id" : "0000000021",
"name": "auto renewable subscription",
"type": "auto-renewal-month ",
"validity": 365,
"price": 1100,
"startDate": "20151201173841",
"endDate": "20151231235959",
"status": {
"code" : "PH00",
"message": "Item authentication succeeded."
}
}]
}
}
Failure Response
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "request_purchase_history",
"result" : {
"code" : "3004",
"message" : "request failed."
}
}
Request
Request to check the purchase availability of the product whose App ID is "OA12345678" and the purchased product ID is "0000000020"
{
"method" : "check_purchasability",
"param" : {
"appid" : "OA12345678",
"product_id" : ["0000000020"]
}
}
Success Response
The additional purchase of product ID "0000000020" is not available
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "check_purchasability",
"result" : {
"code" : "0000",
"message" : "request is successfully processed",
"count" : 1,
"product" : [ {
"id" : "0000000020",
"purchasability": false
}]
}
}
Failure Response
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "check_purchasability",
"result" : {
"code" : "3004",
"message" : "request failed."
}
}
Request
Request to cancel the auto-renewal-month whose App ID is "OA12345678" and the subscribed auto-renewal-month ID is "0000000020"
{
"method" : "change_product_properties",
"param" : {
"appid" : "OA12345678",
"product_id" : ["0000000021"],
"action" : "cancel_subscription"
}
}
Success Response
- Cancellation of subscription successfully requested.
- Product ID: 0000000021
- Product status: 0000000021 product – cancellation succeeded
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : "change_product_properties",
"result" : {
"code" : "0000",
"message" : "request is successfully processed.",
"count" : 1,
"product" : [ {
"id" : "0000000020",
"status" : {
"code": "CS00",
"message" : "The monthly auto renewable subscription is successfully cancelled."
}
}]
}
}
Failure Response
{
"api_version" : "4",
"identifier" : "1234567890",
"method" : " change_product_properties",
"result" : {
"code" : "3004",
"message" : "request failed."
}
}
Request
Check the payment number of 12313& 12324 purchased in OA00027256 product on 2016/07/15
http://iap.tstore.co.kr:8090/billIntf/billinglog/billloginquiry.action?DATE=20160715&APPID=OA00027256&TIDCNT=2&TID=12313|12324
Success Response
Purchase 2 T data coupon 5G products
<GXG_RES type="BillingLog">
<result>
<status>0</status>
<detail>0000</detail>
<message>successfully checked.</message>
<appid>OA00285882</appid>
<count>2</count>
<billing_log>
<item>
<tid>20160709191552028174</tid
<product_id>0901247195</product_id>
<log_time>20160709191641</log_time>
<charging_id>11111111111</charging_id>
<charge_amount>33,000</charge_amount>
<detail_pname>T data coupon 5GB</detail_pname>
<bp_info/>
<tcash_flag>N</tcash_flag>
</item>
<item>
<tid>20160709191649869595</tid>
<product_id>0901247195</product_id>
<log_time>20160709191733</log_time>
<charging_id>11111111111</charging_id>
<charge_amount>33,000</charge_amount>
<detail_pname>T data coupon 5GB</detail_pname>
<bp_info/>
<tcash_flag>N</tcash_flag>
</item>
</billing_log>
</result>
</GXG_RES>
Failure Response
<GXG_RES type="BillingLog">
<result>
<status>9</status>
<detail>9100</detail>
<message>no information matches the requested conditions.</message>
<appid>OA00285882</appid>
<count>0</count>
</result>
</GXG_RES>
Request
Check the payment number of TSTORE0004_20150515102510XXXXXXXXXXXXXXX purchased in OA00012345 product 10 minutes ago
{
"txid":"TSTORE0004_20150515102510XXXXXXXXXXXXXXX",
"appid":"OA00012345",
"signdata":"MIIH7QYJKoZIhvcNAQcCoIIH3jCCB9oCAQExDzANBglghkgBZQMEAMIIH7QYJKdDFDFFEFEFEFoZIhvcNAQcCoIIH3jCCB9oCAQExDzANBglghkgBZQMEA"
}
Success Response
{
"status" : 0,
"detail" : "0000",
"message" : "successfully verified",
"count" : 1,
"product" : [{
"log_time" : "20120321154451",
"appid" : "OA12345678",
"product_id" : "0900012345",
"charge_amount" : 1000,
"tid" : "201012226_01047637315_00000239",
"detail_pname" : "custom product name",
"bp_info" : "X"}]
}
Failure Response
{
"message":"e-Receipt data is not valid.",
"detail":"9113",
"status":9
}