<!-- source: docs/api/2_capi/productmanagement/index.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement -->

# ProductManagement

**ProductManagement** is a new service that allows devs to create/edit/delete products and prices programmatically via S2S and cloud-code.
### API Summary

### ProductManagement
* [SysGetProductList](/api/capi/productmanagement/sysgetproductlist) - Returns the list of products (summary details only) for the specified category (optional).
* [SysReadProduct](/api/capi/productmanagement/sysreadproduct) - Retrieve the full product meta-data for the specified product.
* [SysCreateProduct](/api/capi/productmanagement/syscreateproduct) - Creates a new product with the specifed values.
* [SysUpdateProduct](/api/capi/productmanagement/sysupdateproduct) - Updates an existing product with the specifed values. Pass -1 as the version to bypass version checking.
* [SysDeleteProduct](/api/capi/productmanagement/sysdeleteproduct) - Delete the product item.
* [SysAddProductPrice](/api/capi/productmanagement/sysaddproductprice) - Adds a new price to the given product item.
* [SysUpdateProductPrice](/api/capi/productmanagement/sysupdateproductprice) - Updates (replaces) a price for the given product item.
* [SysDeleteProductPrice](/api/capi/productmanagement/sysdeleteproductprice) - Deletes a price for the given product item. If the priceId being deleted is the currently active price, the defaultPriceId will be set to -1 (not-for-sale).
* [SysSetDefaultProductPrice](/api/capi/productmanagement/syssetdefaultproductprice) - Sets the default (i.e. active) price for the given product item.


---

<!-- source: docs/api/2_capi/productmanagement/sysaddproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysaddproductprice -->

# SysAddProductPrice

Adds a new price to the given product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_ADD_PRODUCT_PRICE |

> **Info:** Note: When passing the referencePrice field to SysAddProductPrice, the value is specified in cents/pennies. This differs from the App Store price fields, which are entered in dollars and cents.

## Method Parameters
Parameter | Description
--------- | -----------
itemId | The product item identifier.
version | The product configuration version. 
priceJson | The price details as JSON map.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
{
    "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"
         }
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/syscreateproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/syscreateproduct -->

# SysCreateProduct

Creates a new product with the specifed values.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_CREATE_PRODUCT |

## Method Parameters
Parameter | Description
--------- | -----------
productJson | The product details.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
//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"
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysdeleteproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysdeleteproduct -->

# SysDeleteProduct

Delete the product item.

> **Tip:** If any real purchases of the product exist, product deletion will be disallowed (error returned)

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_DELETE_PRODUCT |

## Method Parameters

| Parameter | Description                                                      |
| --------- | ---------------------------------------------------------------- |
| itemId    | The item id being deleted.                                       |
| version   | The version being validated. Pass -1 to bypass version checking. |

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var itemId = "barBundle1Imp";
var version = 1;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysDeleteProduct(itemId, version);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_DELETE_PRODUCT",
    "data": {
    "itemId": "barBundle1Imp",
    "version": 1
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": null,
    "status": 200
}
```

</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysdeleteproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysdeleteproductprice -->

# SysDeleteProductPrice

Deletes a price for the given product item. If the priceId being deleted is the currently active price, the defaultPriceId will be set to -1 (not-for-sale).

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_DELETE_PRODUCT_PRICE |

## Method Parameters
Parameter | Description
--------- | -----------
itemId | The product item identifier.
version | The product configuration version. The version being validated. Pass -1 to bypass version checking.
priceId | The priceId being deleted.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 3;
var priceId = 2;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysDeleteProductPrice(itemId, version, priceId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_DELETE_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 3,
    "priceId": 2
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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"
                    }
                }
            },
            {
                "priceId": 1,
                "referencePrice": 999,
                "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": 1592930578072,
        "version": 4,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysgetproductlist.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysgetproductlist -->

# SysGetProductList

Returns the list of products (summary details only) for the specified category (optional).

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_GET_PRODUCT_LIST |

## Method Parameters
Parameter | Description
--------- | -----------
category | Optional. The product item category to filter on. Leave blank or null to retrieve all products.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var category = "bars";
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysGetProductList(category);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_GET_PRODUCT_LIST",
    "data": {
    "category": "bars"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "products": [
            {
                "itemId": "barBundle1Imp12peer",
                "defaultReferencePrice": -1,
                "iTunesSubscriptionType": "Free",
                "data": {
                    "customAttr": "value"
                },
                "imageUrl": "",
                "description": "Bundle of 10 Bars.",
                "title": "Bars (10)",
                "category": "bars",
                "type": "Subscription"
            }
        ]
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysreadproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysreadproduct -->

# SysReadProduct

Retrieve the full product meta-data for the specified product.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_READ_PRODUCT |

## Method Parameters
Parameter | Description
--------- | -----------
itemId | The item id being requested.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysReadProduct(itemId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_READ_PRODUCT",
    "data": {
    "itemId": "gold_bars_10"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "productDetails": {
            "gameId": "23783",
            "itemId": "gold_bars_10",
            "type": "Consumable",
            "iTunesSubscriptionType": null,
            "category": "gold",
            "title": "product",
            "description": "gold_bars_10",
            "imageUrl": null,
            "currency": {},
            "parentCurrency": {},
            "peerCurrency": {
                "deploypeer": {
                    "gems": 1
                }
            },
            "defaultPriceId": 0,
            "prices": [
                {
                    "priceId": 0,
                    "referencePrice": 400,
                    "storeData": {
                        "amazon": {
                            "id": "com.amazon.cunsumable.gold.v1"
                        },
                        "facebook": {
                            "currencyList": [
                                {
                                    "currency": "USD",
                                    "price": 6
                                }
                            ]
                        },
                        "googlePlay": {
                            "id": "3"
                        }
                    }
                },
                {
                    "priceId": 1,
                    "referencePrice": 500,
                    "storeData": {
                        "amazon": {
                            "id": "a"
                        }
                    }
                }
            ],
            "data": null,
            "createdAt": 1592542611282,
            "updatedAt": 1592543124830,
            "version": 7,
            "absoluteImageUrl": null
        }
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/syssetdefaultproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/syssetdefaultproductprice -->

# SysSetDefaultProductPrice

Sets the default (i.e. active) price for the given product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_SET_DEFAULT_PRODUCT_PRICE |

## Method Parameters
Parameter | Description
--------- | -----------
itemId | The product item identifier.
version | The product configuration version. The version being validated. Pass -1 to bypass version checking.
priceId | The priceId being set as the default. Pass -1 to make a product item not-for-sale.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 1;
var priceId = 2;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysSetDefaultProductPrice(itemId, version, priceId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_SET_DEFAULT_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 1,
    "priceId": 2
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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": 2,
        "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"
                    }
                }
            },
            {
                "priceId": 1,
                "referencePrice": 999,
                "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"
                    }
                }
            },
            {
                "priceId": 2,
                "referencePrice": 699,
                "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": 1592931088568,
        "version": 2,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysupdateproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysupdateproduct -->

# 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

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_UPDATE_PRODUCT",
    "data": {
    "itemId": "barBundle1Imp",
    "version": 1,
    "productJson": { 
      "category": "bars",
      "title": "Bars (10)",
      "description": "The new bundle of 10 Bars."
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```
</details>


---

<!-- source: docs/api/2_capi/productmanagement/sysupdateproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/capi/productmanagement/sysupdateproductprice -->

# SysUpdateProductPrice

Updates (replaces) a price for the given product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_UPDATE_PRODUCT_PRICE |

## Method Parameters
Parameter | Description
--------- | -----------
itemId | The product item identifier.
version | The product configuration version.
priceId | The priceId being updated.
priceJson | The price details as JSON map.

## Usage

**C#:**

```csharp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**C++:**

```cpp
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Obj-C:**

```objectivec
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Java:**

```java
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**JavaScript:**

```javascript
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Dart:**

```dart
// Cloud Code only. To view example, switch to the Cloud Code tab
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- Cloud Code only. To view example, switch to the Cloud Code tab
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 2;
var priceId = 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.sysUpdateProductPrice(itemId, version, priceId, priceJson);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_UPDATE_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 2,
    "priceId": 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"
         }
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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"
                    }
                }
            },
            {
                "priceId": 1,
                "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": 1592930067424,
        "version": 3,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```
</details>


---

<!-- source: docs/api/4_s2s/productmanagement/index.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement -->

# ProductManagement

**ProductManagement** is a new service that allows devs to create/edit/delete products and prices programmatically via S2S and cloud-code.
### API Summary

### ProductManagement
* [SysGetProductList](/api/s2s/productmanagement/sysgetproductlist) - Returns the list of products (summary details only) for the specified category (optional).
* [SysReadProduct](/api/s2s/productmanagement/sysreadproduct) - Retrieve the full product meta-data for the specified product.
* [SysCreateProduct](/api/s2s/productmanagement/syscreateproduct) - Creates a new product with the specifed values.
* [SysUpdateProduct](/api/s2s/productmanagement/sysupdateproduct) - Updates an existing product with the specifed values. Pass -1 as the version to bypass version checking.
* [SysDeleteProduct](/api/s2s/productmanagement/sysdeleteproduct) - Delete the product item.
* [SysAddProductPrice](/api/s2s/productmanagement/sysaddproductprice) - Adds a new price to the given product item.
* [SysUpdateProductPrice](/api/s2s/productmanagement/sysupdateproductprice) - Updates (replaces) a price for the given product item.
* [SysDeleteProductPrice](/api/s2s/productmanagement/sysdeleteproductprice) - Deletes a price for the given product item. If the priceId being deleted is the currently active price, the defaultPriceId will be set to -1 (not-for-sale).
* [SysSetDefaultProductPrice](/api/s2s/productmanagement/syssetdefaultproductprice) - Sets the default (i.e. active) price for the given product item.


---

<!-- source: docs/api/4_s2s/productmanagement/sysaddproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysaddproductprice -->

# 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

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
{
    "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"
         }
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/syscreateproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/syscreateproduct -->

# SysCreateProduct

Creates a new product with the specifed values.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_CREATE_PRODUCT |

## Method Parameters

| Parameter   | Description          |
| ----------- | -------------------- |
| productJson | The product details. |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
//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"
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysdeleteproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysdeleteproduct -->

# SysDeleteProduct

Delete the product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_DELETE_PRODUCT |

## Method Parameters

| Parameter | Description                                                      |
| --------- | ---------------------------------------------------------------- |
| itemId    | The item id being deleted.                                       |
| version   | The version being validated. Pass -1 to bypass version checking. |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var itemId = "barBundle1Imp";
var version = 1;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysDeleteProduct(itemId, version);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_DELETE_PRODUCT",
    "data": {
    "itemId": "barBundle1Imp",
    "version": 1
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": null,
    "status": 200
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysdeleteproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysdeleteproductprice -->

# SysDeleteProductPrice

Deletes a price for the given product item. If the priceId being deleted is the currently active price, the defaultPriceId will be set to -1 (not-for-sale).

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_DELETE_PRODUCT_PRICE |

## Method Parameters

| Parameter | Description                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------- |
| itemId    | The product item identifier.                                                                        |
| version   | The product configuration version. The version being validated. Pass -1 to bypass version checking. |
| priceId   | The priceId being deleted.                                                                          |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 3;
var priceId = 2;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysDeleteProductPrice(itemId, version, priceId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_DELETE_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 3,
    "priceId": 2
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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"
                    }
                }
            },
            {
                "priceId": 1,
                "referencePrice": 999,
                "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": 1592930578072,
        "version": 4,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysgetproductlist.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysgetproductlist -->

# SysGetProductList

Returns the list of products (summary details only) for the specified category (optional).

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_GET_PRODUCT_LIST |

## Method Parameters

| Parameter | Description                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- |
| category  | Optional. The product item category to filter on. Leave blank or null to retrieve all products. |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var category = "bars";
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysGetProductList(category);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_GET_PRODUCT_LIST",
    "data": {
    "category": "bars"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "products": [
            {
                "itemId": "barBundle1Imp12peer",
                "defaultReferencePrice": -1,
                "iTunesSubscriptionType": "Free",
                "data": {
                    "customAttr": "value"
                },
                "imageUrl": "",
                "description": "Bundle of 10 Bars.",
                "title": "Bars (10)",
                "category": "bars",
                "type": "Subscription"
            }
        ]
    },
    "status": 200
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysreadproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysreadproduct -->

# SysReadProduct

Retrieve the full product meta-data for the specified product.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_READ_PRODUCT |

## Method Parameters

| Parameter | Description                  |
| --------- | ---------------------------- |
| itemId    | The item id being requested. |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysReadProduct(itemId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_READ_PRODUCT",
    "data": {
    "itemId": "gold_bars_10"
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "data": {
        "productDetails": {
            "gameId": "23783",
            "itemId": "gold_bars_10",
            "type": "Consumable",
            "iTunesSubscriptionType": null,
            "category": "gold",
            "title": "product",
            "description": "gold_bars_10",
            "imageUrl": null,
            "currency": {},
            "parentCurrency": {},
            "peerCurrency": {
                "deploypeer": {
                    "gems": 1
                }
            },
            "defaultPriceId": 0,
            "prices": [
                {
                    "priceId": 0,
                    "referencePrice": 400,
                    "storeData": {
                        "amazon": {
                            "id": "com.amazon.cunsumable.gold.v1"
                        },
                        "facebook": {
                            "currencyList": [
                                {
                                    "currency": "USD",
                                    "price": 6
                                }
                            ]
                        },
                        "googlePlay": {
                            "id": "3"
                        }
                    }
                },
                {
                    "priceId": 1,
                    "referencePrice": 500,
                    "storeData": {
                        "amazon": {
                            "id": "a"
                        }
                    }
                }
            ],
            "data": null,
            "createdAt": 1592542611282,
            "updatedAt": 1592543124830,
            "version": 7,
            "absoluteImageUrl": null
        }
    },
    "status": 200
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/syssetdefaultproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/syssetdefaultproductprice -->

# SysSetDefaultProductPrice

Sets the default (i.e. active) price for the given product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_SET_DEFAULT_PRODUCT_PRICE |

## Method Parameters

| Parameter | Description                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------- |
| itemId    | The product item identifier.                                                                        |
| version   | The product configuration version. The version being validated. Pass -1 to bypass version checking. |
| priceId   | The priceId being set as the default. Pass -1 to make a product item not-for-sale.                  |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 1;
var priceId = 2;
var productManagementProxy = bridge.getProductManagementServiceProxy();

var postResult = productManagementProxy.sysSetDefaultProductPrice(itemId, version, priceId);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_SET_DEFAULT_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 1,
    "priceId": 2
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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": 2,
        "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"
                    }
                }
            },
            {
                "priceId": 1,
                "referencePrice": 999,
                "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"
                    }
                }
            },
            {
                "priceId": 2,
                "referencePrice": 699,
                "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": 1592931088568,
        "version": 2,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysupdateproduct.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysupdateproduct -->

# 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

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
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!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_UPDATE_PRODUCT",
    "data": {
    "itemId": "barBundle1Imp",
    "version": 1,
    "productJson": {
      "category": "bars",
      "title": "Bars (10)",
      "description": "The new bundle of 10 Bars."
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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
}
```

</details>


---

<!-- source: docs/api/4_s2s/productmanagement/sysupdateproductprice.md -->
<!-- url: https://docs-internal.braincloudservers.com/api/s2s/productmanagement/sysupdateproductprice -->

# SysUpdateProductPrice

Updates (replaces) a price for the given product item.

| Service | Operation |
| ------- | --------- |
| productManagement | SYS_UPDATE_PRODUCT_PRICE |

## Method Parameters

| Parameter | Description                        |
| --------- | ---------------------------------- |
| itemId    | The product item identifier.       |
| version   | The product configuration version. |
| priceId   | The priceId being updated.         |
| priceJson | The price details as JSON map.     |

## Usage

**C#:**

```csharp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**C++:**

```cpp
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Obj-C:**

```objectivec
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Java:**

```java
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**JavaScript:**

```javascript
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Dart:**

```dart
// S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Roblox:**

```lua
-- N/A
```

**GDScript:**

```gdscript
N/A
```

**Lua:**

```lua
-- S2S call: to view example, switch to the Cloud Code or Raw tab.
```

**Cloud Code:**

```cfscript
var itemId = "gold_bars_10";
var version = 2;
var priceId = 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.sysUpdateProductPrice(itemId, version, priceId, priceJson);
if (postResult.status == 200) {
    // Success!
}
```

**Raw:**

```r
{
    "service": "productManagement",
    "operation": "SYS_UPDATE_PRODUCT_PRICE",
    "data": {
    "itemId": "gold_bars_10",
    "version": 2,
    "priceId": 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"
         }
      }
    }
  }
}
```

<details>
<summary>JSON Response</summary>

```json
{
    "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"
                    }
                }
            },
            {
                "priceId": 1,
                "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": 1592930067424,
        "version": 3,
        "absoluteImageUrl": "https://api.braincloudservers.com/files/portal/g/23783"
    },
    "status": 200
}
```

</details>
