Skip to main content
Version: 6.1.0

SysCreateScenario

Creates a new variant scenario under the specified campaign. The scenario code is assigned automatically, using the next available letter from A to Z, so a campaign can have at most 26 variant scenarios. The campaign must not have ended.

A new scenario is not part of the campaign's traffic split until you give it a weight with SysUpdateCampaignScenarioWeights — until then, no players are assigned to it.

ServiceOperation
campaignSYS_CREATE_SCENARIO

Method Parameters​

ParameterDescription
campaignCodeThe campaign code to create the scenario under.
configJsonThe scenario configuration. Supported fields are description (string), overrides (see below — at least one override is required) and scenarioJson (free-form custom payload returned to players assigned to the scenario).

Scenario Overrides​

overrides holds up to three maps. Each one is keyed by the identifier of the thing being overridden, and every scenario must contain at least one override.

MapKeyValue fields
globalPropertiesGlobal property namename (must match the key) and value (string). The property must already exist, cannot be marked as secret, and the override value must differ from its current value.
cashProductsCash product itemIditemId (must match the key), priceId (the price point to use), notForSale (hide the product) and showAsListPrice (show the regular price as a strikethrough list price).
itemsItem definition defIddefId (must match the key), buyPrice (map of currency to amount), buyPriceDisabled (item cannot be bought) and showAsListPrice (show the regular price as a list price).

Usage​

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"campaignCode": "SUMMER2026",
"scenarioCode": "A",
"scenarioCampaignCode": "SUMMER2026:A",
"description": "Beach",
"overrides": {
"globalProperties": {
"xpMultiplier": {
"name": "xpMultiplier",
"value": "2"
},
"ThemeJson": {
"name": "ThemeJson",
"value": "{\"season\":\"Summer\",\"extra\":\"Beach\"}"
}
},
"cashProducts": {
"coinBundle10": {
"itemId": "coinBundle10",
"notForSale": false,
"priceId": 1,
"showAsListPrice": false
}
},
"items": {
"beachHat": {
"defId": "beachHat",
"buyPriceDisabled": false,
"buyPrice": {
"coin": 200
},
"showAsListPrice": false
},
"summerHat": {
"defId": "summerHat",
"buyPriceDisabled": true,
"buyPrice": null,
"showAsListPrice": false
}
}
},
"scenarioJson": {
"customField1": "beach"
},
"version": 1,
"createdAt": 1811725200000,
"updatedAt": 1811725200000
},
"status": 200
}
Common Error Codes

Status Codes​

CodeNameDescription
40345MISSING_RECORDNo campaign exists for the specified campaignCode.
40001INVALID_REQUESTThe campaign has ended and can no longer be modified.
40001INVALID_REQUESTAll 26 scenario codes (A–Z) are already in use for the campaign.
40660INVALID_PARAMETER_VALUEThe scenario configuration is invalid — for example, no overrides were specified, or an override refers to a global property, cash product or item that does not exist. The error message describes the specific problem.
40616CLOUD_CODE_ONLY_METHODThe method was called from a client. It can only be called from Cloud Code or S2S.
40731FEATURE_NOT_SUPPORTED_BY_BILLING_PLANBilling plan does not include the Campaign feature. Requires a plan that includes Enterprise features.