Coins & Transactions
Distribute coins, check balances, and react to store purchases via webhooks
The store handles browsing and redemption; everything else — awarding coins, showing balances in your own UI, and reacting to purchases — happens through the REST API and webhooks, ideally from your backend.
Make these calls from your backend, not the app, so your API key stays out of the client binary. See Security best practices.
Response examples on this page show the data payload of the standard response envelope.
Distribute coins
Award coins when the player completes a rewarded action. Get the coinId from the Coins page in the console:
curl -X POST https://api.playsuper.club/coins/YOUR_COIN_ID/distribute \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-game-uuid: your-unique-player-id" \
-d '{"amount": 100}'| Body field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | The amount of coins to distribute (must be positive) |
The x-game-uuid header identifies the player by the same UUID you used in Authentication. Alternatively, use Authorization: Bearer <token> instead.
Response 201:
{
"message": "Coin distribution initiated",
"transactionId": "txn-1a2b3c4d-5678-90ab-cdef-1234567890ab"
}The player sees the updated balance the next time the store loads.
Check coin balances
Show the player's balance in your own UI:
curl https://api.playsuper.club/player/funds \
-H "x-api-key: YOUR_API_KEY" \
-H "x-game-uuid: your-unique-player-id"Response 200:
[
{
"id": "wallet-123",
"playerId": "d2f1a3b4-5678-90ab-cdef-1234567890ab",
"coinId": "YOUR_COIN_ID",
"balance": 1500,
"coin": {
"name": "Gold Coin",
"pictureUrl": "https://assets.playsuper.club/coins/gold.png"
}
}
]Refresh the balance when the player closes the store screen — a purchase inside the store changes it.
React to store purchases (webhooks)
Unlike the Unity SDK's Transaction Sync, a plain WebView has no event bridge into your app. To know when a player spends or is refunded coins in the store, configure a webhook — PlaySuper POSTs to your server in real time:
curl -X POST 'https://api.playsuper.club/studio-webhooks/configure' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_STUDIO_API_KEY' \
-d '{
"webhookUrl": "https://your-server.com/webhooks/playsuper",
"subscribedEvents": ["COINS_CREDITED", "COINS_DEBITED", "COINS_REFUNDED"],
"environment": "PRODUCTION"
}'Your endpoint then receives events like:
{
"event_type": "COINS_DEBITED",
"user_uuid": "your-unique-player-id",
"coin_id": "YOUR_COIN_ID",
"delta": -500,
"new_balance": 1000,
"reason": "PURCHASE_DEBIT"
}The reason field tells you what happened:
| Reason | Meaning |
|---|---|
PURCHASE_DEBIT | Player purchased a reward from the store |
REFUND_CREDIT | Coins refunded due to a failed/expired purchase |
GAME_CREDIT / GAME_DEBIT | Your own distribute/deduct API calls — skip these to avoid double-processing |
See the Webhook Integration guide for signature verification, retry policy, and complete server examples in Node.js, Python, and Go.
Next, see everything wired together in the Complete Example.