Welcome to the Mock E-Commerce Cart & Checkout API documentation. In this API we allows users to interact with a shopping cart system, like adding items to the cart, fetching cart items, simulating the checkout process, and more. The data is not stored, and responses are simulated for testing purposes.
The base URL for all API requests is:
https://apitpoint.com/
No authentication is required for this mock API. All endpoints are open and accessible for testing purposes.
Endpoint: POST /addToCartMock.php
This endpoint simulates adding an item to the shopping cart. It accepts product details as input and returns a success message, but it does not store the data in any database.
https://apitpoint.com/api//addToCartMock.php
product_id = 101
product_name = "Wireless Keyboard"
quantity = 2
price = 50.00
{
"message": "Item added to cart successfully (mock)",
"product_id": 101,
"product_name": "Wireless Keyboard",
"quantity": 2,
"price": 50.00
}
curl -X POST https://apitpoint.com/api/addToCartMock.php \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "product_id=101&product_name=Wireless+Keyboard&quantity=2&price=50.00"
Endpoint: GET /getCartItemsMock.php
This endpoint returns a mock list of items in the cart. It is a static response that simulates items in the cart.
https://apitpoint.com/api/getCartItemsMock.php
[
{
"product_id": 1,
"product_name": "Laptop",
"quantity": 1,
"price": 1000.00
},
{
"product_id": 2,
"product_name": "Mouse",
"quantity": 2,
"price": 25.00
}
]
curl -X GET https://apitpoint.com/api/getCartItemsMock.php
Endpoint: POST /checkoutMock.php
This endpoint simulates the checkout process and returns a mock total amount for the cart. It does not perform any actual checkout operations.
https://apitpoint.com/api//checkoutMock.php
{
"cart_id": "12345"
}
{
"message": "Checkout completed successfully (mock)",
"total_amount": 1100.00
}
curl -X POST https://apitpoint.com/api/checkoutMock.php \
-H "Content-Type: application/json" \
-d '{"cart_id": "12345"}'
Endpoint: POST /clearCartMock.php
This endpoint simulates clearing all items from the cart. It returns a success message without performing any actual data operations.
https://apitpoint.com/api/clearCartMock.php
{
"cart_id": "12345"
}
{
"message": "Cart cleared successfully (mock)"
}
curl -X POST https://apitpoint.com/api/clearCartMock.php \
-H "Content-Type: application/json" \
-d '{"cart_id": "12345"}'