Skip to main content

Collection

The Collection API can be used to get collection products or filters for a given collection's id.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

List the products of a collection

GET /{locale}/api/collections/{collection_id}/products

Get the products of a collection, page by page.

Example request

Example request
fetch(window.SHOPLAZZA.routes.root + '/api/collections/8bc2047d-bf57-4c91-b207-e3480f79800d/products?page=0&limit=5')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    collection_idstring

    The id of the collection.

    pagenumber

    The page of products to return.

    limitnumber

    The number of products per page.

Response

    data object

    The response payload.

    products object[]

    List of products.

  • Array [
  • idstring

    ID of the product.

    titlestring

    Title of the product.

    briefstring

    Short description of the product.

    vendorstring

    Vendor of the product.

    vendor_urlstring

    URL of the product vendor.

    has_only_default_variantboolean

    Whether the product has only the default variant.

    requires_shippingboolean

    Whether shipping is required.

    taxableboolean

    Whether tax is charged.

    inventory_policystring

    Whether the product keeps selling when it is out of stock.

    inventory_quantitynumber

    Inventory quantity.

    inventory_trackingboolean

    Whether inventory tracking is enabled.

    publishedboolean

    Whether the resource is published.

    handlestring

    URL-friendly handle used in the resource URL.

    spustring

    SPU of the product.

    notestring

    Note attached to the object.

    need_variant_imageboolean

    Whether each variant must have its own image.

    fake_salesnumber

    Virtual sales figure of the product.

    display_fake_salesboolean

    Whether the virtual sales figure is shown on the storefront.

    independent_seoboolean

    Whether SEO settings are managed independently.

    created_atstring

    Creation time, in ISO-8601 format.

    updated_atstring

    Last update time, in ISO-8601 format.

    tagsstring

    Tags attached to the object.

    availableboolean

    Whether the item can be purchased.

    price_minstring

    Lowest variant price, in the store's main currency unit.

    price_maxstring

    Highest variant price, in the store's main currency unit.

    pricestring

    Price of the product, in the store's main currency unit.

    compare_at_pricestring

    Compare-at price of the item.

    compare_at_price_minstring

    Lowest compare-at price among the variants.

    compare_at_price_maxstring

    Highest compare-at price among the variants.

    urlstring

    Relative URL of the product page.

    published_atstring

    Publication time, in ISO-8601 format.

    salesnumber

    Number of units sold.

    image object

    First image of the product.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

    meta_titlestring

    SEO title used in the page metadata.

    meta_descriptionstring

    SEO description used in the page metadata.

    meta_keywordstring

    SEO keywords used in the page metadata.

    options object[]

    Options of the product, such as colour or size.

  • Array [
  • idstring

    ID of the product option.

    namestring

    Name of the product option, for example Color.

    positionnumber

    Sort position of the option.

    valuesstring[]

    Values available for the product option.

  • ]
  • variants object[]

    List of the product variants.

  • Array [
  • idstring

    ID of the variant.

    titlestring

    Title of the variant, made of its option values joined by -.

    weight_unitstring

    Unit of the weight, for example kg.

    inventory_quantitynumber

    Inventory quantity.

    skustring

    SKU of the variant, used for inventory tracking.

    barcodestring

    Barcode of the variant.

    positionnumber

    Sort position in the list.

    option1string

    Value of the first product option for this variant.

    option2string

    Value of the second product option for this variant.

    option3string

    Value of the third product option for this variant.

    notestring

    Note attached to the object.

    image object

    Image attached to the variant.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

    weightstring

    Weight of the variant.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Price of the variant, in the store's main currency unit.

    availableboolean

    Whether the item can be purchased.

    available_quantitynumber

    Quantity still available for purchase.

    options object[]

    Values of the variant for each product option.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • urlstring

    Relative URL of the product page with this variant selected.

    off_rationumber

    Discount ratio currently applied.

    flashsale_infoundefined[]

    Flash sale information for the item.

    salesnumber

    Number of units sold.

    wholesale_price object[]

    Wholesale price tiers.

  • Array [
  • pricestring

    Unit price of this wholesale tier.

    min_quantitynumber

    Minimum quantity required for this wholesale tier.

  • ]
  • retail_pricestring

    Retail price in the store's main currency unit.

  • ]
  • variants_countnumber
    images object[]

    List of product images.

  • Array [
  • srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

  • ]
  • flashsale_infoundefined[]

    Flash sale information for the item.

    off_rationumber

    Discount ratio currently applied.

    price_variesboolean

    Whether the variants of the product have different prices.

    ifbstring
    cfbstring
    sspstring
    scmstring
    mixed_wholesaleboolean

    Whether mixed wholesale is supported.

    retail_pricestring

    Retail price in the store's main currency unit.

    retail_price_minstring

    Lowest retail price among the variants.

    retail_price_maxstring

    Highest retail price among the variants.

    min_price_variant object

    The variant with the lowest price.

    idstring

    ID of the variant.

    titlestring

    Title of the variant, made of its option values joined by -.

    weight_unitstring

    Unit of the weight, for example kg.

    inventory_quantitynumber

    Inventory quantity.

    skustring

    SKU of the variant, used for inventory tracking.

    barcodestring

    Barcode of the variant.

    positionnumber

    Sort position in the list.

    option1string

    Value of the first product option for this variant.

    option2string

    Value of the second product option for this variant.

    option3string

    Value of the third product option for this variant.

    notestring

    Note attached to the object.

    imagestringnullable

    Image attached to the variant.

    weightstring

    Weight of the variant.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Price of the variant, in the store's main currency unit.

    availableboolean

    Whether the item can be purchased.

    available_quantitynumber

    Quantity still available for purchase.

    options object[]

    Values of the variant for each product option.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • urlstring

    Relative URL of the product page with this variant selected.

    off_rationumber

    Discount ratio currently applied.

    flashsale_infoundefined[]

    Flash sale information for the item.

    salesnumber

    Number of units sold.

    wholesale_price object[]

    Wholesale price tiers.

  • Array [
  • pricestring

    Unit price of this wholesale tier.

    min_quantitynumber

    Minimum quantity required for this wholesale tier.

  • ]
  • retail_pricestring

    Retail price in the store's main currency unit.

    product_typestring

    Product type.

    descriptionstring

    Description of the product.

    comment_avg_starnumber

    Average review rating of the product.

    comment_countnumber

    Number of customer reviews for the product.

  • ]
  • has_morenumber

    Whether more records are available.

    pagenumber

    Current page number.

    limitnumber

    Maximum number of records returned per page.

    products_countnumber

    Total number of products matched.

    countnumber

    Number of products returned.

    comment_enabledboolean

    Whether customer reviews are enabled.

    msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.

Filter the products of a collection

GET /{locale}/api/collections/{collection_id}/cps

The following example requests the products for a specific collection:

curl
GET /{locale}/api/collections/{collection_id}/cps?page=0&limit=8

Example request

Example request using Fetch
fetch(window.SHOPLAZZA.routes.root + '/api/collections/8bc2047d-bf57-4c91-b207-e3480f79800d/cps?page=0&limit=8')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    pagenumber

    The base-0 page number of results.

    limitnumber

    Limits the number of results.

    [filter.filter_scope.attribute]string

    Refer to Storefront filtering. The [filter.filter_scope.attribute.attribute_scope] form is also accepted.

Response

    data object

    The response payload.

    products object[]

    List of products.

  • Array [
  • idstring

    ID of the product.

    titlestring

    Title of the product.

    briefstring

    Short description of the product.

    vendorstring

    Vendor of the product.

    vendor_urlstring

    URL of the product vendor.

    has_only_default_variantboolean

    Whether the product has only the default variant.

    requires_shippingboolean

    Whether shipping is required.

    taxableboolean

    Whether tax is charged.

    inventory_policystring

    Whether the product keeps selling when it is out of stock.

    inventory_quantitynumber

    Inventory quantity.

    inventory_trackingboolean

    Whether inventory tracking is enabled.

    publishedboolean

    Whether the resource is published.

    handlestring

    URL-friendly handle used in the resource URL.

    spustring

    SPU of the product.

    notestring

    Note attached to the object.

    need_variant_imageboolean

    Whether each variant must have its own image.

    fake_salesnumber

    Virtual sales figure of the product.

    display_fake_salesboolean

    Whether the virtual sales figure is shown on the storefront.

    independent_seoboolean

    Whether SEO settings are managed independently.

    created_atstring

    Creation time, in ISO-8601 format.

    updated_atstring

    Last update time, in ISO-8601 format.

    tagsstring

    Tags attached to the object.

    availableboolean

    Whether the item can be purchased.

    price_minstring

    Lowest variant price, in the store's main currency unit.

    price_maxstring

    Highest variant price, in the store's main currency unit.

    pricestring

    Price of the product, in the store's main currency unit.

    compare_at_pricestring

    Compare-at price of the item.

    compare_at_price_minstring

    Lowest compare-at price among the variants.

    compare_at_price_maxstring

    Highest compare-at price among the variants.

    urlstring

    Relative URL of the product page.

    published_atstring

    Publication time, in ISO-8601 format.

    salesnumber

    Number of units sold.

    image object

    First image of the product.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

    meta_titlestring

    SEO title used in the page metadata.

    meta_descriptionstring

    SEO description used in the page metadata.

    meta_keywordstring

    SEO keywords used in the page metadata.

    options object[]

    Options of the product, such as colour or size.

  • Array [
  • idstring

    ID of the product option.

    namestring

    Name of the product option, for example Color.

    positionnumber

    Sort position of the option.

    valuesstring[]

    Values available for the product option.

  • ]
  • variants object[]

    List of the product variants.

  • Array [
  • idstring

    ID of the variant.

    titlestring

    Title of the variant, made of its option values joined by -.

    weight_unitstring

    Unit of the weight, for example kg.

    inventory_quantitynumber

    Inventory quantity.

    skustring

    SKU of the variant, used for inventory tracking.

    barcodestring

    Barcode of the variant.

    positionnumber

    Sort position in the list.

    option1string

    Value of the first product option for this variant.

    option2string

    Value of the second product option for this variant.

    option3string

    Value of the third product option for this variant.

    notestring

    Note attached to the object.

    image object

    Image attached to the variant.

    srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

    weightstring

    Weight of the variant.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Price of the variant, in the store's main currency unit.

    availableboolean

    Whether the item can be purchased.

    available_quantitynumber

    Quantity still available for purchase.

    options object[]

    Values of the variant for each product option.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • urlstring

    Relative URL of the product page with this variant selected.

    off_rationumber

    Discount ratio currently applied.

    flashsale_infoundefined[]

    Flash sale information for the item.

    salesnumber

    Number of units sold.

    wholesale_price object[]

    Wholesale price tiers.

  • Array [
  • pricestring

    Unit price of this wholesale tier.

    min_quantitynumber

    Minimum quantity required for this wholesale tier.

  • ]
  • retail_pricestring

    Retail price in the store's main currency unit.

  • ]
  • variants_countnumber
    images object[]

    List of product images.

  • Array [
  • srcstring

    URL of the image.

    widthnumber

    Width of the image, in pixels.

    heightnumber

    Height of the image, in pixels.

    altstring

    Alt text of the image.

    pathstring

    Path of the image file on the image server.

    aspect_rationumber

    Width of the image divided by its height.

  • ]
  • flashsale_infoundefined[]

    Flash sale information for the item.

    off_rationumber

    Discount ratio currently applied.

    price_variesboolean

    Whether the variants of the product have different prices.

    ifbstring
    cfbstring
    sspstring
    scmstring
    mixed_wholesaleboolean

    Whether mixed wholesale is supported.

    retail_pricestring

    Retail price in the store's main currency unit.

    retail_price_minstring

    Lowest retail price among the variants.

    retail_price_maxstring

    Highest retail price among the variants.

    min_price_variant object

    The variant with the lowest price.

    idstring

    ID of the variant.

    titlestring

    Title of the variant, made of its option values joined by -.

    weight_unitstring

    Unit of the weight, for example kg.

    inventory_quantitynumber

    Inventory quantity.

    skustring

    SKU of the variant, used for inventory tracking.

    barcodestring

    Barcode of the variant.

    positionnumber

    Sort position in the list.

    option1string

    Value of the first product option for this variant.

    option2string

    Value of the second product option for this variant.

    option3string

    Value of the third product option for this variant.

    notestring

    Note attached to the object.

    imagestringnullable

    Image attached to the variant.

    weightstring

    Weight of the variant.

    compare_at_pricestring

    Compare-at price of the item.

    pricestring

    Price of the variant, in the store's main currency unit.

    availableboolean

    Whether the item can be purchased.

    available_quantitynumber

    Quantity still available for purchase.

    options object[]

    Values of the variant for each product option.

  • Array [
  • namestring

    Name of the product option, for example Color.

    valuestring

    Value selected for this product option.

  • ]
  • urlstring

    Relative URL of the product page with this variant selected.

    off_rationumber

    Discount ratio currently applied.

    flashsale_infoundefined[]

    Flash sale information for the item.

    salesnumber

    Number of units sold.

    wholesale_price object[]

    Wholesale price tiers.

  • Array [
  • pricestring

    Unit price of this wholesale tier.

    min_quantitynumber

    Minimum quantity required for this wholesale tier.

  • ]
  • retail_pricestring

    Retail price in the store's main currency unit.

    product_typestring

    Product type.

    descriptionstring

    Description of the product.

    comment_avg_starnumber

    Average review rating of the product.

    comment_countnumber

    Number of customer reviews for the product.

  • ]
  • has_morenumber

    Whether more records are available.

    pagenumber

    Current page number.

    limitnumber

    Maximum number of records returned per page.

    products_countnumber

    Total number of products matched.

    countnumber

    Number of products returned.

    comment_enabledboolean

    Whether customer reviews are enabled.

    msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.

List the filters of a collection

GET /{locale}/api/collections/{collection_id}/filters

Example request

The following example requests the filters for a specific collection:

Example request using Fetch
fetch(window.SHOPLAZZA.routes.root + '/api/collections/8bc2047d-bf57-4c91-b207-e3480f79800d/filters')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    collection_idstring

    ID of the collection.

Response

    data object[]

    The response payload.

  • Array [
  • labelstring

    Name of the filter, for example price or vendor.

    param_namestring

    URL parameter used by the filter.

    typestring

    Filter type, for example list or price_range.

    range_minnumber

    Lowest value available for a price_range filter.

    range_maxnumber

    Highest value available for a price_range filter.

    values object[]

    Values available for the filter.

  • Array [
  • param_namestring

    URL parameter used by the filter.

    labelstring

    Label of the filter value shown to the customer.

    valuestring

    The filter value.

    activeboolean

    Whether the filter value is currently applied.

    countnumber

    Number of products matching this filter value.

  • ]
  • active_valuesstringnullable

    Filter values that are currently applied.

    inactive_values object[]

    Filter values that are not currently applied.

  • Array [
  • param_namestring

    URL parameter used by the filter.

    labelstring

    Label of the filter value shown to the customer.

    valuestring

    The filter value.

    activeboolean

    Whether the filter value is currently applied.

    countnumber

    Number of products matching this filter value.

  • ]
  • max_valuestringnullable

    Upper bound of a price_range filter.

    min_valuestringnullable

    Lower bound of a price_range filter.

  • ]
  • msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.