Print

Import ShipStation Data to Google Sheets

In this guide, we’ll walk through how to pull data from the ShipStation API directly into Google Sheets, using the API Connector add-on for Sheets.

We'll first get credentials from ShipStation, and then set up a request to pull in data to your spreadsheet.

Contents

Before You Begin

Click here to install the API Connector extension from the Google Marketplace.

Part 1: Get ShipStation API Credentials

  1. Sign in to ShipStation and click the Settings icon in the main navigation menu
  2. In the sidebar on the left, click Account > API Settings
  3. In the API Settings section, click the Generate API Keys button
  4. You'll now see an API Key and API secret.
    shipstation-apikeys
  5. One last step: Because the ShipStation API requires Basic Authentication, we need to encode our authentication info to base 64. You can do this by entering your your credentials in the format API_KEY:API_SECRET into this form (i.e. your API key, then a colon, and then your API secret).

    The encoding script runs in your browser, and none of your credentials are seen or stored by this site.

     

  6. Keep this value handy as we'll use it in the next step to fetch data from ShipStation.

Part 2: Pull ShipStation API Data into Sheets

You can connect to any of the request URLs provided in ShipStation's API documentation. Here's a complete sample request to show how it works:

Request configuration example

  • Application: Custom
  • Method: GET
  • Request URL: https://ssapi.shipstation.com/orders?createDateStart=2023-01-01&orderStatus=awaiting_shipment&pageSize=500
  • OAuth: None
  • Headers:
    • Authorization : Basic the_base64_encoded_value
shipstation-response

Part 3: View Data in a Grid

By default, data will print out with one row for each order ID. Each item in the order will get its own column. If you prefer, you can have each item print down into subsequent rows instead of columns by switching to grid style and flattening headers (as otherwise each option value produces a new row).

  1. Output options > Report style > grid (tick the 'unwind data' box)
  2. Output options > Flatten field to header > custom
    • Path to header: orders.items.options.name
    • Path to value: orders.items.options.value

Part 4: Handle Pagination

By default, the Shipstation API will only return 100 records. To get more, set the pageSize parameter to 500. To get even more than that, you can loop through multiple pages of data using pagination handling:

  • Pagination typepage parameter
  • Page parameterpage
  • Run untilchoose when to stop fetching data
    pagination-page-parameter

Shipstation returns metadata for every page (even those with no results), so do not select the "Run until no data returned option". Instead, choose to fetch data for a specific number of pages or until a specific ID field is empty.

Part 5: API Documentation

Official API documentation: https://www.shipstation.com/docs/api/

2 thoughts on “Import ShipStation Data to Google Sheets”

  1. My request to https://ssapi.shipstation.com/shipments is timing out when I use pagination with the "no data returned" option. Is there a way to make this work?

    Reply
    • Hi Kim, "page parameter" pagination generally can't be used with the "no data returned" option. This is because this type of pagination often returns data on EVERY page, e.g. even if the data set only has 3 pages, if you fetch page #4, they still send back a response. I confirmed that that's exactly the case here; when I fetch a page without data from Shipstation, they responded {"shipments":[],"total":858,"page":4,"pages":2}. You can see more about this issue here: https://mixedanalytics.com/knowledge-base/pagination-handling/#troubleshooting. To fix this please try the following configuration:
      Request URL: https://ssapi.shipstation.com/shipments?pageSize=500
      Pagination type: page parameter
      Run until: response field empty
      Response field path: shipments.shipmentId

      Reply

Leave a Comment

Jump To