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 {shop_auth_token}
401 handling: Axios interceptor dispatches auth:unauthorized → logout.
Auth & Account
| Method | Endpoint | Function | Purpose |
|---|
| POST | /portal-auth/login | portalLogin | Shop login (or cashier — blocked in UI) |
| POST | /shop-auth/login | loginWithUsernameOrEmail | Shop login (legacy) |
| POST | /shop-auth/verify-otp | verifyPortalLoginOtp | Verify login OTP |
| POST | /shop-auth/forgot-password/request-otp | requestForgotPasswordOtp | Forgot password step 1 |
| POST | /shop-auth/forgot-password/verify-otp | verifyForgotPasswordOtp | Forgot password step 2 |
| POST | /shop-auth/forgot-password/confirm | confirmForgotPasswordReset | Forgot password step 3 — set new password |
| GET | /shop/me | fetchShopMe | Shop profile |
| PATCH | /shop/settings/two-factor | patchPortalTwoFactor | Enable/disable 2FA |
| PATCH | /shop/settings/low-balance-warning | patchShopLowBalanceWarning | Low balance warning |
| POST | /shop/verify/send-otp | sendShopVerificationOtp | Send shop verification OTP |
| POST | /shop/verify/confirm | confirmShopVerificationOtp | Confirm shop OTP |
Dashboard & Credits
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/dashboard | fetchDashboard | Balances, player count, flags |
| POST | /shop/credits/purchase | purchaseShopCredits | Buy credits (payment redirect) |
| POST | /shop/convert-balance-to-credits | convertBalanceToCredits | USD → credits |
| GET | /shop/payments/zeroxprocessing/static-wallets | listZeroxStaticWallets | Static crypto wallet list |
| POST | /shop/payments/zeroxprocessing/static-wallets/init | initZeroxStaticWallets | Initialize crypto wallets |
Players
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/players | fetchShopPlayers | Player list |
| POST | /shop/players | createShopPlayer | Create new player |
| GET | /shop/players/:id | fetchShopPlayer | Player detail |
| GET | /shop/players/lookup | lookupPlayerByPhone | Lookup by phone |
| POST | /shop/players/register-initiate | registerPlayerInitiate | OTP registration — step 1 |
| POST | /shop/players/register-resend | resendPlayerRegistrationOtp | Resend registration OTP |
| POST | /shop/players/register-verify | verifyPlayerRegistration | OTP registration — step 2 |
| POST | /shop/players/:id/credits | postShopPlayerCredits | Deposit/deduct credits |
| POST | /shop/players/:id/ban | banShopPlayer | Ban player |
| POST | /shop/players/:id/unban | unbanShopPlayer | Unban player |
| POST | /shop/players/:id/credentials/reissue | postShopPlayerReissueCredentials | Reissue credentials |
| POST | /shop/players/:id/send-verification | sendPlayerVerification | Send player OTP |
| POST | /shop/players/:id/verify | verifyPlayerVerification | Verify player OTP |
| GET | /shop/players/:id/transactions | fetchPlayerTransactions | Player transaction history |
Transactions & Ledger
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/transactions | fetchShopWalletTransactions | Credit ledger |
| GET | /shop/transactions/:id | fetchShopCreditTransactionById | Credit transaction detail |
| GET | /shop/transactions/export | exportShopWalletTransactions | CSV export credits |
| GET | /shop/online-balance/ledger | fetchShopOnlineBalanceLedger | USD ledger |
| GET | /shop/online-balance/ledger/:id | fetchShopUsdLedgerEntryById | USD entry detail |
| GET | /shop/online-balance/ledger/export | exportShopOnlineBalanceLedger | CSV export USD |
Withdrawals
Player withdrawals (shop approval)
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/withdrawals/pending | fetchPendingWithdrawalsForApproval | Pending approval list |
| GET | /shop/withdrawals | fetchShopWithdrawals | Withdrawal history |
| POST | /shop/withdrawals/:id/approve | approveShopWithdrawal | Approve |
| POST | /shop/withdrawals/:id/reject | rejectShopWithdrawal | Reject |
Shop USD withdrawal
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/online-balance/withdrawals/otp/eligibility | fetchShopWithdrawalOtpEligibility | Check OTP eligibility |
| POST | /shop/online-balance/withdrawals/otp/send | sendShopWithdrawalOtp | Send OTP |
| POST | /shop/online-balance/withdrawals/otp/verify | verifyShopWithdrawalOtp | Verify OTP |
| POST | /shop/online-balance/withdrawals | createShopOnlineBalanceWithdrawal | Create USD withdrawal |
| GET | /shop/online-balance/withdrawals/fee | fetchShopOnlineBalanceWithdrawalFee | Fee preview |
| GET | /shop/portal-withdrawal-limits | fetchShopPortalWithdrawalLimits | Withdrawal limits |
Provider fees & Payment
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/provider-fees | fetchProviderFeeConfigs | Shop fee configuration |
| PUT | /shop/provider-fees | upsertShopProviderFeeConfigs | Update fees |
| GET | /payment/provider-fee-rate | getProviderFeeRate | Fee rate |
| GET | /payment/supported-methods | fetchSupportedMethods | Supported methods (public) |
Cashiers & Fraud
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/cashiers | fetchShopCashiers | Cashier list |
| POST | /shop/cashiers | createShopCashier | Create cashier |
| PATCH | /shop/cashiers/:id/suspend | suspendShopCashier | Suspend |
| PATCH | /shop/cashiers/:id/terminate | terminateShopCashier | Terminate |
| GET | /shop/cashiers/:id/report | fetchCashierReport | Report |
| GET | /shop/cashiers/:id/shifts | fetchCashierShifts | Shift history |
| GET | /shop/fraud-indicators | fetchFraudIndicators | Cashier fraud |
| GET | /shop/player-fraud-indicators | fetchPlayerFraudIndicators | Player fraud (list) |
| GET | /shop/player-fraud-indicators/:id | fetchPlayerFraudIndicatorDetail | Detail |
| GET | /shop/player-fraud-indicators/transaction/:id/profit-analysis | fetchPlayerFraudWithdrawalAnalysis | Profit analysis |
| POST | /shop/player-fraud-indicators/:id/resolve | resolvePlayerFraudIndicator | Resolve indicator |
Communication & Domain
| Method | Endpoint | Function | Purpose |
|---|
| GET | /shop/broadcasts | fetchShopBroadcasts | Broadcast list |
| POST | /shop/broadcasts/:id/ack | ackShopBroadcast | Acknowledge broadcast |
| POST | /shop/broadcasts | createShopBroadcast | Send broadcast |
| GET | /shop/in-app-popups/unseen | fetchShopInAppPopupsUnseen | Unseen popups |
| POST | /shop/in-app-popups/:id/seen | markShopInAppPopupSeen | Mark as seen |
| POST | /shop/in-app-popups/:id/never-again | markShopInAppPopupNeverAgain | Never show again |
| POST | /shop/in-app-popups | createShopInAppPopup | Send popup |
| GET | /shop/kiosk-domain | fetchShopKioskDomain | Get subdomain |
| POST | /shop/kiosk-domain | createShopKioskDomain | Create subdomain |
| PATCH | /shop/kiosk-domain | patchShopKioskDomain | Update subdomain |
Cashier API (separate client)
cashierClient uses token cashier_auth_token. These functions exist in api.ts but are not the main flow of Shop Portal — cashiers use Cashier App.
| Method | Endpoint | Function |
|---|
| POST | /cashier-auth/login | cashierLogin |
| GET | /cashier/me | fetchCashierMe |
| POST | /cashier/shifts/open | cashierOpenShift |
| POST | /cashier/shifts/close | cashierCloseShift |
| GET | /cashier/players | cashierFetchPlayers |
| POST | /cashier/players | cashierCreatePlayer |
| POST | /cashier/players/:id/deposit | cashierDepositCredits |
| POST | /cashier/players/:id/redeem | cashierRedeemCredits |