[Part of Sam's series on how to use the Ordr.in API]

The Ordr.in APIs are broken up into 3 modules - I’m going to chat a little bit about each one and what you use them for:

 

Restaurant API

The restaurant API is where the bulk of the work takes place for most basic apps. It allows you to get the relevant data about restaurants on the Ordr.in network.

It has four endpoints:

  • Delivery list - Find all restaurants delivering to a given address

  • Restaurant details - Access all of a specific restaurant’s data(most importantly, the menu)

  • Delivery check - Verify that a restaurant delivers to a given address, at a given time.

  • Fee - Calculates all necessary fees(like delivery/convenience charges)


User API

The user API allows you to:

  • Create users

  • Save/delete/modify address information

  • Save/delete/modify credit card and billing information

The only thing this does that you can’t do on your own is save credit cards securely - if you want to have saved cards, you’ll need to use the user API. If you don’t care about that - you can decide whether or not you want to store a lot of this information yourself or whether you want to store it via the API. Developers typically use this API to proxy the storage of user data, allowing them to store it with us behind the scenes. It may make your life easier if you plan on doing more complicated things with the API, but lets focus on throwing something basic together for your hackathon project.


Order API

This is where the magic happens! Sure, restaurant and user data is nice, but what you really want to do is order some damn food! This is the simplest of the three in principle, but requires the most amount of data(stuff like credit card info, name, email, phone number, delivery address, billing address, not to mention the actual order! jeez!). There is really only one endpoint in the order API but it can be called in two ways: guest order and user order.

Guest order is what most basic apps use because it usually takes one "line" of code after gathering the data. All you need to do is send a POST request (or make an API wrapper call) to guest order with the relevant info, and you're done! That will place an actual food order(or a test order if you are using the test API).

User order is really helpful as well because it makes things less janky if you already have your user data saved. It requires the same kind of authentication (not OAuth, don’t worry :) that the User API has.

And that's all there is to it! Please check out the other 101 posts:

API Overview

API Walkthrough

Dealing With The Menu

Test vs Production