Skip to content

Errors

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;
}
CodeMeaning
NO_IFRAMENo Cashier iframe is available for the operation.
CONTAINER_NOT_FOUNDThe containerId passed to open() doesn't match an element on the page.
INVALID_ORIGINA message was received from an origin that failed validation.
SESSION_CONFLICTAn operation conflicts with the current session state.
NOT_READYThe Cashier isn't ready for the requested operation yet.
UNKNOWNAn unspecified error.

These are thrown by SDK methods — wrap calls in try/catch where you need to handle them.

Session expiry

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.

Build it →