Skip to main content
Handle payment errors gracefully to give customers a smooth experience.

Error Response Format

All API errors follow this structure:

HTTP Status Codes

Two Types of Errors

Ozura Checkout handles errors differently based on whether the customer can fix them:

Fixable Errors (Customer Stays on Checkout)

These errors allow the customer to try again without leaving the checkout page:
  • Card declined
  • Insufficient funds
  • Invalid card number
  • Expired card
  • Wrong CVV
  • Address verification failed
What happens: An inline error message appears. The customer can correct their information and try again.

Unrecoverable Errors (Redirect to errorUrl)

These errors require redirecting the customer away from checkout:
  • Server/system errors
  • Authentication failures
  • Network connectivity issues
  • Payment processor unavailable
What happens: The customer is redirected to your errorUrl with error details in the URL.

Redirect Behavior Summary

Error URL Parameters

When an unrecoverable error occurs, the customer is redirected to your errorUrl:

Error Codes

Building Your Error Page

Instead of showing a dead-end error page, redirect customers back to their cart with a popup message: Set your errorUrl to your cart page with a flag:
Then on your cart page:
This keeps customers in their shopping flow instead of showing a confusing error page.

Retry Logic for API Calls

If you get a 500 error, it’s safe to retry with exponential backoff:

Network Retry Protection

To prevent duplicate sessions from network issues, use an idempotency key:
If you send the same idempotencyKey twice, you’ll get back the original session instead of creating a duplicate (the response will include "cached": true). If the original session has expired or reached a terminal state (cancelled / failed), the replay is rejected with a 409 and one of these errorCode values — use a new idempotencyKey to create a fresh session: