Tích hợp API
Tất cả HTTP calls trong src/services/api.ts (~150 methods). React Query hooks bọc trong src/hooks/useApi.ts.
Base URL: REACT_APP_API_BASE_URL — mặc định http://localhost:3001/api
Auth: Authorization: Bearer {admin_auth_token}
401: dispatch auth:unauthorized → logout.
Auth
| Method | Path | Function |
|---|---|---|
| POST | /admin-auth/login | loginCredentials |
| POST | /admin-auth/verify-otp | verifyOtp |
Dashboard
| GET | /admin/dashboard/stats | getDashboardStats |
Players (Users)
| Method | Path | Function |
|---|---|---|
| GET | /admin/users | getUsers |
| GET | /admin/users/filter-meta | getPlayerFilterMeta |
| GET | /admin/users/:userId | getUserDetails |
| POST | /admin/users/:userId/ban | banUser |
| POST | /admin/users/:userId/unban | unbanUser |
| GET | /admin/users/:userId/terminate/preview | getTerminatePlayerPreview |
| POST | /admin/users/:userId/terminate | terminatePlayer |
| PATCH | /admin/users/:userId/status | updateUserStatus |
| GET | /admin/users/:userId/wallet | getUserWallet |
| GET | /admin/users/:userId/wallet/transactions | getWalletTransactions |
| GET | /admin/users/:userId/wallet/reserved-balance-detail | getReservedBalanceDetail |
Payment Transactions
| Method | Path | Function |
|---|---|---|
| GET | /admin/transactions | getTransactions |
| GET | /admin/transactions/stats | getTransactionStats |
| GET | /admin/transactions/:id | getTransactionDetail |
| PATCH | /admin/transactions/:id/status | updateTransactionStatus |
| GET | /admin/payment-transactions/:id | getFullTransactionDetail |
| POST | /admin/payment-transactions/:id/sync-game-wallet | retrySyncTransaction |
| GET | /admin/payment-transactions/failed-sync | getFailedTransactions |
| POST | /payment/admin/payment-transactions/:id/refund | refundTransaction |
| POST | /payment/admin/payment-transactions/refund-all | refundAllTransactions |
Withdrawals
| Method | Path | Function |
|---|---|---|
| GET | /payment/admin/withdrawals/pending | getWithdrawals |
| POST | /payment/admin/withdrawals/:id/approve | approveWithdrawal |
| POST | /payment/admin/withdrawals/:id/reject | rejectWithdrawal |
| POST | /payment/admin/withdrawals/:id/complete | completeWithdrawal |
| GET | /payment/admin/withdrawals/:id/payout-log | getWithdrawalPayoutLog |
| POST | /payment/admin/withdrawals/:id/retry-payout | retryWithdrawalPayout |
| GET | /payment/admin/withdrawals/:id/profit-analysis | getWithdrawalProfitAnalysis |
| POST | /payment/admin/users/:userId/adjust-balance | adjustUserBalance |
Support Tickets
| Method | Path | Function |
|---|---|---|
| GET | /support/admin/tickets | getTickets |
| GET | /support/admin/tickets/search | searchTickets |
| GET | /support/tickets/:ticketNumber | getTicket |
| POST | /support/admin/tickets/:ticketNumber/reply | replyTicket |
| PATCH | /support/admin/tickets/:ticketNumber | updateTicketStatus |
| PATCH | /support/admin/tickets/:ticketNumber/done | markTicketDone |
| GET | /support/admin/stats | getSupportStats |
| GET | /support/categories | getCategories |
Admin Management
| Method | Path | Function |
|---|---|---|
| GET | /admin/manage/me | getCurrentAdmin |
| PATCH | /admin/manage/me/settings | updateMySettings |
| POST | /admin/manage/me/email/request | requestEmailChange |
| POST | /admin/manage/me/email/verify | verifyEmailChange |
| GET/POST | /admin/manage | getAdmins / createAdmin |
| PATCH/DELETE | /admin/manage/:adminId | updateAdmin / deleteAdmin |
| PATCH | /admin/manage/:adminId/reset-password | resetAdminPassword |
| GET | /admin/manage/permissions | getAllPermissions |
| GET/POST/PUT | /admin/manage/:adminId/permissions/* | grant/revoke/set |
Game Wallets
| Method | Path | Function |
|---|---|---|
| GET | /admin/game-wallets | getGameWallets |
| GET | /admin/game-wallets/:id | getGameWalletDetail |
| GET | /admin/game-wallets/:id/transactions | getGameWalletTransactions |
| POST | /admin/game-wallets/:id/sync | syncGameWallet |
| GET | /admin/game-wallets/statistics | getGameWalletStatistics |
| GET/POST | /admin/game-wallets/recall-all/* | preview/run recall job |
| GET | /admin/game-wallets/export-recall | exportGameRecallCsv |
Game Providers
| Method | Path | Function |
|---|---|---|
| GET/POST | /admin/game-providers | list / create |
| GET/PUT/DELETE | /admin/game-providers/:id | detail / update / delete |
| PUT | /admin/game-providers/display-order | reorderGameProviders |
| GET/POST | /admin/agent-balances | getAgentBalances / syncAgentBalances |
VFX Config
| GET/POST | /admin/vfx-config | get / update |
| GET/POST/PUT/DELETE | /admin/vfx-config/schedules/* | schedule CRUD |
Transaction Limits & Fraud
| GET/POST | /admin/transaction-limits/config | get / update |
| GET | /admin/transaction-limits/fraud-flags | getFraudFlags |
| POST | /admin/transaction-limits/fraud-flags/:id/resolve | resolveFraudFlag |
Provider Fees
| GET/PUT | /admin/payment/provider-fees | get / upsert |
| GET | /payment/supported-methods | getSupportedMethods |
Manual Game Deposits
| GET | /admin/manual-game-deposits | list |
| GET | /admin/manual-game-deposits/:id | detail |
| POST | .../confirm / .../reject | confirm / reject |
| PUT | .../account | update game account |
Domains
| GET/POST | /admin/domains | list / create |
| PATCH/DELETE | /admin/domains/:id | update / delete |
| GET/PUT | /admin/domains/:id/game-mappings | mappings |
| GET | /admin/domains/:id/analytics | analytics |
| GET | /admin/kiosk/health | kiosk health |
Super Agents
| Method | Path | Function |
|---|---|---|
| GET/POST | /admin/super-agents | list / create |
| GET/PATCH | /admin/super-agents/:id | detail / patch |
| PATCH | .../password, .../suspend, .../unsuspend, .../terminate | governance |
| GET/PUT | .../game-mappings | game mappings |
| POST | .../cash-funding, .../cash-withdrawal | funding |
| PATCH | .../agents/:agentId/assign | assign agent |
| GET | .../wallet-transactions | wallet ledger |
Agents (CDN)
| Method | Path | Function |
|---|---|---|
| GET/POST | /admin/agents | list / create |
| GET | /admin/agents/:id | getAdminAgentDetail |
| PATCH | .../password, .../rates, .../suspend, .../unsuspend, .../terminate, .../popup-permissions | governance |
| GET | .../payment-transactions, .../wallet-transactions | ledgers |
| POST | .../shops | create shop |
| GET/PATCH | .../shops/:shopId/* | shop detail, rates, credit adjust, suspend/terminate |
Shops & Cashiers
| GET | /admin/shops/:shopId | getAdminShopDetailByShopId |
| GET/POST | /admin/cashiers | list / create |
| PATCH | /admin/cashiers/:id/suspend\|unsuspend\|terminate | governance |
| GET | /admin/cashiers/:id/report, .../shifts | report |
| GET | /admin/cashiers/fraud-indicators | fraud |
Finance & Reports
| POST | /admin/finance-corrections | postAdminFinanceCorrection |
| GET | /admin/reports/cost | getCostReport |
Broadcasts & Popups
| GET/POST | /admin/broadcasts | list / create |
| POST | /admin/broadcasts/credential-sms/batch | SMS batch |
| GET | /admin/me/broadcasts, POST .../ack | admin inbox |
| GET/POST | /admin/in-app-popups | list / create |
USD & Credit Wallets
| GET | /admin/usd-wallets/summary | summary |
| GET | /admin/usd-wallets/ledger | ledger |
| GET | /admin/usd-wallets/ledger/export | export |
| GET | /admin/usd-wallets/ledger/:id | detail |
| POST | /admin/usd-wallets/withdrawals/:id/approve\|reject | approve/reject |
| GET | /admin/credit-wallets/summary\|ledger\|export | credit wallet ops |
Integration API Logs (super admin)
| GET | /admin/api-logs/game, .../payment, .../webhooks | list |
| GET | /admin/api-logs/*/:id | detail |