🛣️ Product routes
Product routes are SDK composers, not Express middleware. Each feature supplies its schema; details document method, path, validator order, pipeline, and response status.
Inventory
Details
createProductRoute
Implementation
Endpoint: POST /products
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: createProductSchema defines the attached body, path, and/or query contract.
Pipeline: createProduct
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
findProductsRoute
Implementation
Endpoint: GET /products
Access: Public; the source supplies no route validators.
Request: findProductsSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500, ProductBlockError → 500. Schema and validator failures are handled by their composed middleware.View complete source
createProductBatchRoute
Implementation
Endpoint: POST /products/batch
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: createProductBatchSchema defines the attached body, path, and/or query contract.
Pipeline: createProductBatch → getProductsByIds
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
updateProductBatchRoute
Implementation
Endpoint: PATCH /products/batch
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: updateProductBatchSchema defines the attached body, path, and/or query contract.
Pipeline: updateProductBatch → getProductsByIds
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
deleteProductBatchRoute
Implementation
Endpoint: DELETE /products/batch
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: deleteProductBatchSchema defines the attached body, path, and/or query contract.
Pipeline: deleteProductBatch → deleteBatchProductsTerminator
Success: 204 response descriptor from deleteBatchProductsTerminator.
Failure: No route-specific orThrow error mapping. Schema and validator failures are handled by their composed middleware.View complete source
getProductRoute
Implementation
Endpoint: GET /products/:productId
Access: Public; the source supplies no route validators.
Request: getProductSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
updateProductRoute
Implementation
Endpoint: PATCH /products/:productId
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: updateProductSchema defines the attached body, path, and/or query contract.
Pipeline: updateProduct
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
deleteProductRoute
Implementation
Endpoint: DELETE /products/:productId
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: deleteProductSchema defines the attached body, path, and/or query contract.
Pipeline: deleteProduct
Success: 204 with no response body; source maps [['undefined'], 204].
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
copyProductRoute
Implementation
Endpoint: POST /products/:productId/copy
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: copyProductSchema defines the attached body, path, and/or query contract.
Pipeline: copyProduct
Success: 204 with no response body; source maps [['undefined'], 204].
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
copyProductBatchRoute
Implementation
Endpoint: POST /products/batch/copy
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: copyProductBatchSchema defines the attached body, path, and/or query contract.
Pipeline: copyProductBatch → getProductsByIds
Success: 204 with no response body; source maps [['undefined'], 204].
Failure: ProductNotFoundBlockError → 404, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
getProductImageUploadUrlRoute
Implementation
Endpoint: GET /products/:productId/image-upload-url
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: getSignedImageUploadUrlSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: FileStorageServiceError → 500, ProductBlockError → 500. Schema and validator failures are handled by their composed middleware.View complete source
createProductImageRoute
Implementation
Endpoint: POST /products/:productId/images
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: createProductImageSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 201 from the final orThrow call.
Failure: ProductNotFoundBlockError → 404, ProductImageNotFoundBlockError → 404, ProductUnexpectedDBError → 500. Schema and validator failures are handled by their composed middleware.View complete source
deleteProductImageRoute
Implementation
Endpoint: DELETE /products/:productId/images/:imageId
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: deleteProductImageSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 204 from the final orThrow call.
Failure: ProductNotFoundBlockError → 404, ProductImageNotFoundBlockError → 404, ProductUnexpectedDBError → 500, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
createProductVariantRoute
Implementation
Endpoint: POST /products/:productId/variants
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: createProductVariantSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 201 from the final orThrow call.
Failure: ProductVariantDbError → 500, ProductVariantNotFoundError → 404. Schema and validator failures are handled by their composed middleware.View complete source
getProductVariantRoute
Implementation
Endpoint: GET /products/:productId/variants/:productVariantId
Access: Authenticated; validators execute in source order: isAuthenticated().
Request: getProductVariantSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: ProductVariantDbError → 500, ProductVariantNotFoundError → 404. Schema and validator failures are handled by their composed middleware.View complete source
updateProductVariantRoute
Implementation
Endpoint: PATCH /products/:productId/variants/:productVariantId
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: updateProductVariantSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: ProductVariantDbError → 500, ProductVariantNotFoundError → 404. Schema and validator failures are handled by their composed middleware.View complete source
deleteProductVariantRoute
Implementation
Endpoint: DELETE /products/:productId/variants/:productVariantId
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: deleteProductVariantSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 204 from the final orThrow call.
Failure: ProductVariantDbError → 500. Schema and validator failures are handled by their composed middleware.View complete source
findProductVariantsRoute
Implementation
Endpoint: GET /products/:productId/variants
Access: Public; the source supplies no route validators.
Request: findProductVariantsSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: ProductVariantDbError → 500. Schema and validator failures are handled by their composed middleware.View complete source
createProductVariantBulkRoute
Implementation
Endpoint: POST /product/:productId/variants/bulk
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: createProductVariantBulkSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 201 from the final orThrow call.
Failure: ProductVariantDbError → 500. Schema and validator failures are handled by their composed middleware.View complete source
updateProductVariantBulkRoute
Implementation
Endpoint: PATCH /product/:productId/variants/bulk
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: updateProductVariantBulkSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: ProductVariantDbError → 500, ProductVariantNotFoundError → 404. Schema and validator failures are handled by their composed middleware.View complete source
deleteProductVariantBulkRoute
Implementation
Endpoint: POST /product/:productId/variants/bulk-delete
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: deleteProductVariantBulkSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 204 from the final orThrow call.
Failure: ProductVariantDbError → 500. Schema and validator failures are handled by their composed middleware.View complete source
findProductsByOrganizationIdRoute
Implementation
Endpoint: GET /products/organizations/:organizationId
Access: Authenticated; validators execute in source order: isAuthenticated(), hasOrgRole(...).
Request: findByOrganizationIdSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: The final orThrow success map returns ordinary route data without a statusCode descriptor; this composer does not set a success status.
Failure: ProductUnexpectedDBError → 500, FileStorageServiceError → 500. Schema and validator failures are handled by their composed middleware.View complete source
getProductLikersRoute
Implementation
Endpoint: GET /products/:productId/likers
Access: Authenticated; validators execute in source order: isAuthenticated(), checkIdentityType(['admin']).
Request: getProductLikersSchema defines the attached body, path, and/or query contract.
Pipeline: This route composes Product blocks and shared utilities directly; see the complete source below.
Success: 200 from the final orThrow call.
Failure: ProductNotFoundBlockError → 404, ProductUnexpectedDBError → 500, ProfileDbBlockError → 500, AvatarBlockError → 500. Schema and validator failures are handled by their composed middleware.View complete source