Spend Balance
Deduct balance from an authorized user. The amount is transferred to your account (app owner).
POST /api/oauth/spend
Request
fetch("https://omegacases.com/api/oauth/spend", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
token: "user_token_here",
amount: 2.50
})
})Success response
{ "ok": true, "spent": 2.50, "new_balance": 47.50 }Error responses
{ "error": "Invalid or revoked token" } // 401
{ "error": "Token does not have spend_balance scope" } // 403
{ "error": "Insufficient balance" } // 402Rules
AmountMust be a positive number — you can only spend, never add
TransferDeducted from user, credited to app owner account
NotificationUser receives an in-app notification every time balance is spent
Requiresspend_balance scope on the token
Only call
/api/oauth/spend from your server. Tokens exposed client-side can be abused.