Print

Import ShareASale Data to Google Sheets

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

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your ShareASale API Credentials

  1. While logged into ShareASale, navigate to ShareASale's Merchant API page
  2. Your API token and secret will be listed there. Copy them down as you'll need them shortly.
    shareasale-key
  3. Before you leave, note your merchant ID, since you'll need that too. It's located in the top left corner.
    shareasale-merchantid

Part 2: Pull Data from ShareASale into Sheets

For this example we'll fetch transaction details. This requires including a header that applies a HMAC SHA256 operation to the endpoint, so we've created a supplemental script to assist with this.

  1. Click here to create a copy of the ShareASale calculator sheet.
  2. In the sheet copy, fill out the inputs for the token, your API secret, and the action (aka data table) you'll be querying. When you do this, your signature will be automatically calculated and displayed in cell F13.
    shareasale-inputs
  3. Open the API Connector sidebar and click Create request. Fill out the request form as follows. Substitute in your own merchant_ID and token, or reference them from cells in your sheet using +++ syntax.
    • ApplicationCustom
    • MethodGET
    • Request URLhttps://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=transactiondetail&dateStart=02/01/2023&dateEnd=03/31/2023
    • OAuthNone
    • Headers:
      • x-ShareASale-Date:  +++ShareASale!F9+++
      • x-ShareASale-Authentication: +++ShareASale!F13+++
  4. Save and run the request:
    shareasale-response
  5. To make other requests, change the request URL, making sure to match the Action selected in the sheet with the Action listed in the request URL. If you're running multiple requests for different Actions, duplicate the signature generator sheet such that there's a unique signature for each Action.

Part 3: Example API Request URLs

  • Weekly Progress Report
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=weeklyprogress&lengthofreport=60
  • Timespan Affiliate Summary
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=affiliatetimespan&dateStart=01/03/2023&dateEnd=04/02/2023&sortCol=grosssales
  • Today At a Glance
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=todayataglance&sortcol=hits
  • Your Affiliate List
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=report-affiliate
  • Ledger Report
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=ledger
  • Balance Inquiry
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=balance
  • Banner Report
    https://api.shareasale.com/w.cfm?merchantId=your_merchant_id&token=your_token&version=3.0&action=bannerreport

Leave a Comment

Jump To