IAP Publish API
The IAP Publish API is used to view, register, modify, and remove Samsung In-App Purchase (IAP) items.
Using the IAP Publish API to register, modify, or delete an item immediately changes it within the content, even when the content is in the For Sale
state.
The following is a quick reference to the IAP Publish APIs:
Name | Request | Description |
---|---|---|
View item list | GET /iap/v6/applications/:packageName/items | Request a list of item information within a scope appropriate for the page and size. |
View individual item | GET /iap/v6/applications/:packageName/items/:id | Request detailed information on one item. |
Create item | POST /iap/v6/applications/:packageName/items | Register an in-app item. |
Modify item | PUT /iap/v6/applications/:packageName/items | Modify an in-app item. |
Partial item modification | PATCH /iap/v6/applications/:packageName/items | Modify the specified parameters of an in-app item. |
Remove item | DELETE /iap/v6/applications/:packageName/items/:id | Remove an in-app item. |
See In-App Purchase for more information about IAP functionality in Seller Portal.
Requirements
In order to use the IAP Publish API, the following is required:
-
The IAP Publish API is part of the Galaxy Store Developer API. You must meet all of the requirements of the Galaxy Store Developer API including, but not limited to, creating the access token, including the access token in the authorization header of every IAP Publish API call, and having commercial seller status to manage in-app purchase items.
-
The IAP Publish API must be connected with the content in the In App Purchase tab area of Seller Portal. To create this connection, you must either initially distribute your content using the Content Publish API or the content must be in the
For Sale
state in Seller Portal. If this connection does not exist, matching product information cannot be retrieved. -
You must integrate IAP Helper into your app. All binaries registered in your content must support IAP.
If these requirements are not met, error code 106 is returned.
Authorization parameters
Every request must include authorization header parameters which specify the content type, your access token, and service account ID and the URL path must contain the package name. See Create an Access Token for more information about how to create an access token and service account ID.
Attribute | In | Description |
---|---|---|
Authorization | header | Required .Use Bearer <your-access-token> where <your-access-token> is the access token you requested from the Galaxy Store authentication server
|
service-account-id | header | Required. The service account ID used to create the JWT associated with the access token (can be found in the Assistance > API Service area of Seller Portal) |
content-type | header | Required. Must be application/json
|
packageName | path | Required. The app's package name |
The following example shows the header used with the IAP Publish APIs:
curl -X IAP_PUBLISH_API_REQUEST \
-H "content-type: application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>"
View item list
Request a list of item information within a scope appropriate for the page and size.
Request
GET /iap/v6/applications/:packageName/items?page={}&size={}
Name | Type | In | Description |
---|---|---|---|
page | int | query | Required. Number of pages of content to return |
size | int | query | Required. Number of items to be returned on a page |
curl \
-X GET \
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items?page=1&size=20"
Response
Parameters
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the in-app item registered in Seller Portal. |
title | string | Title of the in-app item registered in Seller Portal. |
description | string | Brief explanation of the in-app item registered in Seller Portal. |
type | string | In-App item type.
|
status | string | Item distribution status in Seller Portal.
|
itemPaymentMethod.phoneBillStatus | Boolean | Whether or not the item is paid with an automatic payment on a phone bill.
|
usdPrice | number | The base price in USD (United States of America dollars) of the item. The price can be set between 0 and 400. |
prices[].countryId | string | Three-character country code (ISO 3166) of the country where the item is sold. |
prices[].currency | string | Three-character currency code (ISO 4217) of the specified country's currency (for example, EUR, GBP, USD). |
prices[].localPrice | string | Price of the item in the specified country's currency. |
totalCount | number | Number of items listed in the response. |
Success
Status: 200 Success
{
"itemList": [
{
"id": "one_gallon_gas",
"title": "1 Gallon gas",
"description": "Fuel for driving game",
"type": "CONSUMABLE",
"status": "PUBLISHED",
"itemPaymentMethod": {
"phoneBillStatus": true
},
"usdPrice": 0.900,
"prices": [
{
"countryId": "KOR",
"currency": "KRW",
"localPrice": "1000.000"
},
{
"countryId": "USA",
"currency": "USD",
"localPrice": "0.900"
}, ...
]
}, ...
],
"totalCount": 3
}
See Failure response codes for a list of possible response codes when a request fails.
View individual item
Request detailed information about one item.
Request
GET /iap/v6/applications/:packageName/items/:id
Name | Type | Description |
---|---|---|
id | string | Required. Unique identifier of the in-app item registered in Seller Portal. |
curl \
-X GET
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items/one_gallon_gas"
Response
See View item response parameters for a description of the response parameters.
Success
Status: 200 Success
{
"id": "one_gallon_gas",
"title": "1 Gallon gas",
"description": "Fuel for driving game",
"type": "CONSUMABLE",
"status": "PUBLISHED",
"itemPaymentMethod": {
"phoneBillStatus": true
},
"usdPrice": 0.900,
"prices": [
{
"countryId": "KOR",
"currency": "KRW",
"localPrice": "1000.000"
},
{
"countryId": "USA",
"currency": "USD",
"localPrice": "0.900"
}, ...
]
}
See Failure response codes for a list of possible response codes when a request fails.
Create item
Register an in-app item.
Request
POST /iap/v6/applications/com.package.name/items
Name | Type | Description |
---|---|---|
id | string | Required. Unique identifier of the in-app item registered in Seller Portal. |
title | string | Required. Title of the in-app item registered in Seller Portal. |
description | string | Required. Brief explanation of the in-app item registered in Seller Portal. |
type | string | Required. In-App item type.
|
status | string | Required. Item distribution status in Seller Portal.
|
itemPaymentMethod.phoneBillStatus | Boolean | Required. Whether or not the item is paid with an automatic payment on a phone bill.
|
usdPrice | number | Required. The base price in USD (United States of America dollars) of the item. The price can be set between 0 and 400. |
prices[].countryId | string | Required. Three-character country code (ISO 3166) of the country where the item is sold. |
prices[].currency | string | Three-character currency code (ISO 4217) of the specified country's currency (for example, EUR, GBP, USD). |
prices[].localPrice | string | Required. Price of the item in the specified country's currency. |
curl \
-X POST \
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
-d '{"id":"one_gallon_gas","title":"1 Gallon gas","description":"Fuel for driving game","type":"CONSUMABLE","status":"PUBLISHED","itemPaymentMethod":{"phoneBillStatus":true},"usdPrice":0.99,"prices":[{"countryId":"KOR","currency":"KRW","localPrice":"1000"},{"countryId":"USA","currency":"USD","localPrice":"0.99"}]}' \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items"
Response
Success
Status: 200 Success
{
"id": "one_gallon_gas",
"type": "CONSUMABLE",
"status": "PUBLISHED",
"prices": [
{
"countryId": "KOR",
"currency": "KRW",
"localPrice": "1000.000"
},
{
"countryId": "USA",
"currency": "USD",
"localPrice": "0.99"
}, ...
]
}
See Failure response codes for a list of possible response codes when a request fails.
Modify item
Modify an in-app item. The request replaces all existing information, except the content ID, of the item.
To modify an app, use the response from View individual item to create the input required for this request.
Request
PUT /iap/v6/applications/:packageName/items
See Create item request for a description of the request parameters.
curl \
-X PUT \
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
-d '{"id":"one_gallon_gas","title":"1 Gallon gas","description":"Fuel for driving game fix","type":"CONSUMABLE","status":"PUBLISHED","itemPaymentMethod":{"phoneBillStatus":true},"usdPrice":1,"prices":[{"countryId":"KOR","currency":"KRW","localPrice":"1000"},{"countryId":"USA","currency":"USD","localPrice":"1"}]}' \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items"
Response
Success
Status: 200 Success
{
"id": "one_gallon_gas",
"type": "CONSUMABLE",
"status": "PUBLISHED",
"prices": [
{
"countryId": "KOR",
"currency": "KRW",
"localPrice": "1000.000"
},
{
"countryId": "USA",
"currency": "USD",
"localPrice": "1"
}, ...
]
}
See Failure response codes for a list of possible response codes when a request fails.
Partial item modification
Modify the title
, countryId
, or localPrice
of an in-app item. The id
cannot be modified. Parameters that are not specified are not modified.
Request
PATCH /iap/v6/applications/:packageName/items
Name | Type | Description |
---|---|---|
id | string | Required. Unique identifier of the in-app item registered in Seller Portal. |
title | string | Title of the in-app item registered in Seller Portal. |
prices[].countryId | string | Three-character country code (ISO 3166) of the country where the item is sold. |
prices[].localPrice | string | Price of the item in the specified country's currency. |
curl \
-X PATCH \
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
-d '{"id":"one_gallon_gas","title":"2 Gallon gas"}' \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items"
Response
Success
Status: 200 Success
{
"id": "one_gallon_gas",
"type": "CONSUMABLE",
"status": "PUBLISHED"
}
See Failure response codes for a list of possible response codes when a request fails.
Remove item
Remove an in-app item.
Request
DELETE /iap/v6/applications/:packageName/items/:id
Name | Type | In | Description |
---|---|---|---|
id | string | path | Required. Unique identifier of the in-app item registered in Seller Portal. |
curl \
-X DELETE
-H "content-type:application/json" \
-H "Authorization: Bearer <your-access-token>" \
-H "service-account-id: <your-service-account-id>" \
"https://devapi.samsungapps.com/iap/v6/applications/com.package.name/items/one_gallon_gas"
Response
Success
Status: 200 OK
{
"id": "one_gallon_gas"
}
See Failure response codes for a list of possible response codes when a request fails.
Failure response codes
The following are response codes you may see when the request fails.
Status | Code and message |
---|---|
400 Bad Request |
|
401 Unauthorized |
|
404 Not Found |
|
409 Conflict |
|