Elite Events API Documentation
Overview
Elite Events provides a comprehensive REST API for e-commerce operations including products, orders, promotions, loyalty programs, support, and admin functionality.
Base URLs
| Environment | URL |
|---|
| Production | https://elite-events.dcsuniverse.com/api |
| Development | http://localhost:3000/api |
Authentication
Session-Based (Web)
Most endpoints use NextAuth session cookies for authentication. Sessions are automatically managed via HTTP-only cookies.
Bearer Token (API)
For programmatic access, include the session token in the Authorization header:
Authorization: Bearer <session-token>
Public Endpoints
Some endpoints are publicly accessible without authentication:
GET /api/products - List products
GET /api/products/[slug] - Get product details
GET /api/categories - List categories
POST /api/auth/* - Authentication endpoints
Success Response
{
"success": true,
"data": { ... },
"meta": {
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"totalPages": 5,
"hasMore": true
}
}
}
Error Response
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid email address",
"details": [
{ "field": "email", "message": "Must be a valid email" }
]
}
}
Rate Limits
| Endpoint Type | Limit | Window |
|---|
| Public API | 100 requests | 1 minute |
| Authenticated | 300 requests | 1 minute |
| Admin API | 1000 requests | 1 minute |
| Auth endpoints | 10 requests | 1 minute |
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1609459200
HTTP Status Codes
| Code | Description |
|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful deletion) |
| 400 | Bad Request - Invalid input |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found |
| 409 | Conflict - Resource already exists |
| 422 | Unprocessable Entity - Validation failed |
| 429 | Too Many Requests - Rate limited |
| 500 | Internal Server Error |
Common Query Parameters
?page=1&limit=20
Sorting
?sortBy=createdAt&sortOrder=desc
Filtering
?categoryId=1&minPrice=10&maxPrice=100
Search
?search=keyword
API Endpoints
Public Endpoints
| Method | Endpoint | Description |
|---|
| GET | /api/products | List products |
| GET | /api/products/[slug] | Get product details |
| GET | /api/products/featured | Get featured products |
| GET | /api/categories | List categories |
| GET | /api/categories/[slug] | Get category details |
| GET | /api/reviews/product/[id] | Get product reviews |
Authentication
| Method | Endpoint | Description |
|---|
| POST | /api/auth/register | Register new user |
| POST | /api/auth/login | Login |
| POST | /api/auth/logout | Logout |
| POST | /api/auth/forgot-password | Request password reset |
| POST | /api/auth/reset-password | Reset password |
| POST | /api/auth/verify-email | Verify email address |
User Endpoints (Authenticated)
| Method | Endpoint | Description |
|---|
| GET | /api/user/profile | Get current user |
| PUT | /api/user/profile | Update profile |
| GET | /api/user/orders | Get order history |
| GET | /api/user/orders/[id] | Get order details |
| GET | /api/user/addresses | Get addresses |
| POST | /api/user/addresses | Add address |
| PUT | /api/user/addresses/[id] | Update address |
| DELETE | /api/user/addresses/[id] | Delete address |
Cart & Wishlist
| Method | Endpoint | Description |
|---|
| GET | /api/cart | Get cart items |
| POST | /api/cart | Add to cart |
| PUT | /api/cart/[id] | Update cart item |
| DELETE | /api/cart/[id] | Remove from cart |
| GET | /api/wishlist | Get wishlist |
| POST | /api/wishlist | Add to wishlist |
| DELETE | /api/wishlist/[id] | Remove from wishlist |
Orders
| Method | Endpoint | Description |
|---|
| POST | /api/orders | Create order |
| GET | /api/orders/[id] | Get order details |
| POST | /api/orders/[id]/cancel | Cancel order |
Payments
| Method | Endpoint | Description |
|---|
| POST | /api/payments/create-intent | Create Stripe payment intent |
| POST | /api/payments/confirm | Confirm payment |
| POST | /api/webhooks/stripe | Stripe webhook handler |
| Method | Endpoint | Description |
|---|
| POST | /api/promotions/validate | Validate promo code |
| GET | /api/promotions/active | Get active promotions |
| POST | /api/promotions/apply | Apply promotion to cart |
Loyalty
| Method | Endpoint | Description |
|---|
| GET | /api/loyalty/balance | Get points balance |
| GET | /api/loyalty/transactions | Get points history |
| POST | /api/loyalty/redeem | Redeem points |
Support
| Method | Endpoint | Description |
|---|
| GET | /api/support/tickets | List user tickets |
| POST | /api/support/tickets | Create ticket |
| GET | /api/support/tickets/[id] | Get ticket details |
| POST | /api/support/tickets/[id]/messages | Add message |
| GET | /api/support/articles | Get help articles |
Admin Endpoints
See Admin API for full documentation.
| Method | Endpoint | Description |
|---|
| GET | /api/admin/dashboard | Dashboard stats |
| GET | /api/admin/orders | Manage orders |
| GET | /api/admin/products | Manage products |
| GET | /api/admin/users | Manage users |
| GET | /api/admin/promotions | Manage promotions |
| GET | /api/admin/analytics | View analytics |
Monitoring
| Method | Endpoint | Description |
|---|
| GET | /api/monitoring/health | Health check |
| GET | /api/monitoring/metrics | Prometheus metrics |
Detailed Documentation
OpenAPI Specification
Interactive API documentation is available at:
Error Codes
| Code | Description |
|---|
VALIDATION_ERROR | Input validation failed |
UNAUTHORIZED | Authentication required |
FORBIDDEN | Insufficient permissions |
NOT_FOUND | Resource not found |
CONFLICT | Resource conflict (duplicate) |
RATE_LIMITED | Too many requests |
PAYMENT_FAILED | Payment processing error |
INSUFFICIENT_STOCK | Product out of stock |
PROMO_EXPIRED | Promotion expired |
PROMO_INVALID | Invalid promo code |
PROMO_USED | Promo code already used |
INTERNAL_ERROR | Server error |
Webhooks
Elite Events can send webhooks for various events:
| Event | Description |
|---|
order.created | New order placed |
order.updated | Order status changed |
payment.succeeded | Payment completed |
payment.failed | Payment failed |
Configure webhooks in Admin > Settings > Webhooks.
SDKs & Examples
JavaScript/TypeScript
// Using fetch
const response = await fetch('/api/products?limit=10', {
headers: {
'Content-Type': 'application/json',
},
});
const { data, meta } = await response.json();
cURL
curl -X GET "https://elite-events.dcsuniverse.com/api/products?limit=10" \
-H "Content-Type: application/json"
Support
For API support, contact: