ONE store IAP Server API
Overview
ONE store IAP Server API indicates Open API to check the data of in-app, which has been billed on ONE store or to change the billing status.
OAuth authentication is necessary to use this API.
Host URL
The URL of {host} used in this document is shown below.
ONE store OAuth
OAuth overview
OAuth authentication is necessary for interworking with ONE store Server Open API.
Understanding ONE store OAuth v2
AccessToken is the value that can get issued through ONE store’s Server Open API, and it is used as the authentication value when the Server Open API provided by ONE store is called.
AccessToken has a default duration of 3,600 seconds. When the valid duration expires or is less than 600 seconds, if you call getAccessToken(), a new AccessToken will be issued.
The existing AccessToken is also available until the valid duration ends.
Numerous AccessTokens get issued in this way, and therefore you can acquire and use AccessTokens differentiated for each service instance of the developer.
The typical interworking flow is as follows
Call the process for obtaining AccessToken (no.1) when the authentication error occurs during API calls.
Use the Authorization Bearer scheme to call ONE store IAP Server API, and the call sample is as shown below.
‘Bearer + Vavant + AccessToken’ must be entered exactly and case-sensitive in the Authorization header as seen in the example above. The Bearer’s value is the value of AccessToken, which has been issued by calling upon getAccessToken().
Incorrect example
OAuth API details
Check client_id & client_secret
You can check the client_id and client_secret values by clicking on the ‘Credentials’ button on the ‘In-App’ of the app registered on ONE store Developer Center.
Issue AccessToken
URI : https://{host}/v6/oauth/token
Method: POST, PUT
Request Parameter: Form format
Request Header :
Example
Response Body : JSON format
Example :
Example of issuance:
AccessToken in the review (development) and commercial environments is managed independently, and therefore you must manage AccessToken separately per environment.
Server API Details
getPurchaseDetails (Check purchased in-app product details)
Desc : It checks the details of purchased ONE store Managed Product. You must search the details by using ONE store purchaseToken (purchase token), which has been received at the completion of the purchase. If you search the details with purchaseToken of Monthly auto-renewal product, then the check failure (NoSuchData) response will be transmitted.
URI : https://{host}/v6/apps/{packageName}/purchases/inapp/products/{productId}/{purchaseToken}
Method : GET
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (Data Size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header:
Example
Request Body : N/A
Response Body : JSON format
Example:
getRecurringPurchaseDetails (Check purchased Monthly auto-renewal product details)
Desc : It checks the automatic payment status of purchased ONE store Monthly auto-renewal product and the details of the last purchase status. You must check them by using ONE store purchaseToken (purchase token), which has been received at the completion of the purchase. If you check the details with purchaseToken of Managed Product, then the check failure (NoSuchData) response will be transmitted.
URI : https://{host}/v6/apps/{packageName}/purchases/inapp/products/{productId}/{purchaseToken}
Method : GET
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (Data Size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header:
Example
Request Body : N/A
Response Body : JSON format
Example:
With the following conditions, you can determine whether the customer has the right to use the content of Monthly auto-renewal product.
If the current time is smaller than or equal to expiryTime(the use end time of purchased in-app) and lastPurchaseState(the purchase status of the last automatic payment) is 0 (the purchase completed) Ex) expiryTime >= current time AND lastPurchaseState == 0
acknowledgePurchase (Acknowledge purchased in-app product)
Desc : It changes the status of purchased Managed product or Monthly auto-renewal product into the ‘acknowledged’ status.
URI : https://{host}/v6/apps/{packageName}/purchases/all/products/{productId}/{purchaseToken}/acknowledge
Method : POST
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (data size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header :
Example
Request Body : JSON format
Example :
Response Body : JSON 형식
It returns the response in the following format to allow for a more intuitive determination of the process completion when API processing is successful. However, when the API processing fails, it returns the standard error response.
Example :
ONE store shall automatically cancel the purchase, which has not been called by acknowledgePurchase API within 3 days.
Accordingly, the developer MUST call this API and then he/she can process through SDK API or server API.
However, the purchase called by consumePurchase API will be considered ‘acknowledged’ and it will not be cancelled.
consumePurchase (Consume purchased in-app product)
Desc : It changes the status of purchased Managed product into the ‘consumed’ status.
URI : https://{host}/v6/apps/{packageName}/purchases/inapp/products/{productId}/{purchaseToken}/consume
Method : POST
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (data size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header :
Example
Request Body : JSON format
Response Body : JSON format
It returns the response in the following format to allow for a more intuitive determination of the process completion when API processing is successful. However, when the API processing fails, it returns the standard error response.
Example :
cancelRecurringPurchase (Request to cancel automatic payment))
Desc :It requests the cancellation of automatic payment of Monthly auto-renewal product.
URI : https://{host}/v6/apps/{packageName}/purchases/auto/products/{productId}/{purchaseToken}/cancel
Method : POST
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (data size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header :
Example
Request Body : N/A
Response Body : JSON format
It returns the response in the following format to allow for a more intuitive determination of the process completion when API processing is successful. However, when the API processing fails, it returns the standard error response.
Example :
reactiveRecurringPurchase (Request to cancel the automatic payment cancellation)
Desc : It cancels the request for the cancellation of automatic payment of Monthly auto-renewal product.
URI : https://{host}/v6/apps/{packageName}/purchases/auto/products/{productId}/{purchaseToken}/reactivate
Method : POST
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (data size : 128)
String productId : In-app ID (data size : 150)
String purchaseToken : Purchase token (data size : 20)
Request Header :
Example
Request Body : N/A
Response Body : JSON format
It returns the response in the following format to allow for a more intuitive determination of the process completion when API processing is successful. However, when the API processing fails, it returns the standard error response.
Example :
getVoidedPurchases (Check purchase cancellation details)
Desc :It checks the purchase cancellation details.
URI : https://{host}/v6/apps/{packageName}/voided-purchases
Method : GET
Request Parameter : Path Variable format
String packageName : Package name of the app that calls API (data size : 128)
Request Parameter (Optional) : Query String format
String continuationKey : ONE store server returns this value if there are numerous purchase cancellations.
If there is continuationKey in the response, you can receive additional purchase cancellation histories if you call up getVoidedPurchases again and send continuationKey (data size: 41).
String startTime : The search start time of purchase cancellation date(milliseconds)
The start time can be set until only one month prior to the current time, and if startTime is used alone, endTime will be set until one month after startTime (data size: 13).
String endTime : The search end time of purchase cancellation date (milliseconds).
The end time cannot be bigger than the current time, and if endTime is used alone, startTime will be set until one month prior to endTime.
unsigned integer maxResults : The default maximum number of searches is 100 (data size: 3)
Request Header :
Example
Request Body : 없음
Response Body :
Example :
Standard Response Specifications
Standard response code
Standard error response specifications
Server API returns the standard error response in the same format as the example below when the error occurs other than the normal response. Refer to the following content.
Response Body : JSON format
Example
Common Code
In-app type code
Market identification code
Last updated