In-App Purchase Server API
ONE store In-App Purchase (IAP) API indicates an Open API, which offers to developers data for the in-app products paid on ONE store. OAuth authentication is required to use this Open API.
HOST URL
OAuth v2 Overview
- ONE store OAuth
OAuth authentication is required for the interworking with ONE store Server Open API.
Understanding of ONE store OAuth v2
Access Token is a value that can be issued through ONE store Server Open API. It is used as an authentication value when calling Server Open API offered by ONE store.
Access Token will be valid for 3,600 seconds on default. When it expires or its time of expiration is less than 600 seconds, you can get a new token issued by calling getAccessToken()
It is still available to use the existing Access Token until its validity expires.
This issuance method is used for numerous Access Tokens, and therefore it can become a form that allows the acquisition and use of Access Tokens, which vary depending on each service interface of developers.
A typical interworking flow is as follows:
If authentication error occurs while calling API, you can call the process of acquiring Access Token (no. 1).
To call ONE store Server Open API, use the Authorization Bearer scheme. Calling sample is as follows:
The Authorization header should contain Bearer + Space + AccessToken case sensitive as shown in the example above
The value of Bearer is an Access Token value, which is issued by calling getAccessToken().
Wrong examples
Authorization: 680b3621-1234-1234-1234-8adfaef561b4 Authorization: bearer 680b3621-1234-1234-1234-8adfaef561b4 Authorization: Bearer <680b3621-1234-1234-1234-8adfaef561b4> Authorization:Bearer680b3621-1234-1234-1234-8adfaef561b4
Server API Details
Desc: check the details of the purchased in-app products.
URI: https://{host}/v2/purchase/details/{purchaseId}/{packageName}
Method: GET
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
Request Header
Example
Request Body: NA
Response Body:
Example
- getPurchaseDetailsByProductId (Check Purchased In-App Product Details)
Desc: This allows to check the details of purchased in-app products. It has a stronger security feature since it makes a response after confirming if the purchase of the in-app product in question (productId) is valid.
URI: https://{host}/v2/purchase/details-by-productid/{purchaseId}/{packageName}/{productId}
Method: GET
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
String productId : the product ID (Data Size : 150)
Request Header
Example
Request Body: NA
Response Body:
Example
- getRecurringPurchaseDetails (Check Purchased In-App Product Details)
Desc: Based on purchase ID, check the details of the purchased subscription
URI: https://{host}/v2/purchase/recurring-details/{purchaseId}/{packageName}
Method: GET
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
Request Header
Example
Request Body: NA
Response Body:
Example
- getLastRecurringPurchaseDetails (Check Purchased Subscription Details)
Desc: This allows to check the details of purchased in-app products. It has a stronger security feature since it makes a response after confirming if the purchase of the in-app product in question (productId) is valid.
URI: https://{host}/v2/purchase/last-recurring-details/{purchaseId}/{packageName}
Method: GET
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
Request Header
Example
Request Body: NA
Response Body:
Example
- manageRecurringPaymentStatus (Cancel Automatic Payment/Cancel the Cancellation)
Desc: change the status of the subscription(cancel & cancel the cancellation).
URI: https://{host}/v2/purchase/manage-payment-status/{purchaseId}/{packageName}/{action}
Method: POST
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
String action: the status change type; cancel(cancel the subscription) and reactivate(cancel the cancellation of the subscription) (Data Size : 10)
Request Header
Example
Request Body: NA
Response Body:
Example
getVoidedPurchases (Check Purchase Cancellation Details)
Desc: check the details of the purchase cancellation
URI: https://{host}/v2/purchase/voided-purchases/{packageName}
Method: GET
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
Optional Query Parameters :
String continuationKey : When a user has many cancelled purchases for the application in query, getVoidedPurchases returns this response value. If there is the continuationKey in the response, it is required to separately call the getVoidedPurchases again with the continuationKey which is received as the response to get more cancelled purchases. (Data Size : 41)
String startTime : it is the start date of searching the cancellations that you want to check (milliseconds). It is available to search up to the past 30 days from the current time. If the startTime is used alone, the endTime will be set at the date one month after the startTime. (Data Size : 13)
String endTime : it is the end date of searching the cancellations that you want to check (milliseconds). It is not available to search the end date which is after the current time. If the endTime is used alone, the startTime will be set at the date one month before the endTime. (Data Size : 13)
unsigned integer maxResults : the maximum number of views (default 100) (Data Size : 3)
Request Header
Example
Request Body: NA
Response Body:
Example
consumePurchase (Consume Purchased In-App Products)
Desc: convert the purchased in-app product status into the consumed status.
URI: https://{host}/v2/purchase/consume/{purchaseId}/{packageName}
Method: POST
Parameters:
String packageName : the package name of the app which calls the API (Data Size : 128)
String purchaseId : the purchase ID (Data Size : 20)
Request Header
Example
Request Body: NA
Response Body:
Example
Error Response
Last updated