4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Activate dimensions on products
  • Login
    • login
      POST
  • Product
    • Brand
      • Get All Brands
      • Get A Brand
      • Insert brand
      • Update brand
    • Season
      • Get All Seasons
      • Get A Season
      • Insert season
      • Update season
    • Attribute
      • Get All Attribute Types
      • Get Attribute Type
      • Get Attribute
      • Insert attribute
      • Update attribute
    • Hierarchy
      • Insert hierarchy
      • Update hierarchy
    • Dimension groups
      • Insert dimension group
      • Update dimension group
    • Dimension
      • Insert dimension
      • Update dimension
      • Delete dimension
    • Product
      • Get products
      • Get product
      • Get product grouping
      • Get SKU's barcodes
      • Get product stock
      • Insert product
      • Update product
    • Activate dimensions on products
      • Insert active dimensions
        POST
      • Delete active dimensions
        DELETE
    • Barcode
      • Get SKU from barcode
      • Generate missing barcodes
      • Generate missing barcode for SKU
      • Insert barcode
      • Delete barcode
    • Prices
      • Get product prices
    • Price dimension groupings
      • Get Dimension Price Grouping
      • Get All Dimension Price Grouping
      • Insert dimension grouping
      • Update dimension grouping
      • Delete dimension grouping
    • Assortment
      • insert product assortment
      • delete product assortment
    • Image
      • Get images
      • Add image
      • Replace image
      • Delete image
    • Supplier
      • Get Item suppliers
      • Insert item supplier
      • Delete item supplier
      • Update item supplier
    • Custom category
      • Get Custom code
      • Insert Custom code
      • Update Custom code
    • Vat
      • Vat types
        • Get VAT type
        • Get VAT types
      • VATs
        • Get VATs
        • Get VATs by type
        • Get VAT
      • Vat rates
        • Get VAT rates
        • Get single VAT rates
    • Stock
      • Insert stock
      • Get stock
  • Price lists
    • Get price lists
      GET
    • Get price lists by type
      GET
    • Get price list
      GET
    • Get prices from price list
      GET
    • Get entities from price lists
      GET
    • Insert Price List
      POST
    • Insert Product Price
      POST
    • Insert Entity On Price Lists
      POST
    • Update price list
      PATCH
    • Delete all product prices
      DELETE
    • Delete single product price
      DELETE
    • Delete entity from a price lists
      DELETE
  • Supplier
    • Supplier contacts
    • Supplier addresses
    • Get Suppliers
    • Get A Specific Supplier
    • Insert supplier
    • Update supplier
  • Entities
    • Get entities
    • Get entity
    • Insert entity
    • Update entity
  • Miscellaneous
    • Get requests rate limits
  • Catalog
    • Get Catalogs details
    • Get Catalog details by Code
    • Get products by Catalog Code
  • Export
    • Get bulk CSV Export
  1. Activate dimensions on products

Delete active dimensions

DELETE
/api/v1/products/{ITEM_CODE}/dimensions/{DIMENSION_TYPE}/{DIMENSION_LEVEL}
Last modified:2025-02-07 14:44:32

Delete a Dimension for a Product#

This API allows for the deletion of a specific dimension associated with a product, by specifying the dimension group and the level of the dimension. The ignore_movements query parameter can be set to manage dependencies with other entities or processes.
Variants and Barcodes
The service checks if the dimension to be detached from the product belongs to one or more SKUs (product variants) linked to barcodes. In this case, it is not possible to remove the dimension. Follow these steps:
1
Retrieve SKU's Barcode
If you do not know the barcodes associated with SKUs that involve the dimension to be detached, invoke the service Get SKU's barcodes, specifying only the parameter ITEM_CODE, for example, for the product MOD124.
This will return all barcodes with the SKUs of the product:
{
  "barcodes": [
    {
      "barcode": "9780201379624",
      "barcode_type": "EAN13",
      "dimension_level1": "XL",
      "dimension_level2": "RED"
    }
  ],
  "moreRows": true
}
2
Remove Barcode
With the list of barcodes containing the dimension to be removed dimension_level_*, proceed to remove them using the service Delete barcode.
If the barcode is moved, meaning it is contained in a sales or inventory document, an HTTP 423 error will be returned with the response:
{
  "message": "This SKU has been already moved"
}
In this case, ONLY IF NECESSARY, it is possible to ignore the movements by specify ignore_movements=true.
3
Remove Variant
After removing all barcodes linked to the SKU, proceed to detach the dimension using Delete active dimensions.

Actors#

API Client: The system or user initiating the request.
4ws.trade: The backend system that processes the request.

Languages#

The API can handle descriptions in multiple languages, such as description_it, description_en, etc., if necessary for international usage.

Preconditions#

The external system must have the necessary permissions and access to the document creation service, please refer to Authentication.
A valid ITEM_CODE, DIMENSION_TYPE, and DIMENSION_LEVEL must be provided in the request.
The dimension must exist within the specified group for it to be successfully deleted.
If ignore_movements=false, the system will not delete dimensions with associated dependencies (such as inventory movements) and may return an error if these dependencies exist.

Main Success Scenario#

1.
The client sends a DELETE request with the specified ITEM_CODE, DIMENSION_TYPE, and DIMENSION_LEVEL, as well as the query parameter ignore_movements=false.
2.
If the dimension is successfully deleted, the API responds with a success message.
{
  "success": true
}

Alternate Flows#

1.
Dimension Not Found
If the specified dimension or group does not exist, the API returns a 404 error.
Response:
{
  "message": "Dimension group or dimension level not found"
}
2.
Constraint Violation
If deleting the dimension violates a unique constraint, the API returns an error message.
Response:
{
  "message": "Unique constraint error"
}
3.
Movements Present
If there are associated movements and ignore_movements=false, the API will prevent deletion, indicating that dependencies must be addressed.
Response:
{
  "message": "Cannot delete dimension; associated movements exist"
}

Sequence Diagram#

Best Practices
Please refer to Best Practices for Error Handling in External System for best practices on implementation.

Code Examples in Node.js#

Request

Path Params

Query Params

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request DELETE '/api/v1/products/RED_SHIRT/dimensions/TAGLIA/XL?ignore_movements=false'

Responses

🟢200success
application/json
Body

Example
{
    "success": true
}
🟠401Authentication failed
🟠403Operation not allowed
🟠422Unique constraint error
Modified at 2025-02-07 14:44:32
Previous
Insert active dimensions
Next
Get SKU from barcode
Built with