Skip to main content

API Endpoints & Error Handling — Test Cases

Feature version: v1.0
Reference doc: Deposit Technical Reference — API Endpoints
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report


Changelog

DateVersionChangeAuthor
2026-05-10v1.0Initial creation

TC-API-001 — Player-facing Endpoints 🆕 NEW

#EndpointTest caseExpected ResultActual Result
1POST /api/payment/depositNo auth tokenHTTP 401
2POST /api/payment/depositAuthenticated player, valid payloadTransaction created successfully; paymentUrl returned
3GET /api/payment/deposit-historyAuthenticated playerReturns only that player's transactions (no cross-player data)
4GET /api/payment/balanceAuthenticated playerReturns { balance, reservedBalance }
5GET /api/payment/reserved-balance-detailAuthenticated playerReturns a detailed breakdown of the reserved balance
6GET /api/payment/supported-methodsAuthenticated playerReturns only active payment methods
7GET /api/payment/provider-fee-rateAuthenticated player, valid providerReturns the correct fee rate
8GET /api/payment/zeroxprocessing/coinsAuthenticated playerReturns the list of supported 0x coins

TC-API-002 — Shop-facing Endpoints 🆕 NEW

#EndpointTest caseExpected ResultActual Result
1POST /api/shop/depositsShop auth; player belongs to shop; shop has creditsCredits transferred successfully
2POST /api/shop/depositsShop auth; player does not belong to shopHTTP 400 or 403
3POST /api/shop/depositsNo auth tokenHTTP 401
4GET /api/shop/depositsShop authReturns only that shop's deposit history (no cross-shop data)

TC-API-003 — Error Responses 🆕 NEW

#DescriptionHow to triggerHTTP StatusExpected message
1User inactiveDeposit with player status = 'inactive'403"Account is not active"
2Invalid amountamount = 0 or negative400"Invalid amount"
3Unknown game providergameProviderId not found in DB400"Provider not found"
4Payment adapter failureSimulate gateway being down500"Gateway error"
5Webhook signature invalidSend webhook with incorrect HMAC403"Signature mismatch"
6Invalid state transitionAttempt a disallowed status change409"Transition not allowed"