This API documentation was built autonomously by CodeHero PRO← Back to Solutions
In a real deployment, this would already be live on your server with a custom domain and SSL certificate.
https://api.store.io/v2

Authentication

All API requests require a Bearer token in the Authorization header. Obtain a token via the /auth/login endpoint.

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Authentication

Endpoints for user authentication and token management.

POST /auth/login Authenticate user

Authenticates a user with email and password. Returns JWT access and refresh tokens.

Request Body

ParameterTypeDescription
emailrequiredstringUser email address
passwordrequiredstringUser password (min 8 chars)
curl
curl -X POST https://api.store.io/v2/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepass123"
  }'
Response 200
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "user": {
    "id": 1,
    "email": "user@example.com",
    "name": "John Doe",
    "role": "admin"
  }
}

Users

Manage user accounts. Requires authentication.

GET /users List all users

Returns a paginated list of users. Supports filtering and sorting.

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)
sortstringSort field (name, email, created_at)
rolestringFilter by role (admin, user, editor)
Response 200
{
  "data": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com",
      "role": "admin",
      "created_at": "2026-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 847,
    "pages": 43
  }
}
GET /users/:id Get user by ID

Returns detailed information about a specific user.

curl
curl https://api.store.io/v2/users/1 \
  -H "Authorization: Bearer <token>"

Products

CRUD operations for product catalog management.

GET /products List products

Returns paginated product list with filtering by category, price range, and availability.

curl
curl "https://api.store.io/v2/products?category=electronics&min_price=100" \
  -H "Authorization: Bearer <token>"
Response 200
{
  "data": [
    {
      "id": 42,
      "name": "ProBook Ultra 15\"",
      "price": 1329.00,
      "category": "laptops",
      "in_stock": true,
      "rating": 4.8,
      "reviews_count": 247
    }
  ],
  "pagination": { "page": 1, "total": 156 }
}
POST /products Create product

Creates a new product. Requires admin role.

Request Body
{
  "name": "Galaxy X Pro",
  "price": 899.00,
  "category": "smartphones",
  "description": "6.7\" AMOLED, 108MP camera",
  "stock": 500
}

Orders

Order management and checkout flow.

POST /orders Create order

Creates a new order from the user's cart. Processes payment and reserves inventory.

Request Body
{
  "items": [
    { "product_id": 42, "quantity": 1 },
    { "product_id": 15, "quantity": 2 }
  ],
  "shipping_address": {
    "street": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94102"
  },
  "payment_method": "card_tok_visa4242"
}
Response 201
{
  "order_id": "ORD-2026-0847",
  "status": "confirmed",
  "total": 1678.00,
  "estimated_delivery": "2026-02-28"
}

Status Codes

Standard HTTP status codes used across all endpoints.

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid authentication token
403ForbiddenInsufficient permissions for this action
404Not FoundResource does not exist
429Rate LimitedToo many requests (limit: 100/min)
500Server ErrorInternal server error