Domain Postman Doc: https://documenter.getpostman.com/view/20499442/[merchant-collection-id] ================================================================================ DOMAIN MANAGEMENT APIs ================================================================================ -------------------------------------------------------------------------------- API: Create Domain -------------------------------------------------------------------------------- POST /merchant/api/v1/domains [Seller Admin, Orchestration] Description: Create a new domain (business/organization) under the authenticated account. Initializes domain settings, creates default store, and sets up subscription. Request Body: { "name": "My Sample domain", "logo": "/tmp/UNIXTIMESTAMP.png?file_name=logo.png&alt_name=logo.png", "favicon": "/tmp/UNIXTIMESTAMP.png?file_name=favicon.png&alt_name=favicon.png", "locale": "en", "country": "India", "timezone": "Asia/Kolkata", "business_details": { "category": "Grocery", // Business category "module": "B2C" // B2C, B2B, etc. }, "store": { "name": "My Store" // Initial default store } } Response: 201 Created { "id": "axzps-169b", "account_name": "The Garden", "timezone": "(GMT-05:00) Eastern Time (US & Canada)", "iana_timezone": "Asia/Kolkata", "country_code": "IN", "country_name": "INDIA", "default_currency": "INR", "domain_Info": { "domain_url": "http://axzps-274.unizap.ai", "redirection_url": ["abc.com", "xyz.com"], "suspended": false, "resource_folder": "axzps_274_unizap_ai" }, "setup_helper": true, "helper": { "product_added": false, "theme_customised": false, "payment_configured": false, "delivery_configured": false, "subscription_selected": false, "blogs_added": false, "coupon_added": false, "checkout_settings": false }, "multi_store_enabled": false, "registration_answers": { "business_category": "Grocery", "business_mode": "B2B", "platform": "unizap" }, "primary_store_id": "6667e8923900cb5826d96f37", "stores": [...], "subscription": {...} } Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Create Domain in Account Service POST /api/domains [Account Service, Core Microservices] # Step 3: Create Default Store POST /api/stores [Store Service] # Step 4: Initialize Subscription POST /api/subscriptions [Subscription Service] # Step 5: Setup Resource Folder and CDN POST /api/resources/init [Resource Service] # Step 6: Log and Cache -------------------------------------------------------------------------------- API: List Domains -------------------------------------------------------------------------------- GET /merchant/api/v1/domains [Seller Admin, Orchestration] Description: List all domains accessible by the authenticated user. Returns paginated list with domain metadata. Query Parameters: - page: Page number (default: 0) - size: Page size (default: 10) Response: 200 OK { "content": [ { "updated_at": "2024-10-23T07:48:45.166Z", "id": "6718aa5c2d9d1c7b4e51d997", "internal_domain_id": "6718aa5c2d9d1c7b4e51d997", "account_id": "6718aa5d235b5f19bc1106dd", "name": "642115", "display_name": "My Domain", "url": "https://642115.ndh01.com", "redirection_url": ["642115.ndh01.com"], "suspended": false, "resource_folder": "642115", "status": "ACTIVE", "setup_helper": true, "setup_helper_product": false, "setup_helper_theme": false, "setup_helper_payment": false, "setup_helper_delivery": true, "setup_helper_subscription": false, "setup_helper_blogs": false, "setup_helper_coupon": false, "setup_helper_checkout": false, "multi_store_enabled": false, "platform": "UNIZAP", "platform_version": "1.0.0", "business_category": ["Grocery"], "business_module": ["B2C"] } ], "pageable": { "pageNumber": 0, "pageSize": 10, "sort": { "empty": true, "sorted": false, "unsorted": true }, "offset": 0, "paged": true, "unpaged": false }, "totalPages": 1, "totalElements": 1, "last": true, "size": 10, "number": 0, "numberOfElements": 1, "first": true, "empty": false } Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Fetch Domains from Account Service GET /api/domains [Account Service, Core Microservices] -------------------------------------------------------------------------------- API: Get Domain -------------------------------------------------------------------------------- GET /merchant/api/v1/domains/:domain_id [Seller Admin, Orchestration] Description: Retrieve detailed domain metadata including stores, subscription status, permissions, and setup helper status. Path Parameters: - domain_id: Required - Domain ID (string) Query Parameters: - store_list: Optional (boolean) - Include store list in response - store_list_size: Optional (int) - Maximum stores to return Response: 200 OK { "id": "6710e52481cf3a55a4973f34", "account_id": "f4847d09-3a90-4672-8181-34966466e282", "is_domain_admin": false, "name": "936893", "display_name": "My Organization", "redirection_url": ["936893.ndh01.com"], "suspended": false, "resource_folder": "936893", "status": "ACTIVE", "setup_helper": { "setup_helper_theme": false, "setup_helper_product": false, "setup_helper_payment": false, "setup_helper_delivery": true, "setup_helper_subscription": false, "setup_helper_blogs": false, "setup_helper_coupon": false, "setup_helper_checkout": false }, "multi_store_enabled": false, "platform": "UNIZAP", "platform_version": "1.0.0", "business_category": ["Fashion"], "business_module": ["B2B"], "permissions": [ "view_store_settings", "edit_store_settings", "view_product_settings", "edit_product_settings", "view_business_hours_settings", "edit_business_hours_settings", "view_general_settings", "edit_general_settings" ], "store_ids": ["67162f5192a7b358b6263479", ...], "updated_at": "2024-10-17T10:21:24.329Z", "store": [ { "id": "673eca1274beca68b87a6737", "name": "TESt", "default": true, "status": "ACTIVE" } ], "subscription": { "id": "673ee1c274beca68b87a673f", "domain_id": "6710e52481cf3a55a4973f34", "plan_id": "673c7154024aec1bf73431d1", "plan_name": "Uni-Connect", "channel": "STRIPE", "status": "ACTIVE", "start_date": "2024-11-21T07:31:14.165", "end_date": "2032-06-21T07:31:14.165", "max_stores": 5, "expired": false } } Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Validate Domain Access Permissions # Step 3: Fetch Domain from Account Service GET /api/domains/:domain_id [Account Service, Core Microservices] # Step 4: Optionally Fetch Stores GET /api/stores?domain_id=:domain_id&size=:store_list_size [Store Service] # Step 5: Fetch Subscription Info GET /api/subscriptions?domain_id=:domain_id [Subscription Service] # Step 6: Fetch User Permissions for Domain GET /api/permissions/:user_id/:domain_id [Account Service] -------------------------------------------------------------------------------- API: Delete Domain -------------------------------------------------------------------------------- DELETE /merchant/api/v1/domains/:domain_id [Seller Admin, Orchestration] Description: Delete a domain. Requires domain admin privileges. This will deactivate the domain and all associated resources. Path Parameters: - domain_id: Required - Domain ID (string) Response: 200 OK or 204 No Content Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Validate Domain Admin Permissions # Step 3: Deactivate Domain in Account Service DELETE /api/domains/:domain_id [Account Service] # Step 4: Cleanup Associated Resources DELETE /api/resources/:domain_id [Resource Service] # Step 5: Cancel Subscription DELETE /api/subscriptions/:domain_id [Subscription Service] # Step 6: Invalidate Cache POST /api/cache/invalidate [Caching Service] ================================================================================ DOMAIN URL (Custom Domain) APIs ================================================================================ -------------------------------------------------------------------------------- API: Get Domain URL -------------------------------------------------------------------------------- GET /merchant/api/v1/domains/:domain_id/domain_url [Seller Admin, Orchestration] Description: Get custom domain URL configuration for a domain. Returns DNS records and verification status. Path Parameters: - domain_id: Required - Domain ID (string) Query Parameters: - check_status: Optional (boolean) - Verify nameserver configuration Response: 200 OK { "id": "675bdc4e9cbdaf23e2ae9ef3", "domain_id": "672b0ce2588b16811b4d2830", "domain_name": "rajivpandey.info", "domain_connect_type": "link", // "link" or "purchase" "status": "pending", // "pending", "active", "inactive" "ns_records": [ "ns-cloud-c1.googledomains.com.", "ns-cloud-c2.googledomains.com.", "ns-cloud-c3.googledomains.com.", "ns-cloud-c4.googledomains.com." ] } Error Response (Domain not configured): { "error": { "status": 400, "message": "Domain not present" } } Error Response (Nameserver not matched - when check_status=true): { "error": { "status": 400, "message": "Not matched" } } Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Fetch Domain URL Config GET /api/domain-url/:domain_id [DNS Service] # Step 3: Optionally Verify Nameservers (if check_status=true) GET /api/dns/verify/:domain_name [DNS Service] -------------------------------------------------------------------------------- API: Create/Link Domain URL -------------------------------------------------------------------------------- POST /merchant/api/v1/domains/:domain_id/domain_url [Seller Admin, Orchestration] Description: Link an existing domain or purchase a new domain. For "link" type: Returns NS records to configure at registrar. For "purchase" type: Initiates domain purchase with payment. Path Parameters: - domain_id: Required - Domain ID (string) Request Body (Link Existing Domain): { "domain_name": "rajivpandey.info", "domain_connect_type": "link" // Link existing domain } Request Body (Purchase New Domain): { "domain_name": "harsh123.info", "domain_connect_type": "purchase", // Purchase new domain "current_domain_name": "404911.ndh01.com", // Required for GCP folder ops "client_return_url": "https://ndhgo.com/return" // Payment redirect URL } Response (Link): 200 OK { "id": "675c0422106a3b36c2c108d0", "domain_id": "672b0ce2588b16811b4d2830", "domain_name": "rajivpandey.info", "domain_connect_type": "link", "status": "pending", "ns_records": [ "ns-cloud-b1.googledomains.com.", "ns-cloud-b2.googledomains.com.", "ns-cloud-b3.googledomains.com.", "ns-cloud-b4.googledomains.com." ] } Response (Purchase - Free Domain): 200 OK { "id": "679336438314fa4a9995615c", "domain_id": "674d6a93c69a4d6a98c8d464", "payment": null // Free domain, no payment } Response (Purchase - Paid Domain): 200 OK { "id": "6793497b8314fa4a9995615d", "domain_id": "674d6a93c69a4d6a98c8d464", "payment": { "id": "96b044e7-6428-4da3-a583-ce6b2d592983", "txn_for": "DOMAIN_PURCHASE", "txn_id": "6793497b8314fa4a9995615d", "order_id": "50057bf1-e2d9-4358-a818-d875ce71e4e2", "method": "CASH", "status": "PENDING", "amount": 1000, "currency": "INR", "reference": "ordeh_2324f23faec14ab78318937b9abf3e0d", "processor": "JUSPAY", "url_web": "https://sandbox.assets.juspay.in/payment-page/order/...", "url_mobile": "https://sandbox.assets.juspay.in/payment-page/order/...", "payment_url_iframe": "https://sandbox.assets.juspay.in/payment-page/order/...", "created_at": "2025-01-24T08:04:12.452791443", "updated_at": "2025-01-24T08:04:12.452798442" } } Error Response (Domain already linked): { "error": { "status": 400, "message": "Domain is already present" } } Flow Sequence (Link): # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Create DNS Zone POST /api/dns/zones [DNS Service, Cloud Services] # Step 3: Store Domain URL Config POST /api/domain-url [DNS Service] # Step 4: Return NS Records for user to configure Flow Sequence (Purchase): # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Check Domain Availability POST /api/domains/check [Domain Registry Service] # Step 3: If paid, create payment order POST /api/payments/orders [Payment Service] # Step 4: Register Domain (after payment) POST /api/domains/register [Domain Registry Service] # Step 5: Configure DNS and SSL POST /api/dns/zones [DNS Service] POST /api/certificates/issue [Certificate Service] -------------------------------------------------------------------------------- API: Delete Domain URL -------------------------------------------------------------------------------- DELETE /merchant/api/v1/domains/:domain_id/domain_url [Seller Admin, Orchestration] Description: Remove custom domain URL configuration. Domain will revert to default platform URL. Path Parameters: - domain_id: Required - Domain ID (string) Response: 200 OK { "success": true, "message": "Domain URL deleted successfully" } Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Delete DNS Zone DELETE /api/dns/zones/:domain_name [DNS Service] # Step 3: Delete Domain URL Config DELETE /api/domain-url/:domain_id [DNS Service] # Step 4: Update Domain to use default URL PATCH /api/domains/:domain_id [Account Service] # Step 5: Invalidate CDN Cache POST /api/cdn/invalidate [CDN Service] -------------------------------------------------------------------------------- API: Search Available Domains -------------------------------------------------------------------------------- POST /merchant/api/v1/domains/:domain_id/domain_url/search [Seller Admin, Orchestration] Description: Search for available domain names for purchase. Returns list of available domains with pricing. Path Parameters: - domain_id: Required - Domain ID (string) Request Body: { "domain_name": "harshagarwal.com" // Search query } Response: 200 OK [ { "domain": "domainnamegautam.com", "period": 1, "period_unit": "year", "currency": "USD", "price": "12", "buy_price": "12", "discount": "0.00", "discount_percent": "0.00" }, { "domain": "domain-name-gautam.com", "period": 1, "period_unit": "year", "currency": "USD", "price": "12", "buy_price": "12", "discount": "0.00", "discount_percent": "0.00" }, { "domain": "domainnamegautam.io", "period": 1, "period_unit": "year", "currency": "USD", "price": "60", "buy_price": "60", "discount": "0.00", "discount_percent": "0.00" } ] Flow Sequence: # Step 1: Validate Token (via Gateway JWT validation) # Step 2: Search Domain Registry POST /api/domains/search [Domain Registry Service, Cloud Services] # Step 3: Get Pricing Information GET /api/domains/pricing [Domain Registry Service] # Step 4: Return Available Domains with Prices ================================================================================ ERROR RESPONSES ================================================================================ 401 Unauthorized: { "error": { "status": 401, "message": "Unauthorized" } } 403 Forbidden: { "error": { "status": 403, "message": "Forbidden" } } 404 Not Found: { "error": { "code": null, "status": "404", "message": "Not Found" } } ================================================================================ NOTES ================================================================================ - Domain creation automatically creates a default store - Domain deletion cascades to stores, subscriptions, and resources - Custom domain linking requires DNS configuration at registrar - Domain purchase integrates with payment gateway (JUSPAY) - NS record propagation may take up to 48 hours - check_status query param verifies nameserver configuration in real-time