SysUpdateProduct
Updates an existing product with the specifed values. Pass -1 as the version to bypass version checking.
Service | Operation |
---|---|
productManagement | SYS_UPDATE_PRODUCT |
Method Parameters
Parameter | Description |
---|---|
itemId | The product item identifier. |
version | The product configuration version. |
productJson | The product details to update. Note: If itemId is included in the productJson, it is ignored. The itemId provided as a direct parameter takes priority. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var itemId = "barBundle1Imp";
var version = 1;
var productJson = {
"category": "bars",
"title": "Bars (10)",
"description": "The new bundle of 10 Bars."
};
var productManagementProxy = bridge.getProductManagementServiceProxy();
var postResult = productManagementProxy.sysUpdateProduct(itemId, version, productJson);
if (postResult.status == 200) {
// Success!
}
{
"service": "productManagement",
"operation": "SYS_UPDATE_PRODUCT",
"data": {
"itemId": "barBundle1Imp",
"version": 1,
"productJson": {
"category": "bars",
"title": "Bars (10)",
"description": "The new bundle of 10 Bars."
}
}
}
JSON Response
{
"data": {
"gameId": "23783",
"itemId": "barBundle1Imp",
"type": "Subscription",
"iTunesSubscriptionType": "Free",
"category": "bars",
"title": "Bars (10)",
"description": "The new bundle of 10 Bars.",
"imageUrl": "",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {},
"defaultPriceId": -1,
"prices": [],
"data": {
"customAttr": "value"
},
"createdAt": 1592594640577,
"updatedAt": 1592596878019,
"version": 2,
"absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
},
"status": 200
}