Let say you have Circulars that would rendered like so:
Note default render when there are no layout define will be 2 columns on normal screen and 1 column on mobile.
We would expect Vendor/Client REST API to return data as followed.
{
"id": 321,
"chain": "greers",
"store_number": 123,
"headline": "Greer's Weekly Ads",
"circulars": [] // array of circulars - see schema below
}
- start_at - query string to pass in a future date for previewing so you can preview/QA ahead of time
{
"id": 123,
"headline": "This Week Ad's",
"image_url": "preview or fallback image url",
"pdf_url": "url to pdf for this circular - if available",
"header_html": "html that goes above all pages - depend on template - html only - see-also append_html",
"footer_html": "html that goes below all pages - depend on template - html only - see-also append_html",
"append_html": "html that below pager on all pages",
"book_page_slug": "default/fallback page layout slug - optional - if empty, grid size layout, see-also item.slot",
"pages": [] // array of pages and should be pre-sorted with smallest page first, e.g. page 1-n
}
data from API should be pre-sorted or a
sort_order
value is provided
{
"id": 234,
"image_url": "image url if no item sent - required in all cases.",
"pdf_url": "pdf for this page allowing use to download specific page pdf - required if no pdf url provided at circular level",
"sort_order": "optional - this number is only use for sorting, not for UI display",
"items": [], // array of items - see schema definition below
"append_html": "page speicifc html that go above pager",
"item_slug": "item template to use for rendering - optional - default value to classic template",
"book_page_slug": "override page layout to use - optional with fallback to circulars.book_page_slug"
}
data from API should be pre-sorted or a
sort_order
value is provided
{
"id": 345, // any number uniquely identify this item
"image_url": "primary image url", // publicly accessible url of main item image
"sale_price": "$5.99", // regular price
"discount": "$2", // discount/saving
"final_price": "$3.99", // sale/final price
"saving": "Save Up to $2.00", // short message/teaser about the sale
"multi": 1, // sales quantity multiple, i.e: 2 for buy-2 for the price of 1
"uom": "ea.", // text identify unit - ea, lb, oz, etc...
"line1": "Hormel Always Tender Marinated Pork Tenderloin or Pork Loin Filet",
"line2": "1.15-1.5 lb. Selected Varieties",
"limit": "item note, warning, limit, disclaimers",
"dept": "Meat", // department or category
"brand": "Hormel", // brand of item
"medias": [], // optional - list/array of other images or video
"upcs": [], // list/array of upcs, i.e. Pepsi sale can include many UPCs
"item_slug": "item template to use - optional - fallback to page.item_slug",
"slot": "identify the location of book_page_slug slot - if size layout, this is a value between 1-12 in columns",
"sort_order": "the sort value", // optional - default to item order if not provided
"classnames": "the css class names to decorate the item container element",
"custom_html": "optional - to pass in to override template html for this item",
"recipes: [] // optional - list/array of any related recipe data
}
Note item schema is generically defined with all fields to provide full set of available data. Fields may or may-not be use on specific item rendering template (item_slug).