/products

Loads a list of products or information on a single product.

URL parameters

Parameters that you can append to the URL, for example: ?parameter=value

TitleTypeDescriptionRequired?
idintID of a single product to load. Can be used after the slash.
Example:
products/27
load product with ID 27
No
pageintNumber of the page to load. Defaults to 1No
sortstringOne or more attributes to sort the items by. Defaults to id descending.
For descending, add ! before the attribute name. For multiple attributes, separate them by commas.
Example:
products?sort=!id,title
sort by descending id first, then by ascending email
No
sizeintNumber of items per page. Defaults to 20No
expandstringRelations that should be extended.
Possible options: textareas, images, variants, options, all
You can use multiple options separated by commas.
Example:
products?expand=textareas,images
Load products with textareas and images
Use all to load all relations.
No

Response attributes

Attributes that you will receive in response from the endpoint in JSON format, for example:
{"id": 1,"title": "Product"}

TitleTypeDescription
idintID of the product
titlestringTitle of the product
is_multiboolIf the product is multi variant as opposed to single variant
typestringType of the product, for example Shirts
collectionsarray of intsArray containing IDs of collections that the product belongs to. Only returns collections with manual addition of products
tagsarray of stringsTags assigned to the product
shipping_weightfloatShipping weight of the product
auto_fulfilmentboolWhether automatic fulfilment is enabled
track_inventoryboolWhether product is tracked in Inventory
vendorstringName of the vendor that supplies the product
skustringSKU of the product
seo_metastringMeta for SEO
seo_titlestringPage title for SEO
seo_urlstringPage URL for SEO. Generates automatically from title
is_templateboolWhether this is a template to create products from
is_draftboolWhether this product is a draft that is not published
pricefloatPrice of the product, for single variant products
compare_pricefloatCompare price of the product, for single variant products
created_atintTimestamp of the product creation time
updated_atintTimestamp of the product last update time
textareasobject containing arraysCustom pieces of text that can be displayed as tabs on the product page. Only the titles that have been pre-set on Product settings page can be used here
textareas.namestringTitle of the tab. Only the titles that have been pre-set on Product settings page can be used here
textareas.textstringText contents of the tab
imagesobject containing arraysImages for the product. Used if no variants change product look
images.idintID of the image
images.pathstringAbsolute URL of the image
images.max_sizeintMax size of the image, for internal usage
optionsobject containing arraysOptions for multi-variant products
options.titlestringTitle of the option, for example Color
options.changes_lookboolWhether this option changes look of the product
options.valuesarray of stringsValues of the option, for example Red and Blue
options.thumbnailsobject containing arraysThumbnails that will be used in the variant selector on the product page
options.thumbnails.valuestringValue of the option for which the thumbnail is used, for example Red
options.thumbnails.colorstringColor of the selector thumbnail, HEX value. Either color or image is used.
options.thumbnails.imagearray of mixedImage of the selector thumbnail. Either color or image is used.
options.thumbnails.image.idintID of the image, if image is used
options.thumbnails.image.pathstringAbsolute URL of the image, if image is used
options.thumbnails.image.max_sizeintMax size of the image, for internal usage
variantsobject containing arraysVariants resulting from combining of options
variants.idintID of the variant
variants.variantarray of stringsA combination of options, for example Red and Big
variants.pricefloatPrice of the variant
variants.compare_pricefloatCompare price of the variant
variants.skustringSKU of the variant
variants.defaultboolWhether the variant is default
variants.ignoreboolWhether the variant should not be used
variants.imagesobject containing arraysImages for the variant if it changes product look
variants.images.idintID of the image
variants.images.pathstringAbsolute URL of the image
variants.images.max_sizeintMax size of the image, for internal usage
GET https://mystore.commercehq.com/api/v1/products/14?expand=all
{
  "id": 14,
  "title": "Fancy bear 1000",
  "is_multi": true,
  "type": "Cats",
  "collections": [6,7],
  "tags": [
    "dog"
  ],
  "shipping_weight": 3000,
  "auto_fulfilment": false,
  "track_inventory": true,
  "vendor": "Supplier #1",
  "sku": "sku dog1000",
  "seo_meta": null,
  "seo_title": "Fancy bear 1000",
  "seo_url": "fancy-bear-1000",
  "is_template": false,
  "is_draft": false,
  "created_at": 1484929254,
  "updated_at": 1485006377,
  "textareas": [
    {
      "name": "Description",
      "text": "Great product"
    }
  ],
  // for a single variant product
  "images": [
    {
      "id": 18,
      "path": "https://s3-us-west-2.amazonaws.com/commercehq-userfiles-dev/commercehq-test/uploads/1484915452_4bc11fff36e9ed964af6163f413bcb42.jpg",
      "max_size": 6
    },
    {
      "id": 17,
      "path": "https://s3-us-west-2.amazonaws.com/commercehq-userfiles-dev/commercehq-test/uploads/1484915445_156e1fe7d4ac89c4b0567fc8c782e490.jpg",
      "max_size": 7
    }
  ],
  // for a multi variant product
  "options": [
    {
      "title": "Color",
      "changes_look": true,
      "values": [
        "Red",
        "Blue"
      ],
      "thumbnails": [{
      			value: "Red",
            color: "#BD3F3F"
      }]
    },
    {
      "title": "Size",
      "changes_look": true,
      "values": [
        "Big",
        "Small"
      ],
      "thumbnails": [{
      			value: "Big",
            image: {
                id: "6",
                path: "https://s3-us-west-2.amazonaws.com/commercehq-userfiles-dev/commercehq-test/uploads/1484915452_4bc11fff36e9ed964af6163f413bcb42.jpg",
                max_size: 6
            }
      }]
    }
  ],
  "variants": [
    {
      "id": 43,
      "variant": [
        "Red",
        "Big"
      ],
      "price": 25,
      "compare_price": 15,
      "sku": null,
      "default": true,
      "ignore": false,
      "images": [
        {
          "id": 19,
          "path": "https://s3-us-west-2.amazonaws.com/commercehq-userfiles-dev/commercehq-test/uploads/1485006363_ceef7428ba5fb55b0cb73897fb2d8720.jpg",
          "max_size": 9
        }
      ]
    },
    {
      "id": 44,
      "variant": [
        "Red",
        "Small"
      ],
      "price": 25,
      "compare_price": 15,
      "sku": null,
      "default": false,
      "ignore": false,
      "images": []
    },
    {
      "id": 45,
      "variant": [
        "Blue",
        "Big"
      ],
      "price": 25,
      "compare_price": 15,
      "sku": null,
      "default": false,
      "ignore": false,
      "images": []
    },
    {
      "id": 46,
      "variant": [
        "Blue",
        "Small"
      ],
      "price": 25,
      "compare_price": 15,
      "sku": null,
      "default": false,
      "ignore": false,
      "images": []
    }
  ]
}