Pages
Postman Doc: https://documenter.getpostman.com/view/20499442/[merchant-collection-id]
================================================================================
SECTION 1: DOMAIN PAGES APIs
================================================================================
Pages are CMS-managed static content pages for seller storefronts.
--------------------------------------------------------------------------------
API: List Pages
--------------------------------------------------------------------------------
GET /merchant/api/v1/domains/:domain_id/pages
Description: List all static content pages for a specific domain.
Supports filtering and including full page data.
Path Parameters:
- domain_id (required): Domain ID
Query Parameters:
- include_data (optional): Set to true to include full page content
Response: 200 OK
[
{
"id": "677d03d9ca531b1a6dcbd228",
"name": "Product A",
"description": "This is a description of Product A",
"seo_title": "Dax90",
"seo_description": "Direct",
"slug": "slug",
"category": "Contact Us",
"path": "/products/product-a",
"is_active": true,
"is_featured": false,
"meta": {
"rating": 4.5,
"brand": "Brand A"
},
"data": "",
"preview_image_url": "https://ik.imagekit.io/unizap/...",
"created_at": "2025-01-07T10:37:13.725Z",
"updated_at": "2025-01-07T10:49:01.411Z"
}
]
Flow Sequence:
# Step 1: Validate Token and Domain Access
POST /api/auth/token/verify [User Service]
GET /api/domains/:domain_id [Account Service]
# Step 2: Fetch Pages for Domain
GET /api/pages?domain_id=:domain_id [Utility Service]
--------------------------------------------------------------------------------
API: Create Page
--------------------------------------------------------------------------------
POST /merchant/api/v1/domains/:domain_id/pages
Description: Create a new static content page with SEO metadata and rich content.
Path Parameters:
- domain_id (required): Domain ID
Request Body:
{
"name": "Home Page",
"description": "This is the homepage of the website",
"slug": "home-page",
"data": {
"header": "Welcome to the homepage!",
"footer": "2024 Example Corp."
},
"is_active": true,
"path": "/products/product-a",
"status": "DRAFT",
"category": "Landing Pages"
}
Response: 200 OK
{
"id": "6819b2e0c757ec0cd066ea0d",
"name": "Home Page",
"description": "This is the homepage of the website",
"slug": "home-page",
"category": "Landing Pages",
"path": "/products/product-a",
"is_active": true,
"data": {
"header": "Welcome to the homepage!",
"footer": "2024 Example Corp."
},
"created_at": "2025-05-06T06:57:36.195Z",
"updated_at": "2025-05-06T06:57:36.195Z"
}
Flow Sequence:
# Step 1: Validate Token and Domain Access
POST /api/auth/token/verify [User Service]
GET /api/domains/:domain_id [Account Service]
# Step 2: Validate Slug Uniqueness
GET /api/pages?domain_id=:domain_id&slug=:slug [Utility Service]
# Step 3: Create Page
POST /api/pages [Utility Service]
# Step 4: If is_active=true, render and publish
POST /api/pages/:id/render [Utility Service]
POST /api/cdn/invalidate [CDN Service]
# Step 5: Optionally index for search
POST /api/search/index/update [Search Service]
--------------------------------------------------------------------------------
API: Get Page
--------------------------------------------------------------------------------
GET /merchant/api/v1/domains/:domain_id/pages/:id
Description: Get detailed information about a specific page including full content.
Path Parameters:
- domain_id (required): Domain ID
- id (required): Page ID
Response: 200 OK
{
"id": "677d03d9ca531b1a6dcbd228",
"name": "Contact Us",
"description": "Contact page with form",
"seo_title": "Contact Us - Company Name",
"seo_description": "Get in touch with us",
"slug": "contact-us",
"category": "Contact Us",
"path": "/contact",
"is_active": true,
"is_featured": false,
"meta": {
"form_enabled": true
},
"data": "",
"preview_image_url": "https://ik.imagekit.io/unizap/...",
"created_at": "2025-01-07T10:37:13.725Z",
"updated_at": "2025-01-07T10:49:01.411Z"
}
Flow Sequence:
# Step 1: Validate Token and Domain Access
POST /api/auth/token/verify [User Service]
GET /api/domains/:domain_id [Account Service]
# Step 2: Fetch Page by ID
GET /api/pages/:id [Utility Service]
--------------------------------------------------------------------------------
API: Update Page
--------------------------------------------------------------------------------
PUT /merchant/api/v1/domains/:domain_id/pages/:id
Description: Update page content, metadata, or status. Supports partial updates.
Path Parameters:
- domain_id (required): Domain ID
- id (required): Page ID
Request Body:
{
"name": "Updated Page Name",
"description": "Updated description",
"seo_title": "Updated SEO Title",
"seo_description": "Updated SEO description",
"data": "",
"is_active": true
}
Response: 200 OK
{
"id": "677d03d9ca531b1a6dcbd228",
"name": "Updated Page Name",
"description": "Updated description",
"seo_title": "Updated SEO Title",
"seo_description": "Updated SEO description",
"slug": "contact-us",
"is_active": true,
"updated_at": "2025-05-06T07:00:00.000Z"
}
Flow Sequence:
# Step 1: Validate Token and Domain Access
POST /api/auth/token/verify [User Service]
GET /api/domains/:domain_id [Account Service]
# Step 2: Update Page
PUT /api/pages/:id [Utility Service]
# Step 3: Re-render and update CDN
POST /api/pages/:id/render [Utility Service]
POST /api/cdn/invalidate [CDN Service]
# Step 4: Update search index
POST /api/search/index/update [Search Service]
--------------------------------------------------------------------------------
API: Delete Page
--------------------------------------------------------------------------------
DELETE /merchant/api/v1/domains/:domain_id/pages/:id
Description: Delete a static page from the domain.
Path Parameters:
- domain_id (required): Domain ID
- id (required): Page ID
Response: 200 OK
{
"message": "Page deleted successfully"
}
Flow Sequence:
# Step 1: Validate Token and Domain Access
POST /api/auth/token/verify [User Service]
GET /api/domains/:domain_id [Account Service]
# Step 2: Delete Page
DELETE /api/pages/:id [Utility Service]
# Step 3: Remove from CDN
POST /api/cdn/invalidate [CDN Service]
# Step 4: Remove from search index
DELETE /api/search/index/:page_id [Search Service]
================================================================================
SECTION 2: GLOBAL PAGES APIs (Admin Only)
================================================================================
These endpoints allow listing and viewing pages across all domains (admin use).
--------------------------------------------------------------------------------
API: List All Pages (Global)
--------------------------------------------------------------------------------
GET /merchant/api/v1/pages
Description: List all pages across all domains. Admin endpoint for
cross-domain page management.
Query Parameters:
- page (optional): Page number
- size (optional): Page size
- category (optional): Filter by category
Response: 200 OK
{
"content": [...],
"pageable": {...},
"totalPages": 5,
"totalElements": 100
}
Flow Sequence:
# Step 1: Validate Token and Admin Permissions
POST /api/auth/token/verify [User Service]
# Step 2: Fetch All Pages (Paginated)
GET /api/pages [Utility Service]
--------------------------------------------------------------------------------
API: Get Page by ID (Global)
--------------------------------------------------------------------------------
GET /merchant/api/v1/pages/:id
Description: Get a specific page by ID without domain context.
Admin endpoint for cross-domain access.
Path Parameters:
- id (required): Page ID
Response: 200 OK
{
"id": "677d03d9ca531b1a6dcbd228",
"domain_id": "670d...",
"name": "Contact Us",
"slug": "contact-us",
"data": "",
"is_active": true
}
Flow Sequence:
# Step 1: Validate Token and Admin Permissions
POST /api/auth/token/verify [User Service]
# Step 2: Fetch Page by ID
GET /api/pages/:id [Utility Service]
================================================================================
PAGE STATUSES
================================================================================
DRAFT - Page is being edited, not visible to customers
PUBLISHED - Page is live and visible to customers
ARCHIVED - Page is no longer active but preserved
================================================================================
PAGE CATEGORIES
================================================================================
Contact Us - Contact and support pages
About Us - Company information pages
Landing Pages - Marketing landing pages
Legal - Terms, Privacy Policy, etc.
Custom - Custom category pages
================================================================================
NOTES
================================================================================
1. Pages support rich HTML content with custom forms
2. SEO fields (seo_title, seo_description) for search optimization
3. Slugs must be unique within a domain
4. Preview images for page thumbnails
5. Meta field for custom key-value data
6. Page rendering triggers CDN invalidation
7. Search indexing for content discovery
8. Categories help organize pages in admin UI