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 {shop_auth_token}

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


Auth & Account

MethodEndpointFunctionPurpose
POST/portal-auth/loginportalLoginShop login (or cashier — blocked in UI)
POST/shop-auth/loginloginWithUsernameOrEmailShop login (legacy)
POST/shop-auth/verify-otpverifyPortalLoginOtpVerify login OTP
POST/shop-auth/forgot-password/request-otprequestForgotPasswordOtpForgot password step 1
POST/shop-auth/forgot-password/verify-otpverifyForgotPasswordOtpForgot password step 2
POST/shop-auth/forgot-password/confirmconfirmForgotPasswordResetForgot password step 3 — set new password
GET/shop/mefetchShopMeShop profile
PATCH/shop/settings/two-factorpatchPortalTwoFactorEnable/disable 2FA
PATCH/shop/settings/low-balance-warningpatchShopLowBalanceWarningLow balance warning
POST/shop/verify/send-otpsendShopVerificationOtpSend shop verification OTP
POST/shop/verify/confirmconfirmShopVerificationOtpConfirm shop OTP

Dashboard & Credits

MethodEndpointFunctionPurpose
GET/shop/dashboardfetchDashboardBalances, player count, flags
POST/shop/credits/purchasepurchaseShopCreditsBuy credits (payment redirect)
POST/shop/convert-balance-to-creditsconvertBalanceToCreditsUSD → credits
GET/shop/payments/zeroxprocessing/static-walletslistZeroxStaticWalletsStatic crypto wallet list
POST/shop/payments/zeroxprocessing/static-wallets/initinitZeroxStaticWalletsInitialize crypto wallets

Players

MethodEndpointFunctionPurpose
GET/shop/playersfetchShopPlayersPlayer list
POST/shop/playerscreateShopPlayerCreate new player
GET/shop/players/:idfetchShopPlayerPlayer detail
GET/shop/players/lookuplookupPlayerByPhoneLookup by phone
POST/shop/players/register-initiateregisterPlayerInitiateOTP registration — step 1
POST/shop/players/register-resendresendPlayerRegistrationOtpResend registration OTP
POST/shop/players/register-verifyverifyPlayerRegistrationOTP registration — step 2
POST/shop/players/:id/creditspostShopPlayerCreditsDeposit/deduct credits
POST/shop/players/:id/banbanShopPlayerBan player
POST/shop/players/:id/unbanunbanShopPlayerUnban player
POST/shop/players/:id/credentials/reissuepostShopPlayerReissueCredentialsReissue credentials
POST/shop/players/:id/send-verificationsendPlayerVerificationSend player OTP
POST/shop/players/:id/verifyverifyPlayerVerificationVerify player OTP
GET/shop/players/:id/transactionsfetchPlayerTransactionsPlayer transaction history

Transactions & Ledger

MethodEndpointFunctionPurpose
GET/shop/transactionsfetchShopWalletTransactionsCredit ledger
GET/shop/transactions/:idfetchShopCreditTransactionByIdCredit transaction detail
GET/shop/transactions/exportexportShopWalletTransactionsCSV export credits
GET/shop/online-balance/ledgerfetchShopOnlineBalanceLedgerUSD ledger
GET/shop/online-balance/ledger/:idfetchShopUsdLedgerEntryByIdUSD entry detail
GET/shop/online-balance/ledger/exportexportShopOnlineBalanceLedgerCSV export USD

Withdrawals

Player withdrawals (shop approval)

MethodEndpointFunctionPurpose
GET/shop/withdrawals/pendingfetchPendingWithdrawalsForApprovalPending approval list
GET/shop/withdrawalsfetchShopWithdrawalsWithdrawal history
POST/shop/withdrawals/:id/approveapproveShopWithdrawalApprove
POST/shop/withdrawals/:id/rejectrejectShopWithdrawalReject

Shop USD withdrawal

MethodEndpointFunctionPurpose
GET/shop/online-balance/withdrawals/otp/eligibilityfetchShopWithdrawalOtpEligibilityCheck OTP eligibility
POST/shop/online-balance/withdrawals/otp/sendsendShopWithdrawalOtpSend OTP
POST/shop/online-balance/withdrawals/otp/verifyverifyShopWithdrawalOtpVerify OTP
POST/shop/online-balance/withdrawalscreateShopOnlineBalanceWithdrawalCreate USD withdrawal
GET/shop/online-balance/withdrawals/feefetchShopOnlineBalanceWithdrawalFeeFee preview
GET/shop/portal-withdrawal-limitsfetchShopPortalWithdrawalLimitsWithdrawal limits

Provider fees & Payment

MethodEndpointFunctionPurpose
GET/shop/provider-feesfetchProviderFeeConfigsShop fee configuration
PUT/shop/provider-feesupsertShopProviderFeeConfigsUpdate fees
GET/payment/provider-fee-rategetProviderFeeRateFee rate
GET/payment/supported-methodsfetchSupportedMethodsSupported methods (public)

Cashiers & Fraud

MethodEndpointFunctionPurpose
GET/shop/cashiersfetchShopCashiersCashier list
POST/shop/cashierscreateShopCashierCreate cashier
PATCH/shop/cashiers/:id/suspendsuspendShopCashierSuspend
PATCH/shop/cashiers/:id/terminateterminateShopCashierTerminate
GET/shop/cashiers/:id/reportfetchCashierReportReport
GET/shop/cashiers/:id/shiftsfetchCashierShiftsShift history
GET/shop/fraud-indicatorsfetchFraudIndicatorsCashier fraud
GET/shop/player-fraud-indicatorsfetchPlayerFraudIndicatorsPlayer fraud (list)
GET/shop/player-fraud-indicators/:idfetchPlayerFraudIndicatorDetailDetail
GET/shop/player-fraud-indicators/transaction/:id/profit-analysisfetchPlayerFraudWithdrawalAnalysisProfit analysis
POST/shop/player-fraud-indicators/:id/resolveresolvePlayerFraudIndicatorResolve indicator

Communication & Domain

MethodEndpointFunctionPurpose
GET/shop/broadcastsfetchShopBroadcastsBroadcast list
POST/shop/broadcasts/:id/ackackShopBroadcastAcknowledge broadcast
POST/shop/broadcastscreateShopBroadcastSend broadcast
GET/shop/in-app-popups/unseenfetchShopInAppPopupsUnseenUnseen popups
POST/shop/in-app-popups/:id/seenmarkShopInAppPopupSeenMark as seen
POST/shop/in-app-popups/:id/never-againmarkShopInAppPopupNeverAgainNever show again
POST/shop/in-app-popupscreateShopInAppPopupSend popup
GET/shop/kiosk-domainfetchShopKioskDomainGet subdomain
POST/shop/kiosk-domaincreateShopKioskDomainCreate subdomain
PATCH/shop/kiosk-domainpatchShopKioskDomainUpdate 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.

MethodEndpointFunction
POST/cashier-auth/logincashierLogin
GET/cashier/mefetchCashierMe
POST/cashier/shifts/opencashierOpenShift
POST/cashier/shifts/closecashierCloseShift
GET/cashier/playerscashierFetchPlayers
POST/cashier/playerscashierCreatePlayer
POST/cashier/players/:id/depositcashierDepositCredits
POST/cashier/players/:id/redeemcashierRedeemCredits