Magicweave: Player Wallet
This guide is for game developers integrating wallet and gem history features from the Magicweave.
The client_wallet module gives you:
- current player gem balance
- wallet identity for the authenticated player
- wallet transaction history
Base URL and Route Prefix
Base URL:
https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/
Wallet routes are under:
/wallet
Examples:
GET https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/walletGET https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/wallet/history
Required Authentication and Headers
All wallet endpoints require:
x-client-id: <your_project_client_id>x-client-secret: <your_project_client_secret>Authorization: Bearer <magicweave_access_token>
The authenticated user must have client.wallet permission.
Endpoint 1: Get Wallet
GET /wallet
Returns the authenticated player's wallet.
Behavior:
- If wallet exists, it is returned.
- If wallet does not exist yet, backend auto-creates an empty wallet (
gems = 0) and returns it.
Response shape:
{
"id": 10,
"user_id": 42,
"gems": 1250,
"created_at": "2026-04-15T10:30:00Z",
"updated_at": "2026-04-15T12:45:00Z"
}
Reference: Get wallet
Endpoint 2: Get Wallet History
GET /wallet/history
Returns wallet transactions for the authenticated player.
Behavior:
- If wallet exists, returns transaction list ordered newest first.
- If wallet does not exist, returns
404 Wallet not found.
Response shape:
{
"transactions": [
{
"id": 301,
"wallet_id": 10,
"amount": -150,
"balance_after": 1250,
"description": "Store redemption: Amazon INR 100",
"created_at": "2026-04-15T12:45:00Z",
"updated_at": "2026-04-15T12:45:00Z"
},
{
"id": 300,
"wallet_id": 10,
"amount": 200,
"balance_after": 1400,
"description": "Daily streak reward",
"created_at": "2026-04-15T09:00:00Z",
"updated_at": "2026-04-15T09:00:00Z"
}
]
}
Amount semantics:
- positive
amount= gems credited - negative
amount= gems debited balance_after= resulting wallet balance after that transaction
Reference: Get wallet history
Common Error Codes
401: missing/invalid project headers or bearer token403: authenticated user lacksclient.walletpermission404: wallet not found (history endpoint only)
cURL Examples
Get Wallet
curl -X GET "https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/wallet" \
-H "x-client-id: <client-id>" \
-H "x-client-secret: <client-secret>" \
-H "Authorization: Bearer <access-token>"
Get Wallet History
curl -X GET "https://mw-client-api.wonderfulcoast-218d579d.centralindia.azurecontainerapps.io/wallet/history" \
-H "x-client-id: <client-id>" \
-H "x-client-secret: <client-secret>" \
-H "Authorization: Bearer <access-token>"
Integration Notes for Game Teams
- Call
GET /walleton app bootstrap after login to hydrate gem balance. - Refresh wallet after every gem-impacting action (redeem, reward claim, event payout).
- Use
GET /wallet/historyfor ledger screens and to explain balance changes to users. - Treat backend wallet as source of truth; avoid optimistic client-only gem mutation.