Skip to content

API Endpoints

GET /:store

Returns store info and featured products.

GET /:store/p/:slug

Returns product details.

POST /:store/p/:slug
Content-Type: application/x-www-form-urlencoded
intent=addToCart&productId=xxx&quantity=1

Adds product to cart.

GET /api/health

Response:

{
"status": "healthy",
"timestamp": "2026-02-06T00:00:00Z",
"checks": {
"database": "connected",
"server": "running"
}
}

All require session authentication.

GET /api/admin/dashboard

Response:

{
"totalRevenue": 150000,
"totalOrders": 45,
"totalProducts": 20,
"totalCustomers": 30,
"recentOrders": [...]
}
GET /api/admin/products
GET /api/admin/products/:id
POST /api/admin/products
PATCH /api/admin/products/:id
DELETE /api/admin/products/:id
GET /api/admin/orders
GET /api/admin/orders/:id
POST /api/admin/orders/create
GET /api/admin/customers
GET /api/admin/customers/:id
POST /api/admin/customers
PATCH /api/admin/customers/:id
DELETE /api/admin/customers/:id
GET /api/admin/collections
GET /api/admin/collections/:id
POST /api/admin/collections
PATCH /api/admin/collections/:id
DELETE /api/admin/collections/:id
GET /api/admin/analytics

List endpoints support pagination:

GET /api/admin/products?page=1&limit=20

Response includes:

{
"items": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"totalPages": 5
}
}

Used by Caddy for SSL:

GET /api/verify-domain?domain=example.com

Response:

{
"allowed": true
}
{
"error": "Error message here"
}

Common errors:

  • "Unauthorized" - Not logged in
  • "Not found" - Resource doesn’t exist
  • "Validation error" - Invalid input