Skip to content

Added Online Shopping System HLD#19

Open
ganeshkumarm1 wants to merge 1 commit intomainfrom
online-shopping-system
Open

Added Online Shopping System HLD#19
ganeshkumarm1 wants to merge 1 commit intomainfrom
online-shopping-system

Conversation

@ganeshkumarm1
Copy link
Collaborator

No description provided.

Copy link
Owner

@SweetCodey SweetCodey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed until API Design and left feedback

* **Track order status:** Users should be able to view order status and track shipment progress.
* **View recommendations:** Users should receive personalized recommendations based on browsing and order history.

### Non-Functional Requirements
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also mention the numbers here for availability and scalability?


```json
{
"recommendations": [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the reason parameter. Very thoughtful!


This API allows users to search for products using keywords and apply filters and sorting.

![Product Search](Resources/API_ProductSearch.png)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to send available quantity back to the client?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This will be helpful if we want to show messages on search result like Only few quantities left or Only 10 quantities left

"reviewCount": 2547,
"imageUrl": "https://cdn.shopping.com/images/prod_12345.jpg",
"inStock": true,
"availableQuantity": 145
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to send available quantity back to the client?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This will be helpful if we want to show messages on search result like Only few quantities left or Only 10 quantities left

The server returns a list of products matching the search criteria along with pagination metadata.

```json
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for including filters and pagination there.


**HTTP Method & Endpoint**

We use `POST` method because adding an item to the cart creates a new entry in our system. The endpoint would be `/v1/cart/{cartId}/items`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great if you can add one more line explaining why you went for v1/cart/{cartid}/items instead of v1/cart/{cartid}. Tell that you are making changes to the items in the cart and not the cart itself.

**HTTP Method & Endpoint**

We use `PATCH` method for this API because it updates only a specific field (quantity) of an existing
item without replacing the entire item. The endpoint would be `/v1/cart/{cartId}/items/{itemId}`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to think about: Why did we go for endpoint as v1/cart/cartid/items/itemid and not v1/cart/cartid/items? We can always pass in item ID in the body.

Copy link
Collaborator Author

@ganeshkumarm1 ganeshkumarm1 Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred itemid because:

  1. As per REST principle, URL should identify the resource. Since item is treated as a separate resource, we mentioned itemid in url
  2. It also makes the traceability of access logs easier.

Please let me know if u think otherwise


#### Remove from Cart

This API allows users to remove an item from the cart.
Copy link
Owner

@SweetCodey SweetCodey Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like updating the cart and not deleting. Can we remove the deletion and only have the update the cart API design?
Same for HLD for delete item. We can simply say that is updating cart.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay. sure


This API allows users to place an order with items from their cart.

![Checkout](Resources/API_Checkout.png)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image seems to be wrong. Can you verify it once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. will update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments