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.Documentation Index
Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
Use this file to discover all available pages before exploring further.
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
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
Key Characteristics
| Characteristic | Description |
|---|---|
| Execution | Inside Mini App runtime only |
| Security | No access to merchant secrets or credentials |
| Permissions | Subject to capability restrictions |
| Context | User-context aware |
Common JSAPI Categories
Authorization JSAPI
Request user authorization for scoped data access:Payment JSAPI
Trigger payment flows from the Mini App: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
| Characteristic | Description |
|---|---|
| Authentication | Requires request signing |
| Execution | Outside Mini App runtime |
| Security | Subject to rate limiting and security policies |
| Invocation | From merchant backend systems only |
Common OpenAPI Categories
- Authentication
- User Info
- Payments
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
| API Type | Executed By | Purpose |
|---|---|---|
| JSAPI | Mini App runtime | UI, navigation, platform capabilities |
| Merchant APIs | Merchant backend | Business logic, data management |
| Rebell OpenAPI | Merchant backend | Payments, platform services |
Mini Apps should always delegate:
- Business logic
- Data persistence
- Payment confirmation
Payments and Mini App APIs
Payments initiated from Mini Apps follow the same principles as standalone payments:Permissions and Capability Control
Access to JSAPI capabilities may be:| Access Level | Description |
|---|---|
| Automatic | Available to all Mini Apps |
| Restricted | Limited by Mini App type |
| Approval Required | Subject to review approval |
Permission Request Flow
Rebell enforces:- Capability-level permissions
- Runtime security checks
- Compliance validation during review
JSAPI Error Handling
All JSAPI calls should include error handling:Common Error Codes
| Code | Meaning | Action |
|---|---|---|
11 | No permission | Request permission or inform user |
12 | Network error | Retry or show error message |
13 | User cancelled | Allow user to retry |
14 | Timeout | Retry with backoff |
Best Practices
Always handle errors
Always handle errors
Never assume JSAPI calls will succeed. Always provide error handlers and user feedback.
Don't trust client-side data
Don't trust client-side data
Always validate and verify data on the backend. Never trust values passed from the Mini App.
Use appropriate APIs
Use appropriate APIs
Use JSAPI for UI and user interaction. Use OpenAPI (via backend) for business operations.
Request minimal permissions
Request minimal permissions
Only request the scopes and capabilities you actually need.
Handle offline gracefully
Handle offline gracefully
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