SysAddProductPrice
Adds a new price to the given product item.
Service | Operation |
---|---|
productManagement | SYS_ADD_PRODUCT_PRICE |
Method Parameters
Parameter | Description |
---|---|
itemId | The product item identifier. |
version | The product configuration version. |
priceJson | The price details as JSON map. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var itemId = "gold_bars_10";
var version = 1;
var priceJson = {
"referencePrice": 99,
"storeData": {
"amazon": {
"id": "amazoniapid"
},
"itunes": {
"ids": [
{
"appId": "iphone",
"itunesId": "appleiapid"
}
]
},
"facebook": {
"currencyList": [
{
"currency": "USD",
"price": 0.99
},
{
"currency": "CAD",
"price": 1.29
}
]
},
"googlePlay": {
"id": "googleiapid"
}
}
};
var productManagementProxy = bridge.getProductManagementServiceProxy();
var postResult = productManagementProxy.sysAddProductPrice(itemId, version, priceJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "productManagement",
"operation": "SYS_ADD_PRODUCT_PRICE",
"data": {
"itemId": "gold_bars_10",
"version": 1,
"priceJson": {
"referencePrice": 99,
"storeData": {
"amazon": {
"id": "amazoniapid"
},
"itunes": {
"ids": [
{
"appId": "iphone",
"itunesId": "appleiapid"
}
]
},
"facebook": {
"currencyList": [
{
"currency": "USD",
"price": 0.99
},
{
"currency": "CAD",
"price": 1.29
}
]
},
"googlePlay": {
"id": "googleiapid"
}
}
}
}
}
JSON Response
{
"data": {
"gameId": "23783",
"itemId": "gold_bars_10",
"type": "Consumable",
"iTunesSubscriptionType": null,
"category": "bars",
"title": "Bars (10)",
"description": "Bundle of 10 Bars.",
"imageUrl": "",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {
"deploypeer": {
"gems": 11
}
},
"defaultPriceId": -1,
"prices": [
{
"priceId": 0,
"referencePrice": 99,
"storeData": {
"amazon": {
"id": "amazoniapid"
},
"itunes": {
"ids": [
{
"appId": "iphone",
"itunesId": "appleiapid"
}
]
},
"facebook": {
"currencyList": [
{
"currency": "USD",
"price": 0.99
},
{
"currency": "CAD",
"price": 1.29
}
]
},
"googlePlay": {
"id": "googleiapid"
}
}
}
],
"data": {
"customAttr": "value"
},
"createdAt": 1592928409270,
"updatedAt": 1592928588330,
"version": 2,
"absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783",
"newPriceId": 0
},
"status": 200
}