• Worldwide Shipping

  • 24/7 Customer Support

  • FAQ
  • Worldwide Shipping

  • 24/7 Customer Support

  • FAQ

PROJECT: Tindie order notifier

Written by: David Zovko, [email protected]

So you have set up your Tindie store, listed few of yours boards that you have made and now hoping to sold some of them. To be honest, we did the same. Here is link to our Tindie store where we are selling boards that we are producing in our workshop.

Since we are looking to provide best service to our customers, I want to ship the products as soon as possible after they are ordered. It is quite time-wasting process of opening the Tindie order page every day to check if there are any new orders. Therefore, it waw an instinct to make a small hardware notifier device to let me know if there are any new orders on my Tindie store - without need to open the browser.

FINALISED PROJECT PICTURE

What do I need?

We intended for this project to be wireless, so it stays somewhere connected, just plugged into the wall(or running on batteries) and notifies us at any time. Therefore, our board Croduino NOVA with ESP8266 WiFi microcontroller is a perfect choice. You will also need a device you want to see your notification. This can be an simple LED or LED strip, LCD screen or something that makes sound. So, here's a list:

  • Croduino NOVA or other ESP8266 board
  • • LED or LED strip or LCD screen or buzzer or other actuator
  • • Breadboard and some cables

How would this work?

If you have ever been looking around the My Store part on Tindie shop, you might have noticed the API tab. API(short of Application Programming Interface) is a way to interface(retrieve and send data) with another system. In this case, it allows us to retrieve order information for your Tindie account. It is all described in a bit more of details on Tindie helpdesk page. Let me explain it here, too.

Before you start using Tindie API, you will need to know two things: your Tindie username(which you probably know already) and your API key(which you would find under the API tab on My store). It is long sequence of random numbers and letters. Your API key is universal and it serves as kind-of-password, so keep it for yourself! If someone had it, he could access all your order data, customer addresses and other stuff. For our case, username is "dava_2" and our API key is "72f................................"(Dots are in place of other digits. I won't put the whole API key here for obvious reasons).

You got those ready? Okay! Now, you will have to enter your data into the special URL from which API is accessible. The URL looks like this:

https://www.tindie.com/api/v1/order/?format=json&username=yourname&api_key=XXXX

I need to enter the data I have extracted before, so I am replacing "yourname" with "dava_2" and "XXXX" with my API key starting with "72f". Now the URL looks like this:

https://www.tindie.com/api/v1/order/?format=json&username=dava_2&api_key=72f...................

If you paste the URL you have created into the browser, you will see bunch of characters, especially {, } and " signs. Looks messy. What is see is JSON formatted data. JSON is way of writing data so computers can easily understand it. Copy all the text you can see on the page(be careful to really copy it all) and paste it into one JSON parser. This small program will disassemble your JSON data into smaller parts so you can clearly see what data it consists.

Usually, at the left side you will see an attribute in double quotation mark then : and after it data(you will see it in double quotation marks if it is a String). After each attribute-data set there is a comma. Each attribute can have a larger set of attributes(like "items" in every "orders"), but it doesn't have to. This is usual way for writing JSON data. For example, this is one attribute-data set:

"total" : 10.54

Doesn't work?
If you have ever had an order on Tindie, you should see something here. If you have 0 orders on your Tindie store, you will just see short JSON data set showing that "total_count" is 0. If you have entered the wrong API key, username or both, you will see just an empty page. Check your data in URL again.

What's there in JSON data for us?

So, there is a lot of data in JSON we have just discovered. We don't need it all - unless we want to do crazy stuff with this simple order notifier. The full JSON answer(as we did get it just before) is really big and can be troublesome for ESP8266 RAM. Luckily, Tindie is allowing some filtering so we can return only unshipped orders - which is what we need anyway! They show this feature in their help desk article. Inside the orders attribute set, there is attribute "shipped" which can be either "true" or "false". We are getting those "shipped": false. I will just add "&shipped=false" into the URL in order to achieve that:

https://www.tindie.com/api/v1/order/?format=json&shipped=false&username=dava_2&api_key=72f...................

That's our trigger!
Aah, there it is. Although this one is shipped already.

The Arduino code part

Now when we know what we need to do, time to write Arduino code! In this example I will use simple LED as a notifier, but you can change that part of code and add LCD screen, sound or thermal printer!

We will use JSON library for Arduino which would parse(disassemble) the JSON data for us and we will be able to use only the attributes and data that we actually need.

Leave a Reply