SysCreateProduct
Creates a new product with the specifed values.
Service | Operation |
---|---|
productManagement | SYS_CREATE_PRODUCT |
Method Parameters
Parameter | Description |
---|---|
productJson | The product details. |
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 productJson = {
"itemId": "barBundle1Imp12peer",
"type": "Subscription",
"iTunesSubscriptionType": "Free",
"category": "bars",
"title": "Bars (10)",
"description": "Bundle of 10 Bars.",
"imageUrl": "",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {
"deploypeer":{
"gems":15
}
},
"data": {
"customAttr": "value"
}
};
var productManagementProxy = bridge.getProductManagementServiceProxy();
var postResult = productManagementProxy.sysCreateProduct(productJson);
if (postResult.status == 200) {
// Success!
}
//for iTunesSubscriptionType Subscription. Should be one of AutoRenewable, Free, or NonRenewing
{
"service": "productManagement",
"operation": "SYS_CREATE_PRODUCT",
"data": {
"productJson": {
"itemId": "barBundle1Imp12peer",
"type": "Subscription",
"iTunesSubscriptionType": "Free",
"category": "bars",
"title": "Bars (10)",
"description": "Bundle of 10 Bars.",
"imageUrl": "",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {
"deploypeer":{
"gems":15
}
},
"data": {
"customAttr": "value"
}
}
}
}
JSON Response
{
"data": {
"gameId": "23783",
"itemId": "barBundle1Imp12peer",
"type": "Subscription",
"iTunesSubscriptionType": "Free",
"category": "bars",
"title": "Bars (10)",
"description": "Bundle of 10 Bars.",
"imageUrl": "",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {
"deploypeer": {
"gems": 15
}
},
"defaultPriceId": -1,
"prices": [],
"data": {
"customAttr": "value"
},
"createdAt": 1592594992376,
"updatedAt": 1592594992376,
"version": 1,
"absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
},
"status": 200
}