Skip to main content
Version: 6.0.0

SysRecordTransactionAdvanced

Records a manual transaction. Useful for stores that are not yet directly supported -- or for apps that doing purchases via other means - but still want to record them in brainCloud for reporting purposes.

tip

This is a variant of SysRecordTransaction that bundles the optional parameters (promotionId, sandbox, platform) - plus new campaignCode / scenarioCode options - into a single optionsJson object instead of passing them as individual arguments. campaignCode and scenarioCode must both be provided together to apply a LiveOps campaign/scenario to the transaction.

ServiceOperation
appStoreSYS_RECORD_TRANSACTION_ADVANCED

Method Parameters

ParameterDescription
profileIdProfile ID of the user.
storeIdIdentifies the store type. See the appendix for Store Ids. Use "_id" (prefix with an underscore) for custom ids.
itemIdItem ID of the product transaction to be recorded.
dataJsonTransaction details from the store's perspective.
receiptDataReceipt information.
processAwardsWhether to deliver rewards/items.
transactionIdUnique id identifying this transaction in the store. Uniqueness enforced across the app.
pricePrice in hundredths of the app's currency (e.g. cents)
optionsJsonOptional JSON object bundling additional transaction options. Supported keys: promotionId (optional ID of any promotion that applies), sandbox (whether purchase is sandbox), platform (platform of the store, only used for sending offboard events to downstream systems - can be empty string or use value from platform ids here), campaignCode and scenarioCode (both required together to apply a LiveOps campaign/scenario to this transaction).

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"userItemRewards": {
"sword001": {
"fac9e483-c958-46b9-a478-06c97a85e74a": {
"itemId": "fac9e483-c958-46b9-a478-06c97a85e74a",
"quantity": 1
}
}
},
"extra": {
"customAttr": "value"
},
"rewards": {
"extra": {
"customAttr": "value"
},
"currency": {
"bar": 10
},
"items": {
"sword001": {
"defId": "sword001",
"quantity": 1
}
}
},
"currencies": {
"currency": {
"bar": {
"consumed": 0,
"balance": 30,
"purchased": 10,
"awarded": 20,
"revoked": 0
},
"coins": {
"consumed": 0,
"balance": 24,
"purchased": 0,
"awarded": 24,
"revoked": 0
}
}
}
},
"status": 200
}