» Working with Products

Working with Products

In the context of WebCommander, “products” encompass the goods or services offered for sale on a website. This section outlines how you can effectively interact with product data in the WebCommander platform. To streamline product-related tasks, a set of APIs is provided for your use. Below is a list of product-related operations that you can perform using WebCommander’s APIs:

Get Product List

Retrieve the list of all products available. Here is an example:


curl --location 'http://yourapp.com/external/app/access/products?max=-1&offset=0' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'

Request Details

  • Request URL: http://yourapp.com/external/app/access/products
  • Request type: GET

Request Parameter

"max": "-1",
"offset": "0"

Response

{
    "status": "success",
    "total": 106,
    "max": -1,
    "offset": 0,
    "products": [
        {
            "category": null,
            "calculatedRestrictPurchaseFor": "none",
            "codeToProtect": "",
            "isAvailableOnWeekdays": false,
            "restrictPurchaseExceptCustomerGroups": [],
            "relatedProducts": [],
            "soldOutLabel": null,
            "videos": [],
            "isActive": true,
            "lowStockLevel": 0,
            "shippingProfile": null,
            "spec": null,
            "calculatedRestrictPriceExceptCustomers": [],
            "productCondition": "new",
            "availableFromDate": null,
            "restrictPriceFor": "none",
            "metaTags": [],
            "globalTradeItemNumber": null,
            "model": null,
            "productFile": null,
            "id": 239,
            "isFeatured": false,
            "sku": "PRODUCT-9911C0FB075D",
            "multipleOfOrderQuantity": 1,
            "supplierIds": [],
            "basePrice": 500.0,
            "height": 0.0,
            "images": [
                {
                    "thumbnail": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002f150-default.png",
                    "url": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002fdefault.png"
                }
            ],
            "created": "2023-05-16T06:33:31",
            "availableStock": 0,
            "weight": 0.0,
            "hidePrice": false,
            "isParentInTrash": false,
            "version": null,
            "calculatedRestrictPriceExceptCustomerGroups": [],
            "availableToCustomers": [],
            "availableToCustomerGroups": [],
            "name": "Bicycle123",
            "isSoldOut": false,
            "availableToDate": null,
            "minOrderQuantity": 1,
            "isMultipleOrderQuantity": false,
            "isVirtual": false,
            "idx": 1,
            "onSaleAmountType": "flat",
            "updated": "2023-05-16T06:33:31",
            "isRestricted": false,
            "maxOrderQuantity": null,
            "categories": [],
            "expectToPayPrice": 0.0,
            "restrictPurchaseExceptCustomers": [],
            "isAvailable": true,
            "isAvailableOnDateRange": false,
            "calculatedRestrictPurchaseExceptCustomers": [],
            "description": "description",
            "isInTrash": false,
            "isInventoryEnabled": false,
            "customSku": null,
            "heading": "Insert an A.",
            "salePrice": 0.0,
            "restrictPriceExceptCustomerGroups": [],
            "length": 0.0,
            "costPrice": 0.0,
            "isNew": false,
            "calculatedRestrictPriceFor": "none",
            "isCombinationPriceFixed": true,
            "url": "bicycle123",
            "customType": null,
            "availabilityDays": [],
            "disableGooglePageTracking": false,
            "createdBy": {
                "isInTrash": false,
                "password": "21232f297a57a5a743894a0e4a801fc3",
                "isFrontEndEditorOnly": false,
                "roles": [
                    1
                ],
                "fullName": "WebCommander Administrator",
                "isMatured": true,
                "id": 1,
                "isActive": true,
                "isAPIAccessOnly": false,
                "uuid": "0EEF3E2B-3A93-4B77-BD80-3459A5950720",
                "email": "testingsalt-03\u0040yopmail.com"
            },
            "availableFor": "everyone",
            "taxProfile": null,
            "restrictPurchaseFor": "none",
            "width": 0.0,
            "isCombined": false,
            "featuredLabel": null,
            "isExpectToPay": false,
            "customTypes": [],
            "calculatedRestrictPurchaseExceptCustomerGroups": [],
            "productExtInfo": {
                "actualBasePrice": 454.55,
                "isOnSale": false,
                "basePrice": 454.55,
                "salePrice": 0.0,
                "previousPriceToDisplay": null,
                "expectToPayPriceWithTax": 500.0045454546,
                "actualPriceToDisplay": 500.0,
                "tax": 45.45,
                "taxMessage": null,
                "minOrderQuantity": 1,
                "maxOrderQuantity": null
            }
        }
    ]
}

Create Product

Responsible for creating a new product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/create-product' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "name": "T-Shirt1",
    "sku": "PRODUCT-E607CEF8B5F01",
    "isCombined": "false",
    "heading": "Insert an Additional heading for your product page.",
    "productType": "physical",
    "isAvailable": "true",
    "availableFor": "everyone",
    "isRestricted": "false",
    "isCodeProtected": "false",
    "basePrice": 100,
    "costPrice": 50,
    "active": "true",
    "summary": "Put a short one or two line of your product to briefly explain what it is about.",
    "description": "<p><i>Put a detailed description of your product. You can insert a link, table, image, video or other cool stuff in here.</i></p>"
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/create-product
  • Request type: POST

Request Parameter

{
    "name": "T-Shirt1",
    "sku": "PRODUCT-E607CEF8B5F01",
    "isCombined": "false",
    "heading": "Insert an Additional heading for your product page.",
    "productType": "physical",
    "isAvailable": "true",
    "availableFor": "everyone",
    "isRestricted": "false",
    "isCodeProtected": "false",
    "basePrice": 100,
    "costPrice": 50,
    "active": "true",
    "summary": "Put a short one or two line of your product to briefly explain what it is about.",
    "description": "<p><i>Put a detailed description of your product. You can insert a link, table, image, video or other cool stuff in here.</i></p>"
}

Response

{
    "status": "success",
    "product": {
        "category": null,
        "calculatedRestrictPurchaseFor": "none",
        "codeToProtect": null,
        "isAvailableOnWeekdays": false,
        "restrictPurchaseExceptCustomerGroups": [],
        "relatedProducts": [],
        "soldOutLabel": null,
        "videos": [],
        "isActive": true,
        "lowStockLevel": 0,
        "shippingProfile": null,
        "spec": null,
        "calculatedRestrictPriceExceptCustomers": [],
        "productCondition": "new",
        "availableFromDate": null,
        "restrictPriceFor": "none",
        "metaTags": [],
        "globalTradeItemNumber": null,
        "model": null,
        "productFile": null,
        "id": 241,
        "isFeatured": false,
        "sku": "PRODUCT-E607CEF8B5F01",
        "multipleOfOrderQuantity": 1,
        "supplierIds": [],
        "basePrice": 100.0,
        "height": 0.0,
        "images": [
            {
                "thumbnail": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002f150-default.png",
                "url": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002fdefault.png"
            }
        ],
        "created": "2023-05-18T10:37:49",
        "availableStock": 0,
        "weight": 0.0,
        "hidePrice": false,
        "isParentInTrash": false,
        "version": null,
        "calculatedRestrictPriceExceptCustomerGroups": [],
        "availableToCustomers": [],
        "availableToCustomerGroups": [],
        "name": "T-Shirt1",
        "isSoldOut": false,
        "availableToDate": null,
        "minOrderQuantity": 1,
        "isMultipleOrderQuantity": false,
        "isVirtual": false,
        "idx": 1,
        "onSaleAmountType": "flat",
        "updated": "2023-05-18T10:37:49",
        "isRestricted": false,
        "maxOrderQuantity": null,
        "categories": [],
        "expectToPayPrice": 0.0,
        "restrictPurchaseExceptCustomers": [],
        "isAvailable": true,
        "isAvailableOnDateRange": false,
        "calculatedRestrictPurchaseExceptCustomers": [],
        "description": "description",
        "title": null,
        "isCallForPriceEnabled": false,
        "isCombinationQuantityFlexible": false,
        "isDisposable": false,
        "restrictPriceExceptCustomers": [],
        "isCodeProtected": false,
        "isOnSale": false,
        "seoConfigs": [],
        "availableDays": [],
        "productType": "physical",
        "summary": "Put",
        "isInTrash": false,
        "isInventoryEnabled": false,
        "customSku": null,
        "heading": "Insert an Add.",
        "salePrice": 0.0,
        "restrictPriceExceptCustomerGroups": [],
        "length": 0.0,
        "costPrice": 50.0,
        "isNew": false,
        "calculatedRestrictPriceFor": "none",
        "isCombinationPriceFixed": true,
        "url": "t-shirt1",
        "customType": null,
        "availabilityDays": null,
        "disableGooglePageTracking": false,
        "createdBy": null,
        "availableFor": "everyone",
        "taxProfile": null,
        "restrictPurchaseFor": "none",
        "width": 0.0,
        "isCombined": false,
        "featuredLabel": null,
        "isExpectToPay": false,
        "customTypes": [],
        "calculatedRestrictPurchaseExceptCustomerGroups": [],
        "productExtInfo": {
            "actualBasePrice": 90.91,
            "isOnSale": false,
            "basePrice": 90.91,
            "salePrice": 0.0,
            "previousPriceToDisplay": null,
            "expectToPayPriceWithTax": 100.0009090909,
            "actualPriceToDisplay": 100.0,
            "tax": 9.09,
            "taxMessage": null,
            "minOrderQuantity": 1,
            "maxOrderQuantity": null
        }
    }
}

Get Single Product

Retrieve the details of a specific product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/product?id=56789345' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb'

Request Details

  • Request URL: http://yourapp.com/external/app/access/product
  • Request type: GET

Request Parameter

"id": 56789345

Response

{
    "status": "success",
    "product": {
        "category": null,
        "calculatedRestrictPurchaseFor": "none",
        "codeToProtect": null,
        "isAvailableOnWeekdays": false,
        "restrictPurchaseExceptCustomerGroups": [],
        "relatedProducts": [],
        "soldOutLabel": null,
        "videos": [],
        "isActive": true,
        "lowStockLevel": 0,
        "shippingProfile": null,
        "spec": null,
        "calculatedRestrictPriceExceptCustomers": [],
        "productCondition": "new",
        "availableFromDate": null,
        "restrictPriceFor": "none",
        "metaTags": [],
        "globalTradeItemNumber": null,
        "model": null,
        "productFile": null,
        "id": 241,
        "isFeatured": false,
        "sku": "PRODUCT-E607CEF8B5F01",
        "multipleOfOrderQuantity": 1,
        "supplierIds": [],
        "basePrice": 100.0,
        "height": 0.0,
        "images": [
            {
                "thumbnail": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002f150-default.png",
                "url": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002fdefault.png"
            }
        ],
        "created": "2023-05-18T10:37:49",
        "availableStock": 0,
        "weight": 0.0,
        "hidePrice": false,
        "isParentInTrash": false,
        "version": null,
        "calculatedRestrictPriceExceptCustomerGroups": [],
        "availableToCustomers": [],
        "availableToCustomerGroups": [],
        "name": "T-Shirt1",
        "isSoldOut": false,
        "availableToDate": null,
        "minOrderQuantity": 1,
        "isMultipleOrderQuantity": false,
        "isVirtual": false,
        "idx": 1,
        "onSaleAmountType": "flat",
        "updated": "2023-05-18T10:37:49",
        "isRestricted": false,
        "maxOrderQuantity": null,
        "categories": [],
        "expectToPayPrice": 0.0,
        "restrictPurchaseExceptCustomers": [],
        "isAvailable": true,
        "isAvailableOnDateRange": false,
        "calculatedRestrictPurchaseExceptCustomers": [],
        "description": "description",
        "title": null,
        "isCallForPriceEnabled": false,
        "isCombinationQuantityFlexible": false,
        "isDisposable": false,
        "restrictPriceExceptCustomers": [],
        "isCodeProtected": false,
        "isOnSale": false,
        "seoConfigs": [],
        "availableDays": [],
        "productType": "physical",
        "summary": "Put",
        "isInTrash": false,
        "isInventoryEnabled": false,
        "customSku": null,
        "heading": "Insert&nbsp;an&nbsp;Add.",
        "salePrice": 0.0,
        "restrictPriceExceptCustomerGroups": [],
        "length": 0.0,
        "costPrice": 50.0,
        "isNew": false,
        "calculatedRestrictPriceFor": "none",
        "isCombinationPriceFixed": true,
        "url": "t-shirt1",
        "customType": null,
        "availabilityDays": null,
        "disableGooglePageTracking": false,
        "createdBy": null,
        "availableFor": "everyone",
        "taxProfile": null,
        "restrictPurchaseFor": "none",
        "width": 0.0,
        "isCombined": false,
        "featuredLabel": null,
        "isExpectToPay": false,
        "customTypes": [],
        "calculatedRestrictPurchaseExceptCustomerGroups": [],
        "productExtInfo": {
            "actualBasePrice": 90.91,
            "isOnSale": false,
            "basePrice": 90.91,
            "salePrice": 0.0,
            "previousPriceToDisplay": null,
            "expectToPayPriceWithTax": 100.0009090909,
            "actualPriceToDisplay": 100.0,
            "tax": 9.09,
            "taxMessage": null,
            "minOrderQuantity": 1,
            "maxOrderQuantity": null
        }
    }
}

Update Product

Responsible for updating an existing product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/update-product' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "id": 241,
    "fields": {
        "name": "Cycle",
        "description": "Amazing cycle"
    }
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/update-product
  • Request type: POST

Request Parameter

Request Details
Request URL: http://yourapp.com/external/app/access/update-product
Request type: POST
Request Parameter

Response

{
    "status": "success",
    "product": {
        "category": null,
        "calculatedRestrictPurchaseFor": "none",
        "codeToProtect": null,
        "restrictPurchaseExceptCustomerGroups": [],
        "relatedProducts": [],
        "soldOutLabel": null,
        "videos": [],
        "isActive": true,
        "lowStockLevel": 0,
        "shippingProfile": null,
        "spec": null,
        "calculatedRestrictPriceExceptCustomers": [],
        "productCondition": "new",
        "availableFromDate": null,
        "restrictPriceFor": "none",
        "metaTags": [],
        "globalTradeItemNumber": null,
        "model": null,
        "productFile": null,
        "id": 241,
        "isFeatured": false,
        "sku": "PRODUCT-E607CEF8B5F01",
        "multipleOfOrderQuantity": 1,
        "supplierIds": [],
        "basePrice": 100.0,
        "height": 0.0,
        "images": [
            {
                "thumbnail": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002f150-default.png",
                "url": "http:\u002f\u002flocalhost:1301\u002fresources\u002f00000000\u002fproduct\u002fdefault\u002fdefault.png"
            }
        ],
        "created": "2023-05-18T10:37:49",
        "availableStock": 0,
        "weight": 0.0,
        "hidePrice": false,
        "isParentInTrash": false,
        "version": null,
        "calculatedRestrictPriceExceptCustomerGroups": [],
        "availableToCustomers": [],
        "availableToCustomerGroups": [],
        "name": "T-Shirt1",
        "isSoldOut": false,
        "availableToDate": null,
        "minOrderQuantity": 1,
        "isMultipleOrderQuantity": false,
        "isVirtual": false,
        "idx": 1,
        "onSaleAmountType": "flat",
        "updated": "2023-05-18T10:37:49",
        "isRestricted": false,
        "maxOrderQuantity": null,
        "categories": [],
        "expectToPayPrice": 0.0,
        "restrictPurchaseExceptCustomers": [],
        "isAvailable": true,
        "isAvailableOnDateRange": false,
        "calculatedRestrictPurchaseExceptCustomers": [],
        "description": "description",
        "title": null,
        "isCallForPriceEnabled": false,
        "isCombinationQuantityFlexible": false,
        "isDisposable": false,
        "restrictPriceExceptCustomers": [],
        "isCodeProtected": false,
        "isOnSale": false,
        "seoConfigs": [],
        "availableDays": [],
        "productType": "physical",
        "summary": "Put",
        "isInTrash": false,
        "isInventoryEnabled": false,
        "customSku": null,
        "heading": "Insert&nbsp;an&nbsp;Add.",
        "salePrice": 0.0,
        "restrictPriceExceptCustomerGroups": [],
        "length": 0.0,
        "costPrice": 50.0,
        "isNew": false,
        "calculatedRestrictPriceFor": "none",
        "isCombinationPriceFixed": true,
        "url": "t-shirt1",
        "customType": null,
        "availabilityDays": null,
        "disableGooglePageTracking": false,
        "createdBy": null,
        "availableFor": "everyone",
        "taxProfile": null,
        "restrictPurchaseFor": "none",
        "width": 0.0,
        "isCombined": false,
        "featuredLabel": null,
        "isExpectToPay": false,
        "customTypes": [],
        "calculatedRestrictPurchaseExceptCustomerGroups": [],
        "productExtInfo": {
            "actualBasePrice": 90.91,
            "isOnSale": false,
            "basePrice": 90.91,
            "salePrice": 0.0,
            "previousPriceToDisplay": null,
            "expectToPayPriceWithTax": 100.0009090909,
            "actualPriceToDisplay": 100.0,
            "tax": 9.09,
            "taxMessage": null,
            "minOrderQuantity": 1,
            "maxOrderQuantity": null
        }
    }
}

Delete Product

Responsible for deleting a product. Here is an example:

curl --location --request DELETE 'http://yourapp.com/external/app/access/delete-product' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "id": 241
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/delete-product
  • Request type: DELETE

Request Parameter

{
    "id": 241
}

Product Stock Update

Responsible for updating the quantity of a product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/product-stock-update' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "status": "success",
    "message": "Inventory has been updated successfully"
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/product-stock-update
  • Request type: POST

Request Parameter

{
    "productId": 54678784645,
    "changeQuantity": 12,
    "note": "10 extra products added for EID"
}

Response

{
    "status": "success",
    "message": "Inventory has been updated successfully"
}

Product Price Update

Responsible for updating the price-related configuration of a product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/product-price-update' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "id": 5456423432,
    "isCallForPriceEnabled": "true",
    "isExpectToPay": "true",
    "expectToPayPrice": 50,
    "isSoldOut": "false",
    "soldOutLabel": "sold out",
    "isOnSale": "true",
    "salePrice": 12,
    "isInventoryEnabled": "false",
    "lowStockLevel": 0
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/product-price-update
  • Request type: POST

Request Parameter

{
    "id": 123,
    "isCallForPriceEnabled": "true",
    "isExpectToPay": "true",
    "expectToPayPrice": 50,
    "isSoldOut": "false",
    "soldOutLabel": "sold out",
    "isOnSale": "true",
    "salePrice": 12,
    "isInventoryEnabled": "false",
    "lowStockLevel": 0
}

Response

{"status": "success", "message": "Price has been updated successfully"}

Product Image Add

Responsible for adding an image to a product. Here is an example:

curl --location 'http://yourapp.com/external/app/access/product-image-add' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "productId": 10,
    "images": [
        "base64data1",
        "base64data2"
    ]
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/product-image-add
  • Request type: POST

Request Parameter

{
    "productId": 10,
    "images": [
        "base64data1",
        "base64data2"
    ]
}

Response

{"status": "success", "message": "Product image properties has been saved successfully"}

Product Image Delete

Responsible for deleting an image of a product. Here is an example:

curl --location --request DELETE 'http://yourapp.com/external/app/access/product-image-delete' \
--header 'uuid: F8A3-A88E-C6EF-B1CB' \
--header 'accessToken: 11b4ec017714ef095b8e115545467fcb' \
--header 'Content-Type: application/json' \
--data '{
    "imageId": [
        22,
        23
    ]
}'

Request Details

  • Request URL: http://yourapp.com/external/app/access/product-image-delete
  • Request type: DELETE

Request Parameter

Request Details
Request URL: http://yourapp.com/external/app/access/product-image-delete
Request type: DELETE
Request Parameter