The SDK throws a CashierError with a code (and optional details) when a method can't proceed.
class CashierError extends Error {
code: CashierErrorCode;
details?: unknown;
}| Code | Meaning |
|---|---|
NO_IFRAME | No Cashier iframe is available for the operation. |
CONTAINER_NOT_FOUND | The containerId passed to open() doesn't match an element on the page. |
INVALID_ORIGIN | A message was received from an origin that failed validation. |
SESSION_CONFLICT | An operation conflicts with the current session state. |
NOT_READY | The Cashier isn't ready for the requested operation yet. |
UNKNOWN | An unspecified error. |
These are thrown by SDK methods — wrap calls in try/catch where you need to handle them.
Session expiry is not thrown as a CashierError. When a session (and its token) expires, the Cashier shows a session-expired screen. To recover, create a new session on your backend and call open() again. See Session & token.