Open2b versione 7.5

products

Returns the products that meet the given conditions. It returns only the visible products, having sale price. Also it returns the number of products regardless of limit and first parameters.

If a customer key is given, the returned prices are for the custormer's group, otherwise are for the default customer group.

Request

HTTP POST
/api/v10/storefront.products
{
  "conditions" : { // returns only the products …
    "ids" : [ 281, 89, … ], // … with these identifiers - int(1…)
    "codes" : [ "FG94CA", "H9WM3", … ], // … with these codes - string(1…40)
    "skus" : [ "A927TP", "C371PR", … ], // … with items with these codes - string(1…40)
    "isFeatured" : false, // … that are featured or not featured on the home page - bool
    "isNewRelease" : false, // … that are new releases or not - bool
    "allowOrders" : true, // … that allow orders or not - bool
    "allowQuotes" : false, // … that allow quotes or not - bool
    "collection" : 0, // … contained in this collection (id), 0 for the catalog collection - int(0…)
    "department" : 34, // … contained in this department (id) - int(1…)
    "producer" : 147, // … of this producer (id) - int(1…)
    "isAccessoryOf" : 862, // … accessory of this product (id) - int(1…)
    "isSimilarTo" : 302, // … similar to this product (id) - int(1…)
    "salePriceFrom" : 10.50, // … with the sale price starting from this - decimal[10,2](0…)
    "salePriceTo" : 50.80, // … with the sale price up to this - decimal[10,2](0…)
    "promotion" : 12, // … that has this promotion (id) - int(1…)
    "keywords" : [ "shirt", … ], // … with these keywords - string(1…100)
    "attributes" : { // … with these attributes and values - int(1…) -> int(1…)
        "3" : [ 5, 7, … ],
        "12" : [ 2, 4, … ],
        …
    },
    "after" : 281 // … with identifier after this value - int(0…)
  },
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "code", … ], // fields to return - string
  "order" : "Position", // sort order of returned products, can be "Position", "Name", "-Name", "Price", "-Price" or "Date"
  "limit" : 10, // maximum number of products to return - int(1…)
  "first" : 0 // index of the first product to return - int(0…)
}

Response

{
  "status" : "ok",
  "products" : [ {
    "id" : 281, // identifier - int(1…)
    "code" : "FG94CA", // code - string(1…40)
    "sku" : "FG94CA-1", // SKU - string(1…40)
    "departments" : [ 63, 12 ], // departments (id), one or more, up to 5 - int(1…)
    "producer" : 290, // producer (id) (can be null) - int(1…)
    "allowOrders" : true, // indicates if can be ordered - bool
    "allowQuotes" : false, // indicates if can be quoted - bool
    "unitOfMeasure" : { // unit of measure (can be null)
      "name" : "Kg", // string(0…32)
      "decimalPlaces" : 2 // int(0…2)
    },
    "isNewRelease" : false, // indicates if it is a new release - bool
    "isPriceFrom": true, // indicates if the prices are "from" - bool
    "listPrice" : { // list price (can be null)
      "net": 49.605, // net price - decimal[12,5](0…)
      "gross": 60.518 // gross price - decimal[12,5](0…)
    },
    "salePrice" : { // sale price (can be null)
      "net": 44.645, // net price - decimal[12,5](0…)
      "gross": 54.467 // gross price - decimal[12,5](0…)
    },
    "taxRate" : 19.00, // tax rate - decimal[4,2](0…)
    "promotion" : 58, // promotion (id) (can be null) - int(1…)
    "rating" : 4.7, // rating - decimal[2,1](0…5)
    "showMoreGalleries" : true, // indicates if more than one image gallery should be shown - bool
    "thumbnailImage" : { // thumbnail image (can be null)
      "url" : "https://…", // url - string(10…)
      "url2x" : "https://…", // double resolution url (can be null) - string(10…)
      "width" : 40, // width in pixel - int(30…50)
      "height" : 40 // height in pixel - int(30…50)
    },
    "smallImage" : { // small image (can be null)
      "url" : "https://…", // url - string(10…)
      "url2x" : "https://…", // double resolution url (can be null) - string(10…)
      "width" : 70, // width in pixel - int(50…250)
      "height" : 70 // height in pixel - int(50…250)
    },
    "mediumImage" : { // medium image (can be null)
      "url" : "https://…", // url - string(10…)
      "url2x" : "https://…", // double resolution url (can be null) - string(10…)
      "width" : 150, // width in pixel - int(50…250)
      "height" : 150 // height in pixel - int(50…250)
    },
    "largeImage" : { // large image (can be null)
      "url" : "https://…", // url - string(10…)
      "url2x" : "https://…", // double resolution url (can be null) - string(10…)
      "width" : 300, // width in pixel - int(250…800)
      "height" : 300 // height in pixel - int(250…800)
    },
    "zoomImage" : { // zoom image (can be null)
      "url" : "https://…", // url - string(10…)
      "url2x" : "https://…", // double resolution url (can be null) - string(10…)
      "width" : 1200, // width in pixel - int(250…)
      "height" : 1200 // height in pixel - int(250…)
    },
    "name" : "Book", // name - string(0…120)
    "shortDescription" : "", // short description - string(0…255)
    "longDescription" : "", // long description - string(0…65535)
    "moreDescription" : "", // more description - string(0…65535)
    "seo" : {
      "title" : "Book", // title for SEO - string(0…255)
      "description" : "" // description for SEO - string(0…255)
    },
    "canonicalURL" : "https://www.site.com/book", // canonical URL - string(10…)
    "releaseDate" : "2020-09-10", // date when it will be available if it is pre-orderable (can be null) - date
    "items" : [ { // items
      "sku" : "FG94CA-1", // SKU - string(1…40)
      "barcode" : "09781555553333", // GTIN barcode ( EAN13, UPC or ISBN13 ) (can be null) - string(14)
      "weight" : 0.452, // weight - decimal[6,3](0…)
      "saleConditions" : { // sale conditions (can be null)
        "minOrder" : 2.00, // minimum quantity that can be ordered (can be null) - decimal[8,2](0…)
        "maxOrder" : null, // maximum quantity that can be ordered (can be null) - decimal[8,2](0…)
        "minQuote" : null // minimum quantity that can be quoted (can be null) - decimal[8,2](0…)
      },
      "listPrice" : { // list price (can be null)
        "net": 49.605, // net price - decimal[12,5](0…)
        "gross": 60.518 // gross price - decimal[12,5](0…)
      },
      "salePrice" : { // sale price (can be null)
        "net": 44.645, // net price - decimal[12,5](0…)
        "gross": 54.467 // gross price - decimal[12,5](0…)
      },
      "salePrices" : [ { // sale price for each tier (can be null)
        "from" : 1.00, // from quantity - decimal[11,2](0…)
        "to" : 10.00, // to quantity (can be null) - decimal[11,2](0…)
        "price" : { // price
          "net": 44.645, // net price - decimal[12,5](0…)
          "gross": 54.467 // gross price - decimal[12,5](0…)
        }
      }, {
        "from" : 11.00,
        "to" : 20.00,
        "price" : {
          "net": 42.927,
          "gross": 52.371
        }
      }, … ],
      "stock" : 62.00, // quantity in stock - decimal[11,2](0…)
      "reorderDays" : 5, // days to wait before it returns available - int(0…255)
      "shippingDate" : "2020-10-12", // estimated shipping date (can be null) - date
      "options" : [ { // options, up to 3
        "id" : 46, // identifier - int(1…)
        "name" : "Red", // name - string(0…60)
        "icon" : { // icon (can be null)
          "color" : null, // color in hexadecimal format (can be null) - string(6)
          "image" : { // image (can be null)
            "url" : "https://...", // URL - string(10…)
            "width" : 32, // width - int(0…100)
            "height" : 32 // height - int(0…100)
          }
        }
      }, … ]
    }, … ],
    "attributes" : [ { // attributes
      "id" : 3, // identifier - int(1…)
      "name" : "Color", // name - string(0…60)
      "values" : [ { // values
        "id" : 51, // identifier - int(1…)
        "name" : "Green", // name - string(0…60)
        "description" : "Intense green", - string(0…1000)
        "canonicalURL" : "https://...", // canonical URL - string(10…)
        "icon" : { // icon (can be null)
          "color" : null, // color in hexadecimal format (can be null) - string(6)
          "image" : { // image (can be null)
            "url" : "https://...", // URL - string(10…)
            "width" : 32, // width - int(0…100)
            "height" : 32 // height - int(0…100)
          }
        }
      }, … ]
    }, … ],
    "variants" : [ { // variants, up to 3
      "id" : 24, // identifier - int(1…)
      "name" : "Color", // name - string(0…60)
      "showName" : true // indicates if the name should be displayed - bool
    }, … ],
    "files" : [ { // files
      "url" : "https://...", // url - string(42…255)
      "size" : 549071, // size in bytes - int(1…)
      "description" : "Manual" // description - string(0…255)
    }, … ]
  }, … ],
  "count" : 371 // total number of products that meet the given conditions - int(0…)
}

Errors

Field Type Description
conditions Malformed 'salePriceFrom' must be less or equal to 'salePriceTo'
conditions Malformed Condition 'isSimilarTo' cannot be used in combination with 'isAccessoryOf'
conditions Malformed There can be at most 5 keywords