Shopify Integration App

Using the previously made Automatic Order API, the site wanted a Shopify Integration app that would automatically pass new orders through the API.

The client's API required that each incoming order be sent with an API key and a secret key. The API key was accessible to the user inside their account area on the client store, however the secret key was only accessible once via in initialization request to the API.
I created a Shopify app in Ruby on Rails for the user's to install on their Shopify store. On initialization, the user would input their API key and the initialization process was completed for them. It used a PostgreSQL database to store the user's credentials which would be sent with any future order request to the API.
Inside the integration app was an interface to create product 'links' between variants on the user's store and variants on the client's store. With the use of an orders/create webhook I first checked if a new order contained a linked product. If it did, I generated an API request to the client's store containing the relevant line items and the customer's shipping information, as well as the required authentication fields.
Since the API was already made to never silently fail, I created a log interface inside the Shopify Integration app where the user could read the responses for any order that failed. I also made use of a Rails Action Mailer to pass any critical errors on to the user's Shopify email address.
When the API accepted an order, it created a pending order that was held inside a group of pending orders until payment had been made. Once paid, the group's orders were converted into real Shopify orders on the client's store.
The Shopify integration app has processed over £200,000 in automated orders since it's creation. Originally the time taken to place an order was 4 minutes, with the Quickorder Interface I had made previously I got this down to 20 seconds on average, however the Shopify Integration app took this time to process down to a flat 0 seconds.