Back Home

API Data Schema Definitions

This section details the structure and format of data exchanged through our various API endpoints. Understanding these schemas is crucial for seamless integration and accurate data handling.

User Profile Schema

Defines the structure for user profile information.

Fields:

  • user_id (string, required): Unique identifier for the user.
  • username (string, required): The user's chosen username.
  • email (string, required, email format): The user's email address.
  • first_name (string, optional): User's first name.
  • last_name (string, optional): User's last name.
  • registration_date (datetime, required): Timestamp of user registration.
  • is_active (boolean, required): Indicates if the user account is currently active.

Example Data:

{
    "user_id": "usr_abc123xyz",
    "username": "data_enthusiast",
    "email": "data.enthusiast@example.com",
    "first_name": "Alex",
    "last_name": "Chen",
    "registration_date": "2023-10-27T10:30:00Z",
    "is_active": true
}

Product Listing Schema

Defines the structure for product catalog entries.

Fields:

  • product_id (string, required): Unique identifier for the product.
  • name (string, required): The name of the product.
  • description (string, optional): A detailed description of the product.
  • price (number, required): The current price of the product (e.g., in USD).
  • currency (string, required): The currency code (e.g., "USD").
  • categories (array of strings, optional): List of categories the product belongs to.
  • stock_quantity (integer, required): Current available stock.
  • added_timestamp (datetime, required): When the product was added to the catalog.

Example Data:

{
    "product_id": "prod_789pqr",
    "name": "Ergonomic Office Chair",
    "description": "Comfortable and adjustable chair designed for long working hours.",
    "price": 249.99,
    "currency": "USD",
    "categories": ["office", "furniture", "ergonomics"],
    "stock_quantity": 50,
    "added_timestamp": "2023-05-15T09:00:00Z"
}

Order Details Schema

Defines the structure for customer orders.

Fields:

  • order_id (string, required): Unique identifier for the order.
  • user_id (string, required): The ID of the user who placed the order.
  • order_date (datetime, required): Timestamp when the order was placed.
  • total_amount (number, required): The final total cost of the order.
  • currency (string, required): The currency of the total amount.
  • items (array of objects, required): List of products in the order. Each object must contain:
    • product_id (string, required)
    • quantity (integer, required)
    • unit_price (number, required)
  • status (string, required): Current status of the order (e.g., "pending", "processing", "shipped", "delivered", "cancelled").

Example Data:

{
    "order_id": "ord_xyz789",
    "user_id": "usr_abc123xyz",
    "order_date": "2023-10-27T14:00:00Z",
    "total_amount": 350.00,
    "currency": "USD",
    "items": [
        {
            "product_id": "prod_789pqr",
            "quantity": 1,
            "unit_price": 249.99
        },
        {
            "product_id": "prod_abc456",
            "quantity": 2,
            "unit_price": 50.01
        }
    ],
    "status": "processing"
}

For more detailed specifications or specific endpoint schemas, please refer to our API Documentation.