Complete REST API documentation for KmerHosting services
NextAuth-based session authentication with rate limiting
Clean, predictable endpoints following REST principles
Consistent JSON format with success/error handling
https://kmerhosting.com/apiMost endpoints require authentication via session cookies (NextAuth). After logging in, the session is maintained automatically.
// Login request
POST /api/user/auth/login
Content-Type: application/json
{
"email": "[email protected]",
"password": "YourSecurePassword123!"
}
// Response
{
"success": true,
"data": {
"user": {
"id": "uuid",
"email": "[email protected]",
"customerId": "KH-XXXXXX"
}
}
}{
"success": true,
"data": {
// Response data here
}
}{
"success": false,
"error": "Error message description"
}| Code | Meaning |
|---|---|
| 200 | Success - Request completed successfully |
| 201 | Created - Resource created successfully |
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error |
/api/user/auth/registerCreate new account
/api/user/auth/loginAuthenticate user
/api/user/auth/logoutEnd session
/api/user/auth/verifyVerify email
/api/cartGet cart items
/api/cart/addAdd to cart
/api/checkoutProcess checkout
/api/orders/[id]Get order details
/api/orders/[id]/payPay order
/api/credits/balanceGet credit balance
/api/credits/addAdd credits
/api/user/shared-hostingList shared hosting
/api/user/vpsList VPS servers
/api/user/wordpress-hostingList WordPress hosting
To ensure fair usage, our API implements rate limiting on authentication endpoints:
For complete API documentation with detailed examples, see our comprehensive guide.
View Complete API Docs