Create a New Product#
An external system needs to create a new product in the Four Way Shop.
Product creation is a multi-step process that depends on the prior configuration of several master data entities (dimensions, brand, attributes, etc.).The system will return the internal identifier (prog_id) and the product code (item_code) once the product is successfully created.Product creation is not an isolated operation. It requires that all dependent master data entities are already configured and available in the tenant.
Use Case Description#
This use case describes the end-to-end process that an external system must follow to correctly create a product in Four Way Shop, including:Dependency setup (master data)
Dimension and barcode activation
Actors#
API Client: The system or user initiating the request.
Four Way Shop API: The backend system that processes the request.
Preconditions#
The tenant must be properly configured with: The following master data must already exist: The external system must have the necessary permissions and access to the document creation service, please refer to Authentication. All referenced codes (e.g., brand_code, season_code) must be valid.
APIs Used#
Master Data APIs#
Product APIs#
Pricing APIs#
Main Success Scenario#
1.
Verify Master Data
Ensure all required entities exist.
2.
Create Dimensions
Call POST /api/v1/dimensions/{DIMENSION_TYPE}/{DIMENSION_GROUP}/
3.
Create Product
Call POST /api/v1/products
4.
Assign Barcodes
Call POST /api/v1/products/{ITEM_CODE}/barcodes
5.
Assign Prices
Use pricing APIs
6.
Upload Product Image
Use media APIs
{
"product": {
"prog_id": 120394,
"item_code": "TSHIRT-SS25-001"
}
}
Alternate Flows#
Authentication Error: If the client does not provide valid credentials, an error response is returned.
Dimensions Creation Failure
Callback Response#
{
"status": "SUCCESS",
"product": {
"prog_id": 120394,
"item_code": "TSHIRT-SS25-001"
}
}
Sequence Diagram in mermaid#
Code Examples in Node.js#