ShipHero and AfterShip Integration: Your Path to Seamless Shipping

Written ByRizwan on December 22nd, 2023
Reviewed ByMuhammad Rizwan

ShipHero is a popular order management and warehouse management system that can streamline your e-commerce business. On the other hand, AfterShip is a powerful shipment tracking platform that provides customers with timely updates on their orders. Integrating ShipHero and AfterShip is essential for seamless order management and improved customer experience.

Today, I’ll be sharing a solution I developed to synchronize ShipHero with AfterShip. I create this plugin for a client of mine and thought I’d share with the world as well.

Step 1: The Plugin

First, I created a custom plugin to handle the webhook listener and process the payload from ShipHero. You can find the complete code for the plugin here.

Simply download the plugin files and install them on your WordPress site. After activating the plugin, it will start listening for ShipHero webhook events.

Step 2: Set Up the Webhook in ShipHero

Next, you’ll need to set up a webhook in your ShipHero account to send the shipment update events to your website. Since their REST API was shut down on September 1, we’re going to use their GraphQL API instead.

  1. Copy the code from this gist
  2. Update the username, password, webhook url, shop_name at the top of the script to match yours. For webhook URL, you can change the random number at the end to any random number/word.
  3. Save as script.py on your computer
  4. Open terminal
  5. Go to the directory where the python script is saved
  6. Now run the script python script.py or python3 script.py

Running the above script should print something like this to your terminal:

Save the highlighted highlighted “shared_signature_secret” safely somewhere, it’s crucial for the next steps. ShipHero will now send shipment updates to your website, and the custom plugin will process the data.

Step 3: Configure AfterShip Integration

The custom plugin updates the order’s post meta to include the tracking information. To ensure that this data is properly synced with AfterShip, you’ll need to follow these steps:

  1. Install and activate the AfterShip WooCommerce plugin.
  2. Follow the plugin’s instructions to set up the API key and other configurations.

That’s it! Your ShipHero and AfterShip integration is now complete. Whenever a shipment update event occurs in ShipHero, the custom plugin will update the order data in WooCommerce and sync it with AfterShip. This enables you to keep track of shipments and provide an excellent customer experience.

If you have any questions or need assistance with the integration, feel free to leave a comment below. I’m happy to help!

How we reviewed this article:

  • Content Process
My process of publishing articles include:
  1. I get an Idea
  2. Get feedback from fellow developers if they want a detailed post on it
  3. Research existing blog posts to see if there's a well written article on it
  4. Write the post
  5. Get feedback from colleagues, improve and publish!

Leave a Comment

Your email address will not be published. Required fields are marked *