跳到主要内容

Error Codes

Most SDK callbacks that can fail (AuthenticationCallBack, UserCallBack, OTP results, and purchase verification) carry a numeric error code alongside a human-readable message — e.g. result.getError().getCode() / error.code.

These codes come from SdkErrorCode (Android: vn.oeg.sdk.v2.core.validation.domain.SdkErrorCode; iOS: SdkErrorCode) and are identical on Android and iOS — the same numeric value always means the same thing on both platforms.

Not Google Play Billing's own codes

These are the SDK's own codes, not BillingClient.BillingResponseCode (which only ranges roughly -3 to 12). If you see a 4-digit code like 2007, it's from this table, not from Billing directly.

Validation Errors (1000–1999)​

Input the game passed to the SDK failed a local check — these never reach the network.

CodeConstantMeaning
1001INVALID_USERNAMEUsername missing or fails format rules
1002INVALID_PASSWORDPassword missing or too short/long
1003INVALID_FULLNAMEFull name fails validation
1004INVALID_EMAILEmail missing or malformed
1005INVALID_PHONEPhone number missing or malformed
1006INVALID_PRODUCT_IDProduct ID missing or blank
1007INVALID_PURCHASE_TOKENPurchase token missing or blank
1008INVALID_SERVER_IDServer ID missing or blank
1009INVALID_ROLE_IDRole/character ID missing or blank
1010PHONE_NOT_SETAction requires a phone number on the account, but none is set
1011INVALID_OTPOTP code missing or blank
1012INVALID_ACCESS_TOKENAccess token/UUID missing — usually means "not logged in" at the call site

Domain Errors (2000–2999)​

A business-logic condition, not a network failure.

CodeConstantMeaning
2001NOT_LOGGED_INAction requires a logged-in user
2002SESSION_EXPIREDSession/token expired — prompt re-login
2003ACCOUNT_MERGE_REQUIREDGuest account must be merged before continuing
2004GUEST_NOT_ALLOWEDAction isn't available for guest/PlayNow accounts
2005ALREADY_PENDINGRequest already in progress (e.g. account deletion already requested)
2006NO_PENDING_DELETIONNo pending account-deletion request to cancel
2007PURCHASE_CANCELLEDUser dismissed/declined the Google Play (or StoreKit) purchase dialog — not an error to alert on, just log/ignore
2008PURCHASE_ALREADY_OWNEDItem already owned — the SDK consumes it automatically and retries

Network Errors (3000–3999)​

HTTP/connectivity failures while talking to the Alogame backend.

CodeConstantMeaning
3001NETWORK_TIMEOUTRequest timed out
3002NETWORK_UNAVAILABLENo connectivity / host unreachable
3003SERVER_ERRORBackend returned 5xx
3004CLIENT_ERRORBackend returned a 4xx not covered by a more specific code below
3401UNAUTHORIZEDBackend returned HTTP 401
3403FORBIDDENBackend returned HTTP 403
3404NOT_FOUNDBackend returned HTTP 404
3409CONFLICTBackend returned HTTP 409 (e.g. duplicate transaction — see Payment → Duplicate Transaction)
3999UNEXPECTED_ERRORUncaught exception — check message for detail
Legacy OegSdk/AlogameSdk facade uses a separate, smaller code set

The older com.github.alo-game:alogame-sdk-android legacy facade (OegSdk.showPayment, IabCallBack) predates this table and uses its own ad hoc codes (401, 1001 for user-cancel, 3000 general) — see Payment → Error Codes. Those two numbering schemes are different; check which API you're calling before looking up a code.