Orchestra Internal API Mapping

Catalog

Product and category browsing with 3-layer architecture: API Gateway → Orchestration → Microservices

View Postman Documentation

3-Layer Architecture

API Gateway Public (Internet)
Storefront Internal Orchestration
Product Service Core Microservices

SERVICE LAYERS

API Gateway Layer 1
Storefront Layer 2
Product Service Layer 3
Search Engine Shared
Caching Service Shared

Search Categories

Search and filter categories using Elasticsearch

POST
API Gateway Layer 1 - Public
POST /categories/search
Storefront Layer 2 - Orchestration
POST /categories/search

Get Category by ID

Retrieve a specific category by its unique identifier

GET
API Gateway Layer 1 - Public
GET /categories/:categoryId
Storefront Layer 2 - Orchestration
GET /categories/:categoryId
Product Service Layer 3 - Core Microservices
GET /api/category/:id

Get Category Filters

Retrieve available filter options for categories

GET
API Gateway Layer 1 - Public
GET /categories/filter
Storefront Layer 2 - Orchestration
GET /categories/filter

Search Products

Search, filter, and sort products using Elasticsearch

POST
API Gateway Layer 1 - Public
POST /products/search
Storefront Layer 2 - Orchestration
POST /products/search

Get Product by ID

Retrieve product details with inventory information

GET
API Gateway Layer 1 - Public
GET /products/:productId
Storefront Layer 2 - Orchestration
GET /products/:productId
Layer 3 - Parallel Service Calls
Product Service
GET /api/products/:id

Fetch product details

Inventory Service
GET /api/inventory/:productId

Fetch stock levels

Get Recently Viewed Products

Retrieve user's recently viewed products from cache (uses Redis)

GET
API Gateway Layer 1 - Public
GET /products/recent-view
Storefront Layer 2 - Orchestration
GET /products/recent-view
Layer 3 - Sequential Service Calls
1 Caching Service
POST /api/caching/get
user:{user_id}:recent_viewed_products

Returns list of recently viewed product IDs

2 Product Service
GET /api/products/bulk

Fetch full product details for cached IDs

3-Layer Catalog API Flow Diagram

┌─────────────────┐    ┌──────────────────┐    ┌──────────────────────┐    ┌─────────────────────────┐
│                 │    │                  │    │                      │    │                         │
│   Mobile App    │───▶│   API Gateway    │───▶│     Storefront       │───▶│   Services (Layer 3)    │
│   / Web Client  │    │   (Layer 1)      │    │   (Layer 2)          │    │                         │
│                 │    │   PUBLIC         │    │   INTERNAL           │    │   INTERNAL              │
└─────────────────┘    └──────────────────┘    └──────────────────────┘    └─────────────────────────┘

═══════════════════════════════════════════════════════════════════════════════════════════════════════
                              PRODUCT SEARCH FLOW
═══════════════════════════════════════════════════════════════════════════════════════════════════════

        │  POST /products/search      │                        │                            │
        │  { query, filters, sort }   │                        │                            │
        │  ─────────────────────────▶ │                        │                            │
        │                             │  POST /products/search │                            │
        │                             │  ──────────────────────▶                            │
        │                             │                        │  POST /api/products/search │
        │                             │                        │  ────────────────────────────▶  [Search Engine]
        │                             │                        │  ◀──── Elasticsearch results │
        │                             │                        │                            │
        │  { products[], total }      │  ◀───── Response ──────│                            │
        │  ◀──────────────────────────│                        │                            │

═══════════════════════════════════════════════════════════════════════════════════════════════════════
                              GET PRODUCT BY ID FLOW
═══════════════════════════════════════════════════════════════════════════════════════════════════════

        │  GET /products/:productId   │                        │                            │
        │  ─────────────────────────▶ │                        │                            │
        │                             │  GET /products/:id     │                            │
        │                             │  ──────────────────────▶                            │
        │                             │                        │  ┌─ Parallel Calls ──────┐ │
        │                             │                        │  │                       │ │
        │                             │                        │  │ GET /api/products/:id │ │
        │                             │                        │  │ ────────────────────────▶  [Product Service]
        │                             │                        │  │                       │ │
        │                             │                        │  │ GET /api/inventory/:id│ │
        │                             │                        │  │ ────────────────────────▶  [Inventory Service]
        │                             │                        │  │                       │ │
        │                             │                        │  └───────────────────────┘ │
        │                             │                        │                            │
        │  { product, stock }         │  ◀───── Response ──────│                            │
        │  ◀──────────────────────────│                        │                            │

═══════════════════════════════════════════════════════════════════════════════════════════════════════
                              RECENTLY VIEWED PRODUCTS FLOW
═══════════════════════════════════════════════════════════════════════════════════════════════════════

        │  GET /products/recent-view  │                        │                            │
        │  ─────────────────────────▶ │                        │                            │
        │                             │  GET /products/        │                            │
        │                             │      recent-view       │                            │
        │                             │  ──────────────────────▶                            │
        │                             │                        │  1. POST /api/caching/get  │
        │                             │                        │     Key: user:{id}:        │
        │                             │                        │     recent_viewed_products │
        │                             │                        │  ────────────────────────────▶  [Caching Service]
        │                             │                        │  ◀──── Returns: [id1,id2]  │
        │                             │                        │                            │
        │                             │                        │  2. GET /api/products/bulk │
        │                             │                        │     ids: [id1, id2, ...]   │
        │                             │                        │  ────────────────────────────▶  [Product Service]
        │                             │                        │  ◀──── Returns products    │
        │                             │                        │                            │
        │  { products: [...] }        │  ◀───── Response ──────│                            │
        │  ◀──────────────────────────│                        │                            │

═══════════════════════════════════════════════════════════════════════════════════════════════════════
                              CATEGORY SEARCH & FILTER FLOW
═══════════════════════════════════════════════════════════════════════════════════════════════════════

        │  POST /categories/search    │                        │                            │
        │  GET /categories/filter     │                        │                            │
        │  ─────────────────────────▶ │                        │                            │
        │                             │  Forward Request       │                            │
        │                             │  ──────────────────────▶                            │
        │                             │                        │  /api/categories/search    │
        │                             │                        │  /api/categories/filter    │
        │                             │                        │  ────────────────────────────▶  [Search Engine]
        │                             │                        │  ◀──── Elasticsearch results │
        │                             │                        │                            │
        │  { categories[], filters }  │  ◀───── Response ──────│                            │
        │  ◀──────────────────────────│                        │                            │

═══════════════════════════════════════════════════════════════════════════════════════════════════════
                              GET CATEGORY BY ID FLOW
═══════════════════════════════════════════════════════════════════════════════════════════════════════

        │  GET /categories/:categoryId│                        │                            │
        │  ─────────────────────────▶ │                        │                            │
        │                             │  GET /categories/:id   │                            │
        │                             │  ──────────────────────▶                            │
        │                             │                        │  GET /api/category/:id     │
        │                             │                        │  ────────────────────────────▶  [Product Service]
        │                             │                        │  ◀──── Category details    │
        │                             │                        │                            │
        │  { category: {...} }        │  ◀───── Response ──────│                            │
        │  ◀──────────────────────────│                        │                            │
        

Service Routing Summary

Search Engine (Elasticsearch)

  • POST /products/search - Product search, filtering, sorting
  • POST /categories/search - Category search
  • GET /categories/filter - Filter aggregations

Product Service (Database)

  • GET /products/:productId - Single product details
  • GET /categories/:categoryId - Single category details
  • GET /products/recent-view - Bulk product fetch

Architecture Summary

API Gateway

Public entry point for all catalog requests. Handles routing and authentication.

Layer 1

Storefront

Orchestrates catalog operations, aggregates data from multiple services.

Layer 2

Core Microservices

Product Service and Inventory Service handle domain-specific operations.

2 Services

Shared Services

Search Engine (Elasticsearch) and Caching Service (Redis) for performance.

2 Services

Services Used in Catalog Module

📦

Product Service

Product CRUD, categories, product details by ID

📊

Inventory Service

Stock levels, availability checks

🔍

Search Engine

Elasticsearch for products and categories search, filtering

Caching Service

Redis for recently viewed products

Orchestra Internal API Mapping - Catalog Module

Last Updated: December 2025