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
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
errorUrl with error details in the URL.
Redirect Behavior Summary
Error URL Parameters
When an unrecoverable error occurs, the customer is redirected to yourerrorUrl:
Error Codes
Building Your Error Page
Recommended Approach: Redirect to Cart with Message
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:Retry Logic for API Calls
If you get a500 error, it’s safe to retry with exponential backoff:
Network Retry Protection
To prevent duplicate sessions from network issues, use an idempotency key: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: