Skip to main content

Product

You can make a GET request for the information of any product using the Ajax Product API.

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

Get a product

GET /{locale}/api/products/{product_id}

Get the JSON of a product using the product's id.

All monetary properties are returned in the customer's presentment currency.

Example request

javascript
fetch(window.SHOPLAZZA.routes.root + '/api/products/588ed0ce-40af-44c7-8dea-afa18b489ef8')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    product_idstring

    ID of the product.

Response

    data object

    The response payload.

    product object

    The product details.

    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.

    msgstring

    Result message returned with the response.

    statenumber

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

List recently viewed products

GET /{locale}/api/product/list

Get the JSON of the recently viewed product list.

All monetary properties are returned in the customer's presentment currency.

Example request

javascript
fetch(window.SHOPLAZZA.routes.root + '/api/product/list?page=1&limit=100')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    pagestring

    The base-1 page number.

    limitstring

    The number of products per page.

Response

    data object

    The response payload.

    comment_enabledboolean

    Whether customer reviews are enabled.

    has_morenumber

    Whether more records are available.

    limitnumber

    Maximum number of records returned per page.

    list 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.

  • ]
  • pagenumber

    Current page number.

    sort object
    object
    totalnumber

    Total number of products matched.

    msgstring

    Result message returned with the response.

    statenumber

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

Get the subscription plans of a product

GET /{locale}/api/storefront/selling_plans/product_plan_info/{product_id}

Get the subscription plan information of a product, where product_id is the id of the product.

Example request

Example request
fetch(window.SHOPLAZZA.routes.root + '/api/storefront/selling_plans/product_plan_info/14a309ec-b966-4cf9-a9bb-33baa821fdbc')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    product_idstring

    The id of the product.

Response

    block_stylestring
    store_ini_payment_subscriptionboolean
    sku object

    SKU of the variant, used for inventory tracking.

    object
    spu object

    SPU of the product.

    object