NXTBN Product Details API

The NXTBN Product Details API is a highly robust system designed to handle complex business requirements efficiently. Below, you’ll find a detailed explanation of the available endpoints for fetching product details and their use cases.


1. Product Details API

Endpoint:

GET http://localhost:8000/product/storefront/api/products/<slug:slug>/

Purpose:

This endpoint provides the complete details of a product, including all associated variants.

Response Includes:

  • Product name, description, and images.

  • All associated variants (e.g., size, color).

  • Pricing details (e.g., minimum price, maximum price).

  • Stock availability information.

Use Case:

This is the primary endpoint for fetching detailed product information. It is best used when you want to display a full overview of the product on its details page.




Best Practices for Implementation

  1. First Load:

    • Use the http://localhost:8000/product/storefront/api/products/<slug:slug>/ endpoint to display product details.

  2. Lazy Loading Recommendations:

    • When the user scrolls down to view recommendations, call the recommended-list API to fetch similar products.

  3. Desktop Sidebar:

    • For desktop layouts, use with-recommended to preload recommended products and display them in the sidebar.

  4. User Navigation:

    • Use the with-related API to provide links to related products, enabling seamless user navigation.


Example Flow

  1. Initial Page Load:

    • Fetch product details using the primary API.

  2. Scroll Down:

    • Call the recommended list API to fetch 20 similar products.

  3. Related Products:

    • Use the with-related API to guide users to similar designs or styles.

This approach optimizes performance and ensures a seamless user experience.