API Reference

Base URL: https://heavenslive.com/api

🔑 Authentication

POST/api/auth/login
Login with email and password. Returns JWT token.
curl -X POST https://heavenslive.com/api/auth/login -H "Content-Type: application/json" -d '{"email":"user@example.com","password":"..."}'
POST/api/auth/register
Create new account. Auto-grants Pro plan.
GET/api/auth/me
Get current user profile. Requires Authorization: Bearer TOKEN
GET/api/auth/sessions
List active sessions. Revoke any session by ID.

🛒 Listings

GET/api/shop/listings
Browse all listings. Filters: ?category=&type=&sort=&q=&minPrice=&maxPrice=&page=&limit=
GET/api/shop/listings/:id
Get single listing details.
POST/api/shop/listings
Create new listing. Auth required.
GET/api/shop/categories
Get category tree. ?lang=fr for translations.

🛒 Cart

GET/api/shop/cart
View cart. Guest supported via X-Guest-Token header.
POST/api/shop/cart/add
Add item. Body: {"listingId":"uuid","quantity":1}
DELETE/api/shop/cart/:id
Remove item from cart.

💳 Wallet

GET/api/wallet/balance
Get Credon wallet balance. Auth required.
POST/api/wallet/send
Send money to another user.

💬 Messages

GET/api/shop/messages/conversations
List all conversations.
POST/api/shop/messages/conversations
Start new conversation.

💰 Affiliate

GET/api/affiliate/dashboard
Referral stats, commission tracking, referral link.
POST/api/affiliate/redeem
Convert commissions to wallet balance (min $1.00).

🤖 AI Assistants

POST/api/ai/listing-suggest
AI generates complete listing from plain description. Auth required.
POST/api/ai/support/chat
24/7 AI support chat. No auth required. Body: {"message":"question","history":[]}

🔧 Admin

GET/api/health
System health check. Returns uptime, DB status.
GET/api/admin/metrics
System metrics + DB stats. Admin only.
POST/api/admin/recover-image
Upload replacement image for lost listing image.

All endpoints accept JSON. Auth via Authorization: Bearer TOKEN header. Rate limit: 100 req/min.