Welcome to Our Test API for E-commerce

This API is for testing purposes only. Feel free to integrate it with your front-end for evaluation and testing. By Id you can provide id like /1

Please note that this API is for mock testing only and does not interact with real entities.

E-commerce API E-commerce API By Id Cart API Order & Shipping Payment & Transactions Reviews & Ratings

Mock E-Commerce Cart & Checkout API Documentation

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.

API Overview

Base URL

The base URL for all API requests is:

https://apitpoint.com/

Authentication

No authentication is required for this mock API. All endpoints are open and accessible for testing purposes.

1. Add Item to Cart

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.

Request

Parameters

Example Request (form-data)


product_id = 101
product_name = "Wireless Keyboard"
quantity = 2
price = 50.00
    

Example Response


{
    "message": "Item added to cart successfully (mock)",
    "product_id": 101,
    "product_name": "Wireless Keyboard",
    "quantity": 2,
    "price": 50.00
}
    

cURL Command


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"
    

2. Get Cart Items

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.

Request

Example Response


[
    {
        "product_id": 1,
        "product_name": "Laptop",
        "quantity": 1,
        "price": 1000.00
    },
    {
        "product_id": 2,
        "product_name": "Mouse",
        "quantity": 2,
        "price": 25.00
    }
]
    

cURL Command


curl -X GET https://apitpoint.com/api/getCartItemsMock.php
    

3. Checkout

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.

Request

Example Request (form-data)


{
    "cart_id": "12345"
}
    

Example Response


{
    "message": "Checkout completed successfully (mock)",
    "total_amount": 1100.00
}
    

cURL Command


curl -X POST https://apitpoint.com/api/checkoutMock.php \
-H "Content-Type: application/json" \
-d '{"cart_id": "12345"}'
    

4. Clear Cart

Endpoint: POST /clearCartMock.php

This endpoint simulates clearing all items from the cart. It returns a success message without performing any actual data operations.

Request

Example Request (form-data)


{
    "cart_id": "12345"
}
    

Example Response


{
    "message": "Cart cleared successfully (mock)"
}
    

cURL Command


curl -X POST https://apitpoint.com/api/clearCartMock.php \
-H "Content-Type: application/json" \
-d '{"cart_id": "12345"}'