Subtle + JSON = SubtleJSON

Published: 04/25/2013

We introduced our JSON API at this year's SXSWi Developer Garage. One month later, developers are using it to build a wide range of apps that integrate directly with bar, restaurant, and hotel Point of Sale systems.

You may have even seen pictures of Adrian Grenier of the TV show Entourage at our SXSWi Developer Garage. Using our SubtleJSON API, we built an example app that allowed Adrian to order a beer directly from his phone (it took us just 10 minutes and 23 lines of code).

Our SubtleJSON API puts the power of ordering, payment, loyalty, rewards, and analytics into a tight and easily-integrated package for app developers.

In addition to introducing our SubtleJSON interface, we created client libraries in 6 different programming languages. With these introductions, SubtleData has just enabled an entirely new breed of developers that are building applications related to restaurants. Never before have so many capabilities been exposed, been made so available, and been made easy to interact with.

Do you want to build an app to display a menu and allow ordering right from the table? SubtleJSON can do that.

Do you want to let people view their bill and checkout from their phone? SubtleJSON can do that.

Do you want to let your consumers pay using alternative currencies or platforms? SubtleJSON can do that too.

And when we say easy, we mean easy. Today, we’re announcing the general availability of the SubtleJSON API and the launch of our client libraries (SubtleLIBS) in Java, JavaScript, Objective-C, PHP, Python, and Ruby.

So you want to see how it works? Let’s get a restaurant’s details. Well, that’s simply one API call:

https://api.subtledata.com/v1/locations/959?api_key=S0YrNTJY

Which will give us the following:

{ "revenue_centers": [ { "default_center": false, "revenue_center_id": 1958, "name": "Unassigned Revenue" } ], "receipt_number_instructions": null, "employee_request_through_app": false, "menu_ordering_available": true, "payment_via_credit_card_available_message": null, "postal_code": "78610", "location_id": 959, "app_specials": false, "city": "Austin", "location_name": "Dev Site Testing", "tender_types": [], "process_new_credit_cards": false, "user_rating": "0", "table_number_instructions": null, "state": "TX", "color_theme": null, "latitude": 30.2625409, "logo_url": "http://www.subtledata.com/I/Logo/?959", "website_url": null, "cross_streets": null, "ordering_available_message": null, "phone": "4156400650", "terminals": [], "location_picture_url": "http://www.subtledata.com/I/Results/?959", "favorites_ordering_available": true, "neighborhood_name": null, "discount_types": [ { "default_discount": false, "discount_type_id": 700, "name": "Employee" }, { "default_discount": false, "discount_type_id": 701, "name": "Two Dollar Tuesday" } ], "longitude": -97.7448585, "price_rating": 0, "process_pre_authed_cards": false, "address_line_2": null, "address_line_1": "1 Congress St" }

What about the menu? That’s also one API call:

https://api.subtledata.com/v1/locations/959/menu?api_key=S0YrNTJY

And we get the entire menu back in JSON:

[ { "items": [ { "name": "Bud Ice", "price": 2.5, "description": null, "revenue_center_id": 1958, "item_id": 215730, "item_images": null }, { "name": "Bud Light Bottle", "price": 2.25, "description": null, "revenue_center_id": 1958, "item_id": 215727, "item_images": null }, { "name": "Bud Light Can", "price": 2.25, "description": null, "revenue_center_id": 1958, "item_id": 215725, "item_images": null }, { "name": "Budweiser Bottle", "price": 2.25, "description": null, "revenue_center_id": 1958, "item_id": 215723, "item_images": null }, { "name": "Budweiser Can", "price": 2.25, "description": null, "revenue_center_id": 1958, "item_id": 215721, "item_images": null }, { "name": "Busch", "price": 1.25,

“revenue_center_id": 1958, "item_id": 215647, "item_images": null } ], "has_items": true, "instructional_text": null, "category_images": null, "category_id": 6814, "has_subcategories": false, "category_name": "Whiskey" } ]


After getting the menu, we are just two POST calls away from opening a ticket and submitting items to the kitchen. Remember that dream we’ve all had about ordering ahead so we don’t have to wait when we arrive? We make that as easy as 4 API calls.

SubtleLIBS go even further. Let’s order a beer in Python.

>>>>pip install subtledata

from subtledata import SubtleData
SD = SubtleData('S0YrNTJY')

def get_me_a_beer():
location = SD.Locations.get(959)
beers = Location.menu.get_category(category_name='beer')
ticket = location.create_ticket(user_id=1234, table_id=5678)
ticket.add_item_to_order(beers[0], qty=2)
ticket.send_order()


That’s it. You’ve just ordered your beer in six lines of code.

Oh yeah, one last thing - we’ve open sourced it too. You can download that app right here: https://github.com/subtledata/sxsw_ordering




Tags: SubtleJSON   SubtleLIBS   Python   PHP   Ruby   Java   JavaScript   Objective-C   Adrian Grenier   Entourage  


CONTACT US NEWS BLOG


© 2011 - 2014   SubtleData, Inc. - All Rights Reserved
Patent 6,384,850; 6,871,325, 6,982,733, and 8,146,077