Skip to main content

Error codes

Every PurseException carries one PurseErrorCode. The names match the web SDK's error codes exactly, and exception.documentationLink points at the matching anchor of that page. This page lists what each code means on Android and the action expected from your app.

Exception families: PurseSessionException (decoding the session), PurseCheckoutException (the checkout's own rules), PartnerUiException (a partner's native step), PaymentApiException (HTTP and transport). Every exception is under the PurseException root.

Session​

CodeExceptionMeaningExpected action
SESSION_MALFORMEDPurseSessionException.SessionMalformedThe widgetData string is not a client session, or an unknown shapeA bug in the hand-over from your backend. Do not show a checkout; log and fix
EXPIRED_SESSIONPurseCheckoutException.SessionExpiredA submit on an expired session, or setSession with an expired one. The watchdog throws nothing: it only sets sessionState to EXPIRED. A refused setSession leaves the current session and its state unchangedMint a new client session and call setSession
SUBMIT_BLOCKEDPurseCheckoutException.SubmitBlockedA submit is in flight, or the session already paid, was declined or terminated. state says which. Android onlyDo nothing on SUBMITTING; otherwise get the outcome from your backend and move on
CHECKOUT_TORN_DOWNPurseCheckoutException.CheckoutTornDownA call that reaches the network, hands out a host or replaces the session after teardown(). Android onlyA lifecycle bug: the checkout outlived its screen. Build a new one

Payment​

CodeExceptionMeaningExpected action
PAYMENT_NOT_FULFILLED_ON_SUBMITPurseCheckoutException.PaymentNotFulfilledThe split does not cover the amount, or no primary is setGuard your Pay button with isPaymentFulfilled; highlight the missing amount
ELEMENT_NOT_FULFILLEDPurseCheckoutException.ItemNotFulfilledA form in the split is incomplete or invalid (the card form, a CVV field)Same guard; focus the form, its fields show their own errors
METHOD_DISABLEDPurseCheckoutException.MethodDisabledsetPrimary or setPrimaryToken on a disabled item, or an element created for a technically disabled one. disabled says whyRender the item as disabled from its disabled state; see Method states
METHOD_NOT_IMPLEMENTEDPurseCheckoutException.NoPluginRegistered, NoSecondaryConfigNo plugin for the chosen method (usually a missing partner artifact), or no config for a gift card issuerAdd the artifact or disabledMethods; register a SecondaryConfig
ON_BEFORE_VALIDATE_HOOK_FAILEDPurseCheckoutException.HookFailed (hook == "onBeforeValidate")Your onBeforeValidate threw; nothing was sent, the split is intactYour own failure is the cause; fix or show it, the shopper can submit again
POST_VALIDATE_FAILEDPurseCheckoutException.HookFailed (hook == "onRedirection")Your onRedirection threw; the redirect was not opened/validate already answered, so the session is spent: get the outcome from your backend or start a new client session
VALIDATE_FAILEDPurseCheckoutException.ValidateFailed/validate failed, or a client-side check before it (no vault token collected). outcomeUnknown is true when the request left and no answer came backIf outcomeUnknown, get the outcome from your backend before showing anything; else show an error
PARTNER_UI_ERRORPartnerUiExceptionA partner's native step failed: its SDK returned an error, a tokenization was refused, the redirect Activity could not complete. The partner's exception is the cause. Android onlyShow an error for this method and let the shopper pick another; the method may also be disabled
UI_VALIDATION_FAILED_ERRORDeclared for parity with the web SDK, not raised on Android

Gift cards (secondary methods)​

CodeExceptionMeaningExpected action
SECONDARY_METHOD_WRONG_PAN_FORMATPurseCheckoutException.InvalidSecondaryCardThe card number does not match the issuer's formatValidate with secondaryConfig(method).validatePan first; show a field error
SECONDARY_METHOD_WRONG_CVV_FORMATInvalidSecondaryCardThe CVV does not match the issuer's formatSame with validateCvv
SECONDARY_METHOD_REQUIRED_CVVInvalidSecondaryCardThis card needs a CVV and none was givenAsk for it when requiresCvv(pan) is true
FAILED_TO_INIT_SECONDARY_TOKENPurseCheckoutException.SecondaryTokenizationFailedThe issuer refused the cardShow "card not accepted"; let the shopper correct it
SECONDARY_TOKEN_EMPTY_BALANCESecondaryTokenizationFailedThe card has no balance, or a saved card's balance is not resolved yetShow the empty balance; for a saved card wait for balanceResolved
INVALID_TAKE_AMOUNTPurseCheckoutException.InvalidTakeapplySecondary(token, amount) with a negative amount, above the balance or above what is leftClamp the slice to min(balance, remainingAmountToPay)
MAX_AMOUNT_REACHEDInvalidTakeThe slice exceeds the issuer's maximum per paymentClamp to the method's maxAmount
USAGE_LIMIT_ERRORInvalidTakeThe issuer's per-session usage limit is spent by the cards already in the splitTell the shopper no more cards of this issuer can be added

Wallet and saved instruments​

CodeExceptionMeaningExpected action
MISSING_WALLET_SESSIONPurseCheckoutException.WalletOperationFailedSaving, renaming, favoriting or deleting needs a wallet session the client session does not carryHide wallet features, or create the client session with a wallet session
MISSING_TOKENWalletOperationFailedThe token is not in the wallet anymoreRefresh the list from paymentTokens
INVALID_TOKEN_NAMEWalletOperationFailedThe label does not match ^[a-zA-Z0-9\s]{1,25}$: empty, longer than 25 characters, or with characters other than letters, digits and spacesShow a field error
TOKEN_NAME_EXISTSWalletOperationFailedAnother token carries that labelShow a field error
TOKEN_NOT_REGISTERABLEWalletOperationFailedregisterSecondary on a gift card the issuer does not let you keepCheck canBeRegistered before offering to save
METHOD_NOT_REGISTERABLEWalletOperationFailedregister on a card method whose save_token_mode forbids savingCheck canBeRegistered before offering to save
SET_WALLET_SESSION_FAILED, FAILED_TO_DELETE_ALL_TOKENSDeclared for parity with the web SDK; a failing wallet call surfaces as API_ERROR on Android

Instalment simulation​

CodeExceptionMeaningExpected action
METHOD_IS_NOT_SIMULABLEPurseCheckoutException.MethodNotSimulablesimulateLoan on a method without the simulable flagOffer the simulation only when method.simulable
INVALID_LOAN_SIMULATIONPurseCheckoutException.LoanSimulationFailedThe partner refused the amount or returned no scheduleHide the schedule; the method stays payable

Transport​

CodeExceptionMeaningExpected action
API_ERRORPaymentApiExceptionA Payment API call failed: transport failure (status == null), non-2xx status, or an unusable response. errorCode is the API's own reason, path the requestisSessionTerminal: new session. isRetryable: offer a retry. Otherwise show an error
UNKNOWN_ERRORDeclared for parity with the web SDK, not raised on Android

Codes that exist only on the web​

BRAND_NOT_BELONGS_TO_DETECTED, ELEMENT_RENDER_FAILED, PAYMENT_TOKEN_NOT_FOUND_IN_SESSION, INVALID_INIT_PARAMS, FAILED_TO_ADD_TOKEN, TOKEN_ALREADY_EXISTS describe situations that cannot happen with a native element and have no Android counterpart. SUBMIT_BLOCKED, CHECKOUT_TORN_DOWN and PARTNER_UI_ERROR exist only on Android.