API Reference
Jiffoo Mall API documentation
API Reference
Interactive Documentation (Recommended)
Detailed API Documentation
For comprehensive guides with code examples and detailed explanations, see our detailed API documentation:
- Authentication API - User registration, login, JWT tokens, and session management
- Products API - Browse marketplace, purchase products, and manage licenses
- Cart API - Shopping cart management and checkout flow
- Orders API - Order creation, tracking, and fulfillment
- Payments API - Payment processing, webhooks, and refunds
Interactive Documentation
The complete API documentation is available via:
- Scalar (Core API): http://localhost:3001/docs
- Swagger UI (Legacy): http://localhost:3001/swagger
- Docs Service (OpenAPI Explorer): /docs/api-reference
Base URL
https://api.yourdomain.com/apiAuthentication
Most endpoints require JWT Bearer token:
Authorization: Bearer <jwt-token>Quick Reference
Authentication
View detailed Authentication API documentation →
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register | User registration |
| POST | /auth/login | User login |
| GET | /auth/me | Get current user |
| POST | /auth/refresh | Refresh token |
| POST | /auth/logout | Logout |
Products
View detailed Products API documentation →
| Method | Endpoint | Description |
|---|---|---|
| GET | /products | List products |
| GET | /products/:id | Get product |
| POST | /admin/products | Create product |
| PUT | /admin/products/:id | Update product |
| DELETE | /admin/products/:id | Delete product |
Cart
See OpenAPI Explorer for the complete and up-to-date list. View detailed Cart API documentation →
| Method | Endpoint | Description |
|---|---|---|
| GET | /cart | Get cart |
| POST | /cart/add | Add to cart |
| PUT | /cart/update | Update quantity |
| DELETE | /cart/remove/:itemId | Remove item |
| DELETE | /cart/clear | Clear cart |
Orders
View detailed Orders API documentation →
| Method | Endpoint | Description |
|---|---|---|
| POST | /orders | Create order |
| GET | /orders | List orders |
| GET | /orders/:id | Get order |
Payments
View detailed Payments API documentation →
| Method | Endpoint | Description |
|---|---|---|
| GET | /payments/available-methods | Get payment methods |
| POST | /payments/create-session | Create payment session |
Response Format
Success Response
{
"success": true,
"data": { "..." : "..." },
"message": "optional"
}Error Response
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable error",
"details": { "optional": "any JSON" }
}
}Error Codes
| Status | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
Rate Limiting
API requests are rate limited:
- Anonymous: 100 requests/minute
- Authenticated: 1000 requests/minute
- Admin: 5000 requests/minute
OpenAPI Specification
Download the OpenAPI spec:
- JSON:
/openapi.json