Products

    List the products of a site

    Get all the products of your site.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/products
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    An array of the first 10 items; each object has the following properties:

    • id - product ID (number)
    • siteId - site ID (number)
    • name - product's name (string)
    • roleId - the roleID of the user to be notified if the product is about to expire (-1 for none) (number)
    • weight - product's weight (number)
    • productCode - product's code (string)
    • keywords - product's keywords (string)
    • unitType - unitType (string)
    • smallImage - product's small image (string)
    • largeImage - product's large image (string)
    • description - product's description (string)
    • inventoryControl - whether this product has inventoryControl on or off (boolean)
    • canPreorder - whether this product can be pre ordered or not (boolean)
    • minUnits - minimum number of units that can be added to the cart (number)
    • maxUnits - maximum number of units that can be added to the cart (number)
    • inStock - number of items in stock (number)
    • onOrder - onOrder (number)
    • reOrder - reOrder (number)
    • reOrderNotified - reOrderNotified (boolean)
    • cycleTypeId - can be one of the following integers (number)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • variablePerCycle - variablePerCycle (boolean)
    • groupingID - the product's groupID (number)
    • GroupingDefault - GroupingDefault (boolean)
    • electronicProduct - whether or not this product is an e-Product (boolean)
    • displayFileName - product's display name (string)
    • size - size (number)
    • downloadLimitCount - download limit (only applies to e-Products) (number)
    • downloadLimitIp - download limit per IP (only applies to e-Products) (number)
    • productWeight - product weight (number)
    • productVolume - product volume (number)
    • productHeight - product height (number)
    • productDepth - product depth (number)
    • supplierEntityId - the supplier's entity ID (number)
    • supplierCommission - the supplier's commission (number)
    • isGiftVoucher - whether this product is to be used as a gift voucher (boolean)
    • poplets - the product's poplets(string)
    • attributes - deprecated, this is null by default, please use Product Attributes endpoint
    • custom1 - custom field 1 (string)
    • custom2 - custom field 2 (string)
    • custom3 - custom field 3 (string)
    • custom4 - custom field 4 (string)
    • releaseDate - product's release date (dateTime)
    • expiryDate - product's expiry date (dateTime)
    • createDate - product's creation date (dateTime)
    • lastUpdateDate - product's last update date (dateTime)
    • captureDetails - captureDetails (boolean)
    • isOnSale - whether this product is marked as "on sale" (boolean)
    • hideIfNoStock - hide product if stock is 0 (boolean)
    • enableDropShipping - enable drop shipping (boolean)
    • excludeFromSearch - exclude this product from search results(boolean)
    • enabled - enabled (boolean)
    • deleted - deleted (boolean)
    • title - product's title (string)
    • reIndex - reIndex (boolean)
    • hasAttributes - hasAttributes (boolean)
    • cycleTypeCount - cycleTypeCount (number)
    • hasVariations - whether the product has variations enabled(boolean)
    • slug - product's slug (string)
    • metaProductDescription - meta description (string)
    • canonicalUrl - product's url (if the product is placed in multiple catalogs the url of the default one will be used) (string)
    • absoluteCanonicalUrl - product's absolute url (string)
    • popletImage1 - product's poplet image 1 url (string)
    • popletImage2 - product's poplet image 2 url (string)
    • popletImage3 - product's poplet image 3 url (string)
    • popletImage4 - product's poplet image 4 url (string)
    • popletImage5 - product's poplet image 5 url (string)
    • popletImage6 - product's poplet image 6 url (string)
    • popletImage7 - product's poplet image 7 url (string)
    • popletImage8 - product's poplet image 8 url (string)
    • popletImage9 - product's poplet image 9 url (string)
    • popletImage10 - product's poplet image 10 url (string)

    You can output additional fields to those listed above as default, see the API v3 Discovery APP for additional details.

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });

    Sample response

    {
        "items": [{
            "id": 9683555,
            "siteId": 2163596,
            "name": "Childhood Dreams T-Shirt",
            "roleId": -1,
            "weight": 1,
            "productCode": "R7VWTBA6LR",
    		 "keywords": "featured",
            "unitType": "",
            "smallImage": "/shop/tshirt1.jpg",
            "largeImage": "/shop/big-product-image.jpg",
            "description": "Casual T-Shirt made from high quality bio cotton. It's light, very comfortable to wear yet it's durable and colors will remain vivid even after a couple of washes. This product is made with respect to human rights and the environment.  Made in Thailand.\r\n",
            "inventoryControl": true,
            "canPreorder": false,
            "minUnits": 1,
            "maxUnits": -1,
            "inStock": 18,
            "onOrder": 0,
            "reOrder": -1,
            "reOrderNotified": false,
            "variablePerCycle": false,
            "groupingID": 39793,
            "GroupingDefault": true,
            "electronicProduct": false,
            "displayFileName": null,
            "size": 0,
            "downloadLimitCount": -1,
            "downloadLimitIp": -1,
            "productWeight": -1.0,
            "productVolume": -1.0,
            "productHeight": -1.0,
            "productDepth": -1.0,
            "supplierEntityId": null,
            "supplierCommission": 0.0,
            "isGiftVoucher": false,
            "poplets": null,
            "attributes": null,
            "custom1": "featured",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "releaseDate": "2013-01-15T23:00:00",
            "expiryDate": "9998-12-31T15:00:00",
            "createDate": "2015-07-14T01:22:17.67",
            "lastUpdateDate": "2015-07-14T01:22:17.67",
            "captureDetails": false,
            "isOnSale": false,
            "hideIfNoStock": false,
            "enableDropShipping": false,
            "excludeFromSearch": false,
            "enabled": true,
            "deleted": false,
            "title": "",
            "reIndex": false,
            "hasAttributes": true,
            "cycleTypeCount": -1,
            "hasVariations": true,
            "slug": "childhood-dreams-t-shirt",
            "metaProductDescription": null,
            "canonicalUrl": "/all-t-shirts/womens-t-shirts/childhood-dreams-t-shirt",
            "absoluteCanonicalUrl": "www.mydomain.com/all-t-shirts/womens-t-shirts/childhood-dreams-t-shirt"
        }, {
            "id": 9683556,
            "siteId": 2163596,
            "name": "Kung-Fu Panda T-Shirt",
            "roleId": -1,
            "weight": 2,
            "productCode": "UFQ3WULVDN",
            "keywords": "new",
            "unitType": "",
            "smallImage": "/shop/tshirt2.jpg",
            "largeImage": "/shop/big-product-image.jpg",
            "description": "Casual T-Shirt made from high quality bio cotton. It's light, very comfortable to wear yet it's durable and colors will remain vivid even after a couple of washes. This product is made with respect to human rights and the environment.  Made in Thailand.\r\n",
            "inventoryControl": true,
            "canPreorder": false,
            "minUnits": 1,
            "maxUnits": -1,
            "inStock": 0,
            "onOrder": 0,
            "reOrder": -1,
            "reOrderNotified": false,
            "variablePerCycle": false,
            "groupingID": 39793,
            "GroupingDefault": false,
            "electronicProduct": false,
            "displayFileName": null,
            "size": 0,
            "downloadLimitCount": -1,
            "downloadLimitIp": -1,
            "productWeight": -1.0,
            "productVolume": -1.0,
            "productHeight": -1.0,
            "productDepth": -1.0,
            "supplierEntityId": null,
            "supplierCommission": 0.0,
            "isGiftVoucher": false,
            "poplets": null,
            "attributes": null,
            "custom1": "",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "releaseDate": "2013-01-15T23:00:00",
            "expiryDate": "9998-12-31T15:00:00",
            "createDate": "2015-07-14T01:22:17.67",
            "lastUpdateDate": "2015-07-14T01:22:17.67",
            "captureDetails": false,
            "isOnSale": false,
            "hideIfNoStock": false,
            "enableDropShipping": false,
            "excludeFromSearch": false,
            "enabled": true,
            "deleted": false,
            "title": "",
            "reIndex": false,
            "hasAttributes": true,
            "cycleTypeCount": -1,
            "hasVariations": true,
            "slug": "kung-fu-panda-t-shirt",
            "metaProductDescription": null,
            "canonicalUrl": "/all-t-shirts/mens-t-shirts/kung-fu-panda-t-shirt",
            "absoluteCanonicalUrl": "www.mydomain.com/all-t-shirts/mens-t-shirts/kung-fu-panda-t-shirt"
        }],
        "totalItemsCount": 2,
        "skip": 0,
        "limit": 10
    }

    Get a product's details

    Get one product and it's details.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/products/[product_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    Displays the details for the product as a JSON object

    • id - product ID (number)
    • siteId - site ID (number)
    • name - product's name (string)
    • roleId - the roleID of the user to be notified if the product is about to expire (-1 for none) (number)
    • weight - product's weight (number)
    • productCode - product's code (string)
    • keywords - product's keywords (string)
    • unitType - unitType (string)
    • smallImage - product's small image (string)
    • largeImage - product's large image (string)
    • description - product's description (string)
    • inventoryControl - whether this product has inventoryControl on or off (boolean)
    • canPreorder - whether this product can be pre ordered or not (boolean)
    • minUnits - minimum number of units that can be added to the cart (number)
    • maxUnits - maximum number of units that can be added to the cart (number)
    • inStock - number of items in stock (number)
    • onOrder - onOrder (number)
    • reOrder - reOrder (number)
    • reOrderNotified - reOrderNotified (boolean)
    • cycleTypeId - can be one of the following integers (number)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • variablePerCycle - variablePerCycle (boolean)
    • groupingID - the product's groupID (number)
    • GroupingDefault - GroupingDefault (boolean)
    • electronicProduct - whether or not this product is an e-Product (boolean)
    • displayFileName - product's display name (string)
    • size - size (number)
    • downloadLimitCount - download limit (only applies to e-Products) (number)
    • downloadLimitIp - download limit per IP (only applies to e-Products) (number)
    • productWeight - product weight (number)
    • productVolume - product volume (number)
    • productHeight - product height (number)
    • productDepth - product depth (number)
    • supplierEntityId - the supplier's entity ID (number)
    • supplierCommission - the supplier's commission (number)
    • isGiftVoucher - whether this product is to be used as a gift voucher (boolean)
    • poplets - the product's poplets(string)
    • attributes - deprecated, this is null by default, please use Product Attributes endpoint
    • custom1 - custom field 1 (string)
    • custom2 - custom field 2 (string)
    • custom3 - custom field 3 (string)
    • custom4 - custom field 4 (string)
    • releaseDate - product's release date (dateTime)
    • expiryDate - product's expiry date (dateTime)
    • createDate - product's creation date (dateTime)
    • lastUpdateDate - product's last update date (dateTime)
    • captureDetails - captureDetails (boolean)
    • isOnSale - whether this product is marked as "on sale" (boolean)
    • hideIfNoStock - hide product if stock is 0 (boolean)
    • enableDropShipping - enable drop shipping (boolean)
    • excludeFromSearch - exclude this product from search results(boolean)
    • enabled - enabled (boolean)
    • deleted - deleted (boolean)
    • title - product's title (string)
    • reIndex - reIndex (boolean)
    • hasAttributes - hasAttributes (boolean)
    • cycleTypeCount - cycleTypeCount (number)
    • hasVariations - whether the product has variations enabled(boolean)
    • slug - product's slug (string)
    • metaProductDescription - meta description (string)
    • canonicalUrl - product's url (if the product is placed in multiple catalogs the url of the default one will be used) (string)
    • absoluteCanonicalUrl - product's absolute url (string)
    • popletImage1 - product's poplet image 1 url (string)
    • popletImage2 - product's poplet image 2 url (string)
    • popletImage3 - product's poplet image 3 url (string)
    • popletImage4 - product's poplet image 4 url (string)
    • popletImage5 - product's poplet image 5 url (string)
    • popletImage6 - product's poplet image 6 url (string)
    • popletImage7 - product's poplet image 7 url (string)
    • popletImage8 - product's poplet image 8 url (string)
    • popletImage9 - product's poplet image 9 url (string)
    • popletImage10 - product's poplet image 10 url (string)

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products/9683556",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Sample response

    {
        "id":9683556,
        "siteId":2163596,
        "name":"Kung-Fu Panda T-Shirt",
        "roleId":-1,
        "weight":2,
        "productCode":"UFQ3WULVDN",
        "keywords": "new",
        "unitType":"",
        "smallImage":"/shop/tshirt2.jpg",
        "largeImage":"/shop/big-product-image.jpg",
        "description":"Casual T-Shirt made from high quality bio cotton. It's light, very comfortable to wear yet it's durable and colors will remain vivid even after a couple of washes. This product is made with respect to human rights and the environment.  Made in Thailand.\r\n",
        "inventoryControl":true,
        "canPreorder":false,
        "minUnits":1,
        "maxUnits":-1,
        "inStock":0,
        "onOrder":0,
        "reOrder":-1,
        "reOrderNotified":false,
        "cycleTypeId": 1,
        "variablePerCycle":false,
        "groupingID":39793,
        "GroupingDefault":false,
        "electronicProduct":false,
        "displayFileName":null,
        "size":0,
        "downloadLimitCount":-1,
        "downloadLimitIp":-1,
        "productWeight":-1.0,
        "productVolume":-1.0,
        "productHeight":-1.0,
        "productDepth":-1.0,
        "supplierEntityId":null,
        "supplierCommission":0.0,
        "isGiftVoucher":false,
        "poplets":null,
        "attributes":null,
        "custom1":"",
        "custom2":"",
        "custom3":"",
        "custom4":"",
        "releaseDate":"2013-01-15T23:00:00",
        "expiryDate":"9998-12-31T15:00:00",
        "createDate":"2015-07-14T01:22:17.67",
        "lastUpdateDate":"2015-07-14T01:22:17.67",
        "captureDetails":false,
        "isOnSale":false,
        "hideIfNoStock":false,
        "enableDropShipping":false,
        "excludeFromSearch":false,
        "enabled":true,
        "deleted":false,
        "title":"",
        "reIndex":false,
        "hasAttributes":true,
        "cycleTypeCount":-1,
        "hasVariations":true,
        "slug":"kung-fu-panda-t-shirt",
        "metaProductDescription":null,
        "canonicalUrl":"/all-t-shirts/mens-t-shirts/kung-fu-panda-t-shirt",
        "absoluteCanonicalUrl":"www.mydomain.com/all-t-shirts/mens-t-shirts/kung-fu-panda-t-shirt",
        "popletImage1": "/shop/tshirt2_poplet1.jpg",
        "popletImage2": "/shop/tshirt2_poplet2.jpg",
        "popletImage3": "/shop/tshirt2_poplet3.jpg",
        "popletImage4": "/shop/tshirt2_poplet4.jpg",
        "popletImage5": null,
        "popletImage6": null,
        "popletImage7": null,
        "popletImage8": null,
        "popletImage9": null,
        "popletImage10": null
    }

    Create a product

    Create a new product.

    Request

    • Method: POST
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/products
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • name - product's name (string)
    • roleId - the roleID of the user to be notified if the product is about to expire (-1 for none) (number)
    • weight - product's weight (number)
    • productCode - product's code (string)
    • keywords - product's keywords (string)
    • unitType - unitType (string)
    • smallImage - product's small image (string)
    • largeImage - product's large image (string)
    • description - product's description (string)
    • inventoryControl - whether this product has inventoryControl on or off (boolean)
    • canPreorder - whether this product can be pre ordered or not (boolean)
    • minUnits - minimum number of units that can be added to the cart (number)
    • maxUnits - maximum number of units that can be added to the cart (number)
    • inStock - number of items in stock (number)
    • onOrder - onOrder (number)
    • reOrder - reOrder (number)
    • reOrderNotified - reOrderNotified (boolean)
    • cycleTypeId - can be one of the following integers (number)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • variablePerCycle - variablePerCycle (boolean)
    • groupingID - the product's groupID (number)
    • GroupingDefault - GroupingDefault (boolean)
    • electronicProduct - whether or not this product is an e-Product (boolean)
    • displayFileName - product's display name (string)
    • size - size (number)
    • downloadLimitCount - download limit (only applies to e-Products) (number)
    • downloadLimitIp - download limit per IP (only applies to e-Products) (number)
    • productWeight - product weight (number)
    • productVolume - product volume (number)
    • productHeight - product height (number)
    • productDepth - product depth (number)
    • supplierEntityId - the supplier's entity ID (number)
    • supplierCommission - the supplier's commission (number)
    • isGiftVoucher - whether this product is to be used as a gift voucher (boolean)
    • poplets - the product's poplets(string)
    • attributes - deprecated, this is null by default, please use Product Attributes endpoint
    • custom1 - custom field 1 (string)
    • custom2 - custom field 2 (string)
    • custom3 - custom field 3 (string)
    • custom4 - custom field 4 (string)
    • releaseDate - product's release date (dateTime)
    • expiryDate - product's expiry date (dateTime)
    • createDate - product's creation date (dateTime)
    • lastUpdateDate - product's last update date (dateTime)
    • captureDetails - captureDetails (boolean)
    • isOnSale - whether this product is marked as "on sale" (boolean)
    • hideIfNoStock - hide product if stock is 0 (boolean)
    • enableDropShipping - enable drop shipping (boolean)
    • excludeFromSearch - exclude this product from search results(boolean)
    • enabled - enabled (boolean)
    • title - product's title (string)
    • reIndex - reIndex (boolean)
    • hasAttributes - hasAttributes (boolean)
    • cycleTypeCount - cycleTypeCount (number)
    • hasVariations - whether the product has variations enabled(boolean)
    • slug - product's slug (string)
    • metaProductDescription - meta description (string)
    • canonicalUrl - product's url (if the product is placed in multiple catalogs the url of the default one will be used) (string)
    • absoluteCanonicalUrl - product's absolute url (string)
    • popletImage1 - product's poplet image 1 url (string)
    • popletImage2 - product's poplet image 2 url (string)
    • popletImage3 - product's poplet image 3 url (string)
    • popletImage4 - product's poplet image 4 url (string)
    • popletImage5 - product's poplet image 5 url (string)
    • popletImage6 - product's poplet image 6 url (string)
    • popletImage7 - product's poplet image 7 url (string)
    • popletImage8 - product's poplet image 8 url (string)
    • popletImage9 - product's poplet image 9 url (string)
    • popletImage10 - product's poplet image 10 url (string)

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts JSON as Content-Type.

    HTTP/1.1 201 Created
    Location: /webresources/api/v3/sites/current/products/[product-id]
    Content-Type: application/json; charset=utf-8

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products/",
        type: "POST",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        },
        processData: false,
        data: JSON.stringify({
            "name": "New Created Product",
    		 "keywords": "test",
            "unitType": "",
            "smallImage": "/img/products/small.jpg",
            "largeImage": "/img/products/large.jpg",
            "slug": "new-product-url",
            "absoluteCanonicalUrl": "",
            "popletImage1": null,
            "popletImage2": null,
            "popletImage3": null,
            "popletImage4": null    
        })
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });

    Important! This call creates the product, but doesn't actually upload any images. To do this, you'll need to generate a second request. Please see Upload product image.

    Edit a product

    Update an existing product.

    Request

    • Method: PUT
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/products/[product_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • name - product's name (string)
    • roleId - the roleID of the user to be notified if the product is about to expire (-1 for none) (number)
    • weight - product's weight (number)
    • productCode - product's code (string)
    • keywords - product's keywords (string)
    • unitType - unitType (string)
    • smallImage - product's small image (string)
    • largeImage - product's large image (string)
    • description - product's description (string)
    • inventoryControl - whether this product has inventoryControl on or off (boolean)
    • canPreorder - whether this product can be pre ordered or not (boolean)
    • minUnits - minimum number of units that can be added to the cart (number)
    • maxUnits - maximum number of units that can be added to the cart (number)
    • inStock - number of items in stock (number)
    • onOrder - onOrder (number)
    • reOrder - reOrder (number)
    • reOrderNotified - reOrderNotified (boolean)
    • cycleTypeId - can be one of the following integers (number)
      • 1 - Once
      • 2 - Daily
      • 3 - Weekly
      • 4 - Fortnightly
      • 5 - Monthly
      • 6 - Quarterly
      • 7 - Half Yearly
      • 8 - Yearly
    • variablePerCycle - variablePerCycle (boolean)
    • groupingID - the product's groupID (number)
    • GroupingDefault - GroupingDefault (boolean)
    • electronicProduct - whether or not this product is an e-Product (boolean)
    • displayFileName - product's display name (string)
    • size - size (number)
    • downloadLimitCount - download limit (only applies to e-Products) (number)
    • downloadLimitIp - download limit per IP (only applies to e-Products) (number)
    • productWeight - product weight (number)
    • productVolume - product volume (number)
    • productHeight - product height (number)
    • productDepth - product depth (number)
    • supplierEntityId - the supplier's entity ID (number)
    • supplierCommission - the supplier's commission (number)
    • isGiftVoucher - whether this product is to be used as a gift voucher (boolean)
    • poplets - the product's poplets(string)
    • attributes - deprecated, this is null by default, please use Product Attributes endpoint
    • custom1 - custom field 1 (string)
    • custom2 - custom field 2 (string)
    • custom3 - custom field 3 (string)
    • custom4 - custom field 4 (string)
    • releaseDate - product's release date (dateTime)
    • expiryDate - product's expiry date (dateTime)
    • createDate - product's creation date (dateTime)
    • lastUpdateDate - product's last update date (dateTime)
    • captureDetails - captureDetails (boolean)
    • isOnSale - whether this product is marked as "on sale" (boolean)
    • hideIfNoStock - hide product if stock is 0 (boolean)
    • enableDropShipping - enable drop shipping (boolean)
    • excludeFromSearch - exclude this product from search results(boolean)
    • enabled - enabled (boolean)
    • deleted - deleted (boolean)
    • title - product's title (string)
    • reIndex - reIndex (boolean)
    • hasAttributes - hasAttributes (boolean)
    • cycleTypeCount - cycleTypeCount (number)
    • hasVariations - whether the product has variations enabled(boolean)
    • slug - product's slug (string)
    • metaProductDescription - meta description (string)
    • canonicalUrl - product's url (if the product is placed in multiple catalogs the url of the default one will be used) (string)
    • absoluteCanonicalUrl - product's absolute url (string)
    • popletImage1 - product's poplet image 1 url (string)
    • popletImage2 - product's poplet image 2 url (string)
    • popletImage3 - product's poplet image 3 url (string)
    • popletImage4 - product's poplet image 4 url (string)
    • popletImage5 - product's poplet image 5 url (string)
    • popletImage6 - product's poplet image 6 url (string)
    • popletImage7 - product's poplet image 7 url (string)
    • popletImage8 - product's poplet image 8 url (string)
    • popletImage9 - product's poplet image 9 url (string)
    • popletImage10 - product's poplet image 10 url (string)

     

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts JSON as Content-Type.

    HTTP/1.1 204 No Content
    Location: /webresources/api/v3/sites/current/products/[product_id]
    Content-Type: application/json; charset=utf-8

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products/9683556",
        type: "PUT",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        },   
        processData: false,
    	data: JSON.stringify({
            "name": "Kung-Fu Panda T-Shirt 2",
            "keywords": "keyword",
            "description":"This is a description",
            "slug": "new-product-url-updated",
            "absoluteCanonicalUrl": "",
            "popletImage1": "/shop/update-tshirt2_poplet1.jpg",
            "popletImage2": "/shop/update-tshirt2_poplet2.jpg",
            "popletImage3": "/shop/update-tshirt2_poplet3.jpg",
            "popletImage4": "/shop/update-tshirt2_poplet4.jpg"
    	})
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });
    

    Delete a product

    Delete an existing product.

    Request

    • Method: DELETE
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/products/[product_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    DELETE /webresources/api/v3/sites/current/products/532542 HTTPS/1.1
    Location: /webresources/api/v3/sites/current/products/[product_id]
    Content-Type: application/json; charset=utf-8

    Response

    Returns an empty body if successful or a detailed error message.

    HTTP/1.1 204 No Content

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/products/9683556",
        type: "DELETE",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });

    Upload image or electronic product

    Upload images or e-product to an existing product.

    Request

    • Method: PUT
    • Path:
      • /webresources/api/v3/sites/current/products/[product-id]?image=smallimage
      • /webresources/api/v3/sites/current/products/[product-id]?image=largeimage
      • /webresources/api/v3/sites/current/products/[product-id]?image=popletimage1
      • /webresources/api/v3/sites/current/products/[product-id]? ...
      • /webresources/api/v3/sites/current/products/[product-id]?image=popletimage10
      • /webresources/api/v3/sites/current/products/[product-id]?image=eproduct
    • Headers:
      • Authorization: This should contain the authorization token. Here is how to obtain the token.
      • Content-Type: application/octet-stream

    Note: In order to be uploaded, the file path must be previously set in smallImage, largeImage, popletImage[N], displayFileName field. There are ten poplet images, from popletImage1 to popletImage10. Exception "Image path not found." will be thrown for negative case.

    The electronic product can be of any extension but with a size limit of 250MB.

    WARNING: The request will overwrite any file found at the image path.

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/products/9683556?image=smallimage",
    type: "PUT",  data: binary-file, processData: false, contentType: "application/octet-stream", headers: { "Authorization": BCAPI.Helper.Site.getAccessToken() } }); request.done(function(data) { console.log(data); }); request.fail(function(jqXHR) { console.log("Request failed."); console.log("Error code: " + jqXHR.status); console.log("Error text: " + jqXHR.statusText); console.log("Response text: " + jqXHR.responseText); });

    Response

    Returns an empty body if successful or a detailed error message.

    HTTP/1.1 204 No Content