Open2b versione 7.5

promotions

Returns the promotions. It returns only promotions that are in their activity interval.

If a customer key is given, returns the promotions of the customer's group, otherwise returns the promotions of the default customer group.

Request

HTTP POST
/api/v10/storefront.promotions
{
  "ids" : [ 43, 28, … ], // identifiers - int(1…)
  "fields" : [ "id", "name", … ] // fields to return - string
}

Response

{
  "status" : "ok",
  "promotions" : [ {
    "id" : 43, // identifier - int(1…)
    "name" : "Promo 2020", // name - string(0…60)
    "summary" : "…", // summary description - string(0…65535)
    "description" : "…", // detailed description - string(0…65535)
    "isActive" : true, // indicates if it is active or not -- bool
    "type" : "DiscountedItems", // type, can be "DiscountedItems", "DiscountedSubtotal" or "DiscountedShippings" - string
    "discountedQuantity" : { // quantity that will be discounted (can be null)
      "quantity": 4, // quantity of discounted items - int(1..)
      "excludeMinQuantity": false // indicates if the minimum quantity is excluded from the discount - bool
    }
    "minSubtotal" : 50.00, // minimum cart subtotal (can be null) - decimal[8,2](0..)
    "maxSubtotal" : null, // maximum cart subtotal, can not be zero (can be null) - decimal[8,2](0..)
    "minQuantity" : { // minimum quantity to purchase (can be null)
      "quantity": 4, // minimum quantity of items in the cart - int(0..)
      "groupBy": "Item" // how to group purchased quantity. Can be "Item", "Product" or "Cart" - string
    }, 
    "discount" : { // discount
      "type" : "PercentOff", // type, can be "PercentOff", "AmountOff" or "FixedPrice" - string
      "value" : 20.000 // value, percent or amount - decimal[8,3](0..)
    },
    "startTime" : "2020-10-15 12:00:00", // first promotion date and time - datetime
    "endTime" : "2021-01-15 12:00:00", // last promotion date and time - datetime
    "hourLimits" : { // Hours during which the promotion is active (can be null)
      "start" : 12, // Hour of promotion activation - int(0..23)
      "end" : 18 // Hour of promotion deactivation - int(0..23)
    },
    "smallImage" : { // small image (can be null)
      "url" : "https://…", // URL - string(10…255)
      "width" : 200, // width in pixel - int(1…2500)
      "height" : 180 // height in pixel - int(1…2500)
    },
    "largeImage" : { // large image (can be null)
      "url" : "https://…", // URL - string(10…255)
      "width" : 800, // width in pixel - int(1…2500)
      "height" : 960 // height in pixel - int(1…2500)
    },
    "productsLayout" : { // products layout on the promotion's page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" or "Date" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    },
    "seo" : { // SEO
      "title" : "", // title for SEO - string(0…255)
      "description" : "" // description for SEO - string(0…255)
    },
    "canonicalURL" : "https://www.site.com/promo-2020" // canonical URL - string(10…)
  }, … ],
}