Product API Documentation

Product Management

This section details the endpoints for managing product information within our system. You can retrieve, create, update, and delete products using these APIs.

GET /api/v1/products

Retrieves a list of all available products.

Query Parameters:

Response Example:

[
  {
    "id": "prod_1a2b3c",
    "name": "Quantum Leap Smartwatch",
    "description": "Track your fitness and stay connected with the latest smartwatch technology.",
    "price": 199.99,
    "currency": "USD",
    "category": "electronics",
    "in_stock": 50,
    "created_at": "2023-10-27T10:00:00Z",
    "updated_at": "2023-10-27T10:00:00Z"
  },
  {
    "id": "prod_4d5e6f",
    "name": "Astro Camping Tent",
    "description": "Durable and spacious tent for your next outdoor adventure.",
    "price": 89.50,
    "currency": "USD",
    "category": "outdoors",
    "in_stock": 120,
    "created_at": "2023-10-26T14:30:00Z",
    "updated_at": "2023-10-26T14:30:00Z"
  }
]
POST /api/v1/products

Creates a new product.

Request Body:

{
  "name": "Galactic Coffee Maker",
  "description": "Brew the perfect cup with our advanced coffee maker.",
  "price": 75.00,
  "currency": "USD",
  "category": "kitchenware",
  "in_stock": 200
}

Response Example:

{
  "id": "prod_7g8h9i",
  "name": "Galactic Coffee Maker",
  "description": "Brew the perfect cup with our advanced coffee maker.",
  "price": 75.00,
  "currency": "USD",
  "category": "kitchenware",
  "in_stock": 200,
  "created_at": "2023-10-27T11:00:00Z",
  "updated_at": "2023-10-27T11:00:00Z"
}
GET /api/v1/products/{productId}

Retrieves details for a specific product by its ID.

Path Parameters:

Response Example:

{
  "id": "prod_1a2b3c",
  "name": "Quantum Leap Smartwatch",
  "description": "Track your fitness and stay connected with the latest smartwatch technology.",
  "price": 199.99,
  "currency": "USD",
  "category": "electronics",
  "in_stock": 50,
  "created_at": "2023-10-27T10:00:00Z",
  "updated_at": "2023-10-27T10:00:00Z"
}
PUT /api/v1/products/{productId}

Updates an existing product.

Path Parameters:

Request Body:

{
  "price": 209.99,
  "in_stock": 45
}

Response Example:

{
  "id": "prod_1a2b3c",
  "name": "Quantum Leap Smartwatch",
  "description": "Track your fitness and stay connected with the latest smartwatch technology.",
  "price": 209.99,
  "currency": "USD",
  "category": "electronics",
  "in_stock": 45,
  "created_at": "2023-10-27T10:00:00Z",
  "updated_at": "2023-10-27T11:30:00Z"
}
DELETE /api/v1/products/{productId}

Deletes a product by its ID.

Path Parameters:

Response Example:

{
  "message": "Product prod_1a2b3c deleted successfully."
}

For more information on error codes and authentication, please refer to the Authentication and Overview sections.

Explore Orders API