POST /api/economy
All requests require a valid Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_TOKENget_coin — retrieve current balances
Retrieve all balances:
{
"action": "get_coin",
"account_type": "player",
"account_uuid": "player-123"
}Retrieve specific balance:
{
"action": "get_coin",
"account_type": "player",
"account_uuid": "player-123",
"coin_type": "GOLD"
}Response example (All):
{
"account_type": "player",
"account_uuid": "player-123",
"balances": {
"COIN": "0",
"COPPER": "0",
"SILVER": "0",
"GOLD": "0",
"POINT": "0"
}
}Response example (Specific):
{
"account_type": "player",
"account_uuid": "player-123",
"balances": {
"GOLD": "0"
}
}add_coin — add currency to an account
{
"action": "add_coin",
"account_type": "player",
"account_uuid": "player-123",
"coin_type": "GOLD",
"amount": 5
}Response example:
{
"message": "Coin added",
"balance": "5",
"currency": "GOLD"
}minus_coin — deduct currency from an account
{
"action": "minus_coin",
"account_type": "player",
"account_uuid": "player-123",
"coin_type": "GOLD",
"amount": 2
}Response example:
{
"message": "Coin deducted",
"balance": "3",
"currency": "GOLD"
}create_account — verify or create an economy account
{
"action": "create_account",
"account_type": "player",
"account_uuid": "player-123"
}Response example:
{
"message": "Account verified/created",
"account_uuid": "player-123"
}account_typedefaults toplayer(e.g.,player,guild).coin_typevalues includeCOIN,COPPER,SILVER,GOLD, andPOINT.amountshould be a numeric value (handled as BigInt internally).- All balances are returned as strings to maintain precision for large numbers.