Skip to content

Commerce Foundations is our pre-built Craft Commerce store. See what it includes

Craft CMS plugins

ShipStation Connect

A plugin for Craft Commerce that integrates with a ShipStation Custom Store.

Getting started

A plugin for Craft Commerce that integrates with a ShipStation Custom Store.

This page walks you from composer require to your first order shipped from ShipStation. By the end, ShipStation imports your completed orders, and shipping an order in ShipStation records its tracking number in Craft.

1. Install#

Requirements:

  • Craft CMS ^5.0
  • Craft Commerce ^5.0
  • PHP ^8.2

Commerce must be installed and enabled before this plugin.

composer require fostercommerce/shipstationconnect
./craft plugin/install shipstationconnect

DDEV:

ddev composer require fostercommerce/shipstationconnect -w && ddev craft plugin/install shipstationconnect

A ShipStation Connect item appears in the control panel nav. Its Dashboard entry is a shortcut out to ShipStation’s own site.

2. Create the shipping info field#

ShipStation sends back a carrier, a service, and a tracking number per shipment, and they are stored in a Matrix field on the order. Create it before configuring the plugin.

Under Settings -> Fields -> New field, add a Matrix field with one entry type holding three Plain Text fields:

Field Handle
Carrier carrier
Service service
Tracking Number trackingNumber

A Matrix field named ShipStation with a Shipping Info entry type holding Carrier, Service, and Tracking Number fields

Add it to the order field layout under Commerce -> Settings -> Order Fields. A field that is not on the layout has nowhere to store a value.

3. Configure#

Open ShipStation Connect -> Settings and set:

  • Username: the username ShipStation authenticates with. Not a Craft user, and not your ShipStation login.
  • Password: the matching password.

Both credential fields accept an environment variable, which keeps the values out of project config:

The Username and Password settings, each holding an environment variable name

Under Shipping Info Matrix Field, enter the handles of the Matrix field, its entry type, and the three fields inside it.

The Shipping Info Matrix Field section of the settings page

Every other setting, with its default, is listed in configuration.

4. Connect ShipStation#

The settings page shows the URL to give ShipStation:

https://your-site.com/actions/shipstationconnect/orders/process

In ShipStation, add a store of type Custom Store and paste that URL with the username and password. ShipStation’s own custom store guide covers the screens on their side.

ShipStation also asks which of your statuses mean awaiting shipment and which mean shipped. Commerce’s defaults are processing and shipped; check yours under Commerce -> Settings -> Order Statuses. A ShipStation status takes more than one source status, comma separated, and the values are case sensitive, so they have to match your Commerce handles exactly.

5. Check it works#

To see the same response ShipStation gets:

curl -u "$SHIPSTATION_USERNAME:$SHIPSTATION_PASSWORD" \
  "https://your-site.com/actions/shipstationconnect/orders/process?action=export"

An <Orders> document comes back with an <Order> per completed order. pages="0" means none matched. See order export for which orders qualify.

Then ship one of those orders in ShipStation. The order in Craft moves to your shipped status, its Shipping Info field holds the carrier, service, and tracking number, and its activity log reads “Marking order as shipped. Adding shipping information.”

If either direction fails, see troubleshooting.

Where to go next#

We can take it from here.

We take on the Craft and Craft Commerce sites you built, so you can get back to building. Introduce a client who signs a management contract and you get a $3,000 partnership fee.

How the Dev Partnership Program works
See if we’re a fit