πŸ“‘ HeavensLive REST API

Public API for third-party integration. Base URL: https://api.heavenslive.com

AuthListingsCategoriesStoresSearchExchange RatesTranslationsCheckoutResetPlansWalletFeaturedErrors
Rate Limit: 60 requests/minute per IP. Authenticated endpoints require Authorization: Bearer {token} header. All timestamps in ISO 8601. All amounts in cents (integer).

πŸ” Authentication

POST/api/auth/login

Authenticate and receive a JWT token. Token expires in 24 hours.

POST /api/auth/login
Content-Type: application/json

{"email": "user@example.com", "password": "yourpassword"}
// Response 200
{"success": true, "token": "eyJhbG...", "user": {"id": "...", "email": "..."}}
POST/api/auth/register

Register a new account. Optional referralCode credits the referrer.

POST /api/auth/register
{"email": "new@example.com", "password": "min8chars", "fullName": "Name", "referralCode": "abc123"}

πŸ“¦ Listings

GET/api/shop/listings

Browse marketplace listings with filters, search, and pagination.

ParamTypeDescription
qstringSearch title/description (also searches translations)
typestringmall, classifieds, auction, reverse_auction
categorystringCategory slug (electronics, clothing, etc.)
minPricenumberMinimum price in dollars
maxPricenumberMaximum price in dollars
sortstringnewest, price_low, price_high, ending_soon
pagenumberPage number (default 1)
limitnumberResults per page (default 12, max 50)
langstringLanguage code for translated titles (en, fa, ja, etc.)
currencystringFilter by display currency (USD, BTC, Credon-USD, etc.)
lat/lng/radiusnumberLocation-based search (radius in km)
GET /api/shop/listings?category=electronics&sort=price_low&lang=ja&limit=20

// Response
{"listings": [{
  "id": "uuid", "title": "ζ—₯本θͺžγ‚Ώγ‚€γƒˆγƒ«", "description": "...",
  "price_cents": 89900, "type": "mall", "category": "electronics",
  "location_city": "Tokyo", "images": ["url1"], "currency": "USD", "accepted_currencies": ["USD","EUR","Credon-BTC"], "created_at": "2026-..."
}], "pagination": {"page": 1, "limit": 20, "total": 42, "totalPages": 3}}
GET/api/shop/listings/:id

Get single listing details. Add ?lang=fa for translated content. Response includes currency and accepted_currencies fields.

πŸ“‚ Categories

GET/api/shop/categories

Get top-level categories with listing counts. Add ?lang=fr for translated names.

GET /api/shop/categories?lang=zh
// Response
{"categories": [{"slug": "electronics", "name": "甡子产品", "icon": "πŸ“±", "count": 9, "subcategory_count": 1}]}
GET/api/shop/categories/subcategories/:parentSlug

Get subcategories under a parent category.

GET /api/shop/categories/subcategories/electronics?lang=ko

πŸ“ Create Listing

POST/api/shop/listings

Create a new marketplace listing. Requires authentication.

POST /api/shop/listings
Authorization: Bearer {token}
Content-Type: application/json

{
  "type": "mall",
  "title": "Vintage Record Player",
  "description": "Fully restored...",
  "category": "electronics",
  "price_cents": 49900,
  "currency": "USD",
  "accepted_currencies": ["USD", "EUR", "Credon-BTC"],
  "quantity_available": 1,
  "duration": "2weeks",
  "location_city": "London",
  "location_country": "GB",
  "is_featured": false,
  "featured_payment_method": null
}
FieldTypeRequiredDescription
typestringYesmall, classifieds, auction, reverse_auction
titlestringYesListing title (auto-translated to 16 languages)
descriptionstringNoFull description
categorystringYesCategory slug from /api/shop/categories
price_centsnumberSee typePrice in cents. Use 0 for free items
currencystringNoDisplay currency code (default: USD). Fiat, crypto, or Credon clone
accepted_currenciesstring[]NoCurrencies buyer can pay with (default: ["USD"])
quantity_availablenumberNoDefault: 1
durationstringNo1day, 2weeks, 1year (default: 2weeks)
is_featuredbooleanNoFeature at top of search. Requires payment method or subscription.
featured_payment_methodstringNosubscription | paypal | credon_wallet. Required if is_featured=true.
imagesstring[]NoUpload via /api/shop/upload first
πŸ’‘ Display price is set in the chosen currency. Buyers can pay in any fiat or Credon clone currency via PayPal or Credon Wallet at live exchange rates.

πŸͺ Stores

GET/api/shop/stores/:slug

Get public store profile and listings by store slug.

GET /api/shop/stores/bryans-marketplace
// Response
{"store": {"store_name": "...", "slug": "...", "description": "..."}, "listings": [...]}

πŸ’± Exchange Rates

GET/api/wallet/exchange-rates

Get live exchange rates for all 84 Credon currencies and fiat pairs. Rates update every 30 minutes from Frankfurter API and CoinGecko. Used for currency display and cross-currency payments.

GET /api/wallet/exchange-rates
// Response
{"rates": {"Credon-USD": {"rate": 1.0}, "Credon-BTC": {"rate": 0.000012},
            "EUR": {"rate": 0.92}, "JPY": {"rate": 149.5}}, "updated_at": "..."}

🌐 Translations

GET/locales/shop-{lang}.json

Get UI translation strings for a language. Used by the frontend for chrome (buttons, nav, filters).

GET /locales/shop-fa.json  // Farsi
GET /locales/shop-ja.json  // Japanese
// 16 languages supported: ar, de, en, es, fa, fr, hi, ja, ko, pt, ru, sv, tl, tr, ur, vi, zh

πŸ”‘ API Keys

API keys provide higher rate limits (1000 req/min) for production integrations. Generate keys from your Settings page.

Include your key in requests:

Authorization: Bearer hl_xxxxxxxxxxxxxxxx

Or as a query parameter:

GET /api/shop/listings?api_key=hl_xxxxxxxxxxxxxxxx

πŸ›’ Checkout

POST/api/shop/checkout

Complete a purchase. Wallet-first: deducts from Credon balance if sufficient, otherwise redirects to PayPal. No errors β€” seamless fallback. Shipping always USD.

POST /api/shop/checkout
Authorization: Bearer {token}

{
  "cartItems": [{"listing_id":"uuid","quantity":1}],
  "shippingAddress": {"street":"...","city":"...","zip":"..."},
  "deliveryMethod": "shipping",
  "paymentMethod": "credon_wallet",
  "shippingCostCents": 500
}
FieldTypeDescription
shippingCostCentsnumberShipping always in USD. Platform fee deducted from item price.
cartItems[].listing_idstringUUID of the listing to purchase
⚠️ Shipping is always USD. Credon Wallet deducts from balance at live exchange rates. Platform fee is configurable (default 5%) and auto-calculated per transaction.
// Response 200 β€” Credon wallet (sufficient balance)
{"success":true,"paymentMethod":"credon_wallet","deducted":1500,"shippingCurrency":"USD"}

// Response 200 β€” PayPal redirect (insufficient balance)
{"success":true,"paymentMethod":"paypal","approvalUrl":"https://www.paypal.com/...","shippingCurrency":"USD"}
πŸ’‘ No errors. System automatically tries Credon wallet first. If balance is insufficient, silently falls back to PayPal. Shipping is always USD.

πŸ” Password Reset

POST/api/auth/forgot-password

Request a password reset link. Always returns success to prevent email enumeration.

POST /api/auth/forgot-password
{"email":"user@example.com"}
// Response 200
{"success":true,"message":"If that email exists, a reset link has been sent."}
POST/api/auth/reset-password

Set a new password using a valid reset token.

POST /api/auth/reset-password
{"token":"abc123...","password":"newpassword123"}
// Response 200
{"success":true,"message":"Password updated. You can now sign in."}

⭐ Subscriptions

GET/api/shop/subscriptions/my-plan

Get current user's subscription plan and featured listing limits. Requires auth.

GET /api/shop/subscriptions/my-plan
Authorization: Bearer {token}
// Response
{"plan_name":"Pro","limits":{"featuredListings":5},"usage":{"currentFeatured":2}}
GET/api/shop/subscriptions/plans

List all available subscription plans (public).

POST/api/shop/subscriptions/subscribe

Subscribe to a plan. Supports PayPal and Credon Wallet payment in any clone currency.

POST /api/shop/subscriptions/subscribe
Authorization: Bearer {token}

{
  "planId": "pro-monthly",
  "billingCycle": "monthly",
  "paymentMethod": "credon_wallet",
  "currency": "Credon-EUR"
}
FieldTypeDescription
billingCyclestringmonthly or yearly
πŸ’± Credon Wallet payment: balance checked, converted at live rates, deducted in USD equivalent. Works with any clone currency. PayPal: redirects to PayPal checkout.
// Response 200 β€” Credon wallet (sufficient balance)
{"success":true,"paymentMethod":"credon_wallet","message":"Pro plan activated! Paid $9.99 from Credon wallet.","plan":"Pro","deducted":999}

// Response 200 β€” PayPal redirect (insufficient balance)
{"success":true,"paymentMethod":"paypal","approvalUrl":"https://www.paypal.com/...","plan":"Pro"}
πŸ’‘ No errors. Wallet-first with silent PayPal fallback. No 402 responses β€” the user never sees an error.

πŸ’± Wallet

GET/api/wallet/balance

Get current user's Credon wallet balance. Requires auth.

GET /api/wallet/balance
Authorization: Bearer {token}
// Response
{"balance_cents":100000,"balance_usd":"1000.00"}
POST/api/shop/listings

When creating a listing, include is_featured: true and a featured_payment_method. Subscription users get free featured slots based on plan limits. Others choose payment.

{
  "is_featured": true,
  "featured_payment_method": "subscription",
  // or "paypal" / "credon_wallet" if no subscription
}
🌟 If user has Pro/Business plan, featured listings are included (up to plan limit). If limit exhausted or no subscription, $1.00 USD or 1 Credon-USD from wallet.

⚠️ Error Handling

All errors return appropriate HTTP status codes with a JSON body:

// 400 Bad Request
{"error": "Amount required"}

// 401 Unauthorized
{"error": "Invalid or expired token"}

// 403 Forbidden
{"error": "Not authorized"}

// 404 Not Found
{"error": "Listing not found"}

// 429 Rate Limited
{"error": "Too many requests"}

// 500 Server Error
{"error": "Internal server error"}
Pricing: Public endpoints are free with rate limiting. For higher limits, API keys, or webhook access, contact api@heavenslive.com. Full OpenAPI 3.0 spec coming soon.