EN CN
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.
For Sale
The following is a quick reference to the IAP Publish APIs:
See In-App Purchase for more information about IAP functionality in Seller Portal.
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.
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.
Bearer <your-access-token>
application/json
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>"
Request a list of item information within a scope appropriate for the page and size.
GET /iap/v6/applications/:packageName/items?page={}&size={}
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"
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.
Request detailed information about one item.
GET /iap/v6/applications/:packageName/items/:id
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"
See View item response parameters for a description of the response parameters.
{ "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" }, ... ] }
Register an in-app item.
POST /iap/v6/applications/com.package.name/items
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"
{ "id": "one_gallon_gas", "type": "CONSUMABLE", "status": "PUBLISHED", "prices": [ { "countryId": "KOR", "currency": "KRW", "localPrice": "1000.000" }, { "countryId": "USA", "currency": "USD", "localPrice": "0.99" }, ... ] }
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.
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"
{ "id": "one_gallon_gas", "type": "CONSUMABLE", "status": "PUBLISHED", "prices": [ { "countryId": "KOR", "currency": "KRW", "localPrice": "1000.000" }, { "countryId": "USA", "currency": "USD", "localPrice": "1" }, ... ] }
Modify the title, countryId, or localPrice of an in-app item. The id cannot be modified. Parameters that are not specified are not modified.
title
countryId
localPrice
id
PATCH /iap/v6/applications/:packageName/items
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"
{ "id": "one_gallon_gas", "type": "CONSUMABLE", "status": "PUBLISHED" }
Remove an in-app item.
DELETE /iap/v6/applications/:packageName/items/:id
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"
Status: 200 OK
{ "id": "one_gallon_gas" }
The following are response codes you may see when the request fails.
109
117
118
400
101
103
104
106
110
105
107