Skip to main content

Tích hợp API

Tất cả HTTP calls nằm trong src/services/api.ts.

Base URL: {REACT_APP_API_BASE_URL} — mặc định http://localhost:3001/api

Auth header: Authorization: Bearer {agent_auth_token}

401 handling: Axios interceptor dispatch auth:unauthorized → logout.


Auth & Account

MethodEndpointFunctionMục đích
POST/agent-auth/loginloginWithUsernameOrEmailLogin agent
POST/agent-auth/verify-otpverifyPortalLoginOtpXác minh OTP login
POST/agent-auth/forgot-password/request-otprequestForgotPasswordOtpBước 1 quên mật khẩu
POST/agent-auth/forgot-password/verify-otpverifyForgotPasswordOtpBước 2 quên mật khẩu
POST/agent-auth/forgot-password/confirmconfirmForgotPasswordResetBước 3 đặt mật khẩu mới
PATCH/agent/settings/two-factorpatchPortalTwoFactorBật/tắt 2FA
PATCH/agent/settings/low-balance-warningpatchAgentLowBalanceWarningCảnh báo số dư thấp
POST/agent/verify/send-otpsendAgentVerificationOtpGửi OTP xác minh agent
POST/agent/verify/confirmconfirmAgentVerificationOtpXác nhận OTP agent

Dashboard & Credits

MethodEndpointFunctionMục đích
GET/agent/dashboardfetchDashboardSố dư, thống kê shops/players
POST/agent/credits/purchasepurchaseCreditsMua credits (redirect payment)
POST/agent/convert-balance-to-creditsconvertBalanceToCreditsUSD → credits
POST/agent/credits/distributedistributeCreditsPhân phối credit xuống shop
POST/agent/shops/:shopId/credits/withdrawwithdrawCreditsFromShopRút credit từ shop về agent
GET/agent/payments/zeroxprocessing/static-walletslistZeroxStaticWalletsDanh sách ví crypto tĩnh
POST/agent/payments/zeroxprocessing/static-wallets/initinitZeroxStaticWalletsKhởi tạo ví crypto

Agent Transactions (Credit ledger)

MethodEndpointFunctionMục đích
GET/agent/transactionsfetchAgentTransactionsCredit ledger
GET/agent/transactions/:idfetchAgentCreditTransactionByIdChi tiết giao dịch
GET/agent/transactions/exportexportAgentWalletTransactionsExport CSV

Online Balance / USD Wallet

MethodEndpointFunctionMục đích
GET/agent/online-balance/ledgerfetchAgentOnlineBalanceLedgerUSD ledger
GET/agent/online-balance/ledger/:idfetchAgentUsdLedgerEntryByIdChi tiết USD entry
GET/agent/online-balance/ledger/exportexportAgentOnlineBalanceLedgerExport CSV
GET/agent/online-balance/withdrawals/otp/eligibilityfetchAgentWithdrawalOtpEligibilityKiểm tra OTP
POST/agent/online-balance/withdrawals/otp/sendsendAgentWithdrawalOtpGửi OTP
POST/agent/online-balance/withdrawals/otp/verifyverifyAgentWithdrawalOtpXác minh OTP
POST/agent/online-balance/withdrawalscreateAgentOnlineBalanceWithdrawalTạo rút USD
GET/agent/online-balance/withdrawals/feefetchAgentOnlineBalanceWithdrawalFeePreview phí
GET/agent/portal-withdrawal-limitsfetchAgentPortalWithdrawalLimitsGiới hạn rút

Shops

MethodEndpointFunctionMục đích
GET/agent/shopsfetchShopsDanh sách shop
GET/agent/shops/statsfetchAgentShopHierarchyStatsThống kê hierarchy theo ngày
GET/agent/shops/:shopIdfetchShopChi tiết shop
POST/agent/shopscreateShopTạo shop mới
PATCH/agent/shops/:shopId/suspendsuspendShopSuspend shop
PATCH/agent/shops/:shopId/unsuspendunsuspendShopUnsuspend shop
PATCH/agent/shops/:shopId/costupdateShopCostCập nhật cost rate
PATCH/agent/shops/:shopId/nameupdateShopNameĐổi tên shop
PATCH/agent/shops/:shopId/passwordupdateShopPasswordĐổi password shop
PATCH/agent/shops/:shopId/popup-permissionsupdateShopPopupPermissionQuyền popup shop
GET/agent/shops/:shopId/walletsfetchAgentShopWalletsWallets của shop
GET/agent/shops/:shopId/transactionsfetchAgentShopWalletTransactionsCredit ledger shop
GET/agent/shops/:shopId/transactions/:idfetchAgentShopCreditTransactionByIdChi tiết credit tx shop
GET/agent/shops/:shopId/online-balance/ledgerfetchAgentShopOnlineBalanceLedgerUSD ledger shop
GET/agent/shops/:shopId/online-balance/ledger/:idfetchAgentShopUsdLedgerEntryByIdChi tiết USD entry shop
GET/agent/shops/:shopId/game-mappingsfetchShopGameMappingsGame mappings
PUT/agent/shops/:shopId/game-mappingsputShopGameMappingsCập nhật game mappings

Players

MethodEndpointFunctionMục đích
GET/agent/playersfetchAgentPlayersDanh sách players
GET/agent/players/:playerIdfetchAgentPlayerChi tiết player
GET/agent/players/:playerId/transactionsfetchAgentPlayerTransactionsLịch sử giao dịch player

Provider Fees & Payment

MethodEndpointFunctionMục đích
GET/agent/provider-feesfetchProviderFeeConfigsBảng phí (read-only)
GET/payment/provider-fee-rategetProviderFeeRateTỷ lệ phí
GET/payment/supported-methodsuseSupportedZeroxMethods (hook)Phương thức hỗ trợ (public)

Broadcasts & Popups

MethodEndpointFunctionMục đích
GET/agent/broadcastsfetchAgentBroadcastsDanh sách broadcast
POST/agent/broadcasts/:id/ackackAgentBroadcastAcknowledge broadcast
POST/agent/broadcastscreateAgentBroadcastGửi broadcast
GET/agent/in-app-popups/unseenfetchAgentInAppPopupsUnseenPopup chưa xem
POST/agent/in-app-popups/:id/seenmarkAgentInAppPopupSeenĐánh dấu đã xem
POST/agent/in-app-popups/:id/never-againmarkAgentInAppPopupNeverAgainKhông hiện lại
POST/agent/in-app-popupscreateAgentInAppPopupGửi popup

Fraud & Games

MethodEndpointFunctionMục đích
GET/agent/player-fraud-indicatorsfetchAgentPlayerFraudIndicatorsFraud player (list)
GET/agent/player-fraud-indicators/:idfetchAgentPlayerFraudIndicatorDetailChi tiết
GET/agent/player-fraud-indicators/transaction/:id/profit-analysisfetchAgentPlayerFraudWithdrawalAnalysisPhân tích profit
POST/agent/player-fraud-indicators/:id/resolveresolveAgentPlayerFraudIndicatorResolve indicator
GET/game-providersfetchPublicGameProvidersDanh sách game providers