Skip to main content
Rebell APIs use a structured error model that clearly separates transport-level errors, business-level outcomes, and payment lifecycle states. You must always interpret both the HTTP status code and the business result object contained in the response body.
A request may return HTTP 200 OK while still representing a business failure. Always check the result object.

Error Layers

Every API response conveys information at three different layers:

Result Object Structure

All Rebell API responses include a result object:

Result Fields

resultCode
string
A detailed business outcome code (e.g., SUCCESS, PAYMENT_FAIL, USER_REJECTED)
resultStatus
string
A high-level status flag used to drive merchant logic: S, U, or F
resultMessage
string
An optional, human-readable message intended for debugging or logging (not for end users)

Result Status Values

The resultStatus field provides a fast way to determine how to proceed.
Important: Always evaluate resultStatus before inspecting specific result codes. This ensures consistent handling across all error scenarios.

HTTP Status Codes

HTTP status codes indicate whether the API request itself was accepted at the protocol level.
Only network-level or 5xx errors should trigger automatic retries. Business failures (HTTP 200 with resultStatus: F) should not be retried.

Common Result Codes

The following result codes are shared across multiple payment flows:

Handling Errors by Payment Flow

Error handling for Retail Pay (merchant scans user QR):
Retail Pay Error Handling

Retry & Idempotency Rules

Retries must be handled carefully to avoid duplicate payments.
These scenarios are safe to retry:
  • Network timeouts (no response received)
  • HTTP 5xx errors (server-side issues)
  • Same request with the same paymentRequestId
  • Connection failures before response
  • TLS/SSL errors
Safe Retry Logic
Critical: The paymentRequestId acts as the idempotency key and must be unique per payment attempt. Never generate a new paymentRequestId when retrying the same payment.

Webhook Error Handling

Webhook delivery is at-least-once. Your webhook handlers must be idempotent.
Webhook Error Handling
Webhooks always represent the final payment outcome. See Webhooks for complete implementation details.

User-Facing Error Messages

Technical error codes should never be exposed directly to end users. Map them to friendly messages:
User Message Mapping

Complete Error Handling Example

Here’s a comprehensive error handling implementation:
Complete Error Handler

Testing Checklist

Test these error scenarios in sandbox before going live:

Next Steps

Webhooks

Implement webhook handlers for payment notifications

Inquiring Payment API

Poll payment status for PROCESSING transactions

Retail Pay

Merchant-initiated payment flow

Authentication Deep Dive

Request signing and verification details