beverage_size_conversions
The beverage_size_conversions
API retrieves a list of conversion factors between units for the account. Each factor identifies the conversion for a particular unit and wine color to a standard bottle.
Parameters
- api_key (string) Required - The API key for the account
- last_updated_at (datetime) Optional - If this parameter is supplied, only conversion factors 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.
Response
The beverage_size_conversions
API returns a JSON array of beverage size conversions. Each member of the array includes these attributes:
- id - Unique identifier.
- unit - A unit code
- conversion - The decimal factor to multiply this unit by to get whole bottles.
- wine_color_id - The unique identifier of a wine color that this conversion applies to. See the Notes section below.
- ounces - The number of ounces for the specified unit and wine color. Ounces and conversion are related by the formula [conversion = 25.4/ounces]. The conversion should be considered correct in case of a conflict between the two.
- updated_at - The date that this conversion factor was last edited.
- created_at - The initial date that this conversion factor was created.
Notes
The portal stores up to two sets of conversion factors for each account: one to be used for sparkling wines and one to be used for all other wines. For calculations, any conversion factor with a wine_color_id
for any non-sparkling wine color should be assumed to apply to all non-sparkling wine colors.
Sample Request
https://dashboard.onpremisewine.com/beverage_size_conversions.json?api_key=ABCDEF123456
Sample Response
{
"beverage_size_conversions": [
{
"id": 3,
"unit": 1,
"conversion": "0.25",
"wine_color_id": 1,
"ounces": "5.0",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 4,
"unit": 17,
"conversion": "0.125",
"wine_color_id": 1,
"ounces": "2.5",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 5,
"unit": 1,
"conversion": "0.25",
"wine_color_id": 2,
"ounces": "5.0",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 6,
"unit": 17,
"conversion": "0.125",
"wine_color_id": 2,
"ounces": "2.5",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 7,
"unit": 1,
"conversion": "0.25",
"wine_color_id": 3,
"ounces": "5.0",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 8,
"unit": 17,
"conversion": "0.125",
"wine_color_id": 3,
"ounces": "2.5",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 9,
"unit": 1,
"conversion": "0.25",
"wine_color_id": 4,
"ounces": "5.0",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 10,
"unit": 17,
"conversion": "0.125",
"wine_color_id": 4,
"ounces": "2.5",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 11,
"unit": 1,
"conversion": "0.25",
"wine_color_id": 5,
"ounces": "5.0",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 12,
"unit": 17,
"conversion": "0.125",
"wine_color_id": 5,
"ounces": "2.5",
"created_at": "2012-03-04T16:00:00-08:00",
"updated_at": "2012-03-04T16:00:00-08:00"
},
{
"id": 234,
"unit": 18,
"conversion": "0.331",
"wine_color_id": 1,
"ounces": "8.4",
"created_at": "2012-09-12T16:17:22-07:00",
"updated_at": "2012-09-12T16:17:22-07:00"
},
{
"id": 235,
"unit": 18,
"conversion": "0.331",
"wine_color_id": 2,
"ounces": "8.4",
"created_at": "2012-09-12T16:17:22-07:00",
"updated_at": "2012-09-12T16:17:22-07:00"
},
{
"id": 236,
"unit": 18,
"conversion": "0.331",
"wine_color_id": 3,
"ounces": "8.4",
"created_at": "2012-09-12T16:17:22-07:00",
"updated_at": "2012-09-12T16:17:22-07:00"
},
{
"id": 237,
"unit": 18,
"conversion": "0.331",
"wine_color_id": 4,
"ounces": "8.4",
"created_at": "2012-09-12T16:17:22-07:00",
"updated_at": "2012-09-12T16:17:22-07:00"
},
{
"id": 238,
"unit": 18,
"conversion": "0.331",
"wine_color_id": 5,
"ounces": "8.4",
"created_at": "2012-09-12T16:17:22-07:00",
"updated_at": "2012-09-12T16:17:22-07:00"
}
]
}