Welcome to the E-Commerce API, a PHP-based API for managing e-commerce functionalities. This API provides various endpoints to perform operations related to products, users, and orders.
GET /products
Retrieve a list of all products.
GET /products/{id}
Retrieve details of a specific product by its ID.
POST /products
Create a new product.
Request Body:
{
"name": "Product Name",
"description": "Product Description",
"price": 9.99,
"quantity": 10
}PUT /products/{id}
Update an existing product by its ID.
Request Body: Same as Create Product
DELETE /products/{id}
Delete a product by its ID.
GET /users
Retrieve a list of all users.
GET /users/{id}
Retrieve details of a specific user by their ID.
POST /users
Create a new user.
Request Body:
{
"name": "User Name",
"email": "user@example.com",
"password": "password"
}PUT /users/{id}
Update an existing user by their ID.
Request Body: Same as Create User
DELETE /users/{id}
Delete a user by their ID.
GET /orders
Retrieve a list of all orders.
GET /orders/{id}
Retrieve details of a specific order by its ID.
POST /orders
Create a new order.
Request Body:
{
"user_id": 1,
"product_id": 1,
"quantity": 1
}PUT /orders/{id}
Update an existing order by its ID.
Request Body: Same as Create Order
DELETE /orders/{id}
Delete an order by its ID.