Skip to main content
The SDK uses two typed error classes: NFCPaymentError for NFC-layer failures and APIError for backend communication failures. Both extend Error with a typed code for programmatic handling.

NFCPaymentError

Thrown by writeSignedInvoice, readSignedInvoice, and the useNFCMerchant / useNFCCustomer hooks.

Handling NFC errors


APIError

Thrown by the API client layer (createPayment, processPayment, etc.) and surfaced via usePayment, usePaymentStatus, and related hooks.

Handling API errors


Retry Behaviour

The SDK’s API client automatically retries server errors (5xx) and network timeouts with exponential backoff: Client errors (4xx) are never retried — they indicate a problem with the request itself.

Error States in Hooks

All hooks expose an error property and a clearError (or reset) method. Prefer handling errors via state rather than try/catch at the call site:

Common Issues