What is it?

The delivery message is shown on the buy button on the product detail view, within the configuration popover on the product detail view and on a line item in the case. It can be used to provide the user with an extra message unique to the selected product variant. For example an estimated delivery date, or an only x left in stock message.

The images below show how the delivery message will appear on the buy button of the product detail view, the configuration popover of the product detail view and the line item in the cart.

How to do it?

In order for the delivery message to be displayed it needs to be present as a custom attribute on a product. 

To fetch the product availability Highstreet will make a request to the following endpoint GET /products/({id},...,{id}).

For example:

GET /products/(1234)?expand=availability&select=(data.(id,inventory,step_quantity,min_order_quantity,c_hsDeliveryMessage))&currency=USD&locale=en-US

  "_v": "18.8",
  "_type": "product_result",
  "data": [{
    "_type": "product",
    "id": "1234",
    "inventory": {
      "_type": "inventory",
      "ats": 0,
      "backorderable": false,
      "id": "Main",
      "orderable": false,
      "preorderable": false,
      "stock_level": 0
    "step_quantity": 1,
    "min_order_quantity": 1,
    * "c_hsDeliveryMessage": "(only 1 left)" *

Things to Note

The locale is passed as a parameter on the request so that you can localise the delivery message.

If a delivery message should not be displayed for a particular variant then the custom attribute should not be returned in the response.