Integrate order information from your Shopify account

Hey Shopify users! :shopping: :shopping_cart: :money_with_wings:

If you want to integrate order information from your account with other services or if you want to automate an internal workflow, you can do so with dashdash!

You can match information to your Stripe account, or send an email or SMS to customers, or send some order information to your CRM - whatever it is. The order endpoint gives you all the info you need.

For this example, we want to grab the relevant information for fulfillment. The app looks like this:

Let’s check how to:

  1. Send the request
  2. Parse the info you need into a table

1. Send the request

B1: "[API key]"
B2: "[password]"
E1: =GET("https://[subdomain].myshopify.com/admin/orders.json",'{"Authorization":"Basic '&BASE64(B1&":"&B2)&'"}')

Note that you have to enter your store’s subdomain in the request URL. This will return a big JSON file into E1. You can check the documentation for a description of all the data fields.

For our purposes, we want to grab the fulfillment information. So let’s:

2. Parse the info you need into a table

General order information:

E2: =PARSE(E1,"orders.length()")
B5: =PARSE($E$1,"orders.["&B4&"].name")
B6: =PARSE($E$1,"orders.["&B4&"].created_at")
B7: =PARSE($E$1,"orders.["&B4&"].contact_email")
B10: =PARSE($E$1,"orders.["&B4&"].shipping_address.name")
B11: =PARSE($E$1,"orders.["&B4&"].shipping_address.address1")
B12: =PARSE($E$1,"orders.["&B4&"].shipping_address.zip")
B13: =PARSE($E$1,"orders.["&B4&"].shipping_address.city")
B14: =PARSE($E$1,"orders.["&B4&"].shipping_address.country")

Ordered items:

B17: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A17&"].sku")
B18: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A18&"].sku")
B19: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A19&"].sku")
C17: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A17&"].name")
C18: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A18&"].name")
C19: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A19&"].name")
D17: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A17&"].quantity")
D18: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A18&"].quantity")
D19: =PARSE($E$1,"orders.["&B$4&"].line_items.["&$A19&"].quantity")

Note that =PARSE(E1,"orders.length()") returns the number of open orders. Similarly, =PARSE($E$1,"orders.["&B$4&"].line_items.length()") would return the number of SKUs on the first order. If you want to create this table dynamically depending on these numbers, the length() function helps.

That’s it! We can grab all relevant order info from Shopify. If you want to automate this to happen every day or hour, just do it with REPEAT. :gear::gear::gear:
How you use this table entirely depends on you.

Happy building!! :raised_hands: