Skip to main content

Transactions

Track in-app purchases, virtual currency exchanges, and blockchain transactions to power the Monetization dashboard.


In-App Purchases

GameRebellion.TrackTransaction(new GrTransactionEvent
{
Amount = 4.99,
Currency = "USD",
Type = "iap",
Description = "Premium Sword",
Status = "success",
UsdValue = 4.99
});

Fields

FieldTypeRequiredDescription
AmountdoubleNoTransaction amount in original currency
CurrencystringYesISO 4217 currency code (e.g., USD, EUR)
TypestringNoiap, virtual, subscription, refund
DescriptionstringNoHuman-readable item name
StatusstringNosuccess, failed, pending, refunded
UsdValuedoubleNoNormalized USD value for cross-currency comparison

Crypto Transactions

GameRebellion.TrackCryptoTransaction(new GrCryptoTransactionEvent
{
Amount = 0.05,
Currency = "ETH",
Type = "nft_purchase",
Blockchain = "ethereum",
UsdValue = 150.00,
Status = "confirmed"
});

Virtual Currency

Track virtual currency exchanges (gems, gold, credits) as Type = "virtual":

GameRebellion.TrackTransaction(new GrTransactionEvent
{
Amount = 500,
Currency = "GEMS",
Type = "virtual",
Description = "Gem Pack - Medium",
Status = "success",
UsdValue = 2.99
});

Server-to-Server

requests.post(
"https://sdk-api.gamerebellion.com/api/v1/event",
headers={"X-API-Key": "<YOUR_API_KEY>"},
json={
"event_type": "transaction",
"payload": {
"amount": 4.99,
"currency": "USD",
"type": "iap",
"description": "Premium Sword",
"status": "success",
"usd_value": 4.99
}
}
)
tip

Always include usd_value for cross-currency revenue reporting. If your store provides a USD equivalent, use that. Otherwise, use a recent exchange rate.