Use this file to discover all available pages before exploring further.
All Lyel Pay API errors follow a consistent format. The code field is a stable string from the @lyelpay/errors package — it won’t change between versions, so it’s safe to key business logic on it.
Install the errors package to get autocompletion and type safety:
npm install @lyelpay/errors
Then match errors by code:
import { ErrorCodes } from '@lyelpay/errors';try { await lyel.charge({ intentionId });} catch (err) { switch (err.code) { case ErrorCodes.E_INSUFFICIENT_FUNDS: showToast('Your wallet balance is too low. Please top up and try again.'); break; case ErrorCodes.E_INVALID_OTP: showToast('Invalid code. Please check and try again.'); break; case ErrorCodes.E_OTP_EXPIRED: showToast('Your code has expired. Request a new one.'); break; case ErrorCodes.E_OTP_BLOCKED: showToast('Too many attempts. Please wait before trying again.'); break; case ErrorCodes.E_ACCOUNT_BLOCKED: showToast('This account has been blocked. Contact support.'); break; default: console.error('Unexpected error:', err.code, err.message); }}
All error codes are exported from @lyelpay/errors:
import { ErrorCodes, ErrorCode } from '@lyelpay/errors';// ErrorCode is the union type of all possible code valuesfunction handleError(code: ErrorCode) { // TypeScript will warn you if you mistype a code}
The package exports ErrorCodes (the object) and ErrorCode (the type). Error codes are stable API contracts — they will not be renamed or removed.