Skip to main content

API Integration

All HTTP calls are in src/services/api.ts.

Base URL: {REACT_APP_API_BASE_URL} — default http://localhost:3001/api

Auth header: Authorization: Bearer {agent_auth_token}

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


Auth & Account

MethodEndpointFunctionPurpose
POST/agent-auth/loginloginWithUsernameOrEmailAgent login
POST/agent-auth/verify-otpverifyPortalLoginOtpVerify login OTP
POST/agent-auth/forgot-password/request-otprequestForgotPasswordOtpForgot password step 1
POST/agent-auth/forgot-password/verify-otpverifyForgotPasswordOtpForgot password step 2
POST/agent-auth/forgot-password/confirmconfirmForgotPasswordResetForgot password step 3 — set new password
PATCH/agent/settings/two-factorpatchPortalTwoFactorEnable/disable 2FA
PATCH/agent/settings/low-balance-warningpatchAgentLowBalanceWarningLow balance warning
POST/agent/verify/send-otpsendAgentVerificationOtpSend agent verification OTP
POST/agent/verify/confirmconfirmAgentVerificationOtpConfirm agent OTP

Dashboard & Credits

MethodEndpointFunctionPurpose
GET/agent/dashboardfetchDashboardBalances, shop/player stats
POST/agent/credits/purchasepurchaseCreditsBuy credits (payment redirect)
POST/agent/convert-balance-to-creditsconvertBalanceToCreditsUSD → credits
POST/agent/credits/distributedistributeCreditsDistribute credits to shop
POST/agent/shops/:shopId/credits/withdrawwithdrawCreditsFromShopWithdraw credits from shop to agent
GET/agent/payments/zeroxprocessing/static-walletslistZeroxStaticWalletsStatic crypto wallet list
POST/agent/payments/zeroxprocessing/static-wallets/initinitZeroxStaticWalletsInitialize crypto wallets

Agent Transactions (Credit ledger)

MethodEndpointFunctionPurpose
GET/agent/transactionsfetchAgentTransactionsCredit ledger
GET/agent/transactions/:idfetchAgentCreditTransactionByIdTransaction detail
GET/agent/transactions/exportexportAgentWalletTransactionsCSV export

Online Balance / USD Wallet

MethodEndpointFunctionPurpose
GET/agent/online-balance/ledgerfetchAgentOnlineBalanceLedgerUSD ledger
GET/agent/online-balance/ledger/:idfetchAgentUsdLedgerEntryByIdUSD entry detail
GET/agent/online-balance/ledger/exportexportAgentOnlineBalanceLedgerCSV export
GET/agent/online-balance/withdrawals/otp/eligibilityfetchAgentWithdrawalOtpEligibilityCheck OTP eligibility
POST/agent/online-balance/withdrawals/otp/sendsendAgentWithdrawalOtpSend OTP
POST/agent/online-balance/withdrawals/otp/verifyverifyAgentWithdrawalOtpVerify OTP
POST/agent/online-balance/withdrawalscreateAgentOnlineBalanceWithdrawalCreate USD withdrawal
GET/agent/online-balance/withdrawals/feefetchAgentOnlineBalanceWithdrawalFeeFee preview
GET/agent/portal-withdrawal-limitsfetchAgentPortalWithdrawalLimitsWithdrawal limits

Shops

MethodEndpointFunctionPurpose
GET/agent/shopsfetchShopsShop list
GET/agent/shops/statsfetchAgentShopHierarchyStatsHierarchy stats by date
GET/agent/shops/:shopIdfetchShopShop detail
POST/agent/shopscreateShopCreate new shop
PATCH/agent/shops/:shopId/suspendsuspendShopSuspend shop
PATCH/agent/shops/:shopId/unsuspendunsuspendShopUnsuspend shop
PATCH/agent/shops/:shopId/costupdateShopCostUpdate cost rate
PATCH/agent/shops/:shopId/nameupdateShopNameRename shop
PATCH/agent/shops/:shopId/passwordupdateShopPasswordChange shop password
PATCH/agent/shops/:shopId/popup-permissionsupdateShopPopupPermissionShop popup permission
GET/agent/shops/:shopId/walletsfetchAgentShopWalletsShop wallets
GET/agent/shops/:shopId/transactionsfetchAgentShopWalletTransactionsShop credit ledger
GET/agent/shops/:shopId/transactions/:idfetchAgentShopCreditTransactionByIdShop credit tx detail
GET/agent/shops/:shopId/online-balance/ledgerfetchAgentShopOnlineBalanceLedgerShop USD ledger
GET/agent/shops/:shopId/online-balance/ledger/:idfetchAgentShopUsdLedgerEntryByIdShop USD entry detail
GET/agent/shops/:shopId/game-mappingsfetchShopGameMappingsGame mappings
PUT/agent/shops/:shopId/game-mappingsputShopGameMappingsUpdate game mappings

Players

MethodEndpointFunctionPurpose
GET/agent/playersfetchAgentPlayersPlayer list
GET/agent/players/:playerIdfetchAgentPlayerPlayer detail
GET/agent/players/:playerId/transactionsfetchAgentPlayerTransactionsPlayer transaction history

Provider Fees & Payment

MethodEndpointFunctionPurpose
GET/agent/provider-feesfetchProviderFeeConfigsFee table (read-only)
GET/payment/provider-fee-rategetProviderFeeRateFee rate
GET/payment/supported-methodsuseSupportedZeroxMethods (hook)Supported methods (public)

Broadcasts & Popups

MethodEndpointFunctionPurpose
GET/agent/broadcastsfetchAgentBroadcastsBroadcast list
POST/agent/broadcasts/:id/ackackAgentBroadcastAcknowledge broadcast
POST/agent/broadcastscreateAgentBroadcastSend broadcast
GET/agent/in-app-popups/unseenfetchAgentInAppPopupsUnseenUnseen popups
POST/agent/in-app-popups/:id/seenmarkAgentInAppPopupSeenMark as seen
POST/agent/in-app-popups/:id/never-againmarkAgentInAppPopupNeverAgainNever show again
POST/agent/in-app-popupscreateAgentInAppPopupSend popup

Fraud & Games

MethodEndpointFunctionPurpose
GET/agent/player-fraud-indicatorsfetchAgentPlayerFraudIndicatorsPlayer fraud (list)
GET/agent/player-fraud-indicators/:idfetchAgentPlayerFraudIndicatorDetailDetail
GET/agent/player-fraud-indicators/transaction/:id/profit-analysisfetchAgentPlayerFraudWithdrawalAnalysisProfit analysis
POST/agent/player-fraud-indicators/:id/resolveresolveAgentPlayerFraudIndicatorResolve indicator
GET/game-providersfetchPublicGameProvidersGame provider list