Orchestra Internal API Mapping

Enquiry

B2B enquiry operations with 3-layer architecture: API Gateway -> Order Management Orchestrator -> Core Microservices

View Postman Documentation

3-Layer Architecture

API Gateway Public (Internet)
Order Management Internal Orchestration
Core Microservices Internal Services

Add/Manage Items in Basket

Basket Operations

Add, update, or remove items from the enquiry basket (5 steps)

POST

REQUEST BODY

{
  "operations": [
    { "op": "SET", "product_id": "prod_123", "variant_id": "var_456", "quantity": 100, "notes": "Bulk order" },
    { "op": "ADD", "product_id": "prod_789", "quantity": 50 },
    { "op": "UPDATE", "item_id": "item_001", "quantity": 200 },
    { "op": "DELETE", "item_id": "item_002" }
  ]
}
API Gateway Layer 1 - Public
POST /enquiry-basket/items
Order Management Layer 2 - Orchestration
POST /enquiry-basket/items

Orchestrates 5 service calls

Layer 3 - Service Calls (5 Steps)
1 Enquiry Service Core Microservices
POST /api/enquiry-baskets/find-or-create

Get existing basket or create new one

2 Product Service Core Microservices
POST /api/products/search

Validate products exist and are available for enquiry

3 Enquiry Service Core Microservices
POST /api/enquiry-baskets/:basket_id/items/batch

Apply all item operations

4 Enquiry Service Core Microservices
POST /api/enquiry-baskets/:basket_id/compute

Calculate estimated totals

5 Caching Service Shared Services
POST /api/caching/set
Key: enquiry_basket:{basket_id}:computed | TTL: 1800s

RESPONSE

{
  "success": true,
  "operations_applied": 4,
  "results": [
    { "operation": "SET", "status": "SUCCESS", "action_taken": "ADDED", "item": {...} },
    { "operation": "ADD", "status": "SUCCESS", "item": {...} },
    { "operation": "UPDATE", "status": "SUCCESS", "item_id": "item_001" },
    { "operation": "DELETE", "status": "SUCCESS", "item_id": "item_002" }
  ],
  "basket": {
    "basket_id": "enq_basket_123",
    "items": [...],
    "item_count": 3,
    "total_quantity": 350,
    "estimated_total": 25000,
    "currency": "INR"
  }
}

Get Basket Details

View Basket

Retrieve the current enquiry basket with computed values (5 steps)

GET

QUERY PARAMETERS

?compute=true (optional, default: true)
API Gateway Layer 1 - Public
GET /enquiry-basket
Order Management Layer 2 - Orchestration
GET /enquiry-basket

Orchestrates 5 service calls

Layer 3 - Service Calls (5 Steps)
1 Enquiry Service Core Microservices
GET /api/enquiry-baskets/:basket_id

Get customer's active basket

2 Caching Service Shared Services
POST /api/caching/get

Check for cached basket (if compute=false)

3 Product Service Core Microservices (if compute=true)
POST /api/products/search

Fetch current product info, prices, images

4 Enquiry Service Core Microservices
POST /api/enquiry-baskets/:basket_id/compute

Calculate with current prices

5 Caching Service Shared Services
POST /api/caching/set
Key: enquiry_basket:{basket_id}:computed | TTL: 1800s

RESPONSE

{
  "success": true,
  "basket": {
    "basket_id": "enq_basket_123",
    "customer_id": "cust_456",
    "status": "ACTIVE",
    "items": [
      {
        "item_id": "item_001",
        "product_id": "prod_123",
        "product_name": "Industrial Widget",
        "variant_id": "var_456",
        "variant_name": "Large",
        "quantity": 100,
        "unit_price": 150,
        "estimated_total": 15000,
        "notes": "Bulk order",
        "in_stock": true,
        "available_quantity": 500
      }
    ],
    "summary": {
      "item_count": 3,
      "total_quantity": 350,
      "estimated_subtotal": 45000,
      "currency": "INR",
      "note": "Final prices subject to quote approval"
    },
    "created_at": "2025-01-15T10:00:00Z",
    "updated_at": "2025-01-15T12:30:00Z"
  }
}

Submit Enquiry

Quote Request

Submit basket as formal quote request, notify seller (6 steps)

POST

REQUEST BODY

{
  "contact_info": {
    "name": "John Doe",
    "email": "john@company.com",
    "phone": "+91-9876543210",
    "company": "ABC Industries"
  },
  "delivery_address": { "address_id": "addr_123" },
  "expected_delivery_date": "2025-02-15",
  "notes": "Urgent requirement. Please provide best price.",
  "attachments": [
    { "file_id": "file_001", "name": "specifications.pdf" }
  ]
}
API Gateway Layer 1 - Public
POST /enquiry-basket/submit
Order Management Layer 2 - Orchestration
POST /enquiry-basket/submit

Orchestrates 6 service calls (with parallel notifications)

Layer 3 - Service Calls (6 Steps)
1 Enquiry Service Core Microservices
GET /api/enquiry-baskets/:basket_id

Validate basket exists and has items

2 Enquiry Service Core Microservices
POST /api/enquiries

Create formal enquiry record

3 Enquiry Service Core Microservices
PUT /api/enquiry-baskets/:basket_id/status

Mark basket as SUBMITTED

4 Caching Service Shared Services
DELETE /api/caching/delete

Clear basket cache

Parallel Post-Submission (Steps 5-6)
5 Notification
POST /api/notifications/send

Notify seller

6 Notification
POST /api/notifications/send

Confirm to customer

+ Util Service
POST /api/events/publish

ENQUIRY_SUBMITTED

RESPONSE

{
  "success": true,
  "enquiry": {
    "enquiry_id": "enq_789",
    "enquiry_number": "ENQ-2025-0001",
    "status": "SUBMITTED",
    "items_count": 3,
    "total_quantity": 350,
    "estimated_total": 45000,
    "currency": "INR",
    "expected_response_by": "2025-01-18T10:00:00Z",
    "created_at": "2025-01-15T14:30:00Z"
  },
  "message": "Your enquiry has been submitted successfully. You will receive a quote within 3 business days."
}

Delete Enquiry Basket

Clear Basket

Delete/clear the entire enquiry basket (2 steps)

DELETE
API Gateway Layer 1 - Public
DELETE /enquiry-basket
Order Management Layer 2 - Orchestration
DELETE /enquiry-basket

Orchestrates 2 sequential calls

Layer 3 - Service Calls (2 Steps)
1 Enquiry Service Core Microservices
DELETE /api/enquiry-baskets/:basket_id

Soft delete the basket

2 Caching Service Shared Services
DELETE /api/caching/delete

Clear basket cache

RESPONSE

{
  "success": true,
  "message": "Enquiry basket deleted successfully",
  "basket_id": "enq_basket_123"
}

List All Enquiries

Search & Filter

List all enquiries with filtering and pagination (2 steps)

POST

REQUEST BODY

{
  "filters": {
    "status": ["SUBMITTED", "QUOTED", "ACCEPTED"],
    "date_from": "2025-01-01",
    "date_to": "2025-01-31",
    "search": "widget"
  },
  "pagination": { "page": 1, "limit": 20 },
  "sort": { "field": "created_at", "order": "DESC" }
}
API Gateway Layer 1 - Public
POST /enquiries
Order Management Layer 2 - Orchestration
POST /enquiries
Layer 3 - Service Calls (2 Steps)
1 Enquiry Service Core Microservices
POST /api/enquiries/search

Search with filters, pagination

2 Enquiry Service Core Microservices
POST /api/enquiries/stats

Get counts by status

RESPONSE

{
  "success": true,
  "enquiries": [
    {
      "enquiry_id": "enq_789",
      "enquiry_number": "ENQ-2025-0001",
      "status": "QUOTED",
      "items_count": 3,
      "total_quantity": 350,
      "estimated_total": 45000,
      "quoted_total": 42000,
      "currency": "INR",
      "invoices_count": 1,
      "created_at": "2025-01-15T14:30:00Z"
    }
  ],
  "pagination": { "page": 1, "limit": 20, "total_count": 45, "total_pages": 3 },
  "stats": { "SUBMITTED": 5, "QUOTED": 12, "ACCEPTED": 20, "REJECTED": 3, "EXPIRED": 5 }
}

Fetch Enquiry Details

Full Details

Get detailed information about a specific enquiry (3 steps)

GET
API Gateway Layer 1 - Public
GET /enquiries/:enquiry_id
Order Management Layer 2 - Orchestration
GET /enquiries/:enquiry_id
Layer 3 - Service Calls (3 Steps)
1 Enquiry Service Core Microservices
GET /api/enquiries/:enquiry_id

Get enquiry with all items

Parallel Calls (Steps 2-3)
2 Enquiry Service
GET /api/enquiries/:enquiry_id/invoices/summary

Returns count and status of invoices

3 Enquiry Service
GET /api/enquiries/:enquiry_id/activity

Status change history

RESPONSE

{
  "success": true,
  "enquiry": {
    "enquiry_id": "enq_789",
    "enquiry_number": "ENQ-2025-0001",
    "status": "QUOTED",
    "customer": { "customer_id": "cust_456", "name": "John Doe", "company": "ABC Industries" },
    "items": [
      { "product_name": "Industrial Widget", "quantity": 100, "requested_unit_price": 150, "quoted_unit_price": 140 }
    ],
    "summary": { "estimated_total": 45000, "quoted_total": 42000, "discount_percentage": 6.67, "currency": "INR" },
    "invoices": { "count": 1, "latest_status": "SENT" },
    "activity": [
      { "action": "SUBMITTED", "timestamp": "2025-01-15T14:30:00Z" },
      { "action": "QUOTED", "timestamp": "2025-01-16T10:00:00Z" }
    ],
    "valid_until": "2025-01-23T10:00:00Z"
  }
}

List Invoices for Enquiry

Quotations

List all invoices/quotes for an enquiry (2 steps)

POST
API Gateway Layer 1 - Public
POST /enquiries/:enquiry_id/invoices
Order Management Layer 2 - Orchestration
POST /enquiries/:enquiry_id/invoices
Layer 3 - Service Calls (2 Steps)
1 Enquiry Service Core Microservices
GET /api/enquiries/:enquiry_id

Validate customer access

2 Enquiry Service Core Microservices
POST /api/enquiries/:enquiry_id/invoices/search

Search invoices with pagination

RESPONSE

{
  "success": true,
  "enquiry_id": "enq_789",
  "enquiry_number": "ENQ-2025-0001",
  "invoices": [
    {
      "invoice_id": "inv_001",
      "invoice_number": "QUO-2025-0001",
      "type": "QUOTATION",
      "status": "SENT",
      "total_amount": 42000,
      "currency": "INR",
      "valid_until": "2025-01-23T10:00:00Z",
      "created_at": "2025-01-16T10:00:00Z",
      "pdf_url": "https://..."
    }
  ],
  "pagination": { "page": 1, "limit": 10, "total_count": 1, "total_pages": 1 }
}

Fetch Invoice Details

Full Quote

Get detailed invoice/quotation for an enquiry (3 steps)

GET
API Gateway Layer 1 - Public
GET /enquiries/:enquiry_id/invoices/:invoice_id
Order Management Layer 2 - Orchestration
GET /enquiries/:enquiry_id/invoices/:invoice_id
Layer 3 - Service Calls (3 Steps)
1 Enquiry Service Core Microservices
GET /api/enquiries/:enquiry_id

Validate customer access

2 Enquiry Service Core Microservices
GET /api/enquiries/:enquiry_id/invoices/:invoice_id

Get full invoice with line items

3 Enquiry Service Core Microservices
PUT /api/enquiries/:enquiry_id/invoices/:invoice_id/viewed

Update status to VIEWED (if first view)

RESPONSE

{
  "success": true,
  "invoice": {
    "invoice_id": "inv_001",
    "invoice_number": "QUO-2025-0001",
    "type": "QUOTATION",
    "status": "VIEWED",
    "enquiry": { "enquiry_id": "enq_789", "enquiry_number": "ENQ-2025-0001" },
    "customer": { "name": "John Doe", "company": "ABC Industries" },
    "seller": { "store_name": "Industrial Supplies Co.", "email": "sales@industrial.com" },
    "items": [
      { "product_name": "Industrial Widget", "quantity": 100, "unit_price": 140, "total": 14000 }
    ],
    "summary": { "subtotal": 42000, "discount": 3000, "tax": 7560, "grand_total": 46560, "currency": "INR" },
    "terms": ["Payment: 50% advance, 50% on delivery", "Delivery: Within 7 business days"],
    "valid_until": "2025-01-23T10:00:00Z",
    "pdf_url": "https://...",
    "actions": { "can_accept": true, "can_reject": true, "can_negotiate": true }
  }
}

Services Used in Enquiry Module

📋

Enquiry Service

Baskets, enquiries, invoices, quotes

📦

Product Service

Product validation, details

📊

Inventory Service

Stock availability checks

👤

Customer User Service

Customer addresses

🔔

Notification Service

Email/SMS notifications

Caching Service

Redis basket caching

📊

Util Service

Event publishing

🎯

Order Management

Orchestration layer

Enquiry Module - Orchestra Internal API Mapping | 8 APIs | 28 Total Steps