Return to documentation index

beverage_types

The beverage_types API retrieves a list of all of the beverage types used by Tastevin.

Parameters

  • api_key (string) Required - The API key for the account
  • last_updated_at (datetime) Optional - If this parameter is supplied, only types whose last edited date is after the supplied date and time will be returned. The parameter should be formatted as "YYYY-MM-DD HH:MM:SS" and will be interpreted as a UTC date and time value. Types with an updated_at value of null will not be included if this parameter is supplied.

Response

The beverage_types API returns a JSON array of beverage types. Each member of the array includes these attributes:

  • id - Unique identifier.
  • name - The display name of the type.
  • updated_at - The date that this type was last edited. May be null.
  • supports_pairings - True if this beverage type can be associated with a menu item.
  • supports_inventory - True if this beverage type supports inventory management
  • has_colors - True if this type supports subtypes.
  • pos_category - The category number used by the POS Manager for products of this type when calling the point_of_sale_skus API.

Extended Attributes for Products

The following attributes can be defined for beverage_types with ID above 2. Legacy types will ignore these attributes.

  • default_list_label_assets (array) - an array of asset objects to be used as label images if the label image is not defined for a particular product. These images should have dimensions of at least 300px x 300px. Larger images will work fine, but will increase the client syncing burden. See the section "Extended Attributes - Assets" below.
  • default_oneup_media_asset (object) - The format of this object is as per the "Extended Attributes - Assets" esction below. This image is displayed in the media view when no oneup images are defined. It should have dimensions of at least 300px by 300px and at most 600px by 600px.
  • list_cell_height (int) - the height of a table cell on the main list. Must in in the range [ 140, 250 ]. Defaults to 140px if not supplied.
  • list_cell_recommended_height (int) - the height a table cell on the main list for a recommended item with this beverage_type. Must be in the range [ 150, 250 ]. Defaults to 150px if not supplied.
  • list_display_title (string) - a title to display at the top of the main list view. eg: "Wines" for the current wine list. defaults to the beverage_type's name
  • oneup_consider_button_icon (int) - an ID of an icon retrieved via the /icons API
  • oneup_consider_button_text (string) - text to display on the button used in the oneup views to add products to the selection drawer. Defaults to "consider this".
  • oneup_display_title (string) - a title to display at the top of one-up views. If not present, list_display_title is used. If that is also not present, the beverage_type's name is used

Extended Attributes - Assets

Clients are expected to fetch and cache any assets delivered in the the "default_list_assets"

All assets are represented by a JSON object with attributes:

  • id (int) - Asset ID
  • status (int) - either 0 or 1, where 0 represents an active asset, and 1 represent an inactive asset which should be deleted from the client
  • updated_at (datetime string) - last time this asset was updated. Clients should retrieve any assets with a update_at timestamp more recent than their own local version
  • url (string) - URL to fetch the asset

Sample Request

https://dashboard.onpremisewine.com/beverage_types.json?api_key=ABCDEF123456

Sample Response

{
  "beverage_types": [
    {
      "id": 1,
      "name": "Wine",
      "updated_at": null,
      "supports_pairings": true,
      "has_colors": true,
      "pos_category": 0,
    },
    {
      "id": 2,
      "name": "Beer",
      "updated_at": null,
      "supports_pairings": true,
      "has_colors": false,
      "pos_category": 1
    },
    {
      "id": 3,
      "name": "Spirit",
      "updated_at": null,
      "supports_pairings": true,
      "has_colors": false,
      "pos_category": 2
    },
    {
      "id": 4,
      "name": "Sake",
      "updated_at": null,
      "supports_pairings": true,
      "has_colors": true,
      "pos_category": 3,
      "default_list_label_assets": [
        {
          "id": 87491,
          "status": 0,
          "updated_at": "2013-03-29T02:26:47-07:00",
          "url": "http://someplacetoretrieveyourimages.com/sake_list/img1.png"
        },
        {
          "id": 87492,
          "status": 0,
          "updated_at": "2013-03-29T06:27:15-07:00",
          "url": "http://someplacetoretrieveyourimages.com/sake_list/img2.png"
        },
        {
          "id": 87493,
          "status": 0,
          "updated_at": "2013-03-29T07:18:35-07:00",
          "url": "http://someplacetoretrieveyourimages.com/sake_list/img3.png"
        },
      ],
      "default_oneup_media_asset": {
        "id": 87490,
        "status": 0,
        "updated_at": "2013-03-29T06:26:55-07:00",
        "url": "http://someplacetoretrieveyourimages.com/oneup/87490.png"
      },
      "list_display_title": "Sake List",
      "list_cell_height": 130,
      "list_cell_recommended_height": 160,
      "oneup_consider_button_icon": 102,
      "oneup_consider_button_text": "select sake",
      "oneup_display_title": "Sake Detail"
    },
  ]
}