Catalogs and products

    List the products in a catalog

    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/catalogs/[catalog_ID]/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)
    • tags - product's tags (string)
    • unitType - unitType (string)
    • smallImage - product's smallImage (string)
    • largeImage - product's largeImage (string)
    • description - product's description (string)
    • inventoryControl - whether this product has inventoryControl on or off(boolean)
    • canPreorder - canPreorder (boolean)
    • minUnits - min number units that can be added to the cart (number)
    • maxUnits - max number 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)
    • 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 - product's attributes (string)
    • 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)
    • 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)
    • url - product's url (if the product is placed in multiple catalogs the url of the default one will be used) (string)
    • metaProductDescription - metaProductDescription (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/catalogs/25479/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": [
        {
          "productId": 3909340,
          "catalogueId": 25481,
          "siteId": 246884,
          "canonicalCatalog": null,
          "product": {
            "id": 3909340,
            "siteId": 246884,
            "name": "Sample Product 1",
            "roleId": -1,
            "weight": null,
            "productCode": "EYE2FQZUGZ",
            "tags": "keyword1",
            "unitType": "",
            "smallImage": "/images/products/prod2.gif",
            "largeImage": "/images/products/placeholder-product-image-large.png",
            "description": "This is a sample product. You can edit this product by logging in to your Admin\nConsole and going to 'ECommerce > Products'\r\n",
            "inventoryControl": true,
            "canPreorder": false,
            "minUnits": 1,
            "maxUnits": -1,
            "inStock": 6,
            "onOrder": 0,
            "reOrder": -1,
            "reOrderNotified": false,
            "variablePerCycle": false,
            "groupingID": null,
            "GroupingDefault": false,
            "electronicProduct": false,
            "displayFileName": null,
            "size": 0,
            "downloadLimitCount": -1,
            "downloadLimitIp": -1,
            "productWeight": -1,
            "productVolume": -1,
            "productHeight": -1,
            "productDepth": -1,
            "supplierEntityId": null,
            "supplierCommission": 0,
            "isGiftVoucher": false,
            "poplets": null,
            "attributes": null,
            "custom1": "",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "releaseDate": "2011-06-02T00:00:00",
            "expiryDate": "9998-12-31T15:00:00",
            "captureDetails": false,
            "isOnSale": false,
            "hideIfNoStock": false,
            "enableDropShipping": false,
            "excludeFromSearch": false,
            "enabled": true,
            "deleted": false,
            "title": "",
            "reIndex": false,
            "hasAttributes": true,
            "cycleTypeCount": -1,
            "hasVariations": true,
            "slug": "sample-product-1",
            "metaProductDescription": ""
          }
        },
        {
          "productId": 3909340,
          "catalogueId": 25479,
          "siteId": 246884,
          "canonicalCatalog": true,
          "product": {
            "id": 3909340,
            "siteId": 246884,
            "name": "Sample Product 1",
            "roleId": -1,
            "weight": null,
            "productCode": "EYE2FQZUGZ",
            "tags": "keyword1",
            "unitType": "",
            "smallImage": "/images/products/prod2.gif",
            "largeImage": "/images/products/placeholder-product-image-large.png",
            "description": "This is a sample product. You can edit this product by logging in to your Admin\nConsole and going to 'ECommerce > Products'\r\n",
            "inventoryControl": true,
            "canPreorder": false,
            "minUnits": 1,
            "maxUnits": -1,
            "inStock": 6,
            "onOrder": 0,
            "reOrder": -1,
            "reOrderNotified": false,
            "variablePerCycle": false,
            "groupingID": null,
            "GroupingDefault": false,
            "electronicProduct": false,
            "displayFileName": null,
            "size": 0,
            "downloadLimitCount": -1,
            "downloadLimitIp": -1,
            "productWeight": -1,
            "productVolume": -1,
            "productHeight": -1,
            "productDepth": -1,
            "supplierEntityId": null,
            "supplierCommission": 0,
            "isGiftVoucher": false,
            "poplets": null,
            "attributes": null,
            "custom1": "",
            "custom2": "",
            "custom3": "",
            "custom4": "",
            "releaseDate": "2011-06-02T00:00:00",
            "expiryDate": "9998-12-31T15:00:00",
            "captureDetails": false,
            "isOnSale": false,
            "hideIfNoStock": false,
            "enableDropShipping": false,
            "excludeFromSearch": false,
            "enabled": true,
            "deleted": false,
            "title": "",
            "reIndex": false,
            "hasAttributes": true,
            "cycleTypeCount": -1,
            "hasVariations": true,
            "slug": "sample-product-1",
            "metaProductDescription": ""
          }
        }
      ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }