GetSalesInventory
Method gets the active sales inventory for the passed-in currency type and platform.
Service | Operation |
---|---|
appStore | GET_INVENTORY |
Method Parameters
Parameter | Description |
---|---|
storeId | The store id. Refer to the current available store IDs here. |
userCurrency | The currency to retrieve the sales inventory for. This is only used for Steam and Facebook stores. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string storeId = "itunes";
string userCurrency = "{\"userCurrency\":\"USD\"}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.AppStoreService.GetSalesInventory(storeId, userCurrency, successCallback, failureCallback);
const char *storeId = "itunes";
const char *userCurrency = "{\"userCurrency\":\"USD\"}";
_bc->getAppStoreService()->getSalesInventory(storeId, userCurrency, this);
NSString *storeId = @"itunes";
NSString *userCurrency = @"{\"userCurrency\":\"USD\"}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc appStoreService] getSalesInventory:storeId
userCurrency:userCurrency
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String storeId = "itunes";
String userCurrency = "{\"userCurrency\":\"USD\"}";
this; // implements IServerCallback
_bc.getAppStoreService().getSalesInventory(storeId, userCurrency, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var storeId = "itunes";
var userCurrency = {
"userCurrency": "USD"
};
_bc.appStore.getSalesInventory(storeId, userCurrency, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var storeId = "itunes";
var userCurrency = {
"userCurrency": "USD"
};
ServerResponse result = await _bc.appStoreService.getSalesInventory(storeId:storeId, userCurrency:userCurrency);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var storeId = "itunes";
var userCurrency = {
"userCurrency": "USD"
};
var appStoreProxy = bridge.getAppStoreServiceProxy();
var postResult = appStoreProxy.getSalesInventory(storeId, userCurrency);
if (postResult.status == 200) {
// Success!
}
{
"service": "appStore",
"operation": "GET_INVENTORY",
"data": {
"storeId": "itunes",
"category": "subscriptions",
"priceInfoCriteria": {
"userCurrency": "USD"
}
}
}
JSON Response
{
"status": 200,
"data": {
"productInventory": [
{
"currency": {
"bar": 50
},
"description": "Bundle of 50 Bars.",
"fbUrl": "https://dev.braincloudservers.com/fbproductservice?gameId=eggies&itemId=barBundle2Imp",
"gameId": "eggies",
"imageUrl": "http://eggies6waves.braincloudservers.com/s3/eggies-prod/store/bars.png",
"itemId": "barBundle2Imp",
"priceData": {
"ids": [
{
"appId": "ipad",
"itunesId": "com.playbrains.eggiesdevhd2.barBundle2Imp"
},
{
"appId": "iphone",
"itunesId": "com.playbrains.eggiesdev2.barBundle2Imp"
}
]
},
"title": "Bars"
}
],
"serverTime": 1395952561266
}
}