Skip to main content
Mini Apps interact with the Rebell platform and merchant systems through a well-defined set of APIs. These APIs are designed to enable user interaction, platform integration, and secure communication with merchant backends while enforcing strict security boundaries.

API Model Overview

Mini App APIs are divided into two main categories:

Client-Side APIs (JSAPI)

APIs exposed to Mini App code running inside the SuperApp

Server-Side APIs (OpenAPI)

Server-to-server APIs consumed by merchant backends
Each category has a distinct role and must be used according to its scope and security constraints.

Client-Side APIs (JSAPI)

JSAPI are APIs exposed to Mini App code running inside the Rebell SuperApp. They allow the Mini App to:
  • Interact with the SuperApp runtime
  • Control navigation and UI behavior
  • Access platform capabilities
  • Trigger user-facing actions such as payments
JSAPI are invoked directly from Mini App JavaScript code and execute within the platform-controlled sandbox.

Key Characteristics

Common JSAPI Categories

Authorization JSAPI

Request user authorization for scoped data access:
The authCode returned is a short-lived, single-use token. It must be exchanged server-side — never validated client-side.

Payment JSAPI

Trigger payment flows from the Mini App:
Important: JSAPI payment results are indicative only. Always confirm payment status via backend webhook before updating business state.

Server-Side APIs (OpenAPI)

OpenAPI refers to server-to-server APIs exposed by Rebell and consumed by merchant backends. They are used to:
  • Execute secure operations
  • Manage payments and transactions
  • Retrieve or update backend data
  • Receive asynchronous notifications

Key Characteristics

OpenAPI calls must never be made directly from Mini App code.

Common OpenAPI Categories

Exchange authorization codes for user context:

Typical API Interaction Pattern

Mini Apps do not operate in isolation. Most real-world flows involve both JSAPI and OpenAPI, coordinated through the merchant backend. This pattern ensures:
  • Sensitive operations remain server-side
  • Payments are securely authorized
  • Asynchronous events are handled reliably

API Scope & Responsibility

Mini Apps should always delegate:
  • Business logic
  • Data persistence
  • Payment confirmation
…to the merchant backend.

Payments and Mini App APIs

Payments initiated from Mini Apps follow the same principles as standalone payments:
1

Trigger

Mini App triggers the payment flow using JSAPI
2

Create

Merchant backend creates the payment using OpenAPI
3

Confirm

Final payment result is delivered via webhook
4

Update

Mini App UI is updated based on backend state
Mini Apps must never:
  • Perform payment authorization locally
  • Trust client-side payment results
  • Bypass backend verification

Permissions and Capability Control

Access to JSAPI capabilities may be:

Permission Request Flow

Rebell enforces:
  • Capability-level permissions
  • Runtime security checks
  • Compliance validation during review
Developers should request only the capabilities required for their Mini App. Excessive permission requests may delay review approval.

JSAPI Error Handling

All JSAPI calls should include error handling:

Common Error Codes

Best Practices

Never assume JSAPI calls will succeed. Always provide error handlers and user feedback.
Always validate and verify data on the backend. Never trust values passed from the Mini App.
Use JSAPI for UI and user interaction. Use OpenAPI (via backend) for business operations.
Only request the scopes and capabilities you actually need.
Design your Mini App to handle network failures gracefully with appropriate user feedback.

Next Steps

With an understanding of Mini App APIs, proceed to implement secure backend authentication:

Backend Authentication

Implement the authCode exchange flow

Payments in Mini Apps

Integrate payment functionality