NAV Navbar
shell ruby python javascript

<< Back to main site

Want to build on Pantri?

We're working to open our API to anyone who wants to build on it, without needing to enter a partnership.

We want to enable self organised integration for everyone from a maker with an IoT fruitbowl, to an international grocer.

Here's what you can expect: a simple, clean API using RESTful principles, modern identity and access control infrastructure, and a lean, mean 5 minute install to get a device or application up and running - FAST!

4 Spheres

From a design perspective, the API operates within 3 functionality spheres, with an overarching Pantri ID to handle all user specific content robustly and independently.

NOT LOADED - Fig. 0

Sphere Collections

The API can be best considered as a group of collections within these spheres, that can each independently be used as required for your specific use case.

ID

Device

UI

Fulfilment

Maker Apliances

Are you a Maker/electronics enthusiast? Take a look at Maker Appliances www.makerappliances.com which has a range of ideas and kits that are built on the Pantri API.

NOT LOADED - Fig. 4

A Few Examples

A Smart Fridge

Will principally report usage of items - such as 45% milk carton remaining, butter removed and not returned within 5 hours, etc. This data can be used to track inventory - with a specific report either altering inventory levels (as with Milk for example), or in the case of the butter - a binary reorder instruction.

A Smart Fridge With A Screen

If a smart fridge has a screen, then it could have a native Powered by Pantri application, that would also link into the identity and UI API's.

An App

Acts as the dashboard to configure all or part of the Pantri service. Perhaps its an app to go with a Pantri Connected Device - which would limit the functionality to the devices and products relevant to the brand, or it's a retailers online shopping portal - that links any device exclusively to their own retail endpoints.

In either case, the UI sphere enables he platforms to configure the platform, from configuring a users device to track and amend inventory, place orders, and look up account history.

A Retailer / Fulfiller

Finally, a retailer transacting orders from Pantri needs to connect to Pantri in a certain manner. It needs to share information about the products it stocks, recieve orders, and inform the user via Pantri that they've dispatched the item and it has subsequently been delivered (to update inventory where it is tracked).

DEVICE: 2 Ways To Talk

Our API and the way your device interacts with it can be generally boiled down into 2 use cases:

  1. You want to trigger the re-ordering of a specific item

  2. You want to alter the inventory level of a specific item that you are tracking the use of, relying on a low level trigger point that the user sets to re-order the specific item.

Below, we have explained how each use-case would interact with the API.

1. Re-ordering A Specific Item

For an app or device where the user can login through the Pantri ID server:

# POST from a user
curl "https://api.pantri.net/???"
  -H "Device_Key: device_id"
  -H "Instruction_Ref: 679866150"

#POST from a app
curl "https://api.pantri.net/???"
  -H "User_Auth: user_token_from_id_server"
  -H "Instruction_Ref: 147478858"

Returns the following:


[
  // Success
  {
    "CommandRef" : 739546323,
    "ID": 201,
    "Status" : "Done"
  }
  // Error
  {
    "CommandRef" : 816844099,
    "ID": 400,
    "Status" : "Didn't do - reason"
  }
]

This is the simplest use-case. The device or app simply needs to place an order on demand. Here are some example use-cases:

The application or device needs to perform a simple action to complete this process:

Setup

During the setup of the instruction between device or application with the pantri user account, the quantity to re-order of a specific product from a specific retailer is defined.

NOT LOADED - Fig. 1

Once paired, the device or app can call the API to trigger the function.

Coming Soon - learn how to set up these device/app order triggers.

Post Setup Trigger

Each time the device or app wants to place an order, the following flow takes place:

NOT LOADED - Fig. 2

2. Altering The Inventory Level Of A Specific Item

Adding more complexity - we often use items incrementally. Lots of these items need to be re-ordered before we completely run out. Some example use-cases:

If you're like us, you like the occasional cookie. You don't eat the whole pack in one go (or at least not that often)! So, if you are using a smart cookie jar, you want it to keep track of how many cookies you have left. Re-ordering some more when you drop down to the last 5... or maybe you need to place that order when theres 10 left!

Setup

Setting up inventory tracking is similar to re-ordering a specific item above.

NOT LOADED - Fig. 3