Product Management
Short Description: The Product Management API provides comprehensive functionality for managing products within shops on the NextGate platform. It supports advanced features including group buying, installment payments,payment plans, color variations, specifications, comprehensivedigital searchproduct file delivery, and filteringcomprehensive search/filter capabilities with role-based access control.
Hints:
Endpoints
1. Create Product
Purpose: Creates a new product in a shopshop, with support for all advanced features includingsupporting group buying, installments, color variations, specifications, and specificationsdigital product rules.
Endpoint: POST /api/v1/e-commerce/shops/{shopId}/products
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
| Content-Type | string | Yes | application/json |
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
Query Parameters:
| Parameter | Type | Required | |||
|---|---|---|---|---|---|
| action | ReqAction | Yes | SAVE_DRAFT or SAVE_PUBLISH |
Request JSON Sample:
{
"productName": "iPhone 15 Pro Max 256GB",
"productDescription": "The most advanced iPhone ever, featuring the groundbreaking A17 Pro chip, titanium design, and the most versatile Pro camera system. With a 6.7-inch Super Retina XDR display, Action Button, and up to 29 hours of video playback battery life.",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip and titanium design",
"price": 1199.00,
"comparePrice": 1299.00,
"stockQuantity": 25,
"lowStockThreshold": 5,
"categoryId": "123e4567-e89b-12d3-a456-426614174000",
"brand": "Apple",
"condition": "NEW",
"productImages": [
"https://example.com/images/iphone15-pro-max-main.jpg",
"https://example.com/images/iphone15-pro-max-side.jpg",
"https://example.com/images/iphone15-pro-max-back.jpg",
"https://example.com/images/iphone15-pro-max-camera.jpg"
],
"tags": ["smartphone", "apple", "premium", "5g", "titanium", "pro-camera"],
"specifications": {
"Display": "6.7-inch Super Retina XDR OLED",
"Chip": "A17 Pro with 6-core GPU",
"Storage": "256GB",
"RAM": "8GB",
"Rear Camera": "48MP Main, 12MP Ultra Wide, 12MP Telephoto",
"Front Camera": "12MP TrueDepth",
"Battery Life": "Up to 29 hours video playback",
"Operating System": "iOS 17",
"Connectivity": "5G, Wi-Fi 6E, Bluetooth 5.3",
"Materials": "Titanium frame, Ceramic Shield front",
"Water Resistance": "IP68 (6 meters for up to 30 minutes)",
"Dimensions": "159.9 x 76.7 x 8.25 mm",
"Weight": "221 grams"
},
"colors": [
{
"name": "Natural Titanium",
"hex": "#F5F5DC",
"images": [
"https://example.com/colors/iphone-natural-titanium-1.jpg",
"https://example.com/colors/iphone-natural-titanium-2.jpg"
],
"priceAdjustment": 0.00
},
{
"name": "Blue Titanium",
"hex": "#4A90E2",
"images": [
"https://example.com/colors/iphone-blue-titanium-1.jpg",
"https://example.com/colors/iphone-blue-titanium-2.jpg"
],
"priceAdjustment": 0.00
},
{
"name": "White Titanium",
"hex": "#FFFFFF",
"images": [
"https://example.com/colors/iphone-white-titanium-1.jpg",
"https://example.com/colors/iphone-white-titanium-2.jpg"
],
"priceAdjustment": 0.00
},
{
"name": "Black Titanium",
"hex": "#1C1C1E",
"images": [
"https://example.com/colors/iphone-black-titanium-1.jpg",
"https://example.com/colors/iphone-black-titanium-2.jpg"
],
"priceAdjustment": 50.00
}
],
"minOrderQuantity": 1,
"maxOrderQuantity": 3,
"maxPerCustomer": 2,
"requiresApproval": false,
"groupBuyingEnabled": true,
"groupMinSize": 10,
"groupMaxSize": 50,
"groupPrice": 1099.00,
"groupTimeLimitHours": 72,
"groupRequiresMinimum": true,
"installmentEnabled": true,
"installmentPlans": [
{
"duration": 6,
"interval": "MONTHS",
"interestRate": 0.00,
"description": "6 months interest-free installment"
},
{
"duration": 12,
"interval": "MONTHS",
"interestRate": 2.90,
"description": "12 months with low interest rate"
},
{
"duration": 24,
"interval": "MONTHS",
"interestRate": 5.90,
"description": "24 months extended payment plan"
}
],
"downPaymentRequired": true,
"minDownPaymentPercentage": 20.00,
"trackInventory": true,
"isFeatured": true,
"isDigital": false,
"requiresShipping": true,
"metaTitle": "iPhone 15 Pro Max 256GB - Premium Titanium Smartphone | TechStore Pro",
"metaDescription": "Buy the latest iPhone 15 Pro Max with 256GB storage, A17 Pro chip, and titanium design. Available with group buying discounts and flexible installment plans."
}
Request Body Parameters:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| productType | ProductType | Yes | PHYSICAL or DIGITAL |
Required |
| productName | string | Yes | Unique name |
Min: 2, Max: 100 |
| productDescription | string | Yes | Detailed |
Min: 10, Max: 1000 |
| price | decimal | Yes | Min: 0.01, |
|
| stockQuantity | integer | Yes | Available stock |
Min: 0 |
| categoryId | UUID | Yes | Product category |
Must exist and be active |
| comparePrice | decimal | No | Original price for discount display | Must be |
| lowStockThreshold | integer | No | Low stock alert threshold | Min: 1, Max: 1000, Default: 5 |
| condition | ProductCondition | No | Product condition | NEW, USED_LIKE_NEW, USED_GOOD, USED_FAIR, REFURBISHED, FOR_PARTS |
| status | ProductStatus | No | Initial action) |
ACTIVE |
| productImages | array | Yes | Product image URLs | Valid URLs, |
| specifications | object | No | ||
| colors | array | No | See Color |
|
| minOrderQuantity | integer | No | Minimum order |
Min: 1, Default: 1 |
| maxOrderQuantity | integer | No | Maximum order |
Min: 1, must be |
| groupBuyingEnabled | boolean | No | Enable group buying |
Default: false |
| groupMaxSize | integer | No | Maximum group participants | Min: 2, |
| groupPrice | decimal | No | Discounted group price | Must be |
| groupTimeLimitHours | integer | No | Group formation time limit | Min: 1, Max: 8760 |
| No | Min: 1, Default: |
|||
| No | ||||
| Min: 1 | ||||
| No | ||||
| Min: | ||||
Color Object:
| Field | Type | Required | Validation |
|---|---|---|---|
| name | string | Yes | Max: 50 chars |
| hex | string | Yes | Valid #RRGGBB format |
| images | array | No | Valid URLs |
| priceAdjustment | decimal | No | Min: 0.0, Default: 0 |
Request ObjectJSON StructureSample (PHYSICAL):
{
"productType": "PHYSICAL",
"productName": "iPhone 15 Pro Max 256GB",
"productDescription": "The most advanced iPhone featuring the A17 Pro chip and titanium design.",
"price": 1199.00,
"comparePrice": 1299.00,
"stockQuantity": 25,
"lowStockThreshold": 5,
"categoryId": "123e4567-e89b-12d3-a456-426614174000",
"condition": "NEW",
"productImages": [
"https://example.com/images/iphone15-main.jpg"
],
"specifications": {
"Display": "6.7-inch Super Retina XDR OLED",
"Chip": "A17 Pro"
},
"colors": [
{
"name": "ColorNatural Name"Titanium",
"hex": "#HEXCODE"#F5F5DC",
"images": ["url1", "url2"https://example.com/colors/natural-titanium.jpg"],
"priceAdjustment": 0.00
}
],
"minOrderQuantity": 1,
"maxOrderQuantity": 3,
"groupBuyingEnabled": true,
"groupMaxSize": 50,
"groupPrice": 1099.00,
"groupTimeLimitHours": 72
}
Installment Plan Request ObjectJSON StructureSample (DIGITAL):
{
"duration": 12,
"interval"productType": "MONTHS"DIGITAL",
"interestRate": 2.90,
"description"productName": "12UI monthsDesign lowKit interest"Pro",
"productDescription": "A comprehensive Figma component library with 500+ components.",
"price": 49.00,
"stockQuantity": 1000,
"categoryId": "123e4567-e89b-12d3-a456-426614174000",
"productImages": ["https://example.com/images/design-kit-preview.jpg"],
"downloadExpiryDays": 30,
"maxDownloadsPerBuyer": 5,
"maxQuantityForDigital": 1
}
Response JSON Sample:
{
"success": true,
"message": "Product created successfully",
"data": null
}
Response Fields:
Business Rules:
- Product name must be unique within the shop
IfcomparePricemust be greater thanis provided, itpriceGroup buying requires groupMinSize โค groupMaxSizeGroup pricegroupPricemust be less thanregularpriceInstallmentAllplansgroup buying settings (groupMaxSize,groupPrice,groupTimeLimitHours) required wheninstallmentEnabled=groupBuyingEnabled=trueAt least one installment planmaxOrderQuantitymust beprovidedโฅminOrderQuantityColorDigitalhexdownloadcodesfieldsmust(downloadExpiryDays,bemaxDownloadsPerBuyer,validmaxQuantityForDigital)6-digitonlyhexapplyformattoDIGITALproductsAllAfterimagecreation,URLsaddmustinstallmentbeplansvalidvia Installment Plan Config andaccessibledigital CategoryfilesmustviaexistDigitalandFilebe activeShop must exist and be activeUser must be shop owner or system admin
Validation Rules:
@AssertTrueGroup maximum size must be greater than minimum size@AssertTrueGroup price must be less than regular price@AssertTrueMaximum order quantity must be greater than minimum order quantity@AssertTrueCompare price must be greater than regular price@AssertTrueAt least one installment plan required when installments enabled@AssertTrueGroup buying settings required when group buying enabledManagement
Error Responses:
400:Bad RequestInvalidValidationrequest data, validation errors,errors or business rule violations401: Authentication requiredUnauthorizedor invalid token403: Insufficient permissionsForbidden(shop owner or system admin required)404: ShopNot Foundnot foundor category notfound/inactivefound409: Product with sameConflictname, brand, price, and specificationsname already exists in shop422:Unprocessable EntityValidationField-level validation errorswith detailed field-level messages500 Internal Server Error: Server error during product creation
2. Update Product
Purpose: Updates an existing productproduct. withOnly supportprovided forfields allare advanced features and partial updatesupdated.
Endpoint: PUT /api/v1/e-commerce/shops/{shopId}/products/{productId}
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop | |
| productId | UUID | Yes | ID of the product |
Query Parameters:
| Parameter | Type | Required | |||
|---|---|---|---|---|---|
| action | ReqAction | Yes | SAVE_DRAFT or SAVE_PUBLISH |
Request JSON Sample:
{
"productName": "iPhone 15 Pro Max 512GB - Updated",
"price": 1399.00,
"comparePrice": 1499.00,
"stockQuantity": 15,
"groupPrice": 1299.00,
"specifications": {
"Display": "6.7-inch Super Retina XDR OLED",
"Storage": "512GB",
"RAM": "8GB",
"New Feature": "Enhanced Night Mode"
},
"installmentPlans": [
{
"duration": 6,
"interval": "MONTHS",
"interestRate": 0.00,
"description": "6 months interest-free"
},
{
"duration": 18,
"interval": "MONTHS",
"interestRate": 4.50,
"description": "18 months flexible payment"
}
],
"tags": ["smartphone", "apple", "premium", "5g", "512gb", "pro-max"]
}
Request Body Parameters (all optional):
All parameters are optional for updates. Only provided fields will be updated.
| Parameter | Type | Description | Validation | |
|---|---|---|---|---|
| productName | string | Updated |
Min: 2, Max: 100 |
|
| productDescription | string | Updated description | Min: 10, Max: 1000 | |
| price | decimal | Updated selling price | Min: 0. |
|
| comparePrice | decimal | Updated |
Must be |
|
| stockQuantity | integer | Updated stock |
Min: 0 | |
| lowStockThreshold | integer | Updated low stock threshold | Min: 1, Max: 1000 | |
| condition | ProductCondition | Updated condition | ||
| status | ProductStatus | Updated status | action |
|
| urgencyTag | UrgencyTag | Urgency badge on product | NONE, NEW_ARRIVAL, LIMITED_EDITION, LIMITED_OFFER, FEW_REMAINS |
|
| categoryId | UUID | Updated category | Must exist and be active | |
| productImages | array | Updated image URLs | Valid | URLs, |
| specifications | object | Updated specifications | Completely replaces existing |
|
| colors | array | Updated color variations | Completely replaces existing |
|
| minOrderQuantity | integer | Updated |
Min: 1 | |
| maxOrderQuantity | integer | Updated |
Min: 1, must be | |
| groupBuyingEnabled | boolean | Enable/disable group buying | ||
| groupMaxSize | integer | Updated group |
Min: |
|
| groupPrice | decimal | Updated group price | Must be |
|
| groupTimeLimitHours | integer | Updated group time limit | Min: 1, Max: 8760 | |
| installmentEnabled | boolean | |||
| boolean | ||||
| boolean | ||||
Response JSON Sample:
{
"success": true,
"message": "Product updated successfully and published",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB - Updated"512GB",
"productSlug": "iphone-15-pro-max-512gb-updated"512gb",
"price": 1399.00,
"comparePrice": 1499.00,
"status": "ACTIVE",
"stockQuantity": 15,
"updatedAt": "2025-09-23T14:2026-05-19T14:30:00Z",
"sku": "SHP12345678-ELE-APP-512-0001"
}
}
Business Rules for Updates:
Product name uniqueness checked only if name is being changedSKU uniqueness validated only if SKU is being changedGroup buying settings must be complete when enabling featureInstallment plans required when enabling installment featureCategory must exist and be active if being changedAction parameter determines final status regardless of status field
Error Responses:
400: Invalid update data or validation errorsBad Request401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden404: Shop or product not foundNot Found409: Updated product nameConflictor SKUalready exists422 Unprocessable Entity: Validation errors
3. Publish Product
Purpose: Publishes a draft product making it active and publicly availableavailable.
Endpoint: PATCH /api/v1/e-commerce/shops/{shopId}/products/{productId}/publish
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop | |
| productId | UUID | Yes | ID of the |
Response JSON Sample:
{
"success": true,
"message": "Product 'iPhone 15 Pro Max 512GB'Max' published successfully",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb"Max",
"status": "ACTIVE",
"publishedAt": "2025-09-23T14:2026-05-19T14:45:00Z",
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro"
}
}
Publishing Validation Requirements:
- Product
namename,mustdescription,notprice,bestockemptyquantity, Productcategory,descriptionandmustatnotleastbeoneemptyPriceimage must begreater than 0Stock quantity must be >= 0Category must be assigned and activeAt least one product image requiredpresent- Group buying settings complete if enabled
- Installment plans present if
installmentsinstallment is enabled
Error Responses:
400: Product already published or missing required publish fieldsBad Requestfor publishing401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden404: Shop or product not foundNot Found
4. Delete Product
Purpose: Deletes a productproduct. usingDraft differentproducts strategiesare basedhard-deleted; onpublished productproducts statusare soft-deleted.
Endpoint: DELETE /api/v1/e-commerce/shops/{shopId}/products/{productId}
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop | |
| productId | UUID | Yes | ID of the product |
Response JSON Sample (Soft Delete):
{
"success": true,
"message": "Product 'iPhone 15 Pro Max 512GB'Max' has been deleted and will be permanently removed after 30 days",
"data": {
"message": "Product 'iPhone 15 Pro Max 512GB' has been deleted and will be permanently removed after 30 days",
"productName": "iPhone 15 Pro Max 512GB"Max",
"productId": "456e7890-e89b-12d3-a456-426614174001",
"previousStatus": "ACTIVE",
"deletedAt": "2025-09-23T15:2026-05-19T15:00:00Z",
"deletionType": "SOFT_DELETE",
"note": "Product will be permanently deleted after 30 days"
}
}
Response JSON Sample (Hard Delete):
{
"success": true,
"message": "Draft product 'iPhone 15 Pro Max 512GB'Max' has been permanently deleted",
"data": null
}
Deletion Logic:
- Draft
Productsproducts: Hard delete (permanentlyremoved from database)removed) - Published
Productsproducts: Soft delete (marked as deleted,statuschangedโtoARCHIVED,ARCHIVED)30-day SoftrecoveryDeleted Products: Marked with deletion timestamp and deleted by user IDRecovery Period: 30 days for soft-deleted products before permanent removalwindow)
Error Responses:
401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden404: Shop or product not foundNot Found
5. Restore Product
Purpose: Restores a soft-deleted product back to draft statusstatus.
Endpoint: PATCH /api/v1/e-commerce/shops/{shopId}/products/{productId}/restore
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop | |
| productId | UUID | Yes | ID of the |
Response JSON Sample:
{
"success": true,
"message": "Product 'iPhone 15 Pro Max 512GB'Max' has been restored successfully",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb"Max",
"status": "DRAFT",
"restoredAt": "2025-09-23T15:2026-05-19T15:30:00Z",
"isDeleted": false,
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"note": "Product restored as draft. Publish to make it active again."
}
}
Restoration Process:
Sets isDeleted flag to falseClears deletedAt and deletedBy fieldsSets status to DRAFT for safety (requires manual publishing)Updates editedBy and updatedAt timestamps
Error Responses:
400: Product is not deletedBad Requestand cannot be restored401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden404: Shop or product not foundNot Found
6. Get Product Detailed (Owner/Admin View)
Purpose: Retrieves comprehensive product details withincluding all features and management informationinformation.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/{productId}/detailed
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop | |
| productId | UUID | Yes | ID of the product |
Response JSON Sample:
{
"success": true,
"message": "Product details retrieved successfully",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb",
"productType": "PHYSICAL",
"productDescription": "The most advanced iPhone ever, featuring the groundbreaking A17 Pro chip.ever...",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip and titanium design",
"productImages": [
"https://example.com/images/iphone15-pro-max-main.jpg",
"https://example.com/images/iphone15-pro-max-side.jpg"
],
"price": 1199.00,
"comparePrice": 1299.00,
"discountAmount": 100.00,
"discountPercentage": 7.69,
"isOnSale": true,
"stockQuantity": 25,
"lowStockThreshold": 5,
"isInStock": true,
"isLowStock": false,
"trackInventory": true,
"brand": "Apple",
"sku": "SHP12345678-ELE-APP-512-0001",
"condition": "NEW",
"status": "ACTIVE",
"tags": ["smartphone", "apple", "premium", "5g", "titanium"],
"metaTitle"urgencyTag": "iPhone 15 Pro Max 512GB - Premium Titanium Smartphone",
"metaDescription": "Buy the latest iPhone 15 Pro Max with 512GB storage..."NONE",
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"categoryId": "789e0123-e89b-12d3-a456-426614174002",
"categoryName": "Smartphones",
"isFeatured": true,
"isDigital": false,
"requiresShipping": true,
"createdAt": "2025-09-23T10:30:00Z",
"updatedAt": "2025-09-23T14:30:00Z",
"createdBy": "111e2222-e89b-12d3-a456-426614174003",
"editedBy": "111e2222-e89b-12d3-a456-426614174003",
"specifications": {
"Display": "6.7-inch Super Retina XDR OLED",
"Chip": "A17 Pro with 6-core GPU",
"Storage": "512GB",
"RAM": "8GB",
"Battery Life": "Up to 29 hours video playback",
"Water Resistance": "IP68"Pro"
},
"hasSpecifications": true,
"specificationCount": 6,
"colors": [
{
"name": "Natural Titanium",
"hex": "#F5F5DC",
"images": ["https://example.com/colors/natural-titanium.jpg"],
"priceAdjustment": 0.00,
"finalPrice": 1199.00,
"hasExtraFee": false,
"extraFeeReason": null
},
{
"name": "Black Titanium",
"hex": "#1C1C1E",
"images": ["https://example.com/colors/black-titanium.jpg"],
"priceAdjustment": 50.00,
"finalPrice": 1249.00,
"hasExtraFee": true,
"extraFeeReason": "Premium color finish"00
}
],
"hasMultipleColors": true,
"colorCount": 2,
"priceRange": {
"minPrice": 1199.00,
"maxPrice": 1249.00,
"priceStartsFrom": 1199.00,
"hasPriceVariations": true
},
"orderingLimits": {
"minOrderQuantity": 1,
"maxOrderQuantity": 3,
"requiresApproval": false,
"canOrderQuantity": 3,
"maxAllowedQuantity": 3,
"hasOrderingLimits": true
},
"groupBuying": {
"isEnabled": true,
"isAvailable": true,
"minGroupSize": 10,
"maxGroupSize"groupMaxSize": 50,
"currentGroupSize": 7,
"remainingSlots": 43,
"progressPercentage": 70.0,
"groupPrice": 1099.00,
"groupDiscount": 100.00,
"groupDiscountPercentage": 8.34,
"timeLimitHours": 72,
"timeRemainingHours": 48,
"expiresAt": "2025-09-25T10:30:00Z",
"requiresMinimum": true,
"status": "PENDING",
"canJoinGroup": true72
},
"installmentOptions": {
"isEnabled": true,
"isAvailable": true,
"downPaymentRequired": true,
"minDownPaymentPercentage": 20.00,
"eligibilityStatus": "ELIGIBLE",
"creditCheckRequired": false,
"plans": [
{
"planId": "plan-6m",
"duration": 6,
"interval": "MONTHS",
"interestRate": 0.00,
"description": "6 months interest-free installment",
"isPopular": true,
"calculations": {
"downPayment": 239.80,
"remainingAmount": 959.20,
"totalInterest": 0.00,
"paymentAmount": 159.87,
"totalAmount": 1199.00
},
"paymentSchedule": [
{
"paymentNumber": 1,
"amount": 159.87,
"dueDate": "2025-10-23T00:00:00Z",
"description": "Month 1 payment"
},
{
"paymentNumber": 2,
"amount": 159.87,
"dueDate": "2025-11-23T00:00:00Z",
"description": "Month 2 payment"
}
]
}
]
},
"purchaseOptions": {
"canBuyNow": true,
"canJoinGroup": true,
"canPayInstallment": true,
"recommendedOption"createdAt": "GROUP_BUYING"2026-05-19T10:30:00Z",
"bestDeal": {
"option"updatedAt": "GROUP_BUYING",
"savings": 100.00,
"finalPrice": 1099.00
}
}2026-05-19T14:30:00Z"
}
}
Response Fields:
Error Responses:
401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden(shop owner or admin required)404: Shop or product not foundNot Found
7. Get Shop Products (Management View)
Purpose: Retrieves all products for a shop management with summary statisticsstatistics.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/all
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
Response JSON Sample:
{
"success": true,
"message": "Retrieved 47 products from shop: TechStore Pro",
"data": {
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": true
},
"summary": {
"totalProducts": 47,
"activeProducts": 35,
"draftProducts": 8,
"outOfStockProducts": 4,
"featuredProducts": 12,
"lowStockProducts": 6,
"averagePrice": 649.75,
"totalInventoryValue": 89543.25,
"productsWithGroupBuying": 18,
"productsWithInstallments": 25,
"productsWithMultipleColors": 14
},
"products": [
{
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip",
"primaryImage": "https://example.com/images/iphone15-pro-max-main.jpg",
"price": 1199.00,
"comparePrice": 1299.00,
"finalPrice": 1199.00,
"isOnSale": true,
"discountPercentage": 7.69,
"stockQuantity": 25,
"isInStock": true,
"isLowStock": false,
"brand": "Apple",
"sku": "SHP12345678-ELE-APP-512-0001",
"condition": "NEW",
"status": "ACTIVE",
"isFeatured": true,
"isDigital": false,
"hasGroupBuying": true,
"hasInstallments": true,
"hasMultipleColors": true,
"groupPrice": 1099.00,
"startingFromPrice": 1199.00,
"createdAt": "2025-09-23T10:30:00Z"
}
],
"totalProducts": 47
}
}
Summary Statistics Fields:
Error Responses:
8. Get Shop Products Paginated (Management View)
Purpose: Retrieves shop products with pagination for management dashboard
Endpoint: GET /api/v1/shops/{shopId}/products/all-paged
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Request Headers:
Path Parameters:
Query Parameters:
Response JSON Sample:
{
"success": true,
"message": "Retrieved 10 products from shop: TechStore Pro (Page 1 of 5)",
"data": {
"contents": {
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": true
},
"summary": {
"totalProducts": 47,
"activeProducts": 35,
"draftProducts": 8,
"averagePrice": 649.75,
"totalInventoryValue": 89543.25
},
"products": [
{
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"price": 1199.00,
"stockQuantity": 25,
"status": "ACTIVE",
"isInStock": true,
"hasGroupBuying": true,
"hasInstallments": true,
"createdAt": "2025-09-23T10:2026-05-19T10:30:00Z"
}
],
"totalProducts": 47
}
}
Error Responses:
401: Authentication required403: Insufficient permissions404: Shop not found
8. Get Shop Products Paginated (Management View)
Purpose: Retrieves shop products with pagination for management dashboard.
Endpoint: GET api/v1/e-commerce/shops/{shopId}/products/all-paged
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| page | integer | No | 1 | Page number (1-indexed) |
| size | integer | No | 10 | Items per page (max: 100) |
Response JSON Sample:
{
"success": true,
"message": "Retrieved 10 products from shop: TechStore Pro (Page 1 of 5)",
"data": {
"contents": { "...same structure as /all..." },
"currentPage": 1,
"pageSize": 10,
"totalElements": 47,
"totalPages": 5,
"hasNext": true,
"hasPrevious": false
}
}
Pagination Fields:
Error Responses:
401: Authentication requiredUnauthorized403: Insufficient permissionsForbidden404: Shop not foundNot Found
9. Get Public Product by ID
Purpose: Retrieves a single active product for public viewing with customer-focused informationviewing.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/{productId}
Access Level: ๐ Public (No authentication required)
Authentication: None
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ||
| productId | UUID | Yes |
Response JSON Sample:
{
"success": true,
"message": "Product retrieved successfully",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb",
"productType": "PHYSICAL",
"productDescription": "The most advanced iPhone ever, featuring the groundbreaking A17 Pro chip.ever...",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip and titanium design",
"productImages": [
"https://example.com/images/iphone15-pro-max-main.jpg",
"https://example.com/images/iphone15-pro-max-side.jpg"
],
"price": 1199.00,
"comparePrice": 1299.00,
"discountAmount": 100.00,
"discountPercentage": 7.69,
"isOnSale": true,
"isInStock": true,
"isLowStock": false,
"stockQuantity": 25,
"brand": "Apple",
"condition": "NEW",
"tags": ["smartphone", "apple", "premium", "5g", "titanium"],
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"shopLogoUrl": "https://example.com/logos/techstore-pro.png",
"categoryId": "789e0123-e89b-12d3-a456-426614174002",
"categoryName": "Smartphones",
"isDigital": false,
"requiresShipping": true,
"specifications": { "Display": "6.7-inch Super Retina XDR OLED",
"Storage": "512GB",
"Chip": "A17 Pro with 6-core GPU",
"Battery Life": "Up to 29 hours video playback" },
"hasSpecifications": true,
"colors": [
{
"name": "Natural Titanium",
"hex": "#F5F5DC",
"images": ["https://example.com/colors/natural-titanium.jpg"],
"priceAdjustment": 0.00,
"finalPrice": 1199.00
},
{
"name": "Black Titanium",
"hex": "#1C1C1E",
"images": ["https://example.com/colors/black-titanium.jpg"],
"priceAdjustment": 50.00,
"finalPrice": 1249.00
}
],
"hasMultipleColors": true,
"priceRange": {
"minPrice": 1199.00,
"maxPrice": 1249.00,
"hasPriceVariations": true
},
"groupBuying": {
"isAvailable": true,
"minGroupSize": 10,
"maxGroupSize"groupMaxSize": 50,
"groupPrice": 1099.00,
"groupDiscount": 100.00,
"groupDiscountPercentage": 8.34,
"timeLimitHours": 72
},
"installmentOptions": {
"isAvailable": true,
"downPaymentRequired": true,
"minDownPaymentPercentage": 20.00,
"plans": [
{
"duration"planId": "...",
"planName": "6-Month Interest-Free",
"paymentFrequency": "MONTHLY",
"numberOfPayments": 6,
"interval": "MONTHS",
"interestRate"apr": 0.00,
"description"minDownPaymentPercent": "6 months interest-free installment"
},
{
"duration": 12,
"interval": "MONTHS",
"interestRate": 2.90,
"description": "12 months with low interest rate"20
}
]
},
"createdAt": "2025-09-23T10:2026-05-19T10:30:00Z"
}
}
Public Response Features:
Only shows active products from approved shopsHides internal management data (SKU, creation user IDs, etc.)Shows stock quantity only if product is in stockIncludes customer-focused information (shipping, features, pricing)Full specifications and color variations for customer decision making
Error Responses:
404: Shop notNot Foundfound,found/not approved, or product not found/not active
10. Get Public Shop Products
Purpose: Retrieves all active products from a shop for public browsingbrowsing.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/public-view/all
Access Level: ๐ Public (No authentication required)
Authentication: None
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes |
Response JSON Sample:
{
"success": true,
"message": "Retrieved 23 products from TechStore Pro",
"data": {
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": falsetrue
},
"products": [
{
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip",
"primaryImage": "https://example.com/images/iphone15-pro-max-main.jpg"Max",
"price": 1199.00,
"comparePrice": 1299.00,
"finalPrice": 1199.00,
"isOnSale": true,
"discountPercentage": 7.69,
"isInStock": true,
"brand": "Apple",
"condition": "NEW",
"hasGroupBuying": true,
"hasInstallments": true,
"hasMultipleColors": true,
"groupPrice": 1099.00,
"startingFromPrice": 1199.00,
"createdAt": "2025-09-23T10:30:00Z"true
}
],
"totalProducts": 23
}
}
Public Shop Information:
Only shows active products (ACTIVE status)Shop verification and approval status displayedNo internal management statisticsCustomer-focused product informationSimplified product cards optimized for browsing
Error Responses:
404: Shop not found, not approved, or not activeNot Found
11. Get Public Shop Products Paginated
Purpose: Retrieves active products from a shop with pagination for public browsingbrowsing.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/public-view/all-paged
Access Level: ๐ Public (No authentication required)
Authentication: None
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes |
Query Parameters:
| Parameter | Type | Required | ||||
|---|---|---|---|---|---|---|
| page | integer | No | 1 | Page number (1-indexed) | ||
| size | integer | No | 10 | Items per page |
Response JSON Sample:
{
"success": true,
"message": "Retrieved 10 products from TechStore Pro (Page 1 of 3)",
"data": {
"contents": {
"shop": {
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": false
},
"products": [
{
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"price": 1199.00,
"isOnSale": true,
"isInStock": true,
"hasGroupBuying": true,
"hasInstallments": true,
"createdAt": "2025-09-23T10:30:00Z"
}
],
"totalProducts": 10
},
"currentPage": 1,
"pageSize": 10,
"totalElements": 23,
"totalPages": 3,
"hasNext": true,
"hasPrevious": false
}
}
Public Pagination Limits:
Maximum page size limited to 50 items for performanceOnly active products included in pagination countShop must be approved and active to show any products
Error Responses:
404: Shop not found, not approved, or not activeNot Found
12. Search Products
Purpose: Searches products within a shop using enhanced multi-word query matching across multiple fieldsfields.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/search
Access Level: ๐ Public (Enhanced features for authenticated users)
Authentication: Optional Bearer Token
Request Headers:
Path Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
Query Parameters:
| Parameter | Type | Required | ||||
|---|---|---|---|---|---|---|
| q | string | Yes | โ | Search query | ||
| status | ProductStatus[] | No | Statuses to search | |||
| page | integer | No | ||||
| size | integer | No | 10 | Items per page | ||
| sortBy | string | No | relevance, createdAt, updatedAt, productName, price, stockQuantity, brand | |||
| sortDir | string | No | asc or desc |
Request URL Examples:
# Basic search for "iphone"
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/search?q=iphone
# Multi-word search for "dell precision"
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/search?q=dell%20precision&sortBy=price&sortDir=asc
# Search with status filter (requires authentication)
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/search?q=smartphone&status=ACTIVE&status=DRAFT
# Search with pagination and sorting
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/search?q=laptop&page=2&size=20&sortBy=price&sortDir=asc
# Partial word search
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/search?q=macbook&sortBy=relevance
Search Features & Behavior:
| Feature | Description | |
|---|---|---|
| Multi-word |
Searches for products containing ALL words | |
| Partial |
"iph" matches "iPhone" |
|
| Cross-field |
||
"APPLE" matches "apple" |
User Access:
| User Type | Searchable Statuses | |
|---|---|---|
| Public / Authenticated | ACTIVE only | |
Response JSON Sample:
{
"success": true,
"message": "Found 12 products matching 'dell precision'iphone'",
"data": {
"contents": {
"shop": { "shopId": "123e4567-e89b-12d3-a456-426614174000"...", "shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": false },
"products": [ { "productId":...product summary fields..."789e0123-e89b-12d3-a456-426614174002",
"productName": "Dell Precision 7770 Mobile Workstation",
"productSlug": "dell-precision-7770-mobile-workstation",
"shortDescription": "Professional mobile workstation with Intel Xeon processor",
"primaryImage": "https://example.com/images/dell-precision-7770.jpg",
"price": 2499.00,
"comparePrice": 2799.00,
"finalPrice": 2499.00,
"isOnSale": true,
"discountPercentage": 10.72,
"stockQuantity": 8,
"isInStock": true,
"isLowStock": true,
"brand": "Dell",
"sku": "SHP87654321-LAP-DEL-PRE-0005",
"condition": "NEW",
"status": "ACTIVE",
"isFeatured": true,
"isDigital": false,
"hasGroupBuying": false,
"hasInstallments": true,
"hasMultipleColors": false,
"groupPrice": null,
"startingFromPrice": 2499.00,
"createdAt": "2025-09-22T15:20:00Z"
},
{
"productId": "890e1234-e89b-12d3-a456-426614174003",
"productName": "Dell Precision 5570 Laptop",
"productSlug": "dell-precision-5570-laptop",
"shortDescription": "Compact precision laptop for professionals",
"primaryImage": "https://example.com/images/dell-precision-5570.jpg",
"price": 1899.00,
"comparePrice": null,
"finalPrice": 1899.00,
"isOnSale": false,
"discountPercentage": 0.00,
"stockQuantity": 15,
"isInStock": true,
"isLowStock": false,
"brand": "Dell",
"sku": "SHP87654321-LAP-DEL-PRE-0006",
"condition": "NEW",
"status": "ACTIVE",
"isFeatured": false,
"isDigital": false,
"hasGroupBuying": true,
"hasInstallments": true,
"hasMultipleColors": true,
"groupPrice": 1749.00,
"startingFromPrice": 1899.00,
"createdAt": "2025-09-21T09:45:00Z" } ],
"totalProducts": 12,
"searchMetadata": {
"searchQuery": "dell precision"iphone",
"searchedStatuses": ["ACTIVE"],
"userType": "PUBLIC",
"canSearchAllStatuses": false
}
},
"currentPage": 1,
"pageSize": 10,
"totalElements": 12,
"totalPages": 2,
"hasNext": true,
"hasPrevious": false
}
}
Search Metadata Fields:
User Access Levels:
Sort Options:
Error Responses:
400:Bad RequestSearch queryQuery too short(< 2 characters),or too long(> 100 characters), or invalid parameters404: Shop not found or not accessibleNot Found(for public users, shop must be active and approved)
13. Advanced Product Filter
Purpose: Filters products using multiple criteria with complexcombined combinationsAND/OR and boolean logiclogic.
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/advanced-filter
Access Level: ๐ Public (Enhanced features for authenticated users)
Authentication: Optional Bearer Token
RequestPath HeadersParameters:
| Type | Required | Description | |
|---|---|---|---|
| UUID | Yes | ID of the shop |
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| minPrice | decimal | No | โ | Minimum price |
| maxPrice | decimal | No | โ | Maximum price (must be โฅ minPrice) |
| condition | ProductCondition | No | โ | Condition filter |
| categoryId | UUID | No | โ | Category filter |
| inStock | boolean | No | โ | Filter by availability |
| onSale | boolean | No | โ | Filter by sale status |
| hasGroupBuying | boolean | No | โ | Filter by group buying |
| hasInstallments | boolean | No | โ | Filter by installments |
| hasMultipleColors | boolean | No | โ | Filter by color variations |
| status | ProductStatus[] | No | ACTIVE | Status filter (owners/admins for non-ACTIVE) |
| page | integer | No | 1 | Page number |
| size | integer | No | 10 | Items per page (max: 50) |
| sortBy | string | No | createdAt, updatedAt, productName, price, stockQuantity |
|
| sortDir | string | No | desc | asc or desc |
Filter Logic:
| Filter Type | Logic |
|---|---|
| Price range | AND (minPrice AND maxPrice) |
| Feature flags | AND (all must match) |
| Multiple statuses | OR |
Error Responses:
400: Invalid filter values or price range error404: Shop or category not found
14. Get Public Product by Slug
Purpose: Retrieves a single active product by its slug (same response shape as Get Public Product by ID).
Endpoint: GET api/v1/e-commerce/shops/{shopId}/products/find-by-slug/{slug}
Access Level: ๐ Public
Path Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| shopId | UUID | Yes | Shop must be active and approved |
| slug | string | Yes | Product slug |
Error Responses:
404: Shop not found/not approved, or product not found/not active
15. Installment Plan Config
Purpose: CRUD for installment plans attached to a product. Plans are created separately after the product, and linked to it by productId.
Base URL: api/v1/e-commerce/products/{shopId}/{productId}/installment-plans
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Path Parameters (shared):
| Parameter | Type | Required | Description |
|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
| productId | UUID | Yes | ID of the product |
15a. Create Installment Plan
Endpoint: POST api/v1/e-commerce/products/{shopId}/{productId}/installment-plans
Request Body:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| Yes | Min: 3, Max: 100 chars | |||
| paymentFrequency | PaymentFrequency | Yes | Payment interval | DAILY, WEEKLY, BI_WEEKLY, SEMI_MONTHLY, MONTHLY, QUARTERLY, CUSTOM_DAYS |
| customFrequencyDays | integer | Conditional | Days between payments | Required when paymentFrequency=CUSTOM_DAYS, min: 1 |
| numberOfPayments | integer | Yes | Total number of |
Min: 2, Max: 120 |
| apr | decimal | Yes | Annual percentage rate | Min: 0.0, Max: 36.0, 2 decimal places |
| minDownPaymentPercent | integer | Yes | Minimum down payment % | Min: 10, Max: 50 |
| fulfillmentTiming | FulfillmentTiming | Yes | When to |
IMMEDIATE AFTER_PAYMENT |
| displayOrder | integer | No | Sort order in UI | Min: 0, Default: 0 |
| isFeatured | boolean | No | Highlight as recommended plan | Default: false |
| isActive | boolean | No | Plan is available to buyers | Default: true |
QueryRequest JSON Sample:
{
"planName": "6-Month Interest-Free",
"paymentFrequency": "MONTHLY",
"numberOfPayments": 6,
"apr": 0.00,
"minDownPaymentPercent": 20,
"fulfillmentTiming": "IMMEDIATE",
"displayOrder": 1,
"isFeatured": true,
"isActive": true
}
Error Responses:
400: Validation errors404: Shop or product not found
15b. Get All Installment Plans
Endpoint: GET api/v1/e-commerce/products/{shopId}/{productId}/installment-plans
Returns a list of all installment plans for the product.
Error Responses:
404: Shop or product not found
15c. Get Installment Plan by ID
Endpoint: GET api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}
Additional Path Parameter:
| Parameter | Type | Description |
|---|---|---|
| planId | UUID | ID of the installment plan |
15d. Update Installment Plan
Endpoint: PUT api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}
All fields are optional โ only provided fields are updated. Same field structure as Create.
15e. Delete Installment Plan
Endpoint: DELETE api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}
15f. Activate / Deactivate Plan
Activate: PATCH api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}/activate
Deactivate: PATCH api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}/deactivate
Toggles isActive on the plan without changing any other fields.
15g. Set Featured Plan
Endpoint: PATCH api/v1/e-commerce/products/{shopId}/{productId}/installment-plans/{planId}/set-featured
Marks the specified plan as the featured (recommended) plan for this product.
16. Digital File Management
Purpose: Manages downloadable files for DIGITAL products. Uses a presign โ upload โ confirm flow to upload files directly to object storage.
Base URL: api/v1/e-commerce/shops/{shopId}/products/{productId}/digital-files
Access Level: ๐ Protected (Requires shop owner or system admin role)
Authentication: Bearer Token
Path Parameters (shared):
| Parameter | Type | Required | Description |
|---|---|---|---|
| shopId | UUID | Yes | ID of the shop |
| productId | UUID | Yes | ID of the digital product |
16a. Presign Upload
Purpose: Generates a presigned PUT URL. The client uploads the file directly to this URL, then calls /confirm.
Endpoint: POST api/v1/e-commerce/shops/{shopId}/products/{productId}/digital-files/presign-upload
Request Body:
| Required | Description | ||||
|---|---|---|---|---|---|
application/pdf) |
|||||
| integer | No | ||||
| Sort | order |||||
Request URLJSON ExamplesSample:
#{
Price"fileName": range"design-kit-v2.fig",
filter"contentType": GET"application/octet-stream",
/api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?minPrice=500&maxPrice=1500"fileSize": #52428800,
Multiple"displayOrder": brand1
filter (Apple OR Samsung)
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?brand=Apple&brand=Samsung&inStock=true
# Feature combination filter
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?hasGroupBuying=true&hasInstallments=true&onSale=true
# Category and condition filter
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?categoryId=123e4567-e89b-12d3-a456-426614174000&condition=NEW&isFeatured=true
# Complex filter with sorting
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?minPrice=100&maxPrice=2000&brand=Apple&brand=Dell&hasInstallments=true&sortBy=price&sortDir=asc
# Tag-based filtering
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?tags=premium&tags=5g&inStock=true
# Status filtering (requires authentication)
GET /api/v1/shops/123e4567-e89b-12d3-a456-426614174000/products/advanced-filter?status=ACTIVE&status=DRAFT&hasGroupBuying=true}
FilterResponse LogicJSON &Sample:
{
"success": true,
"message": "Upload URL generated โ upload directly to this URL then call /confirm",
"data": {
"uploadUrl": "https://s3.example.com/bucket/key?X-Amz-Signature=...",
"objectKey": "digital-files/product-456/design-kit-v2.fig",
"expiresAt": "2026-05-19T11:00:00"
}
}
Upload Flow:
- Call
POST /presign-uploadโ receiveuploadUrlandobjectKey PUT {uploadUrl}with binary file body (do not call the API for this step)- Call
POST /confirmwithobjectKeyto register the file
16b. Confirm Upload
Purpose: Registers a file after direct upload to object storage. Must be called after the actual file upload succeeds.
Endpoint: POST api/v1/e-commerce/shops/{shopId}/products/{productId}/digital-files/confirm
Request Body:
| Type | |||
|---|---|---|---|
| Returned |
|||
| Original |
|||
| MIME |
|||
| File |
|||
Response JSON Sample:
{
"success": true,
"message": "FoundFile 18confirmed productsand matchinglinked yourto filters"product",
"data": {
"contents": {
"shop": {
"shopId"fileId": "123e4567-aaa1bbbb-e89b-12d3-a456-426614174000"426614174001",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"logoUrl": "https://example.com/logos/techstore-pro.png",
"isVerified": true,
"isApproved": true,
"isMyShop": false
},
"products": [
{
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName"fileName": "iPhone 15 Pro Max 512GB"design-kit-v2.fig",
"productSlug"contentType": "iphone-15-pro-max-512gb"application/octet-stream",
"shortDescription"fileSize": "Premium 6.7-inch iPhone with A17 Pro chip",52428800,
"primaryImage"fileVersion": "https://example.com/images/iphone15-pro-max.jpg",1,
"price"displayOrder": 1199.00,1,
"comparePrice": 1299.00,
"finalPrice": 1199.00,
"isOnSale"isActive": true,
"discountPercentage": 7.69,
"stockQuantity": 25,
"isInStock": true,
"isLowStock": false,
"brand"uploadedAt": "Apple",
"sku": "SHP12345678-ELE-APP-512-0001",
"condition": "NEW",
"status": "ACTIVE",
"isFeatured": true,
"isDigital": false,
"hasGroupBuying": true,
"hasInstallments": true,
"hasMultipleColors": true,
"groupPrice": 1099.00,
"startingFromPrice": 1199.00,
"createdAt": "2025-09-23T10:30:00Z"
},
{
"productId": "567e8901-e89b-12d3-a456-426614174002",
"productName": "Samsung Galaxy S24 Ultra",
"productSlug": "samsung-galaxy-s24-ultra",
"shortDescription": "Premium Android flagship with S Pen",
"primaryImage": "https://example.com/images/samsung-s24-ultra.jpg",
"price": 1099.00,
"comparePrice": 1199.00,
"finalPrice": 1099.00,
"isOnSale": true,
"discountPercentage": 8.34,
"stockQuantity": 12,
"isInStock": true,
"isLowStock": false,
"brand": "Samsung",
"sku": "SHP12345678-ELE-SAM-ULT-0007",
"condition": "NEW",
"status": "ACTIVE",
"isFeatured": true,
"isDigital": false,
"hasGroupBuying": true,
"hasInstallments": true,
"hasMultipleColors": true,
"groupPrice": 999.00,
"startingFromPrice": 1099.00,
"createdAt": "2025-09-22T14:15:00Z"
}
],
"totalProducts": 18,
"filterMetadata": {
"appliedFilters": {
"minPrice": 800.00,
"maxPrice": 1500.00,
"brands": ["Apple", "Samsung"],
"inStock": true,
"onSale": true,
"hasGroupBuying": true,
"hasInstallments": true,
"isFeatured": true
},
"userType": "PUBLIC",
"searchedStatuses": ["ACTIVE"],
"hasActiveFilters": true
}
},
"currentPage": 1,
"pageSize": 10,
"totalElements": 18,
"totalPages": 2,
"hasNext": true,
"hasPrevious": false2026-05-19T10:45:00"
}
}
Applied
Filters Metadata:
The appliedFilters object shows exactly which filters were applied:
Filter Validation Rules:
Performance Considerations:
Filters use database indexing for optimal performanceComplex filter combinations are optimized with JPA SpecificationsPage size limited to 50 items to prevent performance issuesPopular filter combinations are cached for better response times
User Permission Differences:
Error Responses:
400 Bad Request: Invalid filter values, price range errors, or invalid parameters404 Not Found: Shop not found, category not found, or shop not accessible422 Unprocessable Entity: Filter combination validation errors
Common Filter Use Cases:
Price Shopping:minPrice=500&maxPrice=1000&sortBy=price&sortDir=ascBrand Comparison:brand=Apple&brand=Samsung&hasInstallments=trueFeature Shopping:hasGroupBuying=true&hasInstallments=true&onSale=trueCategory Browsing:categoryId=UUID&inStock=true&sortBy=pricePremium Products:isFeatured=true&hasMultipleColors=true&minPrice=500Sale Items:onSale=true&inStock=true&sortBy=discountPercentage&sortDir=desc
14.16c. Get Public Product by Slug
Purpose: Retrieves a single active product for public viewing with customer-focused information by slug
Endpoint: GET /api/v1/e-commerce/shops/{shopId}/products/find-by-slug/{slug}productId}/digital-files
Returns a list of DigitalFileResponse objects for all files linked to the product.
16d. Delete File
Endpoint: DELETE api/v1/e-commerce/shops/{shopId}/products/{productId}/digital-files/{fileId}
AccessAdditional LevelPath Parameter:
| Parameter | Type | Description |
|---|---|---|
| fileId | UUID | ID of the file to delete |
16e. Toggle File Active Status
Endpoint: ๐PATCH Public (No authentication required)api/v1/e-commerce/shops/{shopId}/products/{productId}/digital-files/{fileId}/toggle
Authentication: None
PathQuery Parameters:
| Parameter | Type | Required | Description | |
|---|---|---|---|---|
| Yes | true | |||
ResponseDeactivated JSONfiles Sample:
{
"success": true,
"message": "Product retrieved successfully",
"data": {
"productId": "456e7890-e89b-12d3-a456-426614174001",
"productName": "iPhone 15 Pro Max 512GB",
"productSlug": "iphone-15-pro-max-512gb",
"productDescription": "The most advanced iPhone ever, featuring the groundbreaking A17 Pro chip...",
"shortDescription": "Premium 6.7-inch iPhone with A17 Pro chip and titanium design",
"productImages": [
"https://example.com/images/iphone15-pro-max-main.jpg",
"https://example.com/images/iphone15-pro-max-side.jpg"
],
"price": 1199.00,
"comparePrice": 1299.00,
"discountAmount": 100.00,
"discountPercentage": 7.69,
"isOnSale": true,
"isInStock": true,
"isLowStock": false,
"stockQuantity": 25,
"brand": "Apple",
"condition": "NEW",
"tags": ["smartphone", "apple", "premium", "5g", "titanium"],
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "TechStore Pro",
"shopSlug": "techstore-pro",
"shopLogoUrl": "https://example.com/logos/techstore-pro.png",
"categoryId": "789e0123-e89b-12d3-a456-426614174002",
"categoryName": "Smartphones",
"isDigital": false,
"requiresShipping": true,
"specifications": {
"Display": "6.7-inch Super Retina XDR OLED",
"Storage": "512GB",
"Chip": "A17 Pro with 6-core GPU",
"Battery Life": "Up to 29 hours video playback"
},
"hasSpecifications": true,
"colors": [
{
"name": "Natural Titanium",
"hex": "#F5F5DC",
"images": ["https://example.com/colors/natural-titanium.jpg"],
"priceAdjustment": 0.00,
"finalPrice": 1199.00
},
{
"name": "Black Titanium",
"hex": "#1C1C1E",
"images": ["https://example.com/colors/black-titanium.jpg"],
"priceAdjustment": 50.00,
"finalPrice": 1249.00
}
],
"hasMultipleColors": true,
"priceRange": {
"minPrice": 1199.00,
"maxPrice": 1249.00,
"hasPriceVariations": true
},
"groupBuying": {
"isAvailable": true,
"minGroupSize": 10,
"maxGroupSize": 50,
"groupPrice": 1099.00,
"groupDiscount": 100.00,
"groupDiscountPercentage": 8.34,
"timeLimitHours": 72
},
"installmentOptions": {
"isAvailable": true,
"downPaymentRequired": true,
"minDownPaymentPercentage": 20.00,
"plans": [
{
"duration": 6,
"interval": "MONTHS",
"interestRate": 0.00,
"description": "6 months interest-free installment"
},
{
"duration": 12,
"interval": "MONTHS",
"interestRate": 2.90,
"description": "12 months with low interest rate"
}
]
},
"createdAt": "2025-09-23T10:30:00Z"
}
}
Public Response Features:
Only shows active productshidden fromapprovedbuyersshopsHides internal management data (SKU, creation user IDs, etc.)Shows stock quantity only if product is in stockIncludes customer-focused information (shipping, features, pricing)Full specifications and color variations for customer decision making
Error Responses:
404 Not Found: Shopbut notfound, not approved, or product not found/not active
Quick Reference Guide
Common HTTP Status Codes
-
Code Meaning 200 OK:Successful GET/PUT/PATCH requestwithresponse data201 Created:Successful POST request,(resourcecreatedcreated)204NoContent: Successful DELETE request (hard delete)400 Bad Request:Invalid requestdata, validation errors,orbusiness rule violations401 Unauthorized:Authentication required,required or invalidtoken,tokenorexpiredtoken403 Forbidden:Insufficient permissions (shopowneror system admin required)404 Not Found:Resource not found,foundshopor notaccessible,accessibleorproductnot available409 Conflict:Duplicate product name/SKU,name or business constraint violation422 Unprocessable Entity:ValidationField-level validation errors withdetailedfield-level messages429 Too Many Requests: Rate limit exceeded (search/filter endpoints)500 Internal Server Error:Server error duringprocessingAuthentication TypesBearer Token: IncludeAuthorization: Bearer your_tokenin headersNone: No authentication required for public product viewingOptional: Enhanced features available with authentication
Dates:UseISOType 8601Flow format(2025-09-23T14:30:00Z)Prices:UsedecimalPHYSICALPayment โ PENDING_SHIPMENTโ Seller ships โ Buyer confirms with26-digitdecimalcodeplacesโ(999.00),EscrowstoredreleasesasโBigDecimalCOMPLETEDUUIDs:UsestandardDIGITALUUIDPayment formatโ(123e4567-e89b-12d3-a456-426614174000)COMPLETED createdPagination:immediately1-indexedโpagesEscrow(pagereleasedparameterโstartsDigitalDownloadAccessfromrecords1)URLs:โMustBuyerbedownloadsvalidHTTP/HTTPSURLs for product images and color imagesColors: Hex format (#1D1D1F) for color codes, case insensitivePercentages: Decimal format (20.00 for 20%), max 2 decimal placesCurrency: Use shop's base currency, no currency symbols in API
User Access Levels & Permissions
| User Type | Product Management | Status Access | ||
|---|---|---|---|---|
| Public |
View active products only | ACTIVE only | ||
| Authenticated |
View active products only | ACTIVE only | ||
| Shop Owner | Full CRUD on own shop | All statuses | ||
| System Admin | Full CRUD on all shops | All statuses |
DataProduct FormatType StandardsFulfillment Flows
Product Status Lifecycle
DRAFT โ ACTIVE โ INACTIVE โ ARCHIVED
โ โ
โ โ
โโโโโโโโโโ RESTORE โโโโโโโดโโโโโโโโโโ
OUT_OF_STOCK โโ ACTIVE (automatic based on inventory)
| Status | Public Visibility | ||
|---|---|---|---|
DRAFT | Hidden | Edit, Publish, Hard Delete | |
ACTIVE | Visible | Edit, Deactivate, Soft Delete | |
INACTIVE | Hidden | Edit, Activate, Soft Delete | |
OUT_OF_STOCK | Visible |
Restock (auto-activates) | |
ARCHIVED | Hidden |
ProductEnums ConditionsReference
ReqAction Values & Effects
Advanced Features Overview
Group Buying System
Group Formation โ Time Limit โ Minimum Check โ Price Activation
โ โ โ โ
Users Join โ Countdown Timer โ Min Size Met โ Discount Applied
Requirements:
groupMinSize: Minimum participants (min: 2)groupMaxSize: Maximum participants (must be >= groupMinSize)groupPrice: Discounted price (must be < regular price)groupTimeLimitHours: Formation time limit (1-8760 hours)groupRequiresMinimum: Whether minimum size is mandatory
Business Rules:
Group price must be less than regular priceTime limit starts when first user joinsIf minimum not reached and required, group failsSuccessful groups lock in the discount for all participants
Installment Payment System
Product Price โ Down Payment โ Remaining Amount โ Monthly Payments
โ โ โ โ
$1000.00 โ $200.00 โ $800.00 โ $133.33 x 6
Payment Intervals:
DAYS: Daily payments (short-term financing)WEEKS: Weekly payments (flexible scheduling)MONTHS: Monthly payments (standard installments)
Calculation Formula:
Down Payment = Product Price ร (Min Down Payment % รท 100)
Remaining Amount = Product Price - Down Payment
Interest Amount = Remaining Amount ร (Interest Rate รท 100)
Total Installment Amount = Remaining Amount + Interest Amount
Payment Per Interval = Total Installment Amount รท Duration
Color Variations System
Price Calculation:
Base Price + Color Price Adjustment = Final Color Price
$999.00 + $50.00 = $1049.00 (Premium Color)
$999.00 + $0.00 = $999.00 (Standard Color)
Price Range Calculation:
minPrice: Lowest price across all color variationsmaxPrice: Highest price across all color variationsstartingFromPrice: Same as minPrice for customer display
Validation Rules Summary
Product Creation/Update Validation
Business Logic Validation
Group Size LogicProductType:,groupMaxSizePHYSICAL>=DIGITALgroupMinSizePrice LogicProductCondition:comparePrice > priceNEWAND,,groupPriceUSED_LIKE_NEW<USED_GOOD,priceUSED_FAIR, REFURBISHED,FOR_PARTSOrder Quantity LogicReqAction:maxOrderQuantitySAVE_DRAFT>=(โminOrderQuantityDRAFT status),SAVE_PUBLISH- (โ ACTIVE status)
Installment LogicUrgencyTag:AtNONE,leastNEW_ARRIVAL,oneLIMITED_EDITION,planLIMITED_OFFER,requiredFEW_REMAINSwhen enabled Publishing RequirementsPaymentFrequency:Name,DAILY,description,WEEKLY,price,BI_WEEKLY,stock,SEMI_MONTHLY,category,MONTHLY,imagesQUARTERLY,required
CUSTOM_DAYS
FulfillmentTiming: IMMEDIATE (ship after down payment), AFTER_PAYMENT (layaway โ ship after final payment)
SKU Generation SystemFormat
Format: SHP[8-CHAR-UUID]-[CATEGORY-3]-[BRAND-3]-[ATTRIBUTE-3]-[SEQUENCE-4]
Components:Example: SHP12345678-ELE-APP-512-0001
Shop PrefixDates:ISOSHP+ first 8 characters of shop UUID8601 (uppercase)2026-05-19T14:30:00Z)Category CodePrices:FirstDecimal3withcharacters2ofdecimalcategoryplaces,namestored(uppercase,asalphanumeric only)BigDecimalBrand CodeUUIDs:FirstStandard3UUIDcharacters of brand name (uppercase, alphanumeric only)formatAttribute CodePagination:Main1-indexedproductpageattribute from specifications or name (3 chars)parameterSequence NumberColors:4-digitHexsequentialformatnumber within shop (0001, 0002, etc.)
Data Format Standards
Examples:
SHP12345678-ELE-APP-256-0001#RRGGBB(Apple iPhone with 256GB storage)- Percentages: Decimal format (
SHP87654321-LAP-DEL-PRE-000520.00(Dell=Precision laptop) SHP11223344-CLO-NIK-XLA-0012(Nike XL clothing)
Search & Filter Capabilities
Search Query Processing
| |||
| |||
Filter Combinations Logic
AND Logic (between different filter types):
Price Range AND Brand Filter AND Feature Filters
OR Logic (within same filter type):
Brand: Apple OR Samsung OR Dell
Tags: premium OR 5g OR wireless
Status: ACTIVE OR DRAFT OR INACTIVE
Performance Optimizations:
Database indexes on: shop_id, status, price, brand, category_idJPA Specifications for dynamic query buildingPage size limits (max 50 for public, max 100 for management)Query result caching for popular filter combinations20%)
Error Handling Guidelines
Error Response Format
{
"success": false,
"message": "Human-readable error message",
"error": {
"code": "ERROR_CODE",
"details": "Detailed error information",
"field": "fieldName (if field-specific)",
"timestamp": "2025-09-23T14:2026-05-19T14:30:00Z"
}
}
Common Error Scenarios
Product | Creation ||
Best Practices for API UsageFlow
Product Management Best Practices
Always validate required fieldsbefore creating productsUse SAVE_DRAFT actionduring product creation processUse SAVE_PUBLISH actiononly when product is completeSet appropriate low stock thresholdsfor inventory alertsEnable group buying for bulk productsto increase sales volumeSet up installments for high-value items(>$500) to improve accessibilityAdd comprehensive specificationsfor better search discoverabilityUse high-quality images(minimum 800x600 pixels recommended)Implement proper inventory trackingto prevent oversellingRegular price updatesto maintain competitiveness
Search & Filter Optimization
Use paginationfor better performance and user experienceImplement client-side cachingfor popular search queriesProvide search suggestionsbased on common queriesUse filter combinationsintelligently to reduce result setsSort by relevancefor search results, by price for filtersImplement infinite scrollfor mobile applicationsShow filter result countsbefore applying filtersProvide clear filter resetfunctionalityUse debouncingfor real-time search inputCache filter metadatafor faster subsequent requests
Security Best Practices
Always validate user permissionsbefore product operationsSanitize search queriesto prevent injection attacksRate limit search endpointsto prevent abuseValidate all file uploads(images) before processingUse HTTPS for all API requestscontaining sensitive dataImplement proper session managementfor authenticated usersLog all product management actionsfor audit trailsValidate price inputsto prevent negative or invalid valuesCheck shop ownershipbefore allowing product modificationsImplement request throttlingfor high-frequency operations
Performance Optimization
Use appropriate page sizes(10-20 for mobile, 50+ for desktop)Implement database indexingon frequently queried fieldsCache expensive calculations(group buying status, installment calculations)Use CDN for product imagesto improve load timesImplement lazy loadingfor non-critical product detailsOptimize database queriesusing JPA Specifications efficientlyUse compressionfor large response payloadsImplement response cachingfor public product listingsMonitor API response timesand optimize slow endpointsUse connection poolingfor database connections
Business Logic Guidelines
Maintain price consistencyacross all product variationsValidate group buying economics(ensure profitability)Set realistic installment termsbased on product valueImplement inventory alertsat appropriate thresholdsUse soft delete for published productsto maintain order historyHard delete only draft productsto keep database cleanValidate category assignmentsfor proper product organizationImplement price change loggingfor audit purposesSet appropriate product conditionsbased on actual stateMaintain SEO-friendly slugsfor better discoverability
API Integration Examples
Creating a Complete Product (Recommended Flow)
1. POST /shops/{shopId}/productsproducts?action=SAVE_DRAFT
(action=SAVE_DRAFT)โ -create Create basicthe product structure
- Validate required fieldsshell
2. PUTPOST /products/{shopId}/{productId}/installment-plans
โ add installment plans (if installmentEnabled)
3. POST /shops/{shopId}/products/{productId}/digital-files/presign-upload
PUT {uploadUrl} (action=SAVE_DRAFT)direct -to Addstorage)
advancedPOST features/shops/{shopId}/products/{productId}/digital-files/confirm
โ upload digital files (groupDIGITAL buying,products installments)only)
- Upload and set product images
- Add specifications and color variations
3.4. PATCH /shops/{shopId}/products/{productId}/publish
-โ Finalpublish validationwhen check
- Publish to make publicly availableready
Search Implementation Pattern
1. Basic Search: GET /shops/{shopId}/products/search?q=query
2. Add Filters: GET /shops/{shopId}/products/advanced-filter?brand=X&minPrice=Y
3. Combine Both: Use search for text matching, filters for refinement
4. Pagination: Always include page and size parameters
5. Sort Results: Use appropriate sortBy based on user intent
Error Recovery Strategies
400 Errors: Validate input client-side, show field-specific errors
401 Errors: Refresh authentication token, redirect to login
403 Errors: Show access denied message, don't retry automatically
404 Errors: Handle gracefully, suggest alternatives
409 Errors: Show conflict resolution options to user
429 Errors: Implement exponential backoff retry strategy
500 Errors: Log error details, show generic error message to user